修改问题

master
sunzehua 1 year ago
parent 00747ba1a7
commit 77ca1870d1

@ -83,6 +83,7 @@
:details="bookingDetails"
:rules="tableRules"
isParent="parent"
@changectnall="changectnall"
@changeDetail="changeDetailFun"
@changeTotal="changeTotalFun"
@changeCtnInfo="changeCtnInfoFun">
@ -1297,7 +1298,7 @@ export default {
let tableErrTip = ''
this.bookingDetails.ctnInputs.map((item, index) => {
Object.keys(item).map((label, lindex) => {
if (this.tableRules[label] && this.tableRules[label].required && !item[label]) {
if (this.tableRules[label] && this.tableRules[label].required && item[label] === '') {
tableErrTip = `${tableErrTip} 序号${index + 1}${this.tableRules[label].title}未填写,`
}
})
@ -1778,6 +1779,16 @@ export default {
this.bookingDetails.totalno = enCapitalRes
}
},
changectnall(arr) {
let str = ''
arr.forEach((item, index) => {
str += item.ctnall + '*' + item.ctnnum
if (index != arr.length - 1) {
str += '/'
}
})
this.bookingDetails.cntrtotal = str
},
removeOrderFun() {
DeleteBookingOrder(this.bookingDetails.id)
.then(res => {

@ -188,6 +188,27 @@ export default {
this.tableData[rowIndex].ctnall = data.name
this.tableData[rowIndex].ctncode = data.code
row['ctnall'] = data.name
var map = {};
var dest = [];
for (var i = 0; i < this.tableData.length; i++) {
var ai = this.tableData[i];
if (!map[ai.ctnall]) {
dest.push({
ctnall: ai.ctnall,
ctnnum: ai.ctnnum
});
map[ai.ctnall] = ai;
} else {
for (var j = 0; j < dest.length; j++) {
var dj = dest[j];
if (dj.ctnall == ai.ctnall) {
dj.ctnnum = (parseFloat(dj.ctnnum) + parseFloat(ai.ctnnum)).toString();
break;
}
}
}
};
this.changeEmit1(dest)
this.$forceUpdate()
} else {
row['ctnall'] = ''
@ -322,7 +343,7 @@ export default {
}
})
}
this.$emit('changeCtnInfo', { type: 'kindpkgs', val: row['kindpkgs'] })
this.changeEmit(row)
}}
on-focus={(val) => {
this.kindpkgsViewIndex = rowIndex
@ -798,6 +819,29 @@ export default {
}
}
}
if (column.field === 'ctnnum') {
const map = {};
const dest = [];
for (var i = 0; i < this.tableData.length; i++) {
var ai = this.tableData[i];
if (!map[ai.ctnall]) {
dest.push({
ctnall: ai.ctnall,
ctnnum: ai.ctnnum
});
map[ai.ctnall] = ai;
} else {
for (var j = 0; j < dest.length; j++) {
var dj = dest[j];
if (dj.ctnall == ai.ctnall) {
dj.ctnnum = (parseFloat(dj.ctnnum) + parseFloat(ai.ctnnum)).toString();
break;
}
}
}
};
this.changeEmit1(dest)
}
},
cellValueChange: ({ row, column }) => { }
},
@ -1178,9 +1222,9 @@ export default {
this.id = this.$route.query.id
}
if (this.$route.name === 'BookingDetail') {
if (this.$route.name === 'BookingDetail') {
this.init()
}
}
}
},
totalKgs() {
@ -1256,9 +1300,9 @@ export default {
setTimeout(() => {
if (document.getElementsByClassName('ve-table-cell-selection')) {
const activeDom = document.getElementsByClassName('ve-table-cell-selection')[0].firstChild
if (this.isDOM(activeDom)) {
activeDom.click()
}
if (this.isDOM(activeDom)) {
activeDom.click()
}
}
}, 200)
}
@ -1272,6 +1316,9 @@ export default {
keydown(e) {
console.log(e)
},
changeEmit(row) {
this.$emit('changeCtnInfo', { type: 'kindpkgs', val: row['kindpkgs'] })
},
isDOM(item) {
// HTMLELement使HTMLElementDOMODM使
return typeof HTMLElement === 'function'
@ -1533,6 +1580,9 @@ export default {
}
this.childTableData.push(data)
},
changeEmit1(arr) {
this.$emit('changectnall', arr)
},
removeChildData() {
this.selectChildArr.map((item, index) => {
this.childTableData.map((oitem, oindex) => {
@ -1588,11 +1638,32 @@ export default {
if (type) {
const data = JSON.parse(res.data)
if (data.length == this.tableData.length) {
console.log(this.tableData, data)
data.forEach((item, index) => {
this.tableData[index].sealno = item.SEALNO
this.tableData[index].cntrno = item.CNTRNO
this.tableData[index].ctnnum = 1
})
const map = {};
const dest = [];
for (var i = 0; i < this.tableData.length; i++) {
var ai = this.tableData[i];
if (!map[ai.ctnall]) {
dest.push({
ctnall: ai.ctnall,
ctnnum: ai.ctnnum
});
map[ai.ctnall] = ai;
} else {
for (var j = 0; j < dest.length; j++) {
var dj = dest[j];
if (dj.ctnall == ai.ctnall) {
dj.ctnnum = (parseFloat(dj.ctnnum) + parseFloat(ai.ctnnum)).toString();
break;
}
}
}
};
this.changeEmit1(dest)
} else {
this.$message.error('箱量与场站不一致')
}
@ -1622,27 +1693,27 @@ export default {
const data = JSON.parse(res.data)
const addTable = []
const cntrnoArr = []
let kindpkgsOld = ''
const kindpkgsOld = ''
this.tableData = []
const lastNum = this.tableData.length > 0 ? Number(this.tableData[this.tableData.length - 1].rowKey) + 1 : 0
data.map((item, index) => {
const _data = {
rowKey: lastNum + index,
ctnall: item.CTNALL,
ctnnum: '1',
cntrno: item.CNTRNO,
sealno: item.SEALNO,
ctncode: item.CtnCode,
pkgs: item.PKGS,
kindpkgs: kindpkgsOld || item.KINDPKGS,
kgs: item.KGS,
cbm: item.CBM,
tareweight: item.TAREWEIGHT,
weightype: '',
weighkgs: '',
weighdate: item.WEIGHDATE
}
addTable.push(_data)
const _data = {
rowKey: lastNum + index,
ctnall: item.CTNALL,
ctnnum: '1',
cntrno: item.CNTRNO,
sealno: item.SEALNO,
ctncode: item.CtnCode,
pkgs: item.PKGS,
kindpkgs: kindpkgsOld || item.KINDPKGS,
kgs: item.KGS,
cbm: item.CBM,
tareweight: item.TAREWEIGHT,
weightype: '',
weighkgs: '',
weighdate: item.WEIGHDATE
}
addTable.push(_data)
})
this.tableData = [...this.tableData, ...addTable]
@ -1778,7 +1849,7 @@ export default {
} else {
cntrnoArr.push(this.tableData[i].cntrno)
}
}
}
const lastNum = this.tableData.length > 0 ? Number(this.tableData[this.tableData.length - 1].rowKey) + 1 : 0
data.map((item, index) => {
if (cntrnoArr.includes(item.CNTRNO)) {
@ -1821,7 +1892,7 @@ export default {
addTable.push(_data)
}
})
console.log(this.tableData,addTable)
console.log(this.tableData, addTable)
this.tableData = [...this.tableData, ...addTable]
this.$forceUpdate()
} else {

@ -216,16 +216,16 @@
@getInputChange="inputChange" />
</a-form-model-item>
</a-col>
<a-col :span="6">
<a-col :span="7">
<a-form-model-item
class="from-label yarn-label"
label="场站"
:labelCol="{ xs: { span: 24 },
sm: { span: 5 },
md: { span: 5 }}"
sm: { span: 4 },
md: { span: 4 }}"
:wrapperCol="{ xs: { span: 24 },
sm: { span: 19 },
md: { span: 19 }}"
sm: { span: 20 },
md: { span: 20 }}"
has-feedback
style="overflow: visible"
prop="yard">
@ -244,7 +244,7 @@
</div>
</a-form-model-item>
</a-col>
<a-col :span="6">
<a-col :span="5">
<a-form-model-item
class="from-label"
label="场站费自结"

@ -160,7 +160,7 @@
</div>
</a-form-model>
<template slot="footer">
<a-button @click="conditFlag = false">
<a-button @click="mexActionFlag = false">
关闭
</a-button>
<a-button type="primary" @click="handleAddMexAction">

@ -203,7 +203,7 @@
</div>
<div class="title">
<span>触发器</span>
<a @click="baseAddFlag = true"></a>
<a @click="handlePushBase(1)"></a>
</div>
<div class="statBox" v-if="activeForm.statusTriggerList && activeForm.statusTriggerList.length > 0">
<div class="status" v-for="(item, index) in activeForm.statusTriggerList" :key="index">
@ -258,6 +258,18 @@
<a-select-option value="STRING">字符串</a-select-option>
</a-select>
</a-form-model-item>
<div class="title">
<span>触发器</span>
<a @click="handlePushBase(2)"></a>
</div>
<div class="statBox" v-if="subActiveForm.statusTriggerList && subActiveForm.statusTriggerList.length > 0">
<div class="status" v-for="(item, index) in subActiveForm.statusTriggerList" :key="index">
<span class="name">{{ item.statusTriggerName }}</span>
<span class="action">
<a-icon type="delete" @click="handleDelBase(index)" style="cursor: pointer;" />
</span>
</div>
</div>
</a-form-model>
</div>
<template slot="footer">
@ -355,7 +367,8 @@
<div class="top">
<div class="line" :class="{ active: item.isYield == 1 }"></div>
<div class="point" :class="{ active: item.isYield == 1 }"></div>
<div class="line" v-if="index != timeForm.activitiesList.length - 1" :class="{ active: item.isYield == 1 }"></div>
<div class="line" v-if="index != timeForm.activitiesList.length - 1" :class="{ active: item.isYield == 1 }">
</div>
</div>
<div class="bottom">
<div :title="item.showName + item.actDate">{{ item.showName }}</div>
@ -527,7 +540,7 @@
</div>
</a-form-model>
<template slot="footer">
<a-button @click="conditFlag = false">
<a-button @click="mexActionFlag = false">
关闭
</a-button>
<a-button type="primary" @click="handleAddMexAction">
@ -565,7 +578,8 @@ export default {
mexActionIndex: 0,
mexActionFlag: false,
subActiveForm: {
sortNo: 1
sortNo: 1,
statusTriggerList: []
},
mextActionList: [],
conditFlag: false,
@ -607,6 +621,7 @@ export default {
addItemFlag: false,
visible: false,
subType: 'add',
baseType: 0,
type: 'add',
index: '',
editConditForm: {
@ -789,6 +804,9 @@ export default {
if (!item.subList) {
item.subList = []
}
if (!item.statusTriggerList) {
item.statusTriggerList = []
}
})
} else {
res.data.ext.statusSkuList = []
@ -848,26 +866,50 @@ export default {
},
handleIntoBase() {
if (this.base) {
let name = ''
const arr = []
this.activeForm.statusTriggerList.forEach(item => {
if (item.pkId == this.base) {
arr.push(1)
}
})
if (arr.length == 0) {
this.baseList.forEach(item => {
if (item.pkId === this.base) {
name = item.statusTriggerName
if (this.baseType == 1) {
let name = ''
const arr = []
this.activeForm.statusTriggerList.forEach(item => {
if (item.pkId == this.base) {
arr.push(1)
}
})
this.activeForm.statusTriggerList.push({
pkId: this.base,
statusTriggerName: name
})
this.baseAddFlag = false
if (arr.length == 0) {
this.baseList.forEach(item => {
if (item.pkId === this.base) {
name = item.statusTriggerName
}
})
this.activeForm.statusTriggerList.push({
pkId: this.base,
statusTriggerName: name
})
this.baseAddFlag = false
} else {
this.$message.warning('请勿添加重复触发器')
}
} else {
this.$message.warning('请勿添加重复触发器')
let name = ''
const arr = []
this.subActiveForm.statusTriggerList.forEach(item => {
if (item.pkId == this.base) {
arr.push(1)
}
})
if (arr.length == 0) {
this.baseList.forEach(item => {
if (item.pkId === this.base) {
name = item.statusTriggerName
}
})
this.subActiveForm.statusTriggerList.push({
pkId: this.base,
statusTriggerName: name
})
this.baseAddFlag = false
} else {
this.$message.warning('请勿添加重复触发器')
}
}
} else {
this.$message.warning('请选择')
@ -902,6 +944,10 @@ export default {
}
})
},
handlePushBase(type) {
this.baseAddFlag = true
this.baseType = type
},
handleSaveSubActive() {
this.$refs.subActiveForm.validate(valid => {
if (valid) {

Loading…
Cancel
Save