|
|
@@ -319,11 +319,10 @@
|
|
|
</el-link>
|
|
|
</template>
|
|
|
</ele-pro-table>
|
|
|
- <product-list
|
|
|
+ <productListNew
|
|
|
ref="productListRef"
|
|
|
- :orderId="orderId"
|
|
|
@changeParent="changeParent"
|
|
|
- ></product-list>
|
|
|
+ ></productListNew>
|
|
|
<!--入库详情-->
|
|
|
<innertboundDetailsDialog
|
|
|
v-if="innerboundDetailsDialogFlag"
|
|
|
@@ -355,7 +354,7 @@
|
|
|
<script>
|
|
|
import { numberReg } from 'ele-admin';
|
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
|
- import productList from './product-list.vue';
|
|
|
+ import productListNew from './product-listNew.vue';
|
|
|
import {
|
|
|
getWarehouseOutStock,
|
|
|
getIdWarehouseList
|
|
|
@@ -393,6 +392,11 @@
|
|
|
type: Array,
|
|
|
default: () => []
|
|
|
},
|
|
|
+ oldProductList: {
|
|
|
+ type: Array,
|
|
|
+ default: () => []
|
|
|
+ },
|
|
|
+
|
|
|
isTotalCount: {
|
|
|
default: 0
|
|
|
}
|
|
|
@@ -400,7 +404,7 @@
|
|
|
components: {
|
|
|
// fileMain,
|
|
|
innertboundDetailsDialog,
|
|
|
- productList,
|
|
|
+ productListNew,
|
|
|
stockLedgerDialog,
|
|
|
selectStockLedgerDialog,
|
|
|
BIZproductList
|
|
|
@@ -509,6 +513,7 @@
|
|
|
align: 'center',
|
|
|
fixed: 'left'
|
|
|
},
|
|
|
+
|
|
|
{
|
|
|
width: 200,
|
|
|
prop: 'productName',
|
|
|
@@ -802,14 +807,6 @@
|
|
|
},
|
|
|
showOverflowTooltip: true
|
|
|
},
|
|
|
- // {
|
|
|
- // width: 80,
|
|
|
- // prop: 'deliveryDays',
|
|
|
- // label: '交期(天)',
|
|
|
- // slot: 'deliveryDays',
|
|
|
- // align: 'center'
|
|
|
- // },
|
|
|
-
|
|
|
{
|
|
|
width: 200,
|
|
|
prop: 'guaranteePeriod',
|
|
|
@@ -1142,18 +1139,13 @@
|
|
|
},
|
|
|
|
|
|
//选择产品回调
|
|
|
- async changeParent(obj, idx) {
|
|
|
- obj.orderTotalCount = obj.totalCount;
|
|
|
- if (this.form.datasource?.find((item) => item.id == obj.id)) {
|
|
|
- return this.$message.error('选择的产品已经存在列表了');
|
|
|
- }
|
|
|
- obj.id = '';
|
|
|
- obj['tempId'] = idx;
|
|
|
- this.$set(
|
|
|
- this.form.datasource,
|
|
|
- this.form.datasource.length,
|
|
|
- copyObj(obj)
|
|
|
- );
|
|
|
+ async changeParent(obj) {
|
|
|
+ console.log(obj,'obj')
|
|
|
+ obj.forEach((item) => {
|
|
|
+ item.orderTotalCount = item.totalCount;
|
|
|
+ item.id = '';
|
|
|
+ });
|
|
|
+ this.putTableValue(copyObj(obj));
|
|
|
},
|
|
|
//选择产品回调
|
|
|
changeParentBiz(obj = [], idx) {
|
|
|
@@ -1161,6 +1153,8 @@
|
|
|
let i = idx == -1 ? index : idx;
|
|
|
let row = JSON.parse(JSON.stringify(this.defaultForm));
|
|
|
row.key = this.form.datasource.length + 1;
|
|
|
+ row['tempId'] = this.form.datasource.length + 1;
|
|
|
+
|
|
|
let parasm = idx == -1 ? row : this.form.datasource[i];
|
|
|
this.$set(parasm, 'productId', item.id);
|
|
|
this.$set(parasm, 'categoryName', item.name);
|
|
|
@@ -1278,22 +1272,51 @@
|
|
|
//修改回显
|
|
|
putTableValue(data) {
|
|
|
if (data) {
|
|
|
- this.form.datasource = data;
|
|
|
- this.form.datasource.forEach(async (item, index) => {
|
|
|
- if (item.modelKey) {
|
|
|
- this.$set(
|
|
|
- this.form.datasource[index],
|
|
|
- 'modelKey',
|
|
|
- item.modelKey.split(',')
|
|
|
- );
|
|
|
- }
|
|
|
- if (item.colorKey) {
|
|
|
- this.$set(
|
|
|
- this.form.datasource[index],
|
|
|
- 'colorKey',
|
|
|
- item.colorKey.split(',')
|
|
|
- );
|
|
|
- }
|
|
|
+ this.setValue(data);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ setValue(data) {
|
|
|
+ let indexS = [];
|
|
|
+ data.forEach((item, index) => {
|
|
|
+ if (item.modelKey) {
|
|
|
+ item.modelKey = item.modelKey.toString();
|
|
|
+ }
|
|
|
+ if (item.colorKey) {
|
|
|
+ item.colorKey = item.colorKey.toString();
|
|
|
+ }
|
|
|
+ item.receiveTotalWeight = item.receiveTotalWeight || 0;
|
|
|
+
|
|
|
+ if (item.weightUnit == item.measuringUnit) {
|
|
|
+ item.sendTotalWeight = item.sendTotalWeight || item.totalCount;
|
|
|
+ } else {
|
|
|
+ item.sendTotalWeight =
|
|
|
+ item.sendTotalWeight ||
|
|
|
+ Number(item.totalCount) * Number(item.singleWeight) ||
|
|
|
+ 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.outsourceSendCode) {
|
|
|
+ item.increaseTotalWeight =
|
|
|
+ Number(item.receiveTotalWeight) - Number(item.sendTotalWeight);
|
|
|
+ item.increaseTotalWeight;
|
|
|
+ } else {
|
|
|
+ item.increaseTotalWeight =
|
|
|
+ item.increaseTotalWeight || item.receiveTotalWeight || 0;
|
|
|
+ }
|
|
|
+ item['sendTotalWeight'] = item.sendTotalWeigh;
|
|
|
+ item['increaseTotalWeight'] = item.increaseTotalWeight;
|
|
|
+ item['tempId'] = this.form.datasource.length;
|
|
|
+ indexS.push(this.form.datasource.length);
|
|
|
+ this.$set(
|
|
|
+ this.form.datasource,
|
|
|
+ this.form.datasource.length,
|
|
|
+ copyObj(item)
|
|
|
+ );
|
|
|
+
|
|
|
+ // this.form.datasource.push(item);
|
|
|
+ });
|
|
|
+ this.form.datasource.forEach(async (item, index) => {
|
|
|
+ if (indexS.includes(index)) {
|
|
|
this.$set(
|
|
|
this.form.datasource[index],
|
|
|
'warehouseList',
|
|
|
@@ -1318,49 +1341,8 @@
|
|
|
);
|
|
|
await this.warehouseChange(index, this.form.datasource[index]);
|
|
|
}
|
|
|
-
|
|
|
- this.$set(
|
|
|
- this.form.datasource[index],
|
|
|
- 'receiveTotalWeight',
|
|
|
- item.receiveTotalWeight || 0
|
|
|
- );
|
|
|
- if (item.weightUnit == item.measuringUnit) {
|
|
|
- item.sendTotalWeight = item.sendTotalWeight || item.totalCount;
|
|
|
- } else {
|
|
|
- item.sendTotalWeight =
|
|
|
- item.sendTotalWeight ||
|
|
|
- Number(item.totalCount) * Number(item.singleWeight) ||
|
|
|
- 0;
|
|
|
- }
|
|
|
-
|
|
|
- if (this.outsourceSendCode) {
|
|
|
- item.increaseTotalWeight =
|
|
|
- Number(item.receiveTotalWeight) - Number(item.sendTotalWeight);
|
|
|
- item.increaseTotalWeight;
|
|
|
- } else {
|
|
|
- item.increaseTotalWeight =
|
|
|
- item.increaseTotalWeight || item.receiveTotalWeight || 0;
|
|
|
- }
|
|
|
- this.$set(
|
|
|
- this.form.datasource[index],
|
|
|
- 'sendTotalWeight',
|
|
|
- item.sendTotalWeigh
|
|
|
- );
|
|
|
- this.$set(
|
|
|
- this.form.datasource[index],
|
|
|
- 'increaseTotalWeight',
|
|
|
- item.increaseTotalWeight
|
|
|
- );
|
|
|
- console.log(item.increaseTotalWeight);
|
|
|
- });
|
|
|
- //保存初始收货总重
|
|
|
- this.oldReceiveTotalWeight = this.form.datasource.map((item) => {
|
|
|
- return {
|
|
|
- productCode: item.productCode,
|
|
|
- oldReceiveTotalWeight: item.receiveTotalWeight
|
|
|
- };
|
|
|
- });
|
|
|
- }
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
remove(i) {
|
|
|
@@ -1384,7 +1366,7 @@
|
|
|
handlAdd() {
|
|
|
if (!this.orderId && !this.orderIds)
|
|
|
return this.$message.error('请先选择订单');
|
|
|
- this.$refs.productListRef.open(this.form.datasource);
|
|
|
+ this.$refs.productListRef.open(this.oldProductList);
|
|
|
},
|
|
|
//库存台账
|
|
|
selectStockLedgerDialogOpen(row) {
|