Browse Source

fix: 检修工单 保养工单

master
songguoqiang 7 months ago
parent
commit
82cb5151f2
  1. 32
      src/pages/overhaulOrder/addServiceRecord.vue
  2. 28
      src/pages/upkeepOrder/addServiceRecord.vue
  3. 4
      src/pages/upkeepOrder/detail.vue

32
src/pages/overhaulOrder/addServiceRecord.vue

@ -132,6 +132,7 @@
<view class="sure" @click="chooseUser">确认</view> <view class="sure" @click="chooseUser">确认</view>
</view> </view>
</u-popup> </u-popup>
<SelectItemList :isShowSelectItem=isShowSelectItem :singleColumnList=singleColumnList @searchItem='searchItem' @chooseItem1='chooseItem1'/>
<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>
<u-picker mode="time" v-model="datetimeShow" :default-time='datetimeDefaultValue' :params="params" <u-picker mode="time" v-model="datetimeShow" :default-time='datetimeDefaultValue' :params="params"
@ -151,13 +152,14 @@
import * as sparePartsApi from "@/api/spareParts.js" import * as sparePartsApi from "@/api/spareParts.js"
import * as deptApi from "@/api/dept.js" import * as deptApi from "@/api/dept.js"
import * as dictApi from "@/api/dict.js" import * as dictApi from "@/api/dict.js"
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('')
// //
const isPopupShow = ref(false) const isPopupShow = ref(false)
const sparePartsList = ref([]) const sparePartsList = ref([])
const isShowSelectItem = ref(false)//
const singleColumnShow = ref(false) const singleColumnShow = ref(false)
const singleColumnDefaultValue = ref([]) const singleColumnDefaultValue = ref([])
const singleColumnList = ref([]) const singleColumnList = ref([])
@ -390,7 +392,12 @@
} else { } else {
singleColumnDefaultValue.value = [] singleColumnDefaultValue.value = []
} }
singleColumnShow.value = true if(fieldName == 'number'){
isShowSelectItem.value = true;
}else{
singleColumnShow.value = true
}
} }
// //
function chooseSingleColumn(e) { function chooseSingleColumn(e) {
@ -411,8 +418,8 @@
singleColumnShow.value = false singleColumnShow.value = false
} }
// //
async function getSparePartsList() { async function getSparePartsList(number,name) {
number =deviceNumber.value number =form.value.deviceNumber
let param = { let param = {
number:number, number:number,
name:name name:name
@ -423,6 +430,7 @@
item.label = item.name item.label = item.name
}) })
sparePartsList.value = res.data sparePartsList.value = res.data
singleColumnList.value = sparePartsList.value
}).catch(() => { }) }).catch(() => { })
} }
// //
@ -510,6 +518,22 @@
await getSelecUser() await getSelecUser()
await getSparePartsList() await getSparePartsList()
}) })
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;
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

28
src/pages/upkeepOrder/addServiceRecord.vue

@ -134,6 +134,7 @@
<view class="sure" @click="chooseUser">确认</view> <view class="sure" @click="chooseUser">确认</view>
</view> </view>
</u-popup> </u-popup>
<SelectItemList :isShowSelectItem=isShowSelectItem :singleColumnList=singleColumnList @searchItem='searchItem' @chooseItem1='chooseItem1'/>
<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>
<u-picker mode="time" v-model="datetimeShow" :default-time='datetimeDefaultValue' :params="params" @confirm='chooseDatetime' @cancle='datetimeShow = false'></u-picker> <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 sparePartsApi from "@/api/spareParts.js"
import * as deptApi from "@/api/dept.js" import * as deptApi from "@/api/dept.js"
import * as dictApi from "@/api/dict.js" import * as dictApi from "@/api/dict.js"
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('')
// //
const isPopupShow = ref(false) const isPopupShow = ref(false)
const sparePartsList = ref([]) const sparePartsList = ref([])
const isShowSelectItem = ref(false)
const singleColumnShow = ref(false) const singleColumnShow = ref(false)
const singleColumnDefaultValue = ref([]) const singleColumnDefaultValue = ref([])
const singleColumnList = ref([]) const singleColumnList = ref([])
@ -167,6 +169,7 @@
const isShowSelecUser = ref(false) const isShowSelecUser = ref(false)
const jxDetailsStatus = ref([])// const jxDetailsStatus = ref([])//
const formatDate = ref('')// const formatDate = ref('')//
const deviceNumber = ref(null);
const form = ref({ const form = ref({
number: '', number: '',
name:'', name:'',
@ -368,7 +371,8 @@ const form = ref({
} else { } else {
singleColumnDefaultValue.value = [] singleColumnDefaultValue.value = []
} }
singleColumnShow.value = true //singleColumnShow.value = true
isShowSelectItem.value = true;
} }
// //
function chooseSingleColumn(e) { function chooseSingleColumn(e) {
@ -388,7 +392,7 @@ const form = ref({
singleColumnShow.value = false singleColumnShow.value = false
} }
// //
async function getSparePartsList() { async function getSparePartsList(number,name) {
number =deviceNumber.value number =deviceNumber.value
let param = { let param = {
number:number, number:number,
@ -400,6 +404,7 @@ const form = ref({
item.label = item.name item.label = item.name
}) })
sparePartsList.value = res.data sparePartsList.value = res.data
singleColumnList.value = sparePartsList.value
}).catch(() => { }) }).catch(() => { })
} }
// //
@ -444,6 +449,22 @@ const form = ref({
datetimeDefaultValue.value = val ? val : proxy.$time.formatDate() datetimeDefaultValue.value = val ? val : proxy.$time.formatDate()
datetimeShow.value = true 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) { function chooseDatetime(e) {
let array1 = [] let array1 = []
@ -474,6 +495,7 @@ const form = ref({
if (option.type) type.value = option.type; if (option.type) type.value = option.type;
if (option.factoryAreaNumber) factoryAreaNumber.value = option.factoryAreaNumber; if (option.factoryAreaNumber) factoryAreaNumber.value = option.factoryAreaNumber;
if (option.number) form.value.number = option.number; 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 if (option.data && JSON.parse(decodeURIComponent(option.data)) && JSON.parse(decodeURIComponent(option
.data)).id) { .data)).id) {
form.value = JSON.parse(decodeURIComponent(option.data)) form.value = JSON.parse(decodeURIComponent(option.data))

4
src/pages/upkeepOrder/detail.vue

@ -206,11 +206,11 @@
} }
if (clickType == 'updata') { if (clickType == 'updata') {
proxy.$tab.navigateTo( proxy.$tab.navigateTo(
`/pages/upkeepOrder/addServiceRecord?type=${data.value.type}&factoryAreaNumber=${data.value.factoryAreaNumber}&number=${data.value.number}&data=${encodeURIComponent(JSON.stringify(item))}` `/pages/upkeepOrder/addServiceRecord?type=${data.value.type}&factoryAreaNumber=${data.value.factoryAreaNumber}&number=${data.value.number}&data=${encodeURIComponent(JSON.stringify(item))}&deviceNumber=${data.value.deviceNumber}`
) )
} else { } else {
proxy.$tab.navigateTo( proxy.$tab.navigateTo(
`/pages/upkeepOrder/addServiceRecord?type=${data.value.type}&factoryAreaNumber=${data.value.factoryAreaNumber}&number=${data.value.number}` `/pages/upkeepOrder/addServiceRecord?type=${data.value.type}&factoryAreaNumber=${data.value.factoryAreaNumber}&number=${data.value.number}&deviceNumber=${data.value.deviceNumber}`
) )
} }
} }

Loading…
Cancel
Save