|
|
@@ -64,9 +64,11 @@
|
|
|
<EditTable ref="goodsTable" :data="formData.itemList" showFooter
|
|
|
major-field="itemId"
|
|
|
control-id="invId"
|
|
|
- :new-row-flag="true" :height="tableHeight"
|
|
|
+ :new-row-flag="true" :height="400"
|
|
|
:columns="this.type === this.$config.formMode.add ? freezeItemColumns: unfreezeItemColumns"
|
|
|
@changeValue="getTotals"
|
|
|
+ @on-choose="getTotals"
|
|
|
+ @changeNonStandard="changeNonStandard"
|
|
|
></EditTable>
|
|
|
</div>
|
|
|
</DkPanel>
|
|
|
@@ -170,31 +172,16 @@ export default {
|
|
|
piece: ['freezeQty%packBox', 'freezeQty', 'packBox'],
|
|
|
},
|
|
|
},
|
|
|
- //包装
|
|
|
+ //基本单位
|
|
|
{
|
|
|
- field: 'packBox',
|
|
|
+ field: 'unitName',
|
|
|
+ title: self.$t('piece'),
|
|
|
type: 'disabled',
|
|
|
},
|
|
|
- //箱
|
|
|
{
|
|
|
- field: 'box',
|
|
|
- type: 'number',
|
|
|
- digits: 0,
|
|
|
- sum: true,
|
|
|
- formula: {
|
|
|
- freezeQty: ['box*packBox+piece', 'box', 'packBox','piece'],
|
|
|
- },
|
|
|
- },
|
|
|
- //片
|
|
|
- {
|
|
|
- field: 'piece',
|
|
|
- type: 'number',
|
|
|
- digits: 0,
|
|
|
- sum: true,
|
|
|
- formula: {
|
|
|
- freezeQty: ['box*packBox+piece', 'piece','box','packBox'],
|
|
|
- box: ['(box*packBox+piece)%packBox', 'piece', 'box' , 'packBox','packBox'],
|
|
|
- },
|
|
|
+ field: 'unitInfo',
|
|
|
+ title: self.$t('boxPiece'),
|
|
|
+ type: 'nonStandard',
|
|
|
},
|
|
|
//备注
|
|
|
{
|
|
|
@@ -280,6 +267,21 @@ export default {
|
|
|
|
|
|
methods: {
|
|
|
/**
|
|
|
+ * @desc : 修改包装数
|
|
|
+ * @author : 周兴
|
|
|
+ * @date : 2024/5/24 15:02
|
|
|
+ */
|
|
|
+ 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]['freezeQty'] = row['packBox'] * (row['nonStandardForm']['box']?row['nonStandardForm']['box']:0) + (row['nonStandardForm']['piece'] ?row['nonStandardForm']['piece']:0)
|
|
|
+ },
|
|
|
+ /**
|
|
|
* @desc : 获取客户相关
|
|
|
* @author : 宋扬
|
|
|
* @date : 2024/3/14 15:05
|
|
|
@@ -328,13 +330,39 @@ export default {
|
|
|
* @date : 2024/3/14 16:36
|
|
|
*/
|
|
|
getTotals(field, row, rowIndex) {
|
|
|
- let table = this.$refs['goodsTable'].getTableDataFilter();
|
|
|
+ let table = this.$refs['goodsTable'].tableData;
|
|
|
let sumQuantity = 0; // 合计数量
|
|
|
if (table && table.length > 0) {
|
|
|
table.forEach(row => {
|
|
|
if (row["freezeQty"]) {
|
|
|
sumQuantity += parseFloat(row["freezeQty"]);
|
|
|
}
|
|
|
+ this.decimalPlaces = row['decimalPlaces']
|
|
|
+ if(row['subUnitId']){
|
|
|
+ row.nonStandardForm = {
|
|
|
+ formula: (row['subUnitName']?'1'+row['subUnitName']+ '=':'' ) + row['packBox'] + row['unitName'],
|
|
|
+ box:(row['freezeQty']/row['packBox'] >= 1 ? Math.floor(row['freezeQty']/row['packBox']):0),
|
|
|
+ piece:row['freezeQty']%row['packBox']?row['freezeQty']%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['freezeQty']/row['packBox'] >= 1 ? Math.floor(row['freezeQty']/row['packBox']):0) + row['subUnitName'] + (row['freezeQty']%row['packBox']?row['freezeQty']%row['packBox']:0).toFixed(this.decimalPlaces) + row['unitName']
|
|
|
+ }else{
|
|
|
+ row.nonStandardForm = {
|
|
|
+ formula: (row['subUnitName']?'1'+row['subUnitName']+ '=':'' ) + row['packBox'] + row['unitName'],
|
|
|
+ piece:row['freezeQty'],
|
|
|
+ }
|
|
|
+ row.nonStandardItems = [
|
|
|
+ {code:'formula',label:'计算公式',type:'text',readonly:true},
|
|
|
+ {code:'piece',label:row['unitName'],type:'number',digits: this.decimalPlaces}
|
|
|
+ ]
|
|
|
+ row['unitInfo'] = row['freezeQty'] + row['unitName']
|
|
|
+ }
|
|
|
+ row['box'] = row['nonStandardForm']['box']
|
|
|
+ row['piece'] = row['nonStandardForm']['piece']
|
|
|
})
|
|
|
this.formData.sumQuantity = sumQuantity;
|
|
|
}
|