|
|
@@ -59,6 +59,9 @@
|
|
|
control-id="oInvId"
|
|
|
:new-row-flag="true" :height="400"
|
|
|
:columns="this.type === this.$config.formMode.add ? transferWhItemColumns: transferStdItemColumns"
|
|
|
+ @changeValue="getTotals"
|
|
|
+ @on-choose="getTotals"
|
|
|
+ @changeNonStandard="changeNonStandard"
|
|
|
></EditTable>
|
|
|
</div>
|
|
|
</DkPanel>
|
|
|
@@ -238,8 +241,8 @@ export default {
|
|
|
digits: 0,
|
|
|
sum: true,
|
|
|
formula: {
|
|
|
- box: ['transferQty/packBox', 'freezeQty', 'packBox'],
|
|
|
- piece: ['transferQty%packBox', 'freezeQty', 'packBox'],
|
|
|
+ box: ['transferQty/packBox', 'transferQty', 'packBox'],
|
|
|
+ piece: ['transferQty%packBox', 'transferQty', 'packBox'],
|
|
|
},
|
|
|
},
|
|
|
//包装
|
|
|
@@ -378,6 +381,64 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
/**
|
|
|
+ * @desc : 数量改变事件
|
|
|
+ * @author : 姜宁
|
|
|
+ * @date : 2024/8/13 9:22
|
|
|
+ */
|
|
|
+ getTotals(field, row, rowIndex) {
|
|
|
+ let table = this.$refs['goodsTable'].tableData;
|
|
|
+ let sumQuantity = 0; // 合计数量
|
|
|
+ if (table && table.length > 0) {
|
|
|
+ table.forEach(row => {
|
|
|
+ if (row["transferQty"]) {
|
|
|
+ sumQuantity += parseFloat(row["transferQty"]);
|
|
|
+ }
|
|
|
+ this.decimalPlaces = row['decimalPlaces']
|
|
|
+ if(row['subUnitId']){
|
|
|
+ row.nonStandardForm = {
|
|
|
+ formula: (row['subUnitName']?'1'+row['subUnitName']+ '=':'' ) + row['packBox'] + row['unitName'],
|
|
|
+ box:(row['transferQty']/row['packBox'] >= 1 ? Math.floor(row['transferQty']/row['packBox']):0),
|
|
|
+ piece:row['transferQty']%row['packBox']?row['transferQty']%row['packBox']:0,
|
|
|
+ }
|
|
|
+ row.nonStandardItems = [
|
|
|
+ {code:'formula',label:'计算公式',type:'text',readonly:true},
|
|
|
+ {code:'box',label:row['subUnitName'],type:'number' },
|
|
|
+ {code:'piece',label:row['unitName'],type:'number',digits:this.decimalPlaces}
|
|
|
+ ]
|
|
|
+ row['unitInfo'] = (row['transferQty']/row['packBox'] >= 1 ? Math.floor(row['transferQty']/row['packBox']):0) + row['subUnitName'] + (row['transferQty']%row['packBox']?row['transferQty']%row['packBox']:0).toFixed(this.decimalPlaces) + row['unitName']
|
|
|
+ }else{
|
|
|
+ row.nonStandardForm = {
|
|
|
+ formula: (row['subUnitName']?'1'+row['subUnitName']+ '=':'' ) + row['packBox'] + row['unitName'],
|
|
|
+ box:row['transferQty'],
|
|
|
+ }
|
|
|
+ row.nonStandardItems = [
|
|
|
+ {code:'formula',label:'计算公式',type:'text',readonly:true},
|
|
|
+ {code:'piece',label:row['unitName'],type:'number',digits: this.decimalPlaces}
|
|
|
+ ]
|
|
|
+ row['unitInfo'] = row['transferQty'] + row['unitName']
|
|
|
+ }
|
|
|
+ row['box'] = row['nonStandardForm']['box']
|
|
|
+ row['piece'] = row['nonStandardForm']['piece']
|
|
|
+ })
|
|
|
+ this.formData.sumQuantity = sumQuantity;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 修改包装数
|
|
|
+ * @author : 姜宁
|
|
|
+ * @date : 2024/8/13 9:28
|
|
|
+ */
|
|
|
+ changeNonStandard({row,rowIndex,field}){
|
|
|
+ let table = this.$refs['goodsTable'].tableData
|
|
|
+ table[rowIndex][field] = (row['nonStandardForm']['box']?row['nonStandardForm']['box']:0)
|
|
|
+ + row['subUnitName']
|
|
|
+ +(row['nonStandardForm']['piece'] == 0 || row['nonStandardForm']['piece'] ?row['nonStandardForm']['piece']:'')
|
|
|
+ +(row['unitName']?(row['nonStandardForm']['piece']?row['unitName']:''):'')
|
|
|
+ table[rowIndex]['box'] = row['nonStandardForm']['box']?row['nonStandardForm']['box']:0
|
|
|
+ table[rowIndex]['piece'] = row['nonStandardForm']['piece'] ?row['nonStandardForm']['piece']:0
|
|
|
+ table[rowIndex]['transferQty'] = row['packBox'] * (row['nonStandardForm']['box']?row['nonStandardForm']['box']:0) + (row['nonStandardForm']['piece'] ?row['nonStandardForm']['piece']:0)
|
|
|
+ },
|
|
|
+ /**
|
|
|
* @desc : 赋值盘点实体信息
|
|
|
* @author : 宋扬
|
|
|
* @date : 2024/3/18 10:57
|