|
@@ -391,8 +391,8 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col v-if="No2 && createTemp.useType == 6" :span="8">
|
|
|
- <el-form-item label="青贮单号:" prop="departmentId">
|
|
|
- <el-input ref="useForm" v-model="createTemp.useForm" type="number" maxlength="20" />
|
|
|
+ <el-form-item label="青贮单号:" prop="greenFodderNumber">
|
|
|
+ <el-input ref="greenFodderNumber" v-model="createTemp.greenFodderNumber" type="number" maxlength="20" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col v-if="isReceiveTime2" :span="8">
|
|
@@ -1222,7 +1222,8 @@ export default {
|
|
|
pastureId: Cookies.get('pastureid'),
|
|
|
receiveTime: parseTime(new Date(), '{y}-{m}-{d}'),
|
|
|
applicatId: Cookies.get('employeid'),
|
|
|
- departmentId: Cookies.get('departmentid')
|
|
|
+ departmentId: Cookies.get('departmentid'),
|
|
|
+ greenFodderNumber:''
|
|
|
},
|
|
|
requestSparePart: {
|
|
|
name: 'getPartsListCK',
|
|
@@ -1796,6 +1797,7 @@ export default {
|
|
|
this.createTemp.applicatId = parseInt(Cookies.get('employeid'))
|
|
|
this.listAdd = []
|
|
|
this.createTemp.useForm = ''
|
|
|
+ this.createTemp.greenFodderNumber = ''
|
|
|
this.No1 = true
|
|
|
this.No2 = false
|
|
|
this.No3 = false
|
|
@@ -2514,6 +2516,7 @@ export default {
|
|
|
})
|
|
|
return true
|
|
|
}else if(this.createTemp.useType === 5){
|
|
|
+ console.log('baofei',this.createTemp.oddCode)
|
|
|
// 报废出库
|
|
|
this.postDataPramas.common = { 'returnmap': '0' }
|
|
|
this.postDataPramas.data = []
|
|
@@ -2571,6 +2574,117 @@ export default {
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
+ this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
|
|
|
+ this.postDataPramas.data[1].children = []
|
|
|
+ this.postDataPramas.data[1].children[0] = { 'name': 'insertPartUse', 'type': 'e', 'parammaps': {
|
|
|
+ bigId: '@insertBigPartUse.LastInsertId',
|
|
|
+ locationId: '@insertSpotList.locationId',
|
|
|
+ departmentId: '@insertSpotList.departmentId',
|
|
|
+ partId: '@insertSpotList.partId',
|
|
|
+ partCode: '@insertSpotList.partCode',
|
|
|
+ partName: '@insertSpotList.partName',
|
|
|
+ specification: '@insertSpotList.specification',
|
|
|
+ price: '@insertSpotList.price',
|
|
|
+ unit: '@insertSpotList.unit',
|
|
|
+ brandId: '@insertSpotList.brandId',
|
|
|
+ contractId: '@insertSpotList.contractId',
|
|
|
+ useNumber: 0,
|
|
|
+ checkoutNumber: '@insertSpotList.checkoutNumber',
|
|
|
+ eqName: '@insertSpotList.eqName',
|
|
|
+ eqCode: '@insertSpotList.eqCode',
|
|
|
+ reportery: '@insertSpotList.reportery',
|
|
|
+ useTypeV: '@insertSpotList.useTypeV',
|
|
|
+ note: '@insertSpotList.note'
|
|
|
+ }}
|
|
|
+ this.postDataPramas.data[1].children[1] = { 'name': 'insertPartUseRepertory', 'type': 'e', 'parammaps': {
|
|
|
+ checkoutNumber: '@insertSpotList.checkoutNumber',
|
|
|
+ pastureId: '@insertSpotList.pastureId',
|
|
|
+ locationId: '@insertSpotList.locationId',
|
|
|
+ location: '@insertSpotList.location',
|
|
|
+ partId: '@insertSpotList.partId',
|
|
|
+ partCode: '@insertSpotList.partCode',
|
|
|
+ partName: '@insertSpotList.partName',
|
|
|
+ specification: '@insertSpotList.specification',
|
|
|
+ providerId: '@insertSpotList.providerId',
|
|
|
+ providerName: '@insertSpotList.providerName',
|
|
|
+ brandId: '@insertSpotList.brandId',
|
|
|
+ price: '@insertSpotList.price',
|
|
|
+ unit: '@insertSpotList.unit',
|
|
|
+ contractId: '@insertSpotList.contractId'
|
|
|
+ }}
|
|
|
+ ExecDataByConfig(this.postDataPramas).then(response => {
|
|
|
+ console.log('新增保存发送参数', this.postDataPramas)
|
|
|
+ if (response.msg === 'fail') {
|
|
|
+ this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
|
|
|
+ } else {
|
|
|
+ this.getdataListParm.parammaps.inputDatetime = ''
|
|
|
+ setTimeout(() => {
|
|
|
+ this.get_table_data()
|
|
|
+ }, 1000)
|
|
|
+ this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return true
|
|
|
+ }else if(this.createTemp.useType === 6){
|
|
|
+ // 青贮出库
|
|
|
+ this.postDataPramas.common = { 'returnmap': '0' }
|
|
|
+ this.postDataPramas.data = []
|
|
|
+ for (var j = 0; j < this.listAdd.length; j++) {
|
|
|
+ if (this.listAdd[j].eqName == '' || this.listAdd[j].eqCode == '' || this.listAdd[j].eqName == null || this.listAdd[j].useTypeV == null || this.listAdd[j].eqCode == null || this.listAdd[j].checkoutNumber == null || this.listAdd[j].checkoutNumber == '') {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '请检查备件名称或设备内部编号或费用类型或出库数量是否未填写',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ } else {
|
|
|
+ // eslint-disable-next-line no-redeclare
|
|
|
+ var rulesCheckoutNumber = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
|
|
|
+ if (!rulesCheckoutNumber.test(parseFloat(this.listAdd[j].checkoutNumber))) {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: '出库数量请输入正数,最多保留两位小数点',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ } else {
|
|
|
+ if (parseFloat(this.listAdd[j].checkoutNumber) > parseFloat(this.listAdd[j].reportery)) {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '出库数量不能大于库位库存数',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ this.$set(this.listAdd.find(obj => obj.checkoutNumber == this.listAdd[j].checkoutNumber), 'isNo', 'No')
|
|
|
+ return false
|
|
|
+ } else {
|
|
|
+ this.$set(this.listAdd.find(obj => obj.checkoutNumber == this.listAdd[j].checkoutNumber), 'isNo', 'Yes')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.postDataPramas.data[0] = { 'name': 'insertBigPartUse', 'type': 'e', 'parammaps': {
|
|
|
+ pastureId: this.createTemp.pastureId,
|
|
|
+ departmentId: this.createTemp.departmentId,
|
|
|
+ useForm: this.createTemp.useForm,
|
|
|
+ useType: this.createTemp.useType,
|
|
|
+ applicatId: this.createTemp.applicatId,
|
|
|
+ receiveTime: this.createTemp.receiveTime,
|
|
|
+ empId: this.createTemp.empId,
|
|
|
+ note: this.createTemp.note,
|
|
|
+ greenFodderNumber:this.createTemp.greenFodderNumber
|
|
|
+ }}
|
|
|
+
|
|
|
+ // if(this.createTemp.oddCode == ""){
|
|
|
+ // this.$notify({
|
|
|
+ // title: '保存失败',
|
|
|
+ // message: '领用单号不得为空',
|
|
|
+ // type: 'warning',
|
|
|
+ // duration: 2000
|
|
|
+ // })
|
|
|
+ // return false
|
|
|
+ // }
|
|
|
+
|
|
|
this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
|
|
|
this.postDataPramas.data[1].children = []
|
|
|
this.postDataPramas.data[1].children[0] = { 'name': 'insertPartUse', 'type': 'e', 'parammaps': {
|