|
@@ -289,8 +289,8 @@
|
|
|
>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item prop="saleNo" label="合同号:">
|
|
|
- <!-- <el-input size="small" v-model="formData.saleNo"></el-input> -->
|
|
|
- {{ formData.saleNo }}
|
|
|
+<!-- <el-input size="small" v-model="formData.saleNo"></el-input>-->
|
|
|
+ {{ this.lsaleNo }}
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<!-- <el-col :span="12">
|
|
@@ -867,6 +867,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ lsaleNo:'',//全局添加合同号
|
|
|
// 提交 表单数据 start
|
|
|
form: {
|
|
|
noticeNumber: "", //通知单号
|
|
@@ -1167,7 +1168,6 @@ export default {
|
|
|
},
|
|
|
// 零售订单完成回调
|
|
|
async handleComplate(row) {
|
|
|
- console.log(row);
|
|
|
let payload = {
|
|
|
id: row.id,
|
|
|
status: 6,
|
|
@@ -1186,7 +1186,6 @@ export default {
|
|
|
type: "error",
|
|
|
message: "订单已完成失败,请稍后再试",
|
|
|
});
|
|
|
- console.log(res);
|
|
|
}
|
|
|
},
|
|
|
// 更新库存箱数和重量
|
|
@@ -1324,14 +1323,6 @@ export default {
|
|
|
).id;
|
|
|
}
|
|
|
},
|
|
|
- // 生成合同号
|
|
|
- getSaleNo() {
|
|
|
- let timeStr = moment().format("YYYYMMDD");
|
|
|
- for (var i = 0; i < 5; i++) {
|
|
|
- timeStr += parseInt(Math.random() * 10);
|
|
|
- }
|
|
|
- return timeStr;
|
|
|
- },
|
|
|
// 自定义筛选方法
|
|
|
mySelectFilter(value, row) {
|
|
|
console.log(value);
|
|
@@ -1393,12 +1384,20 @@ export default {
|
|
|
)?.productType;
|
|
|
this.productionOptions = this.allProductionOptions.slice(0, 500);
|
|
|
},
|
|
|
-
|
|
|
+// 生成合同号
|
|
|
+ getSaleNo() {
|
|
|
+ let timeStr = moment().format("YYYYMMDD");
|
|
|
+ for (var i = 0; i < 5; i++) {
|
|
|
+ timeStr += parseInt(Math.random() * 10);
|
|
|
+ }
|
|
|
+ console.log("生成合同号==============",timeStr)
|
|
|
+ return timeStr;
|
|
|
+ },
|
|
|
// 重置审计表单数据
|
|
|
resetFormData() {
|
|
|
Object.assign(this.formData, {
|
|
|
//订单表数据
|
|
|
- saleNo: this.getSaleNo(), //合同号
|
|
|
+ saleNo: "", //合同号
|
|
|
saleCustomNo: "", //客户编号
|
|
|
saleDate: moment(new Date()).format("YYYY-MM-DD"), //销售单日期
|
|
|
saleOrderEstimatedTime: moment(new Date()).format("YYYY-MM-DD"), //预计下单时间
|
|
@@ -1626,8 +1625,12 @@ export default {
|
|
|
this.createById = this.userInfo.userId;
|
|
|
}
|
|
|
await this.getRoleUser();
|
|
|
+ this.formData.saleNo ='';
|
|
|
+ this.lsaleNo = '';
|
|
|
this.resetFormData();
|
|
|
-
|
|
|
+ this.lsaleNo =this.getSaleNo();
|
|
|
+ this.formData.saleNo = this.lsaleNo;
|
|
|
+ console.log("赋值合同号==============",this.formData.saleNo)
|
|
|
this.title = "新增零售单";
|
|
|
this.open = true;
|
|
|
this.$nextTick(() => {
|
|
@@ -1831,8 +1834,6 @@ export default {
|
|
|
// }
|
|
|
this.$refs.formDataRef.validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
- console.log(valid);
|
|
|
-
|
|
|
let {
|
|
|
id,
|
|
|
//订单表数据
|
|
@@ -1881,7 +1882,7 @@ export default {
|
|
|
this.form.drawer = this.username;
|
|
|
this.form.documentType = "1";
|
|
|
this.form.billingType = "1";
|
|
|
- this.form.saleOrderNo = saleNo;
|
|
|
+ this.form.saleOrderNo = this.lsaleNo;
|
|
|
this.form.dispatchNoteRemark = orderRemark;
|
|
|
this.form.customerId = this.customerOptions.find(
|
|
|
(item) => item.customNo == saleCustomNo
|
|
@@ -1902,6 +1903,7 @@ export default {
|
|
|
} else {
|
|
|
//新增
|
|
|
payload.orderType = 1;
|
|
|
+ payload.saleNo = this.lsaleNo;
|
|
|
let res = await addRetailOrder(payload);
|
|
|
if (res.code == 200) {
|
|
|
// 准备新增时 提交 数据 start
|
|
@@ -1961,7 +1963,6 @@ export default {
|
|
|
},
|
|
|
// 审计 编辑回调
|
|
|
async handleEdit(index, row) {
|
|
|
- console.log(row);
|
|
|
let { saleOrderSaleNo } = row;
|
|
|
try {
|
|
|
let payLoad = [
|
|
@@ -2077,11 +2078,6 @@ export default {
|
|
|
// 计算金额
|
|
|
computedPrice(row) {
|
|
|
let { productNumber, productUnitPrice } = row;
|
|
|
- console.log(
|
|
|
- "productNumber, productUnitPrice",
|
|
|
- productNumber,
|
|
|
- productUnitPrice
|
|
|
- );
|
|
|
row.productAmounts = (
|
|
|
Number(productNumber) * Number(productUnitPrice)
|
|
|
).toFixed(2);
|
|
@@ -2132,7 +2128,6 @@ export default {
|
|
|
// 处理列表信息
|
|
|
columnsHandler(columns) {
|
|
|
let resArr = [];
|
|
|
- console.log(columns, 111);
|
|
|
columns.forEach((item) => {
|
|
|
for (const key in item) {
|
|
|
let tempObj = {};
|
|
@@ -2141,7 +2136,6 @@ export default {
|
|
|
resArr.push(tempObj);
|
|
|
}
|
|
|
});
|
|
|
- console.log(resArr, 222);
|
|
|
return resArr;
|
|
|
},
|
|
|
// 取消按钮
|
|
@@ -2178,7 +2172,6 @@ export default {
|
|
|
// );
|
|
|
this.selection = selection;
|
|
|
this.myDelIds = selection.map((item) => item.id);
|
|
|
- console.log(this.myDelIds);
|
|
|
this.ids = selection.map((item) => item.saleOrderSaleNo);
|
|
|
this.single = selection.length != 1;
|
|
|
this.multiple = !selection.length;
|
|
@@ -2374,7 +2367,6 @@ export default {
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
|
async handleUpdate(row) {
|
|
|
- console.log(row);
|
|
|
this.isEdit = true;
|
|
|
await this.getDropDownData();
|
|
|
this.isLeader = !this.userInfo.roles.includes("salesman");
|
|
@@ -2385,8 +2377,8 @@ export default {
|
|
|
this.title = "修改零售单";
|
|
|
try {
|
|
|
let res = await getRetailOrderInfo(row.id);
|
|
|
- console.log(res);
|
|
|
if (res.code == 200) {
|
|
|
+ this.lsaleNo = res.data.saleNo;
|
|
|
this.initData(res.data);
|
|
|
this.open = true;
|
|
|
} else {
|
|
@@ -2406,7 +2398,6 @@ export default {
|
|
|
await this.getRoleUser();
|
|
|
try {
|
|
|
let res = await getRetailOrderInfo(row.id);
|
|
|
- console.log(res);
|
|
|
if (res.code == 200) {
|
|
|
await this.initData(res.data);
|
|
|
this.printDomData = this.getPrintDom(res.data);
|
|
@@ -2430,7 +2421,6 @@ export default {
|
|
|
},
|
|
|
// 取消提交
|
|
|
async handleSubmitCancel(row) {
|
|
|
- console.log(row);
|
|
|
this.$confirm("此操作将撤回该次提交, 是否继续?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
@@ -2453,7 +2443,6 @@ export default {
|
|
|
this.getList();
|
|
|
} else {
|
|
|
this.$message.error("取消失败");
|
|
|
- console.log(res);
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.log(error);
|
|
@@ -2488,7 +2477,6 @@ export default {
|
|
|
// 工艺表数据
|
|
|
orderRemark,
|
|
|
} = this.formData;
|
|
|
- console.log(this.form, this.productionTableData);
|
|
|
let { truckRegistration } = this.form;
|
|
|
let customData = this.customerOptions.find(
|
|
|
(item) => item.customNo == saleCustomNo
|
|
@@ -2940,7 +2928,6 @@ export default {
|
|
|
this.kOpen = false;
|
|
|
})
|
|
|
.catch((res) => {
|
|
|
- console.log(res);
|
|
|
this.$modal.msgError("表单校验失败,请规范填写数据");
|
|
|
});
|
|
|
} else {
|
|
@@ -3046,7 +3033,6 @@ export default {
|
|
|
|
|
|
// 设置表格字段样式
|
|
|
async setFieldStyleData(tableList) {
|
|
|
- console.log(JSON.parse(JSON.stringify(tableList)));
|
|
|
let fieldConditionList = this.styleList.filter(
|
|
|
(item) => item.styleType == 1 || item.styleType == 2
|
|
|
);
|
|
@@ -3230,7 +3216,6 @@ export default {
|
|
|
];
|
|
|
let res = await queryDropDownBoxData(payLoad);
|
|
|
if (res.code == 200) {
|
|
|
- console.log(res);
|
|
|
let { sale_craft, sale_order, sale_products } = res.data.resultMap;
|
|
|
let {
|
|
|
//订单表数据
|
|
@@ -3341,7 +3326,6 @@ export default {
|
|
|
let productData = this.productionOptions.find(
|
|
|
(pro) => pro.productNo == item.productNo
|
|
|
);
|
|
|
- console.log("item", item);
|
|
|
item.sliceTypeLabel =
|
|
|
this.sliceTypeOptions.find((k) => k.materielCode == item.sliceType)
|
|
|
?.materielName || "";
|
|
@@ -3465,13 +3449,10 @@ export default {
|
|
|
},
|
|
|
// 自定义删除按钮
|
|
|
async myDeleteHandler(row) {
|
|
|
- console.log(row);
|
|
|
let stateArr = ["6"];
|
|
|
let isDeleteValidate = this.selection.some((item) => {
|
|
|
return stateArr.includes(item.status);
|
|
|
});
|
|
|
- console.log(this.selection);
|
|
|
- console.log(isDeleteValidate);
|
|
|
if (isDeleteValidate) {
|
|
|
this.$message.error("'已完成'状态订单不可删除!");
|
|
|
return;
|
|
@@ -3483,7 +3464,6 @@ export default {
|
|
|
});
|
|
|
let payLoad = row.id ? [row.id] : this.myDelIds;
|
|
|
payLoad = payLoad.join(",");
|
|
|
- console.log(payLoad);
|
|
|
|
|
|
try {
|
|
|
let res = await deleRetailOrder(payLoad);
|