|
@@ -17,7 +17,7 @@
|
|
|
label-position="right"
|
|
|
>
|
|
|
<el-row :gutter="20">
|
|
|
- <el-col :xs="24" :sm="12" :lg="8" v-if="!listItem">
|
|
|
+ <el-col :xs="24" :sm="12" :lg="8" >
|
|
|
<el-form-item label="销售政策编号" prop="policyCode">
|
|
|
<div style="display: flex">
|
|
|
<el-input
|
|
@@ -34,7 +34,7 @@
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :xs="24" :sm="12" :lg="8" v-else>
|
|
|
+ <!-- <el-col :xs="24" :sm="12" :lg="8" v-else>
|
|
|
<el-form-item label="销售政策编号" prop="policyCode">
|
|
|
<el-input
|
|
|
disabled
|
|
@@ -42,7 +42,8 @@
|
|
|
placeholder="销售政策编号"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
+
|
|
|
+ </el-col> -->
|
|
|
<el-col :xs="24" :sm="12" :lg="8" style="height: 51px">
|
|
|
<el-form-item label="单据日期" prop="date">
|
|
|
<el-date-picker
|
|
@@ -85,7 +86,7 @@
|
|
|
|
|
|
<div class="main-title">
|
|
|
<div class="title">货品信息</div>
|
|
|
- <div v-if="!listItem">
|
|
|
+ <div >
|
|
|
<el-select
|
|
|
v-model="warehouseValue"
|
|
|
placeholder="请选择发货仓库"
|
|
@@ -222,7 +223,7 @@
|
|
|
<template slot-scope="scope">
|
|
|
{{
|
|
|
(scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) /
|
|
|
- 100
|
|
|
+ 100 || 0
|
|
|
}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -385,28 +386,11 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
- <el-dialog :visible.sync="dialogVisible" width="50%">
|
|
|
- <el-form label-width="80px" :inline="false" size="small">
|
|
|
- <el-form-item label="单据日期" prop="date">
|
|
|
- <el-date-picker
|
|
|
- v-model="mainForm.date"
|
|
|
- type="datetime"
|
|
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
- style="width: 100%"
|
|
|
- placeholder="选择日期"
|
|
|
- >
|
|
|
- </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
-
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" size="small" @click="hendleEdit"
|
|
|
- >确 定</el-button
|
|
|
- >
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
- <div class="page-footer">
|
|
|
+
|
|
|
+ <div class="page-footer" style="
|
|
|
+ position: fixed;
|
|
|
+ bottom: 0;
|
|
|
+ ">
|
|
|
<div class="footer" :class="classObj">
|
|
|
<el-button type="primary" @click="clickSubmitForm">保 存</el-button>
|
|
|
<el-popconfirm
|
|
@@ -433,6 +417,9 @@
|
|
|
label-width="120px"
|
|
|
size="small"
|
|
|
>
|
|
|
+ <el-row v-if="factor.length" style="margin: 0 0 20px 0">
|
|
|
+ 引用销售政策说明:{{ factor.length ? factor[0].name : "" }}
|
|
|
+ </el-row>
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :xs="24" :sm="6" :lg="6">
|
|
|
<el-form-item label="销售政策">
|
|
@@ -444,6 +431,8 @@
|
|
|
:disabled="disabled"
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
+ <el-option label="默认" :value="''"></el-option>
|
|
|
+
|
|
|
<el-option
|
|
|
v-for="(item, index) in policyList"
|
|
|
:key="index"
|
|
@@ -478,7 +467,7 @@
|
|
|
placeholder="选择销售类型"
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
- <el-option label="默认" :value="''"></el-option>
|
|
|
+ <el-option label="默认" :value="''"></el-option>
|
|
|
|
|
|
<el-option
|
|
|
v-for="item in ztypeList"
|
|
@@ -513,6 +502,9 @@
|
|
|
@select-all="handleSelectionChange($event, 1, index)"
|
|
|
@selection-change="handleSelectionChange($event, 1, index)"
|
|
|
stripe
|
|
|
+ show-summary
|
|
|
+ :summary-method="$getSummaries"
|
|
|
+
|
|
|
>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
@@ -593,6 +585,8 @@
|
|
|
@select-all="handleSelectionChange"
|
|
|
@selection-change="handleSelectionChange"
|
|
|
stripe
|
|
|
+ show-summary
|
|
|
+ :summary-method="$getSummaries"
|
|
|
>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
@@ -801,7 +795,7 @@ export default {
|
|
|
|
|
|
computed: {
|
|
|
sidebar() {
|
|
|
- console.log(11145454);
|
|
|
+ // console.log(11145454);
|
|
|
return this.$store.state.app.sidebar;
|
|
|
},
|
|
|
classObj() {
|
|
@@ -848,6 +842,11 @@ export default {
|
|
|
// },
|
|
|
// };
|
|
|
// },
|
|
|
+ wZong(){
|
|
|
+ return (val,oval)=>{
|
|
|
+ console.log(744);
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
created() {
|
|
@@ -892,6 +891,9 @@ export default {
|
|
|
},
|
|
|
// 选择销售政策获取政策条件列表
|
|
|
async handlePolicy(e) {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
this.multipleSelections = [];
|
|
|
this.dataList = [];
|
|
|
this.popDataArr = [];
|
|
@@ -910,6 +912,9 @@ export default {
|
|
|
|
|
|
if (this.policyId) {
|
|
|
this.screenForm.policyId = this.policyId;
|
|
|
+ if (this.listItem) {
|
|
|
+ this.policyConditionId = data[0].id;
|
|
|
+ }
|
|
|
} else {
|
|
|
this.screenForm.policyId = data[0].policyId;
|
|
|
this.policyConditionId = data[0].id;
|
|
@@ -975,6 +980,8 @@ export default {
|
|
|
policyConditionId,
|
|
|
popType,
|
|
|
});
|
|
|
+
|
|
|
+
|
|
|
if (!fang) {
|
|
|
this.poptotal["total" + popType] = data.total;
|
|
|
this.popcun["cun" + popType] = 1;
|
|
@@ -990,17 +997,25 @@ export default {
|
|
|
}
|
|
|
const datas = data.records;
|
|
|
// this.total = data.total;
|
|
|
+ // console.log(this.goodsList,'4555');
|
|
|
if (this.goodsList.length) {
|
|
|
for (let p = 0; p < this.goodsList.length; p++) {
|
|
|
for (let q = 0; q < datas.length; q++) {
|
|
|
if (this.goodsList[p].id == datas[q].id) {
|
|
|
- datas[q].disabled = true;
|
|
|
+ this.$set(datas[q],'disabled',true)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
for (let i = 0; i < data.records.length; i++) {
|
|
|
data.records[i].qty = 1;
|
|
|
+
|
|
|
+ this.$set(
|
|
|
+ data.records[i],
|
|
|
+ "zong",
|
|
|
+ data.records[i].qty * data.records[i].price
|
|
|
+ );
|
|
|
+ data.records[i].sums1 = ["price", "qty", "zong"];
|
|
|
// this.$set(data.records[i],'userList',this.userList)
|
|
|
}
|
|
|
if (fang) {
|
|
@@ -1008,9 +1023,56 @@ export default {
|
|
|
} else {
|
|
|
this.popDataArr.push(datas);
|
|
|
}
|
|
|
-
|
|
|
// consloe(this.popDataArr);
|
|
|
},
|
|
|
+ // 获取政策列表
|
|
|
+ getMaterialTypeList(val) {
|
|
|
+ getMaterialTypeList({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ policyId: this.screenForm.policyId,
|
|
|
+ saleTypeCode: this.screenForm.saleTypeCode,
|
|
|
+ [val]: true,
|
|
|
+ }).then((res) => {
|
|
|
+
|
|
|
+ this.dataList = res.data.records;
|
|
|
+ if (this.listItem) {
|
|
|
+
|
|
|
+ for (let i = 0; i < this.dataList.length; i++) {
|
|
|
+ for (let j = 0; j < this.goodsList.length; j++) {
|
|
|
+ console.log(8888);
|
|
|
+ if (this.dataList[i].id==this.goodsList[j].id) {
|
|
|
+ this.$set(this.dataList[i],'disabled',true)
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (let i = 0; i < res.data.records.length; i++) {
|
|
|
+ res.data.records[i].qty = 1;
|
|
|
+ this.$set(
|
|
|
+ res.data.records[i],
|
|
|
+ "zong",
|
|
|
+ res.data.records[i].qty * res.data.records[i].price
|
|
|
+ );
|
|
|
+ res.data.records[i].sums1 = ["price", "qty", "zong"];
|
|
|
+ res.data.records[i].userList = this.userList;
|
|
|
+ for (let j = 0; j < this.newDataList.length; j++) {
|
|
|
+ if (this.newDataList[j].id == res.data.records[i].id) {
|
|
|
+ res.data.records[i].disabled = false;
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.dataList = res.data.records;
|
|
|
+ this.total = res.data.total;
|
|
|
+ this.popDataArr = [];
|
|
|
+ this.popArr = [];
|
|
|
+ // // consloe(this.dataList, "kkkk");
|
|
|
+ });
|
|
|
+ },
|
|
|
// 下一步获取某个政策条件比例数据
|
|
|
handleCondition() {
|
|
|
if (this.multipleSelection.length) {
|
|
@@ -1099,10 +1161,13 @@ export default {
|
|
|
this.$set(item, "userList", this.userList);
|
|
|
});
|
|
|
|
|
|
- if (this.goodsList.length && this.goodsList[0].wallets.length) {
|
|
|
- this.mainForm.k3ServiceName = this.goodsList[0].wallets[0].serviceId;
|
|
|
- this.mainForm.k3ServiceId = this.goodsList[0].wallets[0].serviceId;
|
|
|
- }
|
|
|
+
|
|
|
+ if (this.goodsList.length && this.goodsList[0].wallets.length) {
|
|
|
+ this.mainForm.k3ServiceName =
|
|
|
+ this.goodsList[0].wallets[0].serviceId || "";
|
|
|
+ this.mainForm.k3ServiceId =
|
|
|
+ this.goodsList[0].wallets[0].serviceId || "";
|
|
|
+ }
|
|
|
|
|
|
this.cusIndex = 0;
|
|
|
this.total = 0;
|
|
@@ -1126,10 +1191,14 @@ export default {
|
|
|
} else {
|
|
|
this.goodsList = arrData;
|
|
|
}
|
|
|
- if (this.goodsList.length && this.goodsList[0].wallets.length) {
|
|
|
- this.mainForm.k3ServiceName = this.goodsList[0].wallets[0].serviceId;
|
|
|
- this.mainForm.k3ServiceId = this.goodsList[0].wallets[0].serviceId;
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+ if (this.goodsList.length && this.goodsList[0].wallets.length) {
|
|
|
+ this.mainForm.k3ServiceName =
|
|
|
+ this.goodsList[0].wallets[0].serviceId || "";
|
|
|
+ this.mainForm.k3ServiceId =
|
|
|
+ this.goodsList[0].wallets[0].serviceId || "";
|
|
|
+ }
|
|
|
|
|
|
this.goodsList.forEach((item) => {
|
|
|
this.$set(item, "status1", "");
|
|
@@ -1145,6 +1214,7 @@ export default {
|
|
|
this.$refs.singleTable.forEach((k) => {
|
|
|
k.clearSelection();
|
|
|
});
|
|
|
+
|
|
|
// this.$refs.singleTable.clearSelection();
|
|
|
} else {
|
|
|
this.$errorMsg("请选择");
|
|
@@ -1158,6 +1228,7 @@ export default {
|
|
|
this.mainForm.type = data.mainId;
|
|
|
this.mainForm.remark = data.remark;
|
|
|
this.mainForm.policyId = data.policyId;
|
|
|
+ this.policyId = data.policyId;
|
|
|
this.mainForm.k3ServiceName = data.k3ServiceId;
|
|
|
this.mainForm.k3ServiceId = data.k3ServiceId;
|
|
|
data.retailOrderItemList.forEach((item) => {
|
|
@@ -1182,7 +1253,14 @@ export default {
|
|
|
pageSize: -1,
|
|
|
status: true,
|
|
|
}).then((res) => {
|
|
|
- this.screenForm.policyId = res.data.records[0].code;
|
|
|
+ if (this.policyId) {
|
|
|
+ this.screenForm.policyId = this.policyId
|
|
|
+ this.disabled = true
|
|
|
+
|
|
|
+ }else{
|
|
|
+ this.screenForm.policyId = res.data.records[0].code;
|
|
|
+ }
|
|
|
+
|
|
|
this.policyList = res.data.records;
|
|
|
if (this.policyList.length) {
|
|
|
this.handlePolicy(this.screenForm.policyId);
|
|
@@ -1220,39 +1298,24 @@ export default {
|
|
|
policyId: this.screenForm.policyId,
|
|
|
saleTypeCode: this.screenForm.saleTypeCode,
|
|
|
}).then((res) => {
|
|
|
+ console.log(res.data.records,'7777');
|
|
|
for (let i = 0; i < res.data.records.length; i++) {
|
|
|
res.data.records[i].qty = 1;
|
|
|
- data.records[i].userList = this.userList;
|
|
|
- }
|
|
|
+ this.$set(
|
|
|
+ res.data.records[i],
|
|
|
+ "zong",
|
|
|
+ res.data.records[i].qty * res.data.records[i].price
|
|
|
+ );
|
|
|
+ res.data.records[i].sums2 = ["price", "qty", "zong"];
|
|
|
+ res.data.records[i].userList = this.userList;
|
|
|
|
|
|
- this.dataList = res.data.records;
|
|
|
- this.total = res.data.total;
|
|
|
- });
|
|
|
- },
|
|
|
- // 获取政策列表
|
|
|
- getMaterialTypeList(val) {
|
|
|
- getMaterialTypeList({
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
- policyId: this.screenForm.policyId,
|
|
|
- saleTypeCode: this.screenForm.saleTypeCode,
|
|
|
- [val]: true,
|
|
|
- }).then((res) => {
|
|
|
- for (let i = 0; i < res.data.records.length; i++) {
|
|
|
- res.data.records[i].qty = 1;
|
|
|
- for (let j = 0; j < this.newDataList.length; j++) {
|
|
|
- if (this.newDataList[j].id == res.data.records[i].id) {
|
|
|
- res.data.records[i].disabled = false;
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
+
|
|
|
this.dataList = res.data.records;
|
|
|
this.total = res.data.total;
|
|
|
- this.popDataArr = [];
|
|
|
- this.popArr = [];
|
|
|
- // // consloe(this.dataList, "kkkk");
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
// 打开引用
|
|
|
handleShow() {
|
|
|
this.isShowDialog = true;
|
|
@@ -1504,7 +1567,8 @@ export default {
|
|
|
// ].dictValue;
|
|
|
let params = {
|
|
|
theTime: this.mainForm.date,
|
|
|
-
|
|
|
+ k3ServiceId: this.mainForm.k3ServiceId,
|
|
|
+ k3ServiceName: this.mainForm.k3ServiceName,
|
|
|
remark: this.mainForm.remark,
|
|
|
type: 2, // 1:普通零售单,2:政策零售单
|
|
|
retailOrderItemList: this.goodsList,
|
|
@@ -1519,7 +1583,6 @@ export default {
|
|
|
});
|
|
|
} else {
|
|
|
addData(params).then((res) => {
|
|
|
- console.log(5585);
|
|
|
this.$successMsg("添加成功");
|
|
|
this.goBack();
|
|
|
this.$parent.getList();
|