|
@@ -296,7 +296,7 @@
|
|
<el-input size="small" v-model="formData.lotNumber"></el-input>
|
|
<el-input size="small" v-model="formData.lotNumber"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col> -->
|
|
</el-col> -->
|
|
- <el-col :span="12">
|
|
|
|
|
|
+ <!-- <el-col :span="12">
|
|
<el-form-item prop="saleDate" label="日期:">
|
|
<el-form-item prop="saleDate" label="日期:">
|
|
<el-date-picker
|
|
<el-date-picker
|
|
size="small"
|
|
size="small"
|
|
@@ -308,7 +308,7 @@
|
|
>
|
|
>
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- </el-col>
|
|
|
|
|
|
+ </el-col> -->
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item prop="saleCustomNo" label="客户名称:">
|
|
<el-form-item prop="saleCustomNo" label="客户名称:">
|
|
<el-select
|
|
<el-select
|
|
@@ -389,7 +389,7 @@
|
|
sum-text="小计"
|
|
sum-text="小计"
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
>
|
|
>
|
|
- <el-table-column prop="productNo" label="品名" width="180">
|
|
|
|
|
|
+ <el-table-column prop="productName" label="品名" width="180">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<!-- <el-input
|
|
<!-- <el-input
|
|
v-model="scope.row.productName"
|
|
v-model="scope.row.productName"
|
|
@@ -397,39 +397,65 @@
|
|
clearable
|
|
clearable
|
|
></el-input> -->
|
|
></el-input> -->
|
|
<el-form-item
|
|
<el-form-item
|
|
- :prop="'productNo-' + scope.$index"
|
|
|
|
- :name="'productNo-' + scope.$index"
|
|
|
|
|
|
+ :prop="'productName-' + scope.$index"
|
|
|
|
+ :name="'productName-' + scope.$index"
|
|
style="margin: 0px; padding: 0px"
|
|
style="margin: 0px; padding: 0px"
|
|
>
|
|
>
|
|
|
|
+ <!-- @change="
|
|
|
|
+ handleProductChange(scope.row.productNo, scope.row)
|
|
|
|
+ :filter-method="(val) => mySelectFilter(val, scope.row)"
|
|
|
|
+ " -->
|
|
<el-select
|
|
<el-select
|
|
- v-model="scope.row.productNo"
|
|
|
|
|
|
+ v-model="scope.row.productName"
|
|
placeholder=""
|
|
placeholder=""
|
|
- :filter-method="(val) => mySelectFilter(val, scope.row)"
|
|
|
|
- clearable
|
|
|
|
filterable
|
|
filterable
|
|
@change="
|
|
@change="
|
|
- handleProductChange(scope.row.productNo, scope.row)
|
|
|
|
|
|
+ newProductChange(scope.row.productName, scope.row)
|
|
"
|
|
"
|
|
- @blur="handleProductBlur(scope.row.productNo, scope.row)"
|
|
|
|
>
|
|
>
|
|
<el-option
|
|
<el-option
|
|
v-for="item in productionOptions"
|
|
v-for="item in productionOptions"
|
|
:key="item.productNo"
|
|
:key="item.productNo"
|
|
:label="item.productName"
|
|
:label="item.productName"
|
|
- :value="item.productNo"
|
|
|
|
|
|
+ :value="item.productName"
|
|
>
|
|
>
|
|
<span class="discribe" style="float: left">{{
|
|
<span class="discribe" style="float: left">{{
|
|
item.productName
|
|
item.productName
|
|
}}</span>
|
|
}}</span>
|
|
- <span
|
|
|
|
|
|
+ <!-- <span
|
|
style="float: right; color: #8492a6; font-size: 13px"
|
|
style="float: right; color: #8492a6; font-size: 13px"
|
|
>{{ item.productSpecifications }}</span
|
|
>{{ item.productSpecifications }}</span
|
|
- >
|
|
|
|
|
|
+ > -->
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
+ <el-table-column prop="productSpecifications" label="规格">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="scope.row.productSpecifications"
|
|
|
|
+ @change="handleSpecificationsChange(scope.row)"
|
|
|
|
+ placeholder=""
|
|
|
|
+ filterable
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in scope.row.specificationsList"
|
|
|
|
+ :key="item.productSpecifications"
|
|
|
|
+ :label="item.productSpecifications"
|
|
|
|
+ :value="item.productSpecifications"
|
|
|
|
+ >
|
|
|
|
+ <span class="discribe" style="float: left">{{
|
|
|
|
+ item.productSpecifications
|
|
|
|
+ }}</span>
|
|
|
|
+ <span
|
|
|
|
+ style="float: right; color: #8492a6; font-size: 13px"
|
|
|
|
+ >{{ item.productType }}</span
|
|
|
|
+ >
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
<el-table-column prop="productType" label="类型">
|
|
<el-table-column prop="productType" label="类型">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="productNumber" label="数量/kg">
|
|
<el-table-column prop="productNumber" label="数量/kg">
|
|
@@ -796,6 +822,8 @@ import {
|
|
updateProductInvoice,
|
|
updateProductInvoice,
|
|
saleOrderList,
|
|
saleOrderList,
|
|
queryMaterielList,
|
|
queryMaterielList,
|
|
|
|
+ getSaleOrderProductionListDistinct,
|
|
|
|
+ getProductSpecificationsByProductName,
|
|
} from "@/api/tablelist/commonTable";
|
|
} from "@/api/tablelist/commonTable";
|
|
import { listData } from "@/api/system/tenant/data";
|
|
import { listData } from "@/api/system/tenant/data";
|
|
import { getToken } from "@/utils/auth";
|
|
import { getToken } from "@/utils/auth";
|
|
@@ -907,13 +935,13 @@ export default {
|
|
// },
|
|
// },
|
|
],
|
|
],
|
|
rules: {
|
|
rules: {
|
|
- deliveryDate: [
|
|
|
|
- {
|
|
|
|
- required: true,
|
|
|
|
- message: "请选择交货日期",
|
|
|
|
- trigger: "change",
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
|
|
+ // deliveryDate: [
|
|
|
|
+ // {
|
|
|
|
+ // required: true,
|
|
|
|
+ // message: "请选择交货日期",
|
|
|
|
+ // trigger: "change",
|
|
|
|
+ // },
|
|
|
|
+ // ],
|
|
salePayType: [
|
|
salePayType: [
|
|
{
|
|
{
|
|
required: true,
|
|
required: true,
|
|
@@ -953,20 +981,20 @@ export default {
|
|
trigger: "change",
|
|
trigger: "change",
|
|
},
|
|
},
|
|
],
|
|
],
|
|
- saleOrderEstimatedTime: [
|
|
|
|
- {
|
|
|
|
- required: true,
|
|
|
|
- message: "请选择预计下单时间",
|
|
|
|
- trigger: "change",
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- saleLeadTime: [
|
|
|
|
- {
|
|
|
|
- required: true,
|
|
|
|
- message: "请输入交货天数",
|
|
|
|
- trigger: "blur",
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
|
|
+ // saleOrderEstimatedTime: [
|
|
|
|
+ // {
|
|
|
|
+ // required: true,
|
|
|
|
+ // message: "请选择预计下单时间",
|
|
|
|
+ // trigger: "change",
|
|
|
|
+ // },
|
|
|
|
+ // ],
|
|
|
|
+ // saleLeadTime: [
|
|
|
|
+ // {
|
|
|
|
+ // required: true,
|
|
|
|
+ // message: "请输入交货天数",
|
|
|
|
+ // trigger: "blur",
|
|
|
|
+ // },
|
|
|
|
+ // ],
|
|
earnestMoney: [
|
|
earnestMoney: [
|
|
{
|
|
{
|
|
validator: this.validateEarnestMoney,
|
|
validator: this.validateEarnestMoney,
|
|
@@ -1112,6 +1140,59 @@ export default {
|
|
}),
|
|
}),
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 规格变化回调
|
|
|
|
+ handleSpecificationsChange(row) {
|
|
|
|
+ let { productSpecifications, specificationsList } = row;
|
|
|
|
+ if (productSpecifications) {
|
|
|
|
+ let targetItem = specificationsList.find(
|
|
|
|
+ (item) => item.productSpecifications == productSpecifications
|
|
|
|
+ );
|
|
|
|
+ console.log(targetItem);
|
|
|
|
+ row.productNo = targetItem?.productNo;
|
|
|
|
+ row.productType = targetItem?.productType;
|
|
|
|
+ } else {
|
|
|
|
+ row.productNo = "";
|
|
|
|
+ row.productType = "";
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 新的产品改变回调
|
|
|
|
+ async newProductChange(productName, row) {
|
|
|
|
+ // 发请求获取对应的规格数据
|
|
|
|
+ if (!productName) {
|
|
|
|
+ row.specificationsList = [];
|
|
|
|
+ (row.productNo = ""), (row.productType = "");
|
|
|
|
+ row.productSpecifications = "";
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // let targetItem = this.productionOptions.find(
|
|
|
|
+ // (item) => item.productNo == productNo
|
|
|
|
+ // );
|
|
|
|
+ // row.productName = targetItem?.productName;
|
|
|
|
+ // row.productType = targetItem?.productType;
|
|
|
|
+ // 获取规格数据
|
|
|
|
+ let res = await getProductSpecificationsByProductName({
|
|
|
|
+ productName: productName,
|
|
|
|
+ });
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ row.specificationsList = res.data;
|
|
|
|
+ console.log(row.specificationsList);
|
|
|
|
+ let defaultItem = row.specificationsList.find(
|
|
|
|
+ (item) => item.isDefaultSpecifications
|
|
|
|
+ );
|
|
|
|
+ if (defaultItem) {
|
|
|
|
+ row.productSpecifications = defaultItem.productSpecifications;
|
|
|
|
+ row.productNo = defaultItem.productNo;
|
|
|
|
+ row.productType = defaultItem.productType;
|
|
|
|
+ } else {
|
|
|
|
+ row.productSpecifications =
|
|
|
|
+ row.specificationsList[0]?.productSpecifications || "";
|
|
|
|
+ row.productNo = row.specificationsList[0]?.productNo || "";
|
|
|
|
+ row.productType = row.specificationsList[0]?.productType || "";
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ row.specificationsList = [];
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// 自定义筛选方法
|
|
// 自定义筛选方法
|
|
mySelectFilter(value, row) {
|
|
mySelectFilter(value, row) {
|
|
console.log(value);
|
|
console.log(value);
|
|
@@ -1186,14 +1267,22 @@ export default {
|
|
orderTypeChange(type) {
|
|
orderTypeChange(type) {
|
|
this.getList(false, type);
|
|
this.getList(false, type);
|
|
},
|
|
},
|
|
|
|
+ // 生成合同号
|
|
|
|
+ getSaleNo() {
|
|
|
|
+ let timeStr = moment().format("YYYYMMDD");
|
|
|
|
+ for (var i = 0; i < 5; i++) {
|
|
|
|
+ timeStr += parseInt(Math.random() * 10);
|
|
|
|
+ }
|
|
|
|
+ return timeStr;
|
|
|
|
+ },
|
|
// 重置审计表单数据
|
|
// 重置审计表单数据
|
|
resetFormData() {
|
|
resetFormData() {
|
|
Object.assign(this.formData, {
|
|
Object.assign(this.formData, {
|
|
//订单表数据
|
|
//订单表数据
|
|
- saleNo: "", //合同号
|
|
|
|
|
|
+ saleNo: this.getSaleNo(), //合同号
|
|
saleCustomNo: "", //客户编号
|
|
saleCustomNo: "", //客户编号
|
|
- saleDate: "", //销售单日期
|
|
|
|
- saleOrderEstimatedTime: "", //预计下单时间
|
|
|
|
|
|
+ saleDate: moment(new Date()).format("YYYY-MM-DD"), //销售单日期
|
|
|
|
+ saleOrderEstimatedTime: moment(new Date()).format("YYYY-MM-DD"), //预计下单时间
|
|
saleLeadTime: "", //交货周期
|
|
saleLeadTime: "", //交货周期
|
|
deliveryDate: "",
|
|
deliveryDate: "",
|
|
saleAmounts: "", //合计金额 小写
|
|
saleAmounts: "", //合计金额 小写
|
|
@@ -1246,10 +1335,11 @@ export default {
|
|
const values = data.map((item) => Number(item[column.property]));
|
|
const values = data.map((item) => Number(item[column.property]));
|
|
if (
|
|
if (
|
|
index === 1 ||
|
|
index === 1 ||
|
|
- index === 5 ||
|
|
|
|
|
|
+ index === 2 ||
|
|
index === 6 ||
|
|
index === 6 ||
|
|
index === 7 ||
|
|
index === 7 ||
|
|
- index === 8
|
|
|
|
|
|
+ index === 8 ||
|
|
|
|
+ index === 9
|
|
) {
|
|
) {
|
|
sums[index] = "";
|
|
sums[index] = "";
|
|
} else if (!values.every((value) => isNaN(value))) {
|
|
} else if (!values.every((value) => isNaN(value))) {
|
|
@@ -1294,6 +1384,7 @@ export default {
|
|
colourNumberLabel: "",
|
|
colourNumberLabel: "",
|
|
colourNumber: "", //色号
|
|
colourNumber: "", //色号
|
|
remark: "", //备注
|
|
remark: "", //备注
|
|
|
|
+ specificationsList: [],
|
|
});
|
|
});
|
|
// 添加校验规则
|
|
// 添加校验规则
|
|
this.initTableValidate();
|
|
this.initTableValidate();
|
|
@@ -1412,13 +1503,15 @@ export default {
|
|
} else {
|
|
} else {
|
|
throw Error("获取下拉框数据失败");
|
|
throw Error("获取下拉框数据失败");
|
|
}
|
|
}
|
|
- let proRes = await getSaleOrderProductionList();
|
|
|
|
|
|
+ let proRes = await getSaleOrderProductionListDistinct();
|
|
|
|
+ console.log("proRes", proRes);
|
|
if (proRes.code == 200) {
|
|
if (proRes.code == 200) {
|
|
console.log(proRes.data);
|
|
console.log(proRes.data);
|
|
// let { production, customer } = proRes.data.resultMap;
|
|
// let { production, customer } = proRes.data.resultMap;
|
|
- this.allProductionOptions = proRes.data || [];
|
|
|
|
- this.productionOptions =
|
|
|
|
- this.allProductionOptions.slice(0, 500) || [];
|
|
|
|
|
|
+ // this.allProductionOptions = proRes.data || [];
|
|
|
|
+ // this.productionOptions =
|
|
|
|
+ // this.allProductionOptions.slice(0, 500) || [];
|
|
|
|
+ this.productionOptions = proRes.data;
|
|
} else {
|
|
} else {
|
|
throw Error("获取下拉框数据失败");
|
|
throw Error("获取下拉框数据失败");
|
|
}
|
|
}
|
|
@@ -3102,7 +3195,7 @@ export default {
|
|
let productData = this.allProductionOptions.find(
|
|
let productData = this.allProductionOptions.find(
|
|
(pro) => pro.productNo == item.productNo
|
|
(pro) => pro.productNo == item.productNo
|
|
);
|
|
);
|
|
- console.log("item", item);
|
|
|
|
|
|
+ console.log(item.productNo, productData, this.allProductionOptions);
|
|
item.sliceTypeLabel =
|
|
item.sliceTypeLabel =
|
|
this.sliceTypeOptions.find((k) => k.materielCode == item.sliceType)
|
|
this.sliceTypeOptions.find((k) => k.materielCode == item.sliceType)
|
|
?.materielName || "";
|
|
?.materielName || "";
|