|
|
@ -134,6 +134,7 @@ |
|
|
|
<view class="sure" @click="chooseUser">确认</view> |
|
|
|
</view> |
|
|
|
</u-popup> |
|
|
|
<SelectItemList :isShowSelectItem=isShowSelectItem :singleColumnList=singleColumnList @searchItem='searchItem' @chooseItem1='chooseItem1'/> |
|
|
|
<u-select v-model="singleColumnShow" mode="single-column" :default-value='singleColumnDefaultValue' |
|
|
|
:list="singleColumnList" @confirm="chooseSingleColumn" @cancle='singleColumnShow = false'></u-select> |
|
|
|
<u-picker mode="time" v-model="datetimeShow" :default-time='datetimeDefaultValue' :params="params" @confirm='chooseDatetime' @cancle='datetimeShow = false'></u-picker> |
|
|
@ -152,13 +153,14 @@ |
|
|
|
import * as sparePartsApi from "@/api/spareParts.js" |
|
|
|
import * as deptApi from "@/api/dept.js" |
|
|
|
import * as dictApi from "@/api/dict.js" |
|
|
|
import SelectItemList from "../../components/item/slectItemList.vue" |
|
|
|
const { proxy} = getCurrentInstance() |
|
|
|
const loading = ref(false) |
|
|
|
const type = ref('') |
|
|
|
// 备件弹窗 |
|
|
|
const isPopupShow = ref(false) |
|
|
|
const sparePartsList = ref([]) |
|
|
|
|
|
|
|
const isShowSelectItem = ref(false) |
|
|
|
const singleColumnShow = ref(false) |
|
|
|
const singleColumnDefaultValue = ref([]) |
|
|
|
const singleColumnList = ref([]) |
|
|
@ -167,6 +169,7 @@ |
|
|
|
const isShowSelecUser = ref(false) |
|
|
|
const jxDetailsStatus = ref([])//完成情况 |
|
|
|
const formatDate = ref('')//日期展示 |
|
|
|
const deviceNumber = ref(null); |
|
|
|
const form = ref({ |
|
|
|
number: '', |
|
|
|
name:'', |
|
|
@ -368,7 +371,8 @@ const form = ref({ |
|
|
|
} else { |
|
|
|
singleColumnDefaultValue.value = [] |
|
|
|
} |
|
|
|
singleColumnShow.value = true |
|
|
|
//singleColumnShow.value = true |
|
|
|
isShowSelectItem.value = true; |
|
|
|
} |
|
|
|
// 单列模式点击确定之后 |
|
|
|
function chooseSingleColumn(e) { |
|
|
@ -388,7 +392,7 @@ const form = ref({ |
|
|
|
singleColumnShow.value = false |
|
|
|
} |
|
|
|
// 获取备件列表 |
|
|
|
async function getSparePartsList() { |
|
|
|
async function getSparePartsList(number,name) { |
|
|
|
number =deviceNumber.value |
|
|
|
let param = { |
|
|
|
number:number, |
|
|
@ -400,6 +404,7 @@ const form = ref({ |
|
|
|
item.label = item.name |
|
|
|
}) |
|
|
|
sparePartsList.value = res.data |
|
|
|
singleColumnList.value = sparePartsList.value |
|
|
|
}).catch(() => { }) |
|
|
|
} |
|
|
|
// 打开弹窗 |
|
|
@ -444,6 +449,22 @@ const form = ref({ |
|
|
|
datetimeDefaultValue.value = val ? val : proxy.$time.formatDate() |
|
|
|
datetimeShow.value = true |
|
|
|
} |
|
|
|
async function searchItem(name){ |
|
|
|
await getSparePartsList(null,name); |
|
|
|
} |
|
|
|
|
|
|
|
async function chooseItem1(type,forms){ |
|
|
|
if(!forms.value.number&&type==1){ |
|
|
|
proxy.$modal.showToast('请选择备件') |
|
|
|
return |
|
|
|
} |
|
|
|
if(type==1){ |
|
|
|
form1.value.number = forms.value.temporarilyNumber |
|
|
|
form1.value.name =forms.value.temporarilyName |
|
|
|
} |
|
|
|
await getSparePartsList(null,null); |
|
|
|
isShowSelectItem.value = false; |
|
|
|
} |
|
|
|
// 日期模式点击确定之后 |
|
|
|
function chooseDatetime(e) { |
|
|
|
let array1 = [] |
|
|
@ -474,6 +495,7 @@ const form = ref({ |
|
|
|
if (option.type) type.value = option.type; |
|
|
|
if (option.factoryAreaNumber) factoryAreaNumber.value = option.factoryAreaNumber; |
|
|
|
if (option.number) form.value.number = option.number; |
|
|
|
if (option.deviceNumber) deviceNumber.value = option.deviceNumber; |
|
|
|
if (option.data && JSON.parse(decodeURIComponent(option.data)) && JSON.parse(decodeURIComponent(option |
|
|
|
.data)).id) { |
|
|
|
form.value = JSON.parse(decodeURIComponent(option.data)) |
|
|
|