|
@@ -17,28 +17,28 @@
|
|
label-position="right"
|
|
label-position="right"
|
|
>
|
|
>
|
|
<el-row :gutter="20">
|
|
<el-row :gutter="20">
|
|
- <el-col
|
|
|
|
- :xs="24"
|
|
|
|
- :sm="12"
|
|
|
|
- :lg="8"
|
|
|
|
- v-if="!listItem"
|
|
|
|
- >
|
|
|
|
|
|
+ <el-col :xs="24" :sm="12" :lg="8" v-if="!listItem">
|
|
<el-form-item label="销售政策编号" prop="policyCode">
|
|
<el-form-item label="销售政策编号" prop="policyCode">
|
|
- <div style="display:flex">
|
|
|
|
- <el-input
|
|
|
|
- v-model="policyId"
|
|
|
|
- placeholder="销售政策编号"
|
|
|
|
- disabled
|
|
|
|
- ></el-input>
|
|
|
|
- <el-button style="margin-left:10px" size="small" @click="handleShow">引用</el-button>
|
|
|
|
-
|
|
|
|
|
|
+ <div style="display: flex">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="policyId"
|
|
|
|
+ placeholder="销售政策编号"
|
|
|
|
+ disabled
|
|
|
|
+ ></el-input>
|
|
|
|
+ <el-button
|
|
|
|
+ style="margin-left: 10px"
|
|
|
|
+ size="small"
|
|
|
|
+ @click="handleShow"
|
|
|
|
+ >引用</el-button
|
|
|
|
+ >
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</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-form-item label="销售政策编号" prop="policyCode">
|
|
<el-input
|
|
<el-input
|
|
- v-model="mainForm.policyCode"
|
|
|
|
|
|
+ disabled
|
|
|
|
+ v-model="mainForm.policyId"
|
|
placeholder="销售政策编号"
|
|
placeholder="销售政策编号"
|
|
></el-input>
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -55,10 +55,19 @@
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
- <!-- <el-col :xs="24" :sm="12" :lg="8">
|
|
|
|
- <el-form-item label="业务员" prop="type">
|
|
|
|
|
|
+
|
|
|
|
+ <el-col :xs="24" :sm="8" :lg="8">
|
|
|
|
+ <el-form-item label="备注" prop="remark">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="mainForm.remark"
|
|
|
|
+ placeholder="请输入备注"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :xs="24" :sm="12" :lg="8">
|
|
|
|
+ <el-form-item label="业务员" prop="k3ServiceName">
|
|
<el-select
|
|
<el-select
|
|
- v-model="mainForm.type"
|
|
|
|
|
|
+ v-model="mainForm.k3ServiceName"
|
|
placeholder="选择业务员"
|
|
placeholder="选择业务员"
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
>
|
|
>
|
|
@@ -70,14 +79,6 @@
|
|
></el-option>
|
|
></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- </el-col> -->
|
|
|
|
- <el-col :xs="24" :sm="8" :lg="8">
|
|
|
|
- <el-form-item label="备注" prop="remark">
|
|
|
|
- <el-input
|
|
|
|
- v-model="mainForm.remark"
|
|
|
|
- placeholder="请输入备注"
|
|
|
|
- ></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
</el-form>
|
|
</el-form>
|
|
@@ -221,7 +222,7 @@
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
{{
|
|
{{
|
|
(scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) /
|
|
(scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) /
|
|
- 100 || 0
|
|
|
|
|
|
+ 100
|
|
}}
|
|
}}
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -235,13 +236,7 @@
|
|
{{ scope.row.qty * scope.row.discAmount }}
|
|
{{ scope.row.qty * scope.row.discAmount }}
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <!-- <el-table-column
|
|
|
|
- align="center"
|
|
|
|
- label="已退数量"
|
|
|
|
- prop="retiredQty"
|
|
|
|
- min-width="100"
|
|
|
|
- show-overflow-tooltip
|
|
|
|
- ></el-table-column> -->
|
|
|
|
|
|
+
|
|
<el-table-column
|
|
<el-table-column
|
|
align="center"
|
|
align="center"
|
|
label="现金钱包"
|
|
label="现金钱包"
|
|
@@ -251,6 +246,7 @@
|
|
>
|
|
>
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-select
|
|
<el-select
|
|
|
|
+ @change="handleWallets($event, scope.row)"
|
|
v-model="scope.row.customerWalletId"
|
|
v-model="scope.row.customerWalletId"
|
|
placeholder="选择现金钱包"
|
|
placeholder="选择现金钱包"
|
|
clearable
|
|
clearable
|
|
@@ -268,6 +264,29 @@
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
align="center"
|
|
align="center"
|
|
|
|
+ label="业务员"
|
|
|
|
+ prop="retiredQty"
|
|
|
|
+ min-width="160"
|
|
|
|
+ show-overflow-tooltip
|
|
|
|
+ >
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-select
|
|
|
|
+ size="small"
|
|
|
|
+ v-model="scope.row.k3ServiceName"
|
|
|
|
+ placeholder="选择业务员"
|
|
|
|
+ style="width: 100%"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in scope.row.userList"
|
|
|
|
+ :key="item.adminUserId"
|
|
|
|
+ :label="item.nickName"
|
|
|
|
+ :value="item.adminUserId"
|
|
|
|
+ ></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ align="center"
|
|
label="实付金额"
|
|
label="实付金额"
|
|
prop="qty"
|
|
prop="qty"
|
|
min-width="100"
|
|
min-width="100"
|
|
@@ -357,7 +376,9 @@
|
|
@click="(dialogVisible = true), (cid = scope.row.id)"
|
|
@click="(dialogVisible = true), (cid = scope.row.id)"
|
|
>修改</el-button
|
|
>修改</el-button
|
|
> -->
|
|
> -->
|
|
- <el-button type="text" @click="deleteItem(scope.$index,scope.row.id)"
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ type="text"
|
|
|
|
+ @click="deleteItem(scope.$index, scope.row.id)"
|
|
>删除</el-button
|
|
>删除</el-button
|
|
>
|
|
>
|
|
</template>
|
|
</template>
|
|
@@ -431,7 +452,7 @@
|
|
></el-option>
|
|
></el-option>
|
|
</el-select> </el-form-item
|
|
</el-select> </el-form-item
|
|
></el-col>
|
|
></el-col>
|
|
- <el-col :xs="24" :sm="6" :lg="6">
|
|
|
|
|
|
+ <!-- <el-col :xs="24" :sm="6" :lg="6">
|
|
<el-form-item label="条件">
|
|
<el-form-item label="条件">
|
|
<el-select
|
|
<el-select
|
|
v-model="screenForm.factorId"
|
|
v-model="screenForm.factorId"
|
|
@@ -448,7 +469,7 @@
|
|
></el-option>
|
|
></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- </el-col>
|
|
|
|
|
|
+ </el-col> -->
|
|
<el-col :xs="24" :sm="6" :lg="6">
|
|
<el-col :xs="24" :sm="6" :lg="6">
|
|
<el-form-item label="销售类型">
|
|
<el-form-item label="销售类型">
|
|
<el-select
|
|
<el-select
|
|
@@ -467,7 +488,7 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
- <el-col :xs="24" :sm="6" :lg="6" class="tr">
|
|
|
|
|
|
+ <el-col :xs="24" :sm="12" :lg="12" class="tr">
|
|
<el-button
|
|
<el-button
|
|
type="primary"
|
|
type="primary"
|
|
size="small"
|
|
size="small"
|
|
@@ -478,96 +499,89 @@
|
|
</el-row>
|
|
</el-row>
|
|
</el-form>
|
|
</el-form>
|
|
<template v-if="!dataList.length">
|
|
<template v-if="!dataList.length">
|
|
- <el-row :gutter="20" style="margin: 10px 0">
|
|
|
|
- {{ cusIndex > 0 ? "选择配提机型" : "选择限定机型" }}
|
|
|
|
- {{ "(" + pop + ")" }}
|
|
|
|
- </el-row>
|
|
|
|
- <el-table
|
|
|
|
- v-loading="listLoading"
|
|
|
|
- :data="popDataArr[cusIndex]"
|
|
|
|
- element-loading-text="Loading"
|
|
|
|
- border
|
|
|
|
- fit
|
|
|
|
- highlight-current-row
|
|
|
|
- @select-all="handleSelectionChange"
|
|
|
|
- @selection-change="handleSelectionChange"
|
|
|
|
- stripe
|
|
|
|
- >
|
|
|
|
- <el-table-column
|
|
|
|
- align="center"
|
|
|
|
- type="selection"
|
|
|
|
- :selectable="selectable"
|
|
|
|
- width="55"
|
|
|
|
|
|
+ <div v-for="(item, index) in popDataArr" :key="index">
|
|
|
|
+ <el-table
|
|
|
|
+ v-loading="listLoading"
|
|
|
|
+ :data="item"
|
|
|
|
+ ref="singleTable"
|
|
|
|
+ element-loading-text="Loading"
|
|
|
|
+ border
|
|
|
|
+ fit
|
|
|
|
+ highlight-current-row
|
|
|
|
+ @select-all="handleSelectionChange($event, 1, index)"
|
|
|
|
+ @selection-change="handleSelectionChange($event, 1, index)"
|
|
|
|
+ stripe
|
|
>
|
|
>
|
|
- </el-table-column>
|
|
|
|
- <template v-for="col in columns">
|
|
|
|
<el-table-column
|
|
<el-table-column
|
|
- v-if="col.num"
|
|
|
|
align="center"
|
|
align="center"
|
|
- :label="col.lable"
|
|
|
|
- :prop="col.prop"
|
|
|
|
- :min-width="col.widht"
|
|
|
|
- show-overflow-tooltip
|
|
|
|
|
|
+ type="selection"
|
|
|
|
+ :selectable="selectable"
|
|
|
|
+ width="55"
|
|
>
|
|
>
|
|
- <template slot-scope="scope">
|
|
|
|
- <el-input v-model="scope.row.qty" size="small"></el-input>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column
|
|
|
|
- v-else-if="col.jie"
|
|
|
|
- align="center"
|
|
|
|
- :label="col.lable"
|
|
|
|
- :prop="col.prop"
|
|
|
|
- :min-width="col.widht"
|
|
|
|
- show-overflow-tooltip
|
|
|
|
- >
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- {{ scope.row.qty * scope.row.price || 0 }}
|
|
|
|
- </template>
|
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column
|
|
|
|
- v-else
|
|
|
|
- align="center"
|
|
|
|
- :label="col.lable"
|
|
|
|
- :prop="col.prop"
|
|
|
|
- :min-width="col.widht"
|
|
|
|
- show-overflow-tooltip
|
|
|
|
|
|
+ <template v-for="col in columns">
|
|
|
|
+ <el-table-column
|
|
|
|
+ v-if="col.num"
|
|
|
|
+ align="center"
|
|
|
|
+ :label="col.lable"
|
|
|
|
+ :prop="col.prop"
|
|
|
|
+ :min-width="col.widht"
|
|
|
|
+ show-overflow-tooltip
|
|
|
|
+ >
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-input v-model="scope.row.qty" size="small"></el-input>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ v-else-if="col.jie"
|
|
|
|
+ align="center"
|
|
|
|
+ :label="col.lable"
|
|
|
|
+ :prop="col.prop"
|
|
|
|
+ :min-width="col.widht"
|
|
|
|
+ show-overflow-tooltip
|
|
|
|
+ >
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ {{ scope.row.qty * scope.row.price || 0 }}
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ v-else
|
|
|
|
+ align="center"
|
|
|
|
+ :label="col.lable"
|
|
|
|
+ :prop="col.prop"
|
|
|
|
+ :min-width="col.widht"
|
|
|
|
+ show-overflow-tooltip
|
|
|
|
+ >
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table>
|
|
|
|
+ <div style="margin: 10px 0">
|
|
|
|
+ <el-pagination
|
|
|
|
+ @size-change="
|
|
|
|
+ popfun['handleSizeChange' + (index + 1)]($event, index + 1)
|
|
|
|
+ "
|
|
|
|
+ @current-change="
|
|
|
|
+ popfun['handleCurrentChange' + (index + 1)]($event, index + 1)
|
|
|
|
+ "
|
|
|
|
+ :current-page="popcun['cun' + (index + 1)]"
|
|
|
|
+ :page-sizes="[10]"
|
|
|
|
+ :page-size="10"
|
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
+ :total="poptotal['total' + (index + 1)]"
|
|
>
|
|
>
|
|
- </el-table-column>
|
|
|
|
- </template>
|
|
|
|
- </el-table>
|
|
|
|
- <div style="margin: 10px 0">
|
|
|
|
- <el-pagination
|
|
|
|
- @size-change="handleSizeChange"
|
|
|
|
- @current-change="handleCurrentChange"
|
|
|
|
- :current-page="currentPage"
|
|
|
|
- :page-sizes="[10]"
|
|
|
|
- :page-size="10"
|
|
|
|
- layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
- :total="total"
|
|
|
|
- >
|
|
|
|
- </el-pagination>
|
|
|
|
|
|
+ </el-pagination>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-if="factor.length">
|
|
|
|
+ 引用销售政策说明:{{ factor.length ? factor[0].name : "" }}
|
|
</div>
|
|
</div>
|
|
<span slot="footer" class="dialog-footer">
|
|
<span slot="footer" class="dialog-footer">
|
|
- <el-button type="primary" v-if="cusIndex > 0" @click="handleShang"
|
|
|
|
- >上一步</el-button
|
|
|
|
- >
|
|
|
|
- <el-button
|
|
|
|
- type="primary"
|
|
|
|
- @click="handleCondition"
|
|
|
|
- v-if="popArr.length != cusIndex + 1"
|
|
|
|
- >下一步</el-button
|
|
|
|
- >
|
|
|
|
- <el-button
|
|
|
|
- type="primary"
|
|
|
|
- @click="hanlePopData"
|
|
|
|
- v-if="popArr.length == cusIndex + 1"
|
|
|
|
- >完成</el-button
|
|
|
|
- >
|
|
|
|
|
|
+ <el-button type="primary" @click="hanlePopData">完成</el-button>
|
|
</span>
|
|
</span>
|
|
</template>
|
|
</template>
|
|
<template v-else>
|
|
<template v-else>
|
|
<el-table
|
|
<el-table
|
|
|
|
+ ref="singleTable"
|
|
v-loading="listLoading"
|
|
v-loading="listLoading"
|
|
:data="dataList"
|
|
:data="dataList"
|
|
element-loading-text="Loading"
|
|
element-loading-text="Loading"
|
|
@@ -664,6 +678,7 @@ import {
|
|
} from "@/api/supply/policy";
|
|
} from "@/api/supply/policy";
|
|
import { getDictList } from "@/api/common";
|
|
import { getDictList } from "@/api/common";
|
|
import { findElem } from "@/utils/util";
|
|
import { findElem } from "@/utils/util";
|
|
|
|
+import { async } from "q";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "RetailForm",
|
|
name: "RetailForm",
|
|
@@ -700,6 +715,8 @@ export default {
|
|
policyCode: "",
|
|
policyCode: "",
|
|
policyRemark: "",
|
|
policyRemark: "",
|
|
policyId: "",
|
|
policyId: "",
|
|
|
|
+ k3ServiceId: "",
|
|
|
|
+ k3ServiceName: "",
|
|
},
|
|
},
|
|
// mainFormRules: {
|
|
// mainFormRules: {
|
|
// type: [{ required: true, message: "请选择品类", trigger: "change" }],
|
|
// type: [{ required: true, message: "请选择品类", trigger: "change" }],
|
|
@@ -767,16 +784,22 @@ export default {
|
|
policyId: "",
|
|
policyId: "",
|
|
policyConditionId: "",
|
|
policyConditionId: "",
|
|
multipleSelection: [],
|
|
multipleSelection: [],
|
|
|
|
+ multipleSelections: [],
|
|
multipleData: [],
|
|
multipleData: [],
|
|
disabled: false,
|
|
disabled: false,
|
|
cid: "",
|
|
cid: "",
|
|
- newDataList:[],
|
|
|
|
- userList:[]
|
|
|
|
|
|
+ newDataList: [],
|
|
|
|
+ userList: [],
|
|
|
|
+ fang: false,
|
|
|
|
+ popfun: {},
|
|
|
|
+ poptotal: {},
|
|
|
|
+ popcun: {},
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
|
|
computed: {
|
|
computed: {
|
|
sidebar() {
|
|
sidebar() {
|
|
|
|
+ console.log(11145454);
|
|
return this.$store.state.app.sidebar;
|
|
return this.$store.state.app.sidebar;
|
|
},
|
|
},
|
|
classObj() {
|
|
classObj() {
|
|
@@ -787,7 +810,7 @@ export default {
|
|
},
|
|
},
|
|
comxjWalletList() {
|
|
comxjWalletList() {
|
|
return (c) => {
|
|
return (c) => {
|
|
- console.log(c, "现金钱包");
|
|
|
|
|
|
+ // // consloe(c, "现金钱包");
|
|
const walle = [];
|
|
const walle = [];
|
|
const ovalVall = c == undefined || !c.length ? [] : c;
|
|
const ovalVall = c == undefined || !c.length ? [] : c;
|
|
for (let i = 0; i < this.xjWalletList.length; i++) {
|
|
for (let i = 0; i < this.xjWalletList.length; i++) {
|
|
@@ -830,41 +853,74 @@ export default {
|
|
this.getWalletList();
|
|
this.getWalletList();
|
|
this.getWarehouseList();
|
|
this.getWarehouseList();
|
|
this.getTypeList();
|
|
this.getTypeList();
|
|
- this.getUserList()
|
|
|
|
|
|
+ this.getUserList();
|
|
if (this.listItem) {
|
|
if (this.listItem) {
|
|
this.getDetail();
|
|
this.getDetail();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
beforeUpdate() {},
|
|
beforeUpdate() {},
|
|
methods: {
|
|
methods: {
|
|
- getUserList(){
|
|
|
|
|
|
+ getUserList() {
|
|
getUserList({
|
|
getUserList({
|
|
- pageNum:1,
|
|
|
|
- pageSize:-1,
|
|
|
|
- adminWebsitId:'',
|
|
|
|
- isCustomer:0,
|
|
|
|
- roleId:'',
|
|
|
|
- status:true,
|
|
|
|
- userName:''
|
|
|
|
- }).then(res=>{
|
|
|
|
- this.userList = res.data.records
|
|
|
|
- console.log(this.userList,'122');
|
|
|
|
- })
|
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageSize: -1,
|
|
|
|
+ adminWebsitId: "",
|
|
|
|
+ isCustomer: 0,
|
|
|
|
+ roleId: "",
|
|
|
|
+ status: true,
|
|
|
|
+ userName: "",
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ this.userList = res.data.records;
|
|
|
|
+ // // consloe(this.userList,'122');
|
|
|
|
+ });
|
|
},
|
|
},
|
|
// 返回列表
|
|
// 返回列表
|
|
goBack() {
|
|
goBack() {
|
|
this.$emit("backListFormDetail");
|
|
this.$emit("backListFormDetail");
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+ handleWallets(e, row) {
|
|
|
|
+ const service = row.wallets.filter((k) => {
|
|
|
|
+ return e == k.customerWalletId;
|
|
|
|
+ })[0];
|
|
|
|
+ if (service.serviceId) {
|
|
|
|
+ this.$set(this.mainForm, "k3ServiceId", service.serviceId);
|
|
|
|
+ this.$set(this.mainForm, "k3ServiceName", service.serviceId);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// 选择销售政策获取政策条件列表
|
|
// 选择销售政策获取政策条件列表
|
|
- handlePolicy(e) {
|
|
|
|
- this.factor = [];
|
|
|
|
|
|
+ async handlePolicy(e) {
|
|
|
|
+ this.multipleSelections = [];
|
|
|
|
+ this.dataList = [];
|
|
this.popDataArr = [];
|
|
this.popDataArr = [];
|
|
- this.total = 0;
|
|
|
|
- this.screenForm.factorId = "";
|
|
|
|
- // 选择销售政策PolidcyId改变获取条件列表
|
|
|
|
- getPolicyConditionList({ policyId: e }).then((res) => {
|
|
|
|
- this.factor = res.data;
|
|
|
|
- });
|
|
|
|
|
|
+ this.screenForm.saleTypeCode = "";
|
|
|
|
+ let type = this.policyList.filter((k) => {
|
|
|
|
+ return k.code === e;
|
|
|
|
+ })[0].type;
|
|
|
|
+ if (type == "PROVISION") {
|
|
|
|
+ // PROVISION 配提
|
|
|
|
+ // 选择销售政策PolidcyId改变获取条件列表
|
|
|
|
+ const { data } = await getPolicyConditionList({ policyId: e });
|
|
|
|
+
|
|
|
|
+ this.factor = data;
|
|
|
|
+ this.pop = data[0].pop;
|
|
|
|
+ this.popArr = data[0].pop.split(":");
|
|
|
|
+
|
|
|
|
+ if (this.policyId) {
|
|
|
|
+ this.screenForm.policyId = this.policyId;
|
|
|
|
+ } else {
|
|
|
|
+ this.screenForm.policyId = data[0].policyId;
|
|
|
|
+ this.policyConditionId = data[0].id;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for (let i = 0; i < this.popArr.length; i++) {
|
|
|
|
+ await this.getConditionList(this.policyConditionId, i + 1);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ // LIMIT 限量
|
|
|
|
+
|
|
|
|
+ this.getMaterialTypeList("sProvision");
|
|
|
|
+ }
|
|
},
|
|
},
|
|
hendleEdit(val, index) {
|
|
hendleEdit(val, index) {
|
|
this.dialogVisible = false;
|
|
this.dialogVisible = false;
|
|
@@ -888,7 +944,7 @@ export default {
|
|
const data = this.factor.filter((k) => {
|
|
const data = this.factor.filter((k) => {
|
|
return k.id == e;
|
|
return k.id == e;
|
|
})[0];
|
|
})[0];
|
|
- console.log(data, "kkkk");
|
|
|
|
|
|
+ // // consloe(data, "kkkk");
|
|
this.pop = data.pop;
|
|
this.pop = data.pop;
|
|
this.popArr = data.pop.split(":");
|
|
this.popArr = data.pop.split(":");
|
|
|
|
|
|
@@ -896,52 +952,65 @@ export default {
|
|
this.policyConditionId = data.id;
|
|
this.policyConditionId = data.id;
|
|
},
|
|
},
|
|
//引用销售政策搜索
|
|
//引用销售政策搜索
|
|
- handlePolicyTypeList() {
|
|
|
|
- if (this.screenForm.factorId && this.screenForm.factorId) {
|
|
|
|
- this.getConditionList(this.policyConditionId, this.cusIndex + 1);
|
|
|
|
- this.dataList = []
|
|
|
|
|
|
+ async handlePolicyTypeList() {
|
|
|
|
+ if (this.popArr.length) {
|
|
|
|
+ this.popDataArr = [];
|
|
|
|
+ this.dataList = [];
|
|
|
|
+
|
|
|
|
+ for (let i = 0; i < this.popArr.length; i++) {
|
|
|
|
+ await this.getConditionList(this.policyConditionId, i + 1, true);
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
// sProvision = true
|
|
// sProvision = true
|
|
this.getMaterialTypeList("sProvision");
|
|
this.getMaterialTypeList("sProvision");
|
|
-
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 获取某一个比例下的数据 ,查询popType 当前 this.cusIndex+1
|
|
// 获取某一个比例下的数据 ,查询popType 当前 this.cusIndex+1
|
|
- getConditionList(policyConditionId, popType) {
|
|
|
|
- getConditionList({
|
|
|
|
|
|
+ async getConditionList(policyConditionId, popType, fang) {
|
|
|
|
+ const { data } = await getConditionList({
|
|
pageNum: this.currentPage,
|
|
pageNum: this.currentPage,
|
|
- pageSize: this.pageSize,
|
|
|
|
|
|
+ pageSize: 10,
|
|
policyConditionId,
|
|
policyConditionId,
|
|
popType,
|
|
popType,
|
|
- }).then((res) => {
|
|
|
|
- const datas = res.data.records;
|
|
|
|
- this.total = res.data.total;
|
|
|
|
-
|
|
|
|
- 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;
|
|
|
|
- }
|
|
|
|
|
|
+ });
|
|
|
|
+ if (!fang) {
|
|
|
|
+ this.poptotal["total" + popType] = data.total;
|
|
|
|
+ this.popcun["cun" + popType] = 1;
|
|
|
|
+ this.popfun["handleSizeChange" + popType] = (val, index) => {
|
|
|
|
+ this.popcun["cun" + index] = val;
|
|
|
|
+ this.currentPage = 1;
|
|
|
|
+ this.getConditionList(this.policyConditionId, index, true);
|
|
|
|
+ };
|
|
|
|
+ this.popfun["handleCurrentChange" + popType] = (val, index) => {
|
|
|
|
+ this.popcun["cun" + index] = val;
|
|
|
|
+ this.getConditionList(this.policyConditionId, index, true);
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+ const datas = data.records;
|
|
|
|
+ // this.total = data.total;
|
|
|
|
+ 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;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- for (let i = 0; i < res.data.records.length; i++) {
|
|
|
|
- res.data.records[i].qty = 1;
|
|
|
|
- }
|
|
|
|
- if (this.popDataArr.length) {
|
|
|
|
- this.popDataArr.splice(this.cusIndex, 1);
|
|
|
|
- }
|
|
|
|
- if (this.cusIndex == 0) {
|
|
|
|
- this.popDataArr = [];
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ for (let i = 0; i < data.records.length; i++) {
|
|
|
|
+ data.records[i].qty = 1;
|
|
|
|
+ // this.$set(data.records[i],'userList',this.userList)
|
|
|
|
+ }
|
|
|
|
+ if (fang) {
|
|
|
|
+ this.popDataArr[popType] = datas;
|
|
|
|
+ } else {
|
|
|
|
+ this.popDataArr.push(datas);
|
|
|
|
+ }
|
|
|
|
|
|
- this.popDataArr = [...this.popDataArr, datas];
|
|
|
|
- });
|
|
|
|
|
|
+ // consloe(this.popDataArr);
|
|
},
|
|
},
|
|
// 下一步获取某个政策条件比例数据
|
|
// 下一步获取某个政策条件比例数据
|
|
handleCondition() {
|
|
handleCondition() {
|
|
-
|
|
|
|
if (this.multipleSelection.length) {
|
|
if (this.multipleSelection.length) {
|
|
this.cusIndex += 1;
|
|
this.cusIndex += 1;
|
|
this.disabled = true;
|
|
this.disabled = true;
|
|
@@ -950,18 +1019,15 @@ export default {
|
|
} else {
|
|
} else {
|
|
this.$errorMsg("请选择");
|
|
this.$errorMsg("请选择");
|
|
}
|
|
}
|
|
- console.log(this.cusIndex,'下');
|
|
|
|
|
|
+ // // consloe(this.cusIndex,'下');
|
|
},
|
|
},
|
|
- // 上一步
|
|
|
|
|
|
+ // 上一步
|
|
handleShang() {
|
|
handleShang() {
|
|
-
|
|
|
|
this.cusIndex == 0 ? (this.disabled = false) : "";
|
|
this.cusIndex == 0 ? (this.disabled = false) : "";
|
|
this.multipleData.splice(this.cusIndex, 1);
|
|
this.multipleData.splice(this.cusIndex, 1);
|
|
-
|
|
|
|
- this.popDataArr.splice(this.cusIndex, 1);
|
|
|
|
-
|
|
|
|
|
|
+ this.popDataArr.splice(this.cusIndex, 1);
|
|
this.cusIndex -= 1;
|
|
this.cusIndex -= 1;
|
|
- console.log(this.cusIndex,'上');
|
|
|
|
|
|
+ // // consloe(this.cusIndex,'上');
|
|
},
|
|
},
|
|
/**
|
|
/**
|
|
* 根据条件禁用行复选框
|
|
* 根据条件禁用行复选框
|
|
@@ -979,7 +1045,7 @@ export default {
|
|
// 页面刷新后该函数会执行 N 次进行判断(N 为表格行数)
|
|
// 页面刷新后该函数会执行 N 次进行判断(N 为表格行数)
|
|
// 如果没有返回值则默认返回false(全部无法选中)
|
|
// 如果没有返回值则默认返回false(全部无法选中)
|
|
},
|
|
},
|
|
- /**
|
|
|
|
|
|
+ /**
|
|
* 根据条件禁用行复选框
|
|
* 根据条件禁用行复选框
|
|
* 函数返回值为false则禁用选择(反之亦然)
|
|
* 函数返回值为false则禁用选择(反之亦然)
|
|
* @param {Object} row - 行数据
|
|
* @param {Object} row - 行数据
|
|
@@ -996,17 +1062,19 @@ export default {
|
|
// 如果没有返回值则默认返回false(全部无法选中)
|
|
// 如果没有返回值则默认返回false(全部无法选中)
|
|
},
|
|
},
|
|
|
|
|
|
-
|
|
|
|
// 条件数据多选
|
|
// 条件数据多选
|
|
- handleSelectionChange(val) {
|
|
|
|
- this.multipleSelection = val;
|
|
|
|
- console.log(this.multipleSelection);
|
|
|
|
|
|
+ handleSelectionChange(val, type, index) {
|
|
|
|
+ if (type == 1) {
|
|
|
|
+ this.$set(this.multipleSelections, index, val);
|
|
|
|
+ // consloe(this.multipleSelections);
|
|
|
|
+ } else {
|
|
|
|
+ this.multipleSelection = val;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
hanlePopData() {
|
|
hanlePopData() {
|
|
this.multipleData.push(this.multipleSelection);
|
|
this.multipleData.push(this.multipleSelection);
|
|
if (this.multipleData.length && this.multipleSelection.length) {
|
|
if (this.multipleData.length && this.multipleSelection.length) {
|
|
let arrData = [];
|
|
let arrData = [];
|
|
- console.log(this.multipleData, "datga");
|
|
|
|
for (let i = 0; i < this.multipleData.length; i++) {
|
|
for (let i = 0; i < this.multipleData.length; i++) {
|
|
arrData = [...arrData, ...this.multipleData[i]];
|
|
arrData = [...arrData, ...this.multipleData[i]];
|
|
}
|
|
}
|
|
@@ -1015,22 +1083,60 @@ export default {
|
|
} else {
|
|
} else {
|
|
this.goodsList = arrData;
|
|
this.goodsList = arrData;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (this.dataList.length) {
|
|
|
|
+ for (let u = 0; u < this.goodsList.length; u++) {
|
|
|
|
+ this.goodsList[u].disabled = true;
|
|
|
|
+ }
|
|
|
|
+ this.newDataList = this.multipleSelection;
|
|
|
|
+ this.disabled = true;
|
|
|
|
+ }
|
|
this.goodsList.forEach((item) => {
|
|
this.goodsList.forEach((item) => {
|
|
this.$set(item, "status1", "");
|
|
this.$set(item, "status1", "");
|
|
this.$set(item, "status2", "");
|
|
this.$set(item, "status2", "");
|
|
|
|
+ this.$set(item, "userList", this.userList);
|
|
});
|
|
});
|
|
|
|
+ this.mainForm.k3ServiceName = this.goodsList[0].wallets[0].serviceId;
|
|
|
|
+ this.mainForm.k3ServiceId = this.goodsList[0].wallets[0].serviceId;
|
|
this.cusIndex = 0;
|
|
this.cusIndex = 0;
|
|
this.total = 0;
|
|
this.total = 0;
|
|
this.popDataArr = [];
|
|
this.popDataArr = [];
|
|
- if ( this.dataList.length) {
|
|
|
|
- this.newDataList = this.multipleSelection
|
|
|
|
- this.dataList = []
|
|
|
|
- this.disabled = true
|
|
|
|
|
|
+ this.multipleData = [];
|
|
|
|
+ this.multipleSelection = [];
|
|
|
|
+ this.policyId = this.screenForm.policyId;
|
|
|
|
+ this.isShowDialog = false;
|
|
|
|
+ this.$refs.singleTable.clearSelection();
|
|
|
|
+ // consloe(this.goodsList, "kkkk");
|
|
|
|
+ } else if (this.multipleSelections.length) {
|
|
|
|
+ let arrData = [];
|
|
|
|
+ for (let i = 0; i < this.multipleSelections.length; i++) {
|
|
|
|
+ for (let j = 0; j < this.multipleSelections[i].length; j++) {
|
|
|
|
+ this.multipleSelections[i][j].disabled = true;
|
|
|
|
+ arrData = [...arrData, this.multipleSelections[i][j]];
|
|
|
|
+ }
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ if (this.goodsList.length) {
|
|
|
|
+ this.goodsList = [...this.goodsList, ...arrData];
|
|
|
|
+ } else {
|
|
|
|
+ this.goodsList = arrData;
|
|
|
|
+ }
|
|
|
|
+ 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", "");
|
|
|
|
+ this.$set(item, "status2", "");
|
|
|
|
+ this.$set(item, "userList", this.userList);
|
|
|
|
+ });
|
|
|
|
+ this.disabled = true;
|
|
|
|
+ // this.popDataArr = [];
|
|
this.multipleData = [];
|
|
this.multipleData = [];
|
|
|
|
+ this.multipleSelection = [];
|
|
this.policyId = this.screenForm.policyId;
|
|
this.policyId = this.screenForm.policyId;
|
|
this.isShowDialog = false;
|
|
this.isShowDialog = false;
|
|
|
|
+ this.$refs.singleTable.forEach((k) => {
|
|
|
|
+ k.clearSelection();
|
|
|
|
+ });
|
|
|
|
+ // this.$refs.singleTable.clearSelection();
|
|
} else {
|
|
} else {
|
|
this.$errorMsg("请选择");
|
|
this.$errorMsg("请选择");
|
|
}
|
|
}
|
|
@@ -1042,9 +1148,20 @@ export default {
|
|
this.mainForm.date = data.theTime;
|
|
this.mainForm.date = data.theTime;
|
|
this.mainForm.type = data.mainId;
|
|
this.mainForm.type = data.mainId;
|
|
this.mainForm.remark = data.remark;
|
|
this.mainForm.remark = data.remark;
|
|
|
|
+ this.mainForm.policyId = data.policyId;
|
|
|
|
+ this.mainForm.k3ServiceName = data.k3ServiceId;
|
|
|
|
+ this.mainForm.k3ServiceId = data.k3ServiceId;
|
|
data.retailOrderItemList.forEach((item) => {
|
|
data.retailOrderItemList.forEach((item) => {
|
|
item.status1 = "";
|
|
item.status1 = "";
|
|
item.status2 = "";
|
|
item.status2 = "";
|
|
|
|
+ item.wallets.forEach((k) => {
|
|
|
|
+ if (k.customerWalletId === data.customerWalletId) {
|
|
|
|
+ this.$set(item, "serviceId", k.serviceId);
|
|
|
|
+ this.$set(item, "serviceName", k.serviceId);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ this.$set(item, "userList", this.userList);
|
|
});
|
|
});
|
|
this.goodsList = data.retailOrderItemList;
|
|
this.goodsList = data.retailOrderItemList;
|
|
});
|
|
});
|
|
@@ -1057,9 +1174,10 @@ export default {
|
|
status: true,
|
|
status: true,
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
this.screenForm.policyId = res.data.records[0].code;
|
|
this.screenForm.policyId = res.data.records[0].code;
|
|
- this.handlePolicy(this.screenForm.policyId);
|
|
|
|
this.policyList = res.data.records;
|
|
this.policyList = res.data.records;
|
|
- console.log(this.policyList, "policyList");
|
|
|
|
|
|
+ if (this.policyList.length) {
|
|
|
|
+ this.handlePolicy(this.screenForm.policyId);
|
|
|
|
+ }
|
|
});
|
|
});
|
|
},
|
|
},
|
|
// 获取销售类型
|
|
// 获取销售类型
|
|
@@ -1073,7 +1191,7 @@ export default {
|
|
};
|
|
};
|
|
typeList(params).then((res) => {
|
|
typeList(params).then((res) => {
|
|
this.ztypeList = res.data.records;
|
|
this.ztypeList = res.data.records;
|
|
- console.log(this.ztypeList, "type1111");
|
|
|
|
|
|
+ // // consloe(this.ztypeList, "type1111");
|
|
});
|
|
});
|
|
},
|
|
},
|
|
// 获取仓库列表
|
|
// 获取仓库列表
|
|
@@ -1095,10 +1213,11 @@ export default {
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
for (let i = 0; i < res.data.records.length; i++) {
|
|
for (let i = 0; i < res.data.records.length; i++) {
|
|
res.data.records[i].qty = 1;
|
|
res.data.records[i].qty = 1;
|
|
|
|
+ data.records[i].userList = this.userList;
|
|
}
|
|
}
|
|
|
|
+
|
|
this.dataList = res.data.records;
|
|
this.dataList = res.data.records;
|
|
this.total = res.data.total;
|
|
this.total = res.data.total;
|
|
- console.log(this.dataList, "kkkk");
|
|
|
|
});
|
|
});
|
|
},
|
|
},
|
|
// 获取政策列表
|
|
// 获取政策列表
|
|
@@ -1112,25 +1231,25 @@ export default {
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
for (let i = 0; i < res.data.records.length; i++) {
|
|
for (let i = 0; i < res.data.records.length; i++) {
|
|
res.data.records[i].qty = 1;
|
|
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;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ 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.dataList = res.data.records;
|
|
this.total = res.data.total;
|
|
this.total = res.data.total;
|
|
- console.log(this.dataList, "kkkk");
|
|
|
|
|
|
+ this.popDataArr = [];
|
|
|
|
+ this.popArr = [];
|
|
|
|
+ // // consloe(this.dataList, "kkkk");
|
|
});
|
|
});
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+ // 打开引用
|
|
handleShow() {
|
|
handleShow() {
|
|
this.isShowDialog = true;
|
|
this.isShowDialog = true;
|
|
- if (!this.goodsList.length) {
|
|
|
|
- this.getPolicyList();
|
|
|
|
|
|
+ if (!this.dataList.length) {
|
|
|
|
+ this.getPolicyList();
|
|
}
|
|
}
|
|
-
|
|
|
|
},
|
|
},
|
|
// 获取钱包列表
|
|
// 获取钱包列表
|
|
getWalletList() {
|
|
getWalletList() {
|
|
@@ -1242,6 +1361,7 @@ export default {
|
|
// 关闭 弹窗
|
|
// 关闭 弹窗
|
|
closeDialog() {
|
|
closeDialog() {
|
|
this.isShowDialog = false;
|
|
this.isShowDialog = false;
|
|
|
|
+ this.popDataArr = [];
|
|
},
|
|
},
|
|
|
|
|
|
// 删除
|
|
// 删除
|
|
@@ -1300,22 +1420,20 @@ export default {
|
|
this.getConditionList(this.policyConditionId, this.cusIndex + 1);
|
|
this.getConditionList(this.policyConditionId, this.cusIndex + 1);
|
|
},
|
|
},
|
|
handleClose() {
|
|
handleClose() {
|
|
- this.cusIndex = 0;
|
|
|
|
- this.radio = "";
|
|
|
|
- this.dataList = [];
|
|
|
|
- this.popDataArr = [];
|
|
|
|
|
|
+ // this.dataList = [];
|
|
|
|
+ // this.popDataArr = [];
|
|
// this.screenForm.policyId = "";
|
|
// this.screenForm.policyId = "";
|
|
// this.screenForm.saleTypeCode = "";
|
|
// this.screenForm.saleTypeCode = "";
|
|
},
|
|
},
|
|
// 删除产品
|
|
// 删除产品
|
|
- deleteItem(index,id) {
|
|
|
|
|
|
+ deleteItem(index, id) {
|
|
this.goodsList.splice(index, 1);
|
|
this.goodsList.splice(index, 1);
|
|
// this.dataList
|
|
// this.dataList
|
|
if (this.newDataList.length) {
|
|
if (this.newDataList.length) {
|
|
- this.newDataList.splice(index, 1);
|
|
|
|
|
|
+ this.newDataList.splice(index, 1);
|
|
}
|
|
}
|
|
if (!this.goodsList.length) {
|
|
if (!this.goodsList.length) {
|
|
- this.disabled = false
|
|
|
|
|
|
+ this.disabled = false;
|
|
}
|
|
}
|
|
|
|
|
|
// this.popDataArr.splice(index,1)
|
|
// this.popDataArr.splice(index,1)
|
|
@@ -1352,7 +1470,7 @@ export default {
|
|
this.goodsList.forEach((item, index) => {
|
|
this.goodsList.forEach((item, index) => {
|
|
item.status1 = res.data[index].allStockNum;
|
|
item.status1 = res.data[index].allStockNum;
|
|
item.status2 = res.data[index].stockNum;
|
|
item.status2 = res.data[index].stockNum;
|
|
- console.log(item.status1, item.status2);
|
|
|
|
|
|
+ // // consloe(item.status1, item.status2);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|