|
|
@ -41,39 +41,63 @@ export default { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
mounted() { |
|
|
mounted() { |
|
|
EventBus.$on("subPackageSubmit", (data) => { |
|
|
|
|
|
|
|
|
EventBus.$on("dialogSubPackageSubmit", (data) => { |
|
|
this.onSubPackageSubmit(data) |
|
|
this.onSubPackageSubmit(data) |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
watch: { |
|
|
|
|
|
row: { |
|
|
|
|
|
handler(newVal, oldVal) { |
|
|
|
|
|
this.innerRow = newVal; |
|
|
|
|
|
}, |
|
|
|
|
|
deep: true, |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
data(){ |
|
|
|
|
|
return{ |
|
|
|
|
|
innerRow: this.row, |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
// 开始配置 |
|
|
// 开始配置 |
|
|
onStartConfig() { |
|
|
onStartConfig() { |
|
|
this.$emit("startConfig", this.row) |
|
|
|
|
|
|
|
|
this.$emit("startConfig", this.innerRow) |
|
|
}, |
|
|
}, |
|
|
// 配置完成 |
|
|
// 配置完成 |
|
|
onConfigComplete() { |
|
|
onConfigComplete() { |
|
|
this.$emit("configComplete", this.row) |
|
|
|
|
|
|
|
|
this.$emit("configComplete", this.innerRow) |
|
|
}, |
|
|
}, |
|
|
// 打印标签 |
|
|
// 打印标签 |
|
|
onPrintLabel() { |
|
|
onPrintLabel() { |
|
|
this.$emit("printLabel", this.row) |
|
|
|
|
|
|
|
|
this.$emit("printLabel", this.innerRow) |
|
|
}, |
|
|
}, |
|
|
// 分装 |
|
|
// 分装 |
|
|
onSubPackage() { |
|
|
onSubPackage() { |
|
|
const {columns,row} = this; |
|
|
|
|
|
|
|
|
const {columns,innerRow} = this; |
|
|
const {headerSelectFields,columnsData} = columns; |
|
|
const {headerSelectFields,columnsData} = columns; |
|
|
const col = columnsData.find((item)=>item.myCodeFields); |
|
|
const col = columnsData.find((item)=>item.myCodeFields); |
|
|
const {myCodeFields,maxVolumeField,maxVolumeFieldUnit} = col; |
|
|
const {myCodeFields,maxVolumeField,maxVolumeFieldUnit} = col; |
|
|
console.log(row,col,"ooooo") |
|
|
|
|
|
const fields = []; |
|
|
const fields = []; |
|
|
myCodeFields.forEach((key)=>{ |
|
|
myCodeFields.forEach((key)=>{ |
|
|
fields.push(row[key]) |
|
|
|
|
|
}) |
|
|
|
|
|
EventBus.$emit("showSubPackageDialog",{mybh:fields.join(""),maxVolume:row[maxVolumeField],maxVolumeUnit:headerSelectFields[maxVolumeFieldUnit],rowIndex:this.rowIndex}) |
|
|
|
|
|
|
|
|
fields.push(innerRow[key]) |
|
|
|
|
|
}); |
|
|
|
|
|
let defaultData = {mybh:fields.join(""),maxVolume:innerRow[maxVolumeField],maxVolumeUnit:headerSelectFields[maxVolumeFieldUnit],rowIndex:this.rowIndex} |
|
|
|
|
|
if(innerRow.fzsj){ |
|
|
|
|
|
defaultData = innerRow.fzsj |
|
|
|
|
|
} |
|
|
|
|
|
EventBus.$emit("showSubPackageDialog",defaultData) |
|
|
}, |
|
|
}, |
|
|
onSubPackageSubmit(data){ |
|
|
onSubPackageSubmit(data){ |
|
|
if(data.rowIndex === this.rowIndex){ |
|
|
if(data.rowIndex === this.rowIndex){ |
|
|
this.$emit("subPackageSubmit", data) |
|
|
|
|
|
|
|
|
this.innerRow.fzsj = data; |
|
|
|
|
|
//通知后端保存数据 |
|
|
|
|
|
const params = { |
|
|
|
|
|
type: "fieldChanged", |
|
|
|
|
|
newRecord: null, |
|
|
|
|
|
resourceList: null, |
|
|
|
|
|
} |
|
|
|
|
|
EventBus.$emit('onModifyRecord', params); |
|
|
|
|
|
this.$emit("subPackageSubmit", {fzsj:data,rowData:this.innerRow}); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
// 删除行 |
|
|
// 删除行 |
|
|
|