|
|
@@ -13,7 +13,7 @@
|
|
|
<template v-slot:toolbar>
|
|
|
<div class="headbox">
|
|
|
<el-button
|
|
|
- v-if="isShowAdd"
|
|
|
+ v-if="isShowAdd && needProduce != 3"
|
|
|
size="small"
|
|
|
type="primary"
|
|
|
icon="el-icon-plus"
|
|
|
@@ -22,22 +22,21 @@
|
|
|
>
|
|
|
新增
|
|
|
</el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="isShowAdd && needProduce == 3"
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-plus"
|
|
|
+ class="ele-btn-icon"
|
|
|
+ @click="handParent()"
|
|
|
+ >
|
|
|
+ 新增
|
|
|
+ </el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template v-slot:technicalDrawings="{ row, $index }">
|
|
|
<el-form-item :prop="'datasource.' + $index + '.technicalDrawings'">
|
|
|
<fileMain v-model="row.technicalDrawings" type="view"></fileMain>
|
|
|
- <!-- <div v-if="row.technicalDrawings && row.technicalDrawings?.length">-->
|
|
|
- <!-- <el-link-->
|
|
|
- <!-- v-for="link in row.technicalDrawings"-->
|
|
|
- <!-- :key="link.id"-->
|
|
|
- <!-- type="primary"-->
|
|
|
- <!-- :underline="false"-->
|
|
|
- <!-- @click="download(link)"-->
|
|
|
- <!-- >-->
|
|
|
- <!-- {{ link.name }}-->
|
|
|
- <!-- </el-link>-->
|
|
|
- <!-- </div>-->
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
<template v-slot:remark="{ row, $index }">
|
|
|
@@ -129,7 +128,7 @@
|
|
|
>
|
|
|
<el-input
|
|
|
v-model="scope.row.totalCount"
|
|
|
- @input="(val) => changeCount(scope.row, scope.$index)"
|
|
|
+ @input="(val) => changeCount1(scope.row, scope.$index)"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
@@ -156,7 +155,6 @@
|
|
|
<el-form-item
|
|
|
:prop="'datasource.' + scope.$index + '.receiveTotalWeight'"
|
|
|
>
|
|
|
- <!-- :disabled="!entrustedCode" -->
|
|
|
<el-input-number
|
|
|
:controls="false"
|
|
|
v-model="scope.row.receiveTotalWeight"
|
|
|
@@ -197,11 +195,13 @@
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
<template v-slot:warehouseId="scope">
|
|
|
- <el-form-item :prop="'datasource.' + scope.$index + '.warehouseId'" :rules="[{ required: true, message: '请选择仓库', trigger: 'blur' }]">
|
|
|
+ <el-form-item
|
|
|
+ :prop="'datasource.' + scope.$index + '.warehouseId'"
|
|
|
+ :rules="[{ required: true, message: '请选择仓库', trigger: 'blur' }]"
|
|
|
+ >
|
|
|
<el-select
|
|
|
v-model="scope.row.warehouseId"
|
|
|
placeholder="请选择"
|
|
|
-
|
|
|
@change="warehouseChange(scope.$index, scope.row)"
|
|
|
>
|
|
|
<el-option
|
|
|
@@ -214,15 +214,44 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
- <!-- <template v-slot:warehouseNum="scope">
|
|
|
+
|
|
|
+ <template v-slot:singlePrice="scope" >
|
|
|
+ <el-form-item
|
|
|
+ style="margin-bottom: 20px"
|
|
|
+ :prop="'datasource.' + scope.$index + '.singlePrice'"
|
|
|
+ :rules="{
|
|
|
+ required: true,
|
|
|
+ message: '请输入正确的单价',
|
|
|
+ trigger: 'change'
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="scope.row.singlePrice"
|
|
|
+ placeholder="请输入"
|
|
|
+ @input="changeCount"
|
|
|
+ type="number"
|
|
|
+ >
|
|
|
+ <template slot="append">元</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ <template v-slot:singleWeight="scope" v-if="needProduce == 3">
|
|
|
<el-form-item
|
|
|
- :prop="'datasource.' + scope.$index + '.warehouseNum'"
|
|
|
- :rules="[{ required: true, message: '库存不足', trigger: 'blur' }]"
|
|
|
+ style="margin-bottom: 20px"
|
|
|
+ :rules="{
|
|
|
+ required: false,
|
|
|
+ pattern: numberReg,
|
|
|
+ trigger: 'change'
|
|
|
+ }"
|
|
|
+ :prop="'datasource.' + scope.$index + '.singleWeight'"
|
|
|
>
|
|
|
- <el-input v-model="scope.row.warehouseNum" readonly> </el-input>
|
|
|
+ <el-input
|
|
|
+ :disabled="isContractId"
|
|
|
+ v-model="scope.row.singleWeight"
|
|
|
+ placeholder="请输入"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
- </template> -->
|
|
|
-
|
|
|
+ </template>
|
|
|
<template v-slot:headerWarehouseNum="{ column }">
|
|
|
<span class="is-required">{{ column.label }}</span>
|
|
|
</template>
|
|
|
@@ -232,8 +261,8 @@
|
|
|
<template v-slot:headerTotalCount="{ column }">
|
|
|
<span class="is-required">{{ column.label }}</span>
|
|
|
</template>
|
|
|
-
|
|
|
- <template v-slot:receiveTotalWeight="{ column }">
|
|
|
+
|
|
|
+ <template v-slot:headerReceiveTotalWeight="{ column }">
|
|
|
<span :class="{ 'is-required': entrustedCode && pricingWay == 2 }">{{
|
|
|
column.label
|
|
|
}}</span>
|
|
|
@@ -285,6 +314,12 @@
|
|
|
ref="selectStockLedgerDialogRef"
|
|
|
@changeParent="replaceTable"
|
|
|
></selectStockLedgerDialog>
|
|
|
+ <BIZproductList
|
|
|
+ ref="BIZproductListRef"
|
|
|
+ classType="1"
|
|
|
+ :isGetInventoryTotal="true"
|
|
|
+ @changeParent="changeParentBiz"
|
|
|
+ ></BIZproductList>
|
|
|
</el-form>
|
|
|
</template>
|
|
|
<script>
|
|
|
@@ -305,11 +340,14 @@
|
|
|
import getDynamicsColumns from '@/mixins/getDynamicsColumns';
|
|
|
import fileMain from '@/components/addDoc/index.vue';
|
|
|
import selectStockLedgerDialog from '@/BIZComponents/selectStockLedger/selectStockLedgerDialog.vue'; //库存台账
|
|
|
+ import BIZproductList from '@/BIZComponents/product-list.vue';
|
|
|
+
|
|
|
// import { changeCount } from '@/BIZComponents/setProduct.js';
|
|
|
export default {
|
|
|
mixins: [dictMixins, getDynamicsColumns],
|
|
|
props: {
|
|
|
orderId: String,
|
|
|
+ needProduce: String,
|
|
|
entrustedCode: String,
|
|
|
pricingWay: [String, Number],
|
|
|
isShowAdd: {
|
|
|
@@ -322,7 +360,8 @@
|
|
|
innertboundDetailsDialog,
|
|
|
productList,
|
|
|
stockLedgerDialog,
|
|
|
- selectStockLedgerDialog
|
|
|
+ selectStockLedgerDialog,
|
|
|
+ BIZproductList
|
|
|
},
|
|
|
data() {
|
|
|
const defaultForm = {
|
|
|
@@ -504,8 +543,7 @@
|
|
|
prop: 'warehouseNum',
|
|
|
label: '库存',
|
|
|
align: 'center',
|
|
|
- slot: 'warehouseNum',
|
|
|
-
|
|
|
+ slot: 'warehouseNum'
|
|
|
},
|
|
|
|
|
|
// {
|
|
|
@@ -545,7 +583,7 @@
|
|
|
label: '发货块数',
|
|
|
slot: 'blockCount',
|
|
|
align: 'center',
|
|
|
- show: this.clientEnvironmentId == '4'
|
|
|
+ // show: this.clientEnvironmentId == '4'
|
|
|
},
|
|
|
{
|
|
|
width: 120,
|
|
|
@@ -610,9 +648,7 @@
|
|
|
prop: 'taxRate',
|
|
|
label: '税率',
|
|
|
formatter: (_row, _column, cellValue) => {
|
|
|
- return _row.taxRate
|
|
|
- ? _row.taxRate+'%'
|
|
|
- : '';
|
|
|
+ return _row.taxRate ? _row.taxRate + '%' : '';
|
|
|
},
|
|
|
align: 'center'
|
|
|
},
|
|
|
@@ -651,9 +687,14 @@
|
|
|
label: '质保期',
|
|
|
slot: 'guaranteePeriod',
|
|
|
formatter: (_row, _column, cellValue) => {
|
|
|
- return (
|
|
|
- (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName
|
|
|
- );
|
|
|
+ let val = '';
|
|
|
+ if (_row.guaranteePeriod) {
|
|
|
+ val += _row.guaranteePeriod;
|
|
|
+ }
|
|
|
+ if (_row.guaranteePeriodUnitName) {
|
|
|
+ val += _row.guaranteePeriodUnitName;
|
|
|
+ }
|
|
|
+ return val
|
|
|
},
|
|
|
align: 'center'
|
|
|
},
|
|
|
@@ -734,6 +775,10 @@
|
|
|
this.$refs.stockLedgerDialogRef.init(row.sendProductDetail, row);
|
|
|
});
|
|
|
},
|
|
|
+ changeCount1(row, index) {
|
|
|
+ this.tableHandleKeyUp(row, index,'sum');
|
|
|
+ this.changeCount();
|
|
|
+ },
|
|
|
//改变数量
|
|
|
changeCount() {
|
|
|
this.form.datasource.forEach((item, index) => {
|
|
|
@@ -753,12 +798,14 @@
|
|
|
this.$set(
|
|
|
this.form.datasource[index],
|
|
|
'discountTotalPrice',
|
|
|
- item.discountSinglePrice * item.totalCount*(item.singleWeight||0)
|
|
|
+ item.discountSinglePrice *
|
|
|
+ item.totalCount *
|
|
|
+ (item.singleWeight || 0)
|
|
|
);
|
|
|
this.$set(
|
|
|
this.form.datasource[index],
|
|
|
'totalPrice',
|
|
|
- item.singlePrice * item.totalCount*(item.singleWeight||0)
|
|
|
+ item.singlePrice * item.totalCount * (item.singleWeight || 0)
|
|
|
);
|
|
|
}
|
|
|
});
|
|
|
@@ -881,9 +928,7 @@
|
|
|
|
|
|
// 表格:模数、数量(方)、块数输入框 输入事件
|
|
|
tableHandleKeyUp(row, index, name) {
|
|
|
- console.log(row, 'row');
|
|
|
- // && this.clientEnvironmentId == '4'
|
|
|
- if (row.specification && this.clientEnvironmentId == '4') {
|
|
|
+ if (row.specification) {
|
|
|
let modelArr = row.specification.split('*');
|
|
|
let modelLong = modelArr[0]; // model规格长度
|
|
|
let modeWide = modelArr[1]; // model规格宽度
|
|
|
@@ -897,7 +942,7 @@
|
|
|
row.totalCount =
|
|
|
(Number(row.blockCount) * modelLong * modeWide * modeHight) /
|
|
|
1000000;
|
|
|
- this.changeCount(row, index);
|
|
|
+ this.changeCount();
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -913,6 +958,65 @@
|
|
|
copyObj(obj)
|
|
|
);
|
|
|
},
|
|
|
+ //选择产品回调
|
|
|
+ changeParentBiz(obj = [], idx) {
|
|
|
+ obj.forEach(async (item, index) => {
|
|
|
+ let i = idx == -1 ? index : idx;
|
|
|
+ let row = JSON.parse(JSON.stringify(this.defaultForm));
|
|
|
+ row.key = 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);
|
|
|
+ this.$set(parasm, 'productCategoryId', item.categoryLevelId);
|
|
|
+ this.$set(parasm, 'productBrand', item.brandNum);
|
|
|
+ this.$set(parasm, 'productCategoryName', item.categoryLevelPath);
|
|
|
+ this.$set(parasm, 'productCode', item.code);
|
|
|
+ this.$set(parasm, 'productName', item.name);
|
|
|
+ this.$set(parasm, 'modelType', item.modelType);
|
|
|
+ this.$set(parasm, 'availableCountBase', item.availableCountBase);
|
|
|
+ this.$set(parasm, 'measuringUnit', item.measuringUnit);
|
|
|
+ this.$set(parasm, 'specification', item.specification);
|
|
|
+ this.$set(parasm, 'weightUnit', item.weightUnit);
|
|
|
+ this.$set(parasm, 'imgCode', item.imgCode);
|
|
|
+ this.$set(parasm, 'produceType', item.componentAttribute);
|
|
|
+ this.$set(parasm, 'approvalNumber', item.extField?.approvalNumber);
|
|
|
+ this.$set(parasm, 'extField', item.extField || {});
|
|
|
+ this.$set(parasm, 'singleWeight', item.netWeight);
|
|
|
+ this.$set(parasm, 'pricingWay', item.pricingWay || 1);
|
|
|
+ this.$set(parasm, 'singlePrice', 0);
|
|
|
+ this.$set(parasm, 'discountSinglePrice', 0);
|
|
|
+
|
|
|
+
|
|
|
+ this.$set(parasm, 'receiveTotalWeight', 0);
|
|
|
+ this.$set(parasm, 'sendTotalWeight', 0);
|
|
|
+ this.$set(parasm, 'increaseTotalWeight', 0);
|
|
|
+
|
|
|
+ this.$set(
|
|
|
+ parasm,
|
|
|
+ 'warehouseList',
|
|
|
+ await getIdWarehouseList({
|
|
|
+ categoryId: item.id
|
|
|
+ })
|
|
|
+ );
|
|
|
+ this.$set(
|
|
|
+ parasm,
|
|
|
+ 'packingSpecification',
|
|
|
+ item.extField?.packingSpecification
|
|
|
+ );
|
|
|
+ this.$set(
|
|
|
+ parasm,
|
|
|
+ 'supplierMark',
|
|
|
+ this.form.datasource[0]?.supplierMark
|
|
|
+ );
|
|
|
+ if (item.purchaseOrigins?.length > 0) {
|
|
|
+ item.purchaseOrigins = item.purchaseOrigins.map((val) => val + '');
|
|
|
+ }
|
|
|
+ this.$set(parasm, 'provenance', item.purchaseOrigins || []);
|
|
|
+ if (idx == -1) {
|
|
|
+ this.form.datasource.push(row);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
replaceTable(list) {
|
|
|
list.forEach((item) => {
|
|
|
item['relationId'] = this.current.tempId;
|
|
|
@@ -1001,29 +1105,11 @@
|
|
|
item.increaseTotalWeight =
|
|
|
item.increaseTotalWeight || item.receiveTotalWeight || 0;
|
|
|
}
|
|
|
- this.changeCount(item, index);
|
|
|
});
|
|
|
+ this.changeCount();
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
- //选择产品
|
|
|
- handParent(row, index) {
|
|
|
- let item = {
|
|
|
- id: row.productCode
|
|
|
- };
|
|
|
- this.$refs.productListRef.open(item, index);
|
|
|
- },
|
|
|
- //选择技术人回调
|
|
|
- changeAnswer(obj, idx) {
|
|
|
- this.$set(this.form.datasource[idx], 'technicalAnswerId', obj.id);
|
|
|
- this.$set(this.form.datasource[idx], 'technicalAnswerName', obj.name);
|
|
|
- },
|
|
|
- handHead(row, index) {
|
|
|
- let item = {
|
|
|
- id: row.technicalAnswerId
|
|
|
- };
|
|
|
- this.$refs.headRef.open(item, index);
|
|
|
- },
|
|
|
|
|
|
remove(i) {
|
|
|
this.form.datasource.splice(i, 1);
|
|
|
@@ -1039,6 +1125,11 @@
|
|
|
n.key = index + 1;
|
|
|
});
|
|
|
},
|
|
|
+ //选择产品
|
|
|
+ handParent() {
|
|
|
+ if (!this.orderId) return this.$message.error('请先选择订单');
|
|
|
+ this.$refs.BIZproductListRef.open('', -1);
|
|
|
+ },
|
|
|
// 添加
|
|
|
handlAdd() {
|
|
|
if (!this.orderId) return this.$message.error('请先选择订单');
|