330 lines
10 KiB
Vue
330 lines
10 KiB
Vue
|
|
<template>
|
||
|
|
<view class="viewport">
|
||
|
|
<u-popup v-model="isShow" mode="left" :border-radius="10" :closeable="true" @close="fnCancel" width="100%" height="100%">
|
||
|
|
<u-row gutter="12">
|
||
|
|
<u-col span="12">
|
||
|
|
<CustomNavbar />
|
||
|
|
</u-col>
|
||
|
|
<u-col span="12">
|
||
|
|
<view :style="{ textAlign: 'center', height: '60px', lineHeight: '60px' }">
|
||
|
|
<text :style="{ fontSize: '40rpx', fontWeight: 500, color: '#1D2129' }">{{ dataItem.eqmtSimpleName }}</text>
|
||
|
|
</view>
|
||
|
|
</u-col>
|
||
|
|
<u-col span="12">
|
||
|
|
<u-form :model="dataItem" :rules="rules" ref="dataItem" :errorType="['toast']" label-position="left" label-width="250" label-align="center">
|
||
|
|
<u-form-item label="设备编号" prop="text" >
|
||
|
|
<text>{{ dataItem.eqmtNo }}</text>
|
||
|
|
</u-form-item>
|
||
|
|
<u-form-item label="设备名称" prop="text" >
|
||
|
|
<text>{{ dataItem.eqmtName }}</text>
|
||
|
|
</u-form-item>
|
||
|
|
<u-form-item label="品牌型号" prop="text" >
|
||
|
|
<text>{{ dataItem.specName }}</text>
|
||
|
|
</u-form-item>
|
||
|
|
<u-form-item label="故障描述" prop="text" required>
|
||
|
|
<u-input v-model="dataItem.failureDesc" type="textarea" placeholder="请输入故障描述" />
|
||
|
|
</u-form-item>
|
||
|
|
</u-form>
|
||
|
|
</u-col>
|
||
|
|
</u-row>
|
||
|
|
<view class="buttom-actions">
|
||
|
|
<u-button class="buttom-btn" @click="jnpf.goBack">取消</u-button>
|
||
|
|
<u-button class="buttom-btn" type="primary" @click="fnOk">保存</u-button>
|
||
|
|
<!-- <u-button class="buttom-btn" type="warning" @click="submit">保存草稿</u-button> -->
|
||
|
|
</view>
|
||
|
|
</u-popup>
|
||
|
|
<u-top-tips ref="uTips"></u-top-tips>
|
||
|
|
</view>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script>
|
||
|
|
import MescrollMixin from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js'
|
||
|
|
import { mapGetters } from 'vuex'
|
||
|
|
import { toProd } from '@/api/yys/materialProcurementOrder.js'
|
||
|
|
import { fix } from '@/api/yys/eqmt.js'
|
||
|
|
import { getDataInterfaceRes } from '@/api/common'
|
||
|
|
import CustomNavbar from './CustomNavbar'
|
||
|
|
import dayjs from 'dayjs'
|
||
|
|
export default {
|
||
|
|
components: { CustomNavbar },
|
||
|
|
mixins: [],
|
||
|
|
data() {
|
||
|
|
return {
|
||
|
|
rules: {
|
||
|
|
// radio: [{
|
||
|
|
// required: true,
|
||
|
|
// message: '请选择任意一种单选',
|
||
|
|
// trigger: 'change'
|
||
|
|
// }],
|
||
|
|
// time: [{
|
||
|
|
// required: true,
|
||
|
|
// message: '请选择时间',
|
||
|
|
// trigger: 'change',
|
||
|
|
// }],
|
||
|
|
// date: [{
|
||
|
|
// required: true,
|
||
|
|
// message: '请选择日期',
|
||
|
|
// trigger: 'change',
|
||
|
|
// type: 'number'
|
||
|
|
// }],
|
||
|
|
},
|
||
|
|
isShow: false,
|
||
|
|
productionNumber: undefined,
|
||
|
|
dataItem: {},
|
||
|
|
productionTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
||
|
|
isShowPickerA: false,
|
||
|
|
isShowReportMember: false,
|
||
|
|
isShowMaterialCode: false,
|
||
|
|
pickerParams: {
|
||
|
|
year: true,
|
||
|
|
month: true,
|
||
|
|
day: true,
|
||
|
|
hour: true,
|
||
|
|
minute: true,
|
||
|
|
second: true,
|
||
|
|
},
|
||
|
|
reportMemberList: [],
|
||
|
|
materialList: [],
|
||
|
|
prodReportItemO: {
|
||
|
|
reportMember: undefined,
|
||
|
|
reportMemberIndex: [],
|
||
|
|
planNum: undefined,
|
||
|
|
reportMemberShow: undefined,
|
||
|
|
compensatoryHour: undefined,
|
||
|
|
},
|
||
|
|
packageReportItemO: {
|
||
|
|
reportMemberShow: undefined,
|
||
|
|
reportMemberIndex: [],
|
||
|
|
planNum: undefined,
|
||
|
|
acquisitionNum: undefined,
|
||
|
|
reportMember: undefined,
|
||
|
|
compensatoryHour: undefined,
|
||
|
|
},
|
||
|
|
requisitionReportItemO: {
|
||
|
|
materialCode: undefined,
|
||
|
|
materialCodeIndex: [],
|
||
|
|
materialName: undefined,
|
||
|
|
acquisitionNum: undefined,
|
||
|
|
duty: undefined,
|
||
|
|
classBalance: undefined,
|
||
|
|
},
|
||
|
|
}
|
||
|
|
},
|
||
|
|
watch: {},
|
||
|
|
computed: {},
|
||
|
|
onLoad(params) {},
|
||
|
|
onUnload() {},
|
||
|
|
methods: {
|
||
|
|
init(dataItem) {
|
||
|
|
dataItem.prodReportList = []
|
||
|
|
dataItem.packageReportList = [] // temp.packageReportList;
|
||
|
|
//dataItem.requisitionReportList =[];// temp.requisitionReportList;
|
||
|
|
this.dataItem = dataItem
|
||
|
|
this.isShow = true
|
||
|
|
console.log(this.dataItem)
|
||
|
|
},
|
||
|
|
fnCancel() {
|
||
|
|
this.dataItem = {}
|
||
|
|
this.isShow = false
|
||
|
|
},
|
||
|
|
fnOk() {
|
||
|
|
if (!this.dataItem.failureDesc) {
|
||
|
|
uni.showToast({
|
||
|
|
title: '请输入故障描述',
|
||
|
|
icon: 'none',
|
||
|
|
})
|
||
|
|
return
|
||
|
|
}
|
||
|
|
this.dataItem.eqmtNo = this.dataItem.eqmtNo
|
||
|
|
let _params = {
|
||
|
|
...this.dataItem,
|
||
|
|
}
|
||
|
|
// reportSeq 新增-参数不存在 更新-参数存在
|
||
|
|
console.log(_params)
|
||
|
|
fix(_params)
|
||
|
|
.then(res => {
|
||
|
|
if (res.code == 200) {
|
||
|
|
this.$emit('evtRefresh')
|
||
|
|
}
|
||
|
|
})
|
||
|
|
.catch(err => {
|
||
|
|
console.log(err)
|
||
|
|
})
|
||
|
|
this.fnCancel()
|
||
|
|
},
|
||
|
|
fnShowPickerA() {
|
||
|
|
this.isShowPickerA = true
|
||
|
|
},
|
||
|
|
fnProductionTime(timeObj) {
|
||
|
|
this.productionTime = timeObj.year + '-' + timeObj.month + '-' + timeObj.day + ' ' + timeObj.hour + ':' + timeObj.minute + ':' + timeObj.second
|
||
|
|
},
|
||
|
|
fnReportMemberList() {
|
||
|
|
userList()
|
||
|
|
.then(res => {
|
||
|
|
if (res.code == 200) {
|
||
|
|
this.reportMemberList = res.data
|
||
|
|
}
|
||
|
|
})
|
||
|
|
.catch(err => {
|
||
|
|
console.log(err)
|
||
|
|
})
|
||
|
|
},
|
||
|
|
fnProdReportItemAdd() {
|
||
|
|
this.prodReportItemO.planNum = this.dataItem.planNumber
|
||
|
|
this.dataItem.prodReportList.push({
|
||
|
|
...this.prodReportItemO,
|
||
|
|
})
|
||
|
|
},
|
||
|
|
fnProdReportItemDel(index) {
|
||
|
|
this.dataItem.prodReportList.splice(index, 1)
|
||
|
|
},
|
||
|
|
fnProReportMemberSltd(row, index) {
|
||
|
|
this.dataItem.prodReportList[index]['reportMember'] = row[0]['value']
|
||
|
|
this.fnProReportMemberFind(this.dataItem.prodReportList[index]['reportMember'], index)
|
||
|
|
},
|
||
|
|
fnProReportMemberFind(reportMember, index) {
|
||
|
|
let _list = [...this.reportMemberList]
|
||
|
|
let _reportMember = _list.find(o1 => {
|
||
|
|
return o1.id == reportMember
|
||
|
|
})
|
||
|
|
let _reportMemberIndex = _list.indexOf(_reportMember)
|
||
|
|
this.dataItem.prodReportList[index]['reportMemberIndex'] = [_reportMemberIndex]
|
||
|
|
this.dataItem.prodReportList[index]['reportMemberShow'] = _reportMember.realName
|
||
|
|
},
|
||
|
|
fnPackageReportItemAdd() {
|
||
|
|
this.packageReportItemO.planNum = this.dataItem.planNumber
|
||
|
|
this.dataItem.packageReportList.push({
|
||
|
|
...this.packageReportItemO,
|
||
|
|
})
|
||
|
|
},
|
||
|
|
fnPackageReportItemDel(index) {
|
||
|
|
this.dataItem.packageReportList.splice(index, 1)
|
||
|
|
},
|
||
|
|
fnPackageReportMemberSltd(row, index) {
|
||
|
|
this.dataItem.packageReportList[index]['reportMember'] = row[0]['value']
|
||
|
|
this.fnPackageReportMemberFind(this.dataItem.packageReportList[index]['reportMember'], index)
|
||
|
|
},
|
||
|
|
fnPackageReportMemberFind(reportMember, index) {
|
||
|
|
let _list = [...this.reportMemberList]
|
||
|
|
let _reportMember = _list.find(o1 => {
|
||
|
|
return o1.id == reportMember
|
||
|
|
})
|
||
|
|
let _reportMemberIndex = _list.indexOf(_reportMember)
|
||
|
|
this.dataItem.packageReportList[index]['reportMemberIndex'] = [_reportMemberIndex]
|
||
|
|
this.dataItem.packageReportList[index]['reportMemberShow'] = _reportMember.realName
|
||
|
|
},
|
||
|
|
fnRequisitionReportItemAdd() {
|
||
|
|
this.dataItem.requisitionReportList.push({
|
||
|
|
...this.requisitionReportItemO,
|
||
|
|
})
|
||
|
|
},
|
||
|
|
fnRequisitionReportItemDel(index) {
|
||
|
|
this.dataItem.requisitionReportList.splice(index, 1)
|
||
|
|
},
|
||
|
|
fnMaterialInformationList() {
|
||
|
|
const query = {
|
||
|
|
paramList: [
|
||
|
|
{
|
||
|
|
dataType: 'varchar',
|
||
|
|
defaultValue: this.dataItem.id,
|
||
|
|
field: 'id',
|
||
|
|
fieldName: '',
|
||
|
|
id: '111',
|
||
|
|
isSubTable: false,
|
||
|
|
relationField: null,
|
||
|
|
required: 0,
|
||
|
|
sourceType: 0,
|
||
|
|
},
|
||
|
|
],
|
||
|
|
}
|
||
|
|
getDataInterfaceRes('606211842770993989', query)
|
||
|
|
.then(res => {
|
||
|
|
if (res.code == 200) {
|
||
|
|
this.materialList = res.data
|
||
|
|
var list = JSON.parse(JSON.stringify(res.data))
|
||
|
|
list.forEach(it => {
|
||
|
|
it.classBalance = undefined
|
||
|
|
it.duty = undefined
|
||
|
|
})
|
||
|
|
this.dataItem.requisitionReportList = list
|
||
|
|
uni.hideLoading()
|
||
|
|
}
|
||
|
|
})
|
||
|
|
.catch(err => {
|
||
|
|
uni.hideLoading()
|
||
|
|
})
|
||
|
|
|
||
|
|
// materialInformationList()
|
||
|
|
// .then((res) => {
|
||
|
|
// if (res.code == 200) {
|
||
|
|
// console.log(res);
|
||
|
|
// this.materialList = res.data;
|
||
|
|
// //var list = res.data.filter(it=>it.materialCode.includes(''))
|
||
|
|
// this.dataItem.requisitionReportList=JSON.parse(JSON.stringify(res.data))
|
||
|
|
// //this.reportMemberList = res.data;
|
||
|
|
// }
|
||
|
|
// })
|
||
|
|
// .catch((err) => {
|
||
|
|
// console.log(err);
|
||
|
|
// });
|
||
|
|
},
|
||
|
|
fnMaterialCodeSltd(row, index) {
|
||
|
|
this.dataItem.requisitionReportList[index]['materialCode'] = row[0]['value']
|
||
|
|
this.fnMaterialCodeFind(this.dataItem.requisitionReportList[index]['materialCode'], index)
|
||
|
|
},
|
||
|
|
fnMaterialCodeFind(materialCode, index) {
|
||
|
|
let _list = [...this.materialList]
|
||
|
|
let _material = _list.find(o1 => {
|
||
|
|
return o1.materialCode == materialCode
|
||
|
|
})
|
||
|
|
let _materialCodeIndex = _list.indexOf(_material)
|
||
|
|
this.dataItem.requisitionReportList[index]['materialCodeIndex'] = [_materialCodeIndex]
|
||
|
|
this.dataItem.requisitionReportList[index]['materialName'] = _material.materialName
|
||
|
|
},
|
||
|
|
},
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<style lang="scss" scoped>
|
||
|
|
/deep/.u-th {
|
||
|
|
width: 100%;
|
||
|
|
height: 32px;
|
||
|
|
}
|
||
|
|
|
||
|
|
/deep/.u-td {
|
||
|
|
width: 100%;
|
||
|
|
height: 32px;
|
||
|
|
}
|
||
|
|
.slot-wrap {
|
||
|
|
display: flex;
|
||
|
|
align-items: center;
|
||
|
|
justify-content: center;
|
||
|
|
position: absolute;
|
||
|
|
left: 41px;
|
||
|
|
right: 41px;
|
||
|
|
/* #ifdef MP */
|
||
|
|
width: 100%;
|
||
|
|
/* #endif */
|
||
|
|
|
||
|
|
.title {
|
||
|
|
font-size: 32rpx;
|
||
|
|
font-weight: bold;
|
||
|
|
}
|
||
|
|
|
||
|
|
.nav-icon {
|
||
|
|
width: 48rpx;
|
||
|
|
height: 48rpx;
|
||
|
|
margin-top: 4rpx;
|
||
|
|
margin-left: 22rpx;
|
||
|
|
background: rgb(240, 242, 246);
|
||
|
|
border-radius: 50%;
|
||
|
|
display: flex;
|
||
|
|
align-items: center;
|
||
|
|
justify-content: center;
|
||
|
|
|
||
|
|
text {
|
||
|
|
font-size: 32rpx;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
</style>
|