|
@ -97,6 +97,7 @@ |
|
|
</u-popup> |
|
|
</u-popup> |
|
|
<u-select v-model="singleColumnShow" mode="single-column" :default-value='singleColumnDefaultValue' |
|
|
<u-select v-model="singleColumnShow" mode="single-column" :default-value='singleColumnDefaultValue' |
|
|
:list="singleColumnList" @confirm="chooseSingleColumn" @cancle='singleColumnShow = false'></u-select> |
|
|
:list="singleColumnList" @confirm="chooseSingleColumn" @cancle='singleColumnShow = false'></u-select> |
|
|
|
|
|
<SelectItemList :isShowSelectItem='isShowSelectItem' :singleColumnList='singleColumnList' @searchItem='searchItem' @chooseItem1='chooseItem1'/> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
@ -112,6 +113,7 @@ |
|
|
import * as sparePartsServiceWorkOrderListApi from "@/api/sparePartsServiceWorkOrderList" |
|
|
import * as sparePartsServiceWorkOrderListApi from "@/api/sparePartsServiceWorkOrderList" |
|
|
import * as dictApi from "@/api/dict" |
|
|
import * as dictApi from "@/api/dict" |
|
|
import * as locationApi from "@/api/location" |
|
|
import * as locationApi from "@/api/location" |
|
|
|
|
|
import SelectItemList from "../../components/item/slectItemList.vue" |
|
|
const { proxy } = getCurrentInstance() |
|
|
const { proxy } = getCurrentInstance() |
|
|
const loading = ref(false) |
|
|
const loading = ref(false) |
|
|
const type = ref('') |
|
|
const type = ref('') |
|
@ -122,8 +124,8 @@ |
|
|
const singleColumnShow = ref(false) |
|
|
const singleColumnShow = ref(false) |
|
|
const singleColumnDefaultValue = ref([]) |
|
|
const singleColumnDefaultValue = ref([]) |
|
|
const singleColumnList = ref([]) |
|
|
const singleColumnList = ref([]) |
|
|
|
|
|
const isShowSelectItem = ref(false) |
|
|
const field = ref('') |
|
|
const field = ref('') |
|
|
|
|
|
|
|
|
const form = ref({ |
|
|
const form = ref({ |
|
|
itemNumbers: [] |
|
|
itemNumbers: [] |
|
|
}) |
|
|
}) |
|
@ -185,6 +187,10 @@ |
|
|
// 单列模式 |
|
|
// 单列模式 |
|
|
function openSingleColumn(fieldName, val, list) { |
|
|
function openSingleColumn(fieldName, val, list) { |
|
|
if (fieldName == 'deviceNumber' && form.value.id) return; |
|
|
if (fieldName == 'deviceNumber' && form.value.id) return; |
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
title: "加载中....", |
|
|
|
|
|
mask: true |
|
|
|
|
|
}); |
|
|
singleColumnList.value = list |
|
|
singleColumnList.value = list |
|
|
field.value = fieldName |
|
|
field.value = fieldName |
|
|
if (val) { |
|
|
if (val) { |
|
@ -192,7 +198,7 @@ |
|
|
} else { |
|
|
} else { |
|
|
singleColumnDefaultValue.value = [] |
|
|
singleColumnDefaultValue.value = [] |
|
|
} |
|
|
} |
|
|
singleColumnShow.value = true |
|
|
isShowSelectItem.value = true |
|
|
} |
|
|
} |
|
|
// 单列模式点击确定之后 |
|
|
// 单列模式点击确定之后 |
|
|
function chooseSingleColumn(e) { |
|
|
function chooseSingleColumn(e) { |
|
@ -213,13 +219,20 @@ |
|
|
} |
|
|
} |
|
|
// 获取备件列表 |
|
|
// 获取备件列表 |
|
|
async function getServiceSparePartsList() { |
|
|
async function getServiceSparePartsList() { |
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
title: "加载中....", |
|
|
|
|
|
mask: true |
|
|
|
|
|
}); |
|
|
await sparePartsApi.getServiceSparePartsList().then(res => { |
|
|
await sparePartsApi.getServiceSparePartsList().then(res => { |
|
|
res.data.map(item => { |
|
|
res.data.map(item => { |
|
|
item.value = item.number |
|
|
item.value = item.number |
|
|
item.label = item.name |
|
|
item.label = item.name |
|
|
}) |
|
|
}) |
|
|
sparePartsList.value = res.data |
|
|
sparePartsList.value = res.data |
|
|
}).catch(() => { }) |
|
|
}).catch(() => { }).finally(()=>{ |
|
|
|
|
|
uni.hideLoading() |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
// 扫描设备条码 |
|
|
// 扫描设备条码 |
|
|
function chickRightButton(field) { |
|
|
function chickRightButton(field) { |
|
@ -320,6 +333,63 @@ |
|
|
function delSpareParts(index) { |
|
|
function delSpareParts(index) { |
|
|
form.value.itemNumbers.splice(index, 1) |
|
|
form.value.itemNumbers.splice(index, 1) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function searchItem(name){ |
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
title: "加载中....", |
|
|
|
|
|
mask: true |
|
|
|
|
|
}); |
|
|
|
|
|
await getSparePartsList(name); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 获取备件列表 |
|
|
|
|
|
async function getSparePartsList(name) { |
|
|
|
|
|
let param = { |
|
|
|
|
|
name:name |
|
|
|
|
|
} |
|
|
|
|
|
await sparePartsApi.getSparePartsList(param).then(res => { |
|
|
|
|
|
res.data.map(item => { |
|
|
|
|
|
item.value = item.number |
|
|
|
|
|
item.label = item.name |
|
|
|
|
|
}) |
|
|
|
|
|
sparePartsList.value = res.data |
|
|
|
|
|
singleColumnList.value = sparePartsList.value |
|
|
|
|
|
uni.hideLoading() |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
uni.hideLoading() |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function chooseItem1(type, form) { |
|
|
|
|
|
if (!form.value.number && type == 1) { |
|
|
|
|
|
proxy.$modal.showToast('请选择备件'); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
title: "加载中....", |
|
|
|
|
|
mask: true |
|
|
|
|
|
}); |
|
|
|
|
|
form1.value['itemNumber'] = form.value.number |
|
|
|
|
|
choosesingleColumnItem.value = sparePartsList.value.filter(item => item.number == form.value.number) |
|
|
|
|
|
form1.value.name = form.value.name |
|
|
|
|
|
form1.value.locationNumber = choosesingleColumnItem.value[0].locationNumber |
|
|
|
|
|
form1.value.areaNumber = choosesingleColumnItem.value[0].areaNumber |
|
|
|
|
|
if (!choosesingleColumnItem.value[0].locationNumber) { |
|
|
|
|
|
isShow.value = true |
|
|
|
|
|
} else { |
|
|
|
|
|
isShow.value = false |
|
|
|
|
|
itemNumber.value = '' |
|
|
|
|
|
} |
|
|
|
|
|
await getSparePartsList(null); |
|
|
|
|
|
isShowSelectItem.value = false; |
|
|
|
|
|
uni.hideLoading() |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onLoad(async (option) => { |
|
|
onLoad(async (option) => { |
|
|
if (option.type) type.value = option.type; |
|
|
if (option.type) type.value = option.type; |
|
|
result.value = await dictApi.getDict('result') |
|
|
result.value = await dictApi.getDict('result') |
|
|