|
|
@@ -357,12 +357,12 @@
|
|
|
label="编码"
|
|
|
prop="assetCode"
|
|
|
align="center"
|
|
|
- width="150"
|
|
|
+ width="130"
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
label="名称"
|
|
|
align="center"
|
|
|
- width="150"
|
|
|
+ width="200"
|
|
|
prop="assetName"
|
|
|
></el-table-column>
|
|
|
|
|
|
@@ -424,7 +424,7 @@
|
|
|
<el-table-column
|
|
|
label="批次号"
|
|
|
prop="batchNo"
|
|
|
- width="150"
|
|
|
+ width="70"
|
|
|
align="center"
|
|
|
>
|
|
|
<template slot-scope="{ row, $index }">
|
|
|
@@ -495,10 +495,7 @@
|
|
|
>
|
|
|
<el-input
|
|
|
v-model="row.outInNum"
|
|
|
- @input="
|
|
|
- (value) =>
|
|
|
- (row.outInNum = value.replace(/^(0+)|[^\d]+/g, ''))
|
|
|
- "
|
|
|
+ @input="packNum(row, $event)"
|
|
|
>
|
|
|
<template slot="append">
|
|
|
{{ row.minPackUnit ? row.minPackUnit : '/' }}
|
|
|
@@ -515,20 +512,21 @@
|
|
|
<el-table-column
|
|
|
label="计量单位"
|
|
|
prop="batchNo"
|
|
|
- width="150"
|
|
|
+ width="100"
|
|
|
align="center"
|
|
|
- v-if="formData.extInfo.assetType == 1"
|
|
|
>
|
|
|
+ <!-- v-if="formData.extInfo.assetType == 1" -->
|
|
|
+
|
|
|
<template slot-scope="{ row, $index }">
|
|
|
<template>
|
|
|
{{ row.measuringUnit }}
|
|
|
</template>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
+ <!-- <el-table-column
|
|
|
label="计量单位"
|
|
|
prop="batchNo"
|
|
|
- width="150"
|
|
|
+ width="100"
|
|
|
align="center"
|
|
|
v-if="formData.extInfo.assetType == 4"
|
|
|
>
|
|
|
@@ -537,7 +535,7 @@
|
|
|
{{ row.measuringUnit }}
|
|
|
</template>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
+ </el-table-column> -->
|
|
|
|
|
|
<!-- <el-table-column
|
|
|
label="数量"
|
|
|
@@ -572,7 +570,7 @@
|
|
|
>
|
|
|
<!-- v-if="formData.extInfo.assetType == 1" -->
|
|
|
<template slot-scope="{ row, $index }">
|
|
|
- {{ weightTotal(row) }}
|
|
|
+ {{ row.weight }}
|
|
|
<template slot="append">
|
|
|
{{ handleRowUnit(row) }}
|
|
|
<!-- {{
|
|
|
@@ -755,13 +753,17 @@
|
|
|
<div class="mt20">
|
|
|
<header-title :title="`包装明细`">
|
|
|
<div class="switch_right">
|
|
|
- 拆分物料明细<el-switch
|
|
|
- v-model="isDetail"
|
|
|
- active-color="#13ce66"
|
|
|
- inactive-color="#ff4949"
|
|
|
- @change="handleIsDetail"
|
|
|
- >
|
|
|
- </el-switch>
|
|
|
+ <span v-if="materialCodeReqList.length != 0">
|
|
|
+ 分拆<el-switch
|
|
|
+ v-model="isDetail"
|
|
|
+ active-color="#13ce66"
|
|
|
+ inactive-color="#ff4949"
|
|
|
+ @change="handleIsDetail"
|
|
|
+ style="margin-left: 10px"
|
|
|
+ >
|
|
|
+ </el-switch>
|
|
|
+ </span>
|
|
|
+
|
|
|
<el-button
|
|
|
style="margin-left: 20px"
|
|
|
type="text"
|
|
|
@@ -795,14 +797,31 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="序号" type="index" width="50">
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="编码" prop="assetCode"></el-table-column>
|
|
|
- <el-table-column label="名称" prop="assetName"></el-table-column>
|
|
|
- <el-table-column label="批次号" prop="batchNo"></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="编码"
|
|
|
+ prop="assetCode"
|
|
|
+ width="130"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="名称"
|
|
|
+ prop="assetName"
|
|
|
+ width="150"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="批次号"
|
|
|
+ prop="batchNo"
|
|
|
+ width="70"
|
|
|
+ ></el-table-column>
|
|
|
<el-table-column
|
|
|
:label="`包装编码`"
|
|
|
prop="onlyCode"
|
|
|
+ width="130"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="包装数量"
|
|
|
+ prop="packingCount"
|
|
|
+ width="80"
|
|
|
></el-table-column>
|
|
|
- <el-table-column label="包装数量" prop="packNum"></el-table-column>
|
|
|
<el-table-column
|
|
|
label="包装单位"
|
|
|
prop="packingUnit"
|
|
|
@@ -821,7 +840,11 @@
|
|
|
prop="materielCode"
|
|
|
>
|
|
|
<template slot-scope="{ row }">
|
|
|
- <el-input v-model="row.materielCode"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-if="!row.isPack"
|
|
|
+ v-model="row.materielCode"
|
|
|
+ ></el-input>
|
|
|
+ <span v-else>{{ row.materielCode }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
@@ -830,7 +853,11 @@
|
|
|
prop="clientCode"
|
|
|
>
|
|
|
<template slot-scope="{ row }">
|
|
|
- <el-input v-model="row.clientCode"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-if="!row.isPack"
|
|
|
+ v-model="row.clientCode"
|
|
|
+ ></el-input>
|
|
|
+ <span v-else> {{ row.clientCode }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
@@ -839,16 +866,19 @@
|
|
|
prop="engrave"
|
|
|
>
|
|
|
<template slot-scope="{ row }">
|
|
|
- <el-input v-model="row.engrave"></el-input>
|
|
|
+ <el-input v-if="!row.isPack" v-model="row.engrave"></el-input>
|
|
|
+ <span v-else>{{ row.engrave }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
v-if="formData.bizType == 2 || formData.bizType == 1"
|
|
|
label="重量"
|
|
|
prop="weight"
|
|
|
+ width="100"
|
|
|
>
|
|
|
<template slot-scope="{ row }">
|
|
|
- <el-input v-model="row.weight"></el-input>
|
|
|
+ <el-input v-if="!row.isPack" v-model="row.weight"></el-input>
|
|
|
+ <span v-else>{{ row.weight }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
@@ -857,11 +887,7 @@
|
|
|
prop="weightUtil"
|
|
|
>
|
|
|
<template slot-scope="{ row }">
|
|
|
- <DictSelection
|
|
|
- dictName="重量单位"
|
|
|
- clearable
|
|
|
- v-model="row.weightUtil"
|
|
|
- />
|
|
|
+ {{ row.weightUtil }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
@@ -889,6 +915,7 @@
|
|
|
</template>
|
|
|
<el-date-picker
|
|
|
v-else
|
|
|
+ :disabled="row.ispack"
|
|
|
size="small"
|
|
|
v-model="row[curDateType]"
|
|
|
type="datetime"
|
|
|
@@ -910,6 +937,13 @@
|
|
|
width="200"
|
|
|
></el-table-column>
|
|
|
</template>
|
|
|
+ <el-table-column label="操作" width="80">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-button type="text" @click="packCout(row)">
|
|
|
+ {{ !row.isPack ? '保存' : '编辑' }}
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
<!-- </el-tab-pane>
|
|
|
</el-tabs> -->
|
|
|
@@ -918,7 +952,7 @@
|
|
|
<header-title :title="`物料明细`"> </header-title>
|
|
|
<el-table
|
|
|
ref="multipleTable"
|
|
|
- :data="materialCodeReqList"
|
|
|
+ :data="resultArray"
|
|
|
tooltip-effect="dark"
|
|
|
:key="formData.bizType"
|
|
|
:header-cell-style="rowClass"
|
|
|
@@ -930,18 +964,33 @@
|
|
|
<el-table-column label="序号" type="index" width="50">
|
|
|
</el-table-column>
|
|
|
<el-table-column label="编码" prop="assetCode"></el-table-column>
|
|
|
- <el-table-column label="名称" prop="assetName"></el-table-column>
|
|
|
- <el-table-column label="批次号" prop="batchNo"></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="名称"
|
|
|
+ prop="assetName"
|
|
|
+ width="200"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="批次号"
|
|
|
+ prop="batchNo"
|
|
|
+ width="80"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="物料编码"
|
|
|
+ prop="no"
|
|
|
+ width="200"
|
|
|
+ ></el-table-column>
|
|
|
<el-table-column
|
|
|
label="计量数量"
|
|
|
prop="minPackingCount"
|
|
|
+ width="90"
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
+ width="80"
|
|
|
label="计量单位"
|
|
|
prop="measuringUnit"
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
- v-if="formData.bizType == 2 || formData.bizType == 1"
|
|
|
+ v-if="formData.bizType == 2"
|
|
|
label="物料代号"
|
|
|
prop="materielCode"
|
|
|
>
|
|
|
@@ -959,49 +1008,33 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- v-if="formData.bizType == 2 || formData.bizType == 1"
|
|
|
- label="重量"
|
|
|
- prop="weight"
|
|
|
+ v-if="formData.bizType == 1"
|
|
|
+ label="刻码"
|
|
|
+ prop="engrave"
|
|
|
>
|
|
|
<template slot-scope="{ row }">
|
|
|
- <el-input v-model="row.weight"></el-input>
|
|
|
+ <el-input v-model="row.engrave"></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
+ width="100"
|
|
|
v-if="formData.bizType == 2 || formData.bizType == 1"
|
|
|
- label="重量单位"
|
|
|
- prop="weightUtil"
|
|
|
+ label="重量"
|
|
|
+ prop="weight"
|
|
|
>
|
|
|
<template slot-scope="{ row }">
|
|
|
- <DictSelection
|
|
|
- dictName="重量单位"
|
|
|
- clearable
|
|
|
- v-model="row.weightUtil"
|
|
|
- />
|
|
|
+ <el-input v-model="row.weight"></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- v-if="formData.bizType == 1"
|
|
|
- label="刻码"
|
|
|
- prop="engrave"
|
|
|
+ v-if="formData.bizType == 2 || formData.bizType == 1"
|
|
|
+ label="重量单位"
|
|
|
+ prop="weightUnit"
|
|
|
>
|
|
|
<template slot-scope="{ row }">
|
|
|
- <el-input v-model="row.engrave"></el-input>
|
|
|
+ {{ row.weightUnit }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
-
|
|
|
- <el-table-column label="最小包装单元" prop="modelType">
|
|
|
- <el-table-column label="" prop="minPackingCount" width="100">
|
|
|
- <template slot-scope="{ row, $index }">
|
|
|
- {{ row.minPackingCount }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="" prop="minPackingCount">
|
|
|
- <template slot-scope="{ row, $index }">
|
|
|
- {{ handleRowUnit(row) }} /{{ row.minPackUnit }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -1091,6 +1124,7 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ resultArray: [],
|
|
|
isDetail: false,
|
|
|
contactList: [],
|
|
|
pickerRow: {},
|
|
|
@@ -1183,7 +1217,68 @@
|
|
|
methods: {
|
|
|
handleIsDetail(event) {
|
|
|
if (event) {
|
|
|
+ const list = this.materialCodeReqList;
|
|
|
+ console.log(list);
|
|
|
+ let resultArray = [];
|
|
|
+ list.forEach((item) => {
|
|
|
+ for (let i = 1; i <= Number(item.minPackingCount); i++) {
|
|
|
+ resultArray.push({
|
|
|
+ onlyCode: item.onlyCode,
|
|
|
+ no: item.onlyCode + i.toString().padStart(4, '0'),
|
|
|
+ assetCode: item.assetCode,
|
|
|
+ assetName: item.assetName,
|
|
|
+ batchNo: item.batchNo,
|
|
|
+ minPackingCount: 1,
|
|
|
+ measuringUnit: item.measuringUnit,
|
|
|
+ materielCode: item.materielCode,
|
|
|
+ clientCode: item.clientCode,
|
|
|
+ weight: item.netWeight,
|
|
|
+ weightUnit: item.weightUnit
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.resultArray = resultArray;
|
|
|
+ } else {
|
|
|
+ this.resultArray = [];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //包装明细保存
|
|
|
+ packCout(row) {
|
|
|
+ console.log(row);
|
|
|
+ console.log('is', !row.isPack);
|
|
|
+ //true保存==》反之
|
|
|
+ if (!row.isPack) {
|
|
|
+ row.isPack = true;
|
|
|
+ const code = row.assetCode;
|
|
|
+ const list = this.warehousingMaterialList;
|
|
|
+ this.warehousingMaterialList.forEach((item) => {
|
|
|
+ if (item.assetCode == code) {
|
|
|
+ // item.
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // for (const k in list) {
|
|
|
+ // if (list[k].assetCode == code) {
|
|
|
+ // const weight = this.weightTotal(list[k]);
|
|
|
+ // console.log('we', weight);
|
|
|
+ // console.log('当前重量', list[k]);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ } else {
|
|
|
+ row.isPack = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ packNum(row, value) {
|
|
|
+ const total = {
|
|
|
+ packingCount: Number(row.minPackingCount),
|
|
|
+ outInNum: Number(row.outInNum)
|
|
|
+ };
|
|
|
+ if (row.measuringUnit == row.weightUnit) {
|
|
|
+ row.weight = total.packingCount * 1 * total.outInNum.toFixed(2);
|
|
|
+ } else {
|
|
|
+ const totals = total.packingCount * total.outInNum;
|
|
|
+ row.weight = totals * row.netWeight.toFixed(2);
|
|
|
}
|
|
|
+ return (row.outInNum = value.replace(/^(0+)|[^\d]+/g, ''));
|
|
|
},
|
|
|
async searchContact(id) {
|
|
|
const data = await contactlink({ contactId: id });
|
|
|
@@ -1236,28 +1331,18 @@
|
|
|
return row;
|
|
|
}
|
|
|
},
|
|
|
- //计算重量
|
|
|
- weightTotal(row) {
|
|
|
- console.log(row);
|
|
|
- const total = {
|
|
|
- packingCount: Number(row.minPackingCount),
|
|
|
- outInNum: Number(row.outInNum)
|
|
|
- };
|
|
|
- if (row.measuringUnit == row.weightUnit) {
|
|
|
- return total.packingCount * total.outInNum * 1;
|
|
|
- } else {
|
|
|
- const totals = total.packingCount * total.outInNum;
|
|
|
- return totals * row.netWeight;
|
|
|
- }
|
|
|
- },
|
|
|
+
|
|
|
//计算金额
|
|
|
calcSumTotal(PackingCount, outInNum, univalence) {
|
|
|
//最小包装单元,包装数量,单价
|
|
|
const total = {
|
|
|
PackingCount: Number(PackingCount),
|
|
|
outInNum: Number(outInNum),
|
|
|
- univalence: Number(univalence)
|
|
|
+ univalence: Number(univalence == undefined ? 0 : univalence)
|
|
|
};
|
|
|
+ console.log(PackingCount);
|
|
|
+ console.log(outInNum);
|
|
|
+ console.log(univalence);
|
|
|
return total.PackingCount * total.outInNum * total.univalence;
|
|
|
},
|
|
|
handleRowUnit(row) {
|
|
|
@@ -1510,6 +1595,8 @@
|
|
|
//入库明细删除
|
|
|
listDel(row, index) {
|
|
|
this.warehousingMaterialList.splice(index, 1);
|
|
|
+ this.resultArray = [];
|
|
|
+ this.isDetail = false;
|
|
|
},
|
|
|
// 入库明细生成条码信息
|
|
|
async createMaterialCode(row) {
|
|
|
@@ -1601,13 +1688,23 @@
|
|
|
if (item.warehouseLedgerDetails?.length) {
|
|
|
item.warehouseLedgerDetails.forEach((i, index) => {
|
|
|
this.$set(i, 'num', num);
|
|
|
- this.$set(i, 'weight', item.netWeight);
|
|
|
+ if (item.measuringUnit == item.weightUnit) {
|
|
|
+ this.$set(i, 'weight', item.minPackingCount);
|
|
|
+ } else {
|
|
|
+ this.$set(
|
|
|
+ i,
|
|
|
+ 'weight',
|
|
|
+ 1 * item.minPackingCount * item.netWeight
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
this.$set(i, 'weightUtil', item.weightUnit);
|
|
|
|
|
|
- this.$set(i, 'packNum', 1);
|
|
|
+ this.$set(i, 'packingCount', 1);
|
|
|
this.$set(i, 'packingUnit ', item.packingUnit);
|
|
|
this.$set(i, 'minPackingCount ', item.minPackingCount);
|
|
|
this.$set(i, 'measuringUnit', item.measuringUnit);
|
|
|
+ this.$set(i, 'isPack', false);
|
|
|
|
|
|
if (!item.isUnpack) {
|
|
|
if (index < item.warehouseLedgerDetails.length - 1) {
|
|
|
@@ -1769,7 +1866,7 @@
|
|
|
this.warehousingMaterialList[key].houseList[k].num;
|
|
|
}
|
|
|
}
|
|
|
- console.log('===', this.warehousingMaterialList);
|
|
|
+ console.log('===123', this.warehousingMaterialList);
|
|
|
let arr = this.warehousingMaterialList.map((item) => {
|
|
|
return {
|
|
|
num: item.num,
|
|
|
@@ -1794,7 +1891,8 @@
|
|
|
item.outInNum * item.minPackingCount * item.univalence,
|
|
|
weightUnit: item.weightUnit,
|
|
|
customCode: item.customCode,
|
|
|
- supplierCode: item.supplierCode
|
|
|
+ supplierCode: item.supplierCode,
|
|
|
+ weight: item.weight
|
|
|
};
|
|
|
});
|
|
|
arr.forEach((item) => {
|
|
|
@@ -1814,7 +1912,9 @@
|
|
|
materielCode: it.materielCode,
|
|
|
weight: it.weight,
|
|
|
weightUtil: it.weightUtil,
|
|
|
- engrave: it.engrave
|
|
|
+ engrave: it.engrave,
|
|
|
+ materialDetails: this.materialDetails(it.onlyCode),
|
|
|
+ packingCount: it.packingCount
|
|
|
};
|
|
|
});
|
|
|
item.outInDetailRecordAddPOList = list;
|
|
|
@@ -1838,6 +1938,9 @@
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ materialDetails(onlyCode) {
|
|
|
+ return this.resultArray.filter((item) => item.onlyCode === onlyCode);
|
|
|
+ },
|
|
|
async getOrderCode() {
|
|
|
const data = await getCode('in_warehouse');
|
|
|
return data;
|