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>
</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"
@ -151,13 +152,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([])
@ -390,7 +392,12 @@
} else {
singleColumnDefaultValue.value = []
}
singleColumnShow.value = true
if(fieldName == 'number'){
isShowSelectItem.value = true;
}else{
singleColumnShow.value = true
}
}
//
function chooseSingleColumn(e) {
@ -411,8 +418,8 @@
singleColumnShow.value = false
}
//
async function getSparePartsList() {
number =deviceNumber.value
async function getSparePartsList(number,name) {
number =form.value.deviceNumber
let param = {
number:number,
name:name
@ -423,6 +430,7 @@
item.label = item.name
})
sparePartsList.value = res.data
singleColumnList.value = sparePartsList.value
}).catch(() => { })
}
//
@ -510,6 +518,22 @@
await getSelecUser()
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>
<style lang="scss" scoped>

28
src/pages/upkeepOrder/addServiceRecord.vue

@ -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))

4
src/pages/upkeepOrder/detail.vue

@ -206,11 +206,11 @@
}
if (clickType == 'updata') {
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 {
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