|
@@ -125,11 +125,16 @@
|
|
:file-list="importFileList"
|
|
:file-list="importFileList"
|
|
:show-file-list="false"
|
|
:show-file-list="false"
|
|
>
|
|
>
|
|
- <el-button size="small">导入货品价格表</el-button>
|
|
|
|
|
|
+ <el-button type="primary" size="small"
|
|
|
|
+ >导入货品价格表</el-button
|
|
|
|
+ >
|
|
</el-upload>
|
|
</el-upload>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
- <el-button size="small" @click="hanleDownloadFiles"
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ size="small"
|
|
|
|
+ @click="hanleDownloadFiles"
|
|
>下载模板</el-button
|
|
>下载模板</el-button
|
|
>
|
|
>
|
|
</el-col>
|
|
</el-col>
|
|
@@ -157,6 +162,20 @@
|
|
label="货品编码"
|
|
label="货品编码"
|
|
align="center"
|
|
align="center"
|
|
>
|
|
>
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-select
|
|
|
|
+ size="small"
|
|
|
|
+ v-model="scope.row.materialNumber"
|
|
|
|
+ @change="handleK3List($event,scope.row)"
|
|
|
|
+ filterable
|
|
|
|
+ >
|
|
|
|
+ <el-option v-for="item in k3List"
|
|
|
|
+ :key="item.id"
|
|
|
|
+ :label="item.number"
|
|
|
|
+ :value="item.id">
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
prop="materialName"
|
|
prop="materialName"
|
|
@@ -169,32 +188,100 @@
|
|
label="规格型号"
|
|
label="规格型号"
|
|
align="center"
|
|
align="center"
|
|
>
|
|
>
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-select
|
|
|
|
+ size="small"
|
|
|
|
+ v-model="scope.row.specification"
|
|
|
|
+ @change="handleK3List($event,scope.row)"
|
|
|
|
+ filterable
|
|
|
|
+ >
|
|
|
|
+ <el-option v-for="item in k3List"
|
|
|
|
+ :key="item.id"
|
|
|
|
+ :label="item.specification"
|
|
|
|
+ :value="item.id">
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
- prop="saleTypeCode"
|
|
|
|
- label="销售类型编码"
|
|
|
|
|
|
+ prop="saleTypeName"
|
|
|
|
+ label="销售类型"
|
|
align="center"
|
|
align="center"
|
|
>
|
|
>
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-select
|
|
|
|
+ size="small"
|
|
|
|
+ v-model="scope.row.saleTypeId"
|
|
|
|
+ @change="handleSalesType($event, scope.row)"
|
|
|
|
+ filterable
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in typeList"
|
|
|
|
+ :key="item.id"
|
|
|
|
+ :label="item.saleName"
|
|
|
|
+ :value="item.id"
|
|
|
|
+ >
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
- prop="saleTypeName"
|
|
|
|
- label="销售类型"
|
|
|
|
|
|
+ prop="saleTypeCode"
|
|
|
|
+ label="销售类型编码"
|
|
align="center"
|
|
align="center"
|
|
>
|
|
>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
+
|
|
<el-table-column prop="discAmount" label="格力折扣" align="center">
|
|
<el-table-column prop="discAmount" label="格力折扣" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-input
|
|
|
|
+ type="number"
|
|
|
|
+ v-model.number="scope.row.discAmount"
|
|
|
|
+ placeholder="请输入格力折扣"
|
|
|
|
+ size="small"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="price" label="单价" align="center">
|
|
<el-table-column prop="price" label="单价" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-input
|
|
|
|
+ type="number"
|
|
|
|
+ v-model.number="scope.row.price"
|
|
|
|
+ placeholder="请输入单价"
|
|
|
|
+ size="small"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="支付钱包" align="center">
|
|
<el-table-column label="支付钱包" align="center">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-tag
|
|
|
|
|
|
+ <el-select
|
|
|
|
+ size="small"
|
|
|
|
+ multiple
|
|
|
|
+ v-model="scope.row.walletIds"
|
|
|
|
+ filterable
|
|
|
|
+ >
|
|
|
|
+ <el-option v-for="item in NoRebateWalletList"
|
|
|
|
+ :key="item.id"
|
|
|
|
+ :label="item.name"
|
|
|
|
+ :value="item.id">
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ <!-- <el-tag
|
|
style="margin: 5px"
|
|
style="margin: 5px"
|
|
type="success"
|
|
type="success"
|
|
size="small"
|
|
size="small"
|
|
v-for="item in scope.row.walletRelaList"
|
|
v-for="item in scope.row.walletRelaList"
|
|
>{{ item.walletName }}</el-tag
|
|
>{{ item.walletName }}</el-tag
|
|
- >
|
|
|
|
|
|
+ > -->
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="remark" label="备注" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="scope.row.remark"
|
|
|
|
+ placeholder="备注"
|
|
|
|
+ size="small"
|
|
|
|
+ ></el-input>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column fixed="right" label="操作" align="center">
|
|
<el-table-column fixed="right" label="操作" align="center">
|
|
@@ -205,7 +292,7 @@
|
|
icon="el-icon-info"
|
|
icon="el-icon-info"
|
|
icon-color="red"
|
|
icon-color="red"
|
|
title="内容确定删除吗?"
|
|
title="内容确定删除吗?"
|
|
- @onConfirm="hanleDelete(scope.row.id)"
|
|
|
|
|
|
+ @onConfirm="hanleDelete(scope.row.id, scope.$index)"
|
|
>
|
|
>
|
|
<el-button
|
|
<el-button
|
|
slot="reference"
|
|
slot="reference"
|
|
@@ -218,7 +305,20 @@
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
<!-- 分页 -->
|
|
<!-- 分页 -->
|
|
- <div style="margin: 20px">
|
|
|
|
|
|
+ <div
|
|
|
|
+ style="
|
|
|
|
+ margin: 20px 20px 20px 0;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ "
|
|
|
|
+ >
|
|
|
|
+ <div>
|
|
|
|
+ <el-button type="primary" size="small" @click="handleNewInfo"
|
|
|
|
+ >添加</el-button
|
|
|
|
+ > <el-button type="primary" size="small" @click="handleSave"
|
|
|
|
+ >保存</el-button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
<el-pagination
|
|
<el-pagination
|
|
@size-change="handleSizeChange"
|
|
@size-change="handleSizeChange"
|
|
@current-change="handleCurrentChange"
|
|
@current-change="handleCurrentChange"
|
|
@@ -230,6 +330,7 @@
|
|
>
|
|
>
|
|
</el-pagination>
|
|
</el-pagination>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
<el-row>
|
|
<el-row>
|
|
<el-divider></el-divider>
|
|
<el-divider></el-divider>
|
|
<el-row type="flex">
|
|
<el-row type="flex">
|
|
@@ -237,7 +338,7 @@
|
|
<h4 style="display: inline-block; margin-right: 20px">
|
|
<h4 style="display: inline-block; margin-right: 20px">
|
|
条件信息
|
|
条件信息
|
|
</h4>
|
|
</h4>
|
|
- <el-button size="small" @click="isCondition = 1"
|
|
|
|
|
|
+ <el-button type="primary" size="small" @click="isCondition = 1"
|
|
>添加</el-button
|
|
>添加</el-button
|
|
></el-col
|
|
></el-col
|
|
>
|
|
>
|
|
@@ -265,7 +366,7 @@
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-input
|
|
<el-input
|
|
v-model="scope.row.name"
|
|
v-model="scope.row.name"
|
|
- style="text-align:center"
|
|
|
|
|
|
+ style="text-align: center"
|
|
placeholder="请输入名称"
|
|
placeholder="请输入名称"
|
|
:disabled="scope.row.fang"
|
|
:disabled="scope.row.fang"
|
|
@blur="handleConditionName(scope.row)"
|
|
@blur="handleConditionName(scope.row)"
|
|
@@ -321,19 +422,23 @@ import { mapGetters, mapMutations } from "vuex";
|
|
import Minxin from "@/mixin";
|
|
import Minxin from "@/mixin";
|
|
import {
|
|
import {
|
|
addPoliy,
|
|
addPoliy,
|
|
|
|
+ getK3List,
|
|
|
|
+ savePolicy,
|
|
getTypeList,
|
|
getTypeList,
|
|
getWalletList,
|
|
getWalletList,
|
|
|
|
+ updateCondition,
|
|
getMaterialList,
|
|
getMaterialList,
|
|
deleteCondition,
|
|
deleteCondition,
|
|
getConditionList,
|
|
getConditionList,
|
|
deleteMaterialPolicy,
|
|
deleteMaterialPolicy,
|
|
- updateCondition,
|
|
|
|
|
|
+ getNoRebateWalletList,
|
|
} from "@/api/policy_list";
|
|
} from "@/api/policy_list";
|
|
import { getDictList } from "@/api/common";
|
|
import { getDictList } from "@/api/common";
|
|
import { downloadFiles, handleImport } from "@/utils/util";
|
|
import { downloadFiles, handleImport } from "@/utils/util";
|
|
import Transfer from "./Transfer";
|
|
import Transfer from "./Transfer";
|
|
import AddCondition from "./AddCondition";
|
|
import AddCondition from "./AddCondition";
|
|
import ImageUpload from "@/components/Common/image-upload.vue";
|
|
import ImageUpload from "@/components/Common/image-upload.vue";
|
|
|
|
+import { type } from "os";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
mixins: [Minxin],
|
|
mixins: [Minxin],
|
|
@@ -354,8 +459,10 @@ export default {
|
|
mainName: "",
|
|
mainName: "",
|
|
type: "",
|
|
type: "",
|
|
},
|
|
},
|
|
|
|
+ dataList: [],
|
|
|
|
+ addList:[],
|
|
listLoading: false,
|
|
listLoading: false,
|
|
-
|
|
|
|
|
|
+ dialogVisible: false,
|
|
importFileList: [],
|
|
importFileList: [],
|
|
fileList: [],
|
|
fileList: [],
|
|
options: {},
|
|
options: {},
|
|
@@ -374,6 +481,8 @@ export default {
|
|
],
|
|
],
|
|
conditionList: [],
|
|
conditionList: [],
|
|
dictList: [],
|
|
dictList: [],
|
|
|
|
+ k3List:[],
|
|
|
|
+ NoRebateWalletList:[],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -414,34 +523,39 @@ export default {
|
|
},
|
|
},
|
|
getCommonApi() {
|
|
getCommonApi() {
|
|
// this.handletwoList()
|
|
// this.handletwoList()
|
|
- const params = {
|
|
|
|
- pageNum: 1,
|
|
|
|
- pageSize: 10,
|
|
|
|
- saleCode: "",
|
|
|
|
- saleName: "",
|
|
|
|
- status: "",
|
|
|
|
- };
|
|
|
|
- const walletParams = {
|
|
|
|
- pageNum: 1,
|
|
|
|
- pageSize: 10,
|
|
|
|
- mainName: "",
|
|
|
|
- saleTypeCode: "",
|
|
|
|
- saleTypeName: "",
|
|
|
|
- status: "",
|
|
|
|
- };
|
|
|
|
- // 获取销售类型列表
|
|
|
|
- getTypeList(params).then((res) => {
|
|
|
|
- this.typeList = res.data.records;
|
|
|
|
- console.log(this.typeList, "type");
|
|
|
|
- });
|
|
|
|
- // 获取钱包列表
|
|
|
|
- getWalletList(walletParams).then((res) => {
|
|
|
|
- this.walletList = res.data.records;
|
|
|
|
- });
|
|
|
|
- getDictList({ sysDictEnum: "PRODUCT_TYPE" }).then((res) => {
|
|
|
|
- this.dictList = res.data;
|
|
|
|
- });
|
|
|
|
|
|
+ // const params = {
|
|
|
|
+ // pageNum: 1,
|
|
|
|
+ // pageSize: 10,
|
|
|
|
+ // saleCode: "",
|
|
|
|
+ // saleName: "",
|
|
|
|
+ // status: "",
|
|
|
|
+ // };
|
|
|
|
+ // const walletParams = {
|
|
|
|
+ // pageNum: 1,
|
|
|
|
+ // pageSize: 10,
|
|
|
|
+ // mainName: "",
|
|
|
|
+ // saleTypeCode: "",
|
|
|
|
+ // saleTypeName: "",
|
|
|
|
+ // status: "",
|
|
|
|
+ // };
|
|
|
|
+ // // 获取钱包列表
|
|
|
|
+ // getWalletList(walletParams).then((res) => {
|
|
|
|
+ // this.walletList = res.data.records;
|
|
|
|
+ // });
|
|
|
|
+ // getDictList({ sysDictEnum: "PRODUCT_TYPE" }).then((res) => {
|
|
|
|
+ // this.dictList = res.data;
|
|
|
|
+ // });
|
|
|
|
+ },
|
|
|
|
+ handleSalesType(e, row) {
|
|
|
|
+ const item = this.typeList.filter((k) => {
|
|
|
|
+ return k.id == e;
|
|
|
|
+ })[0];
|
|
|
|
+
|
|
|
|
+ this.$set(row, "saleTypeCode", item.saleCode);
|
|
|
|
+ this.$set(row,'saleTypeName',item.saleName)
|
|
|
|
+ // this.$set(row,'saleTypeId',item.id)
|
|
},
|
|
},
|
|
|
|
+ //修改条件名称
|
|
handleConditionName(row) {
|
|
handleConditionName(row) {
|
|
console.log(row.name);
|
|
console.log(row.name);
|
|
updateCondition({ id: row.id, name: row.name }).then((res) => {
|
|
updateCondition({ id: row.id, name: row.name }).then((res) => {
|
|
@@ -449,6 +563,7 @@ export default {
|
|
row.fang = true;
|
|
row.fang = true;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ //提交信息
|
|
handleSubmitCon() {
|
|
handleSubmitCon() {
|
|
const params = {
|
|
const params = {
|
|
policyId: this.comCode,
|
|
policyId: this.comCode,
|
|
@@ -461,6 +576,7 @@ export default {
|
|
this.conditionList = res.data;
|
|
this.conditionList = res.data;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ // 视图部分已注释,废弃的功能 fucn
|
|
handelStop() {
|
|
handelStop() {
|
|
if (this.searchForm.mainId) {
|
|
if (this.searchForm.mainId) {
|
|
this.fang = true;
|
|
this.fang = true;
|
|
@@ -499,18 +615,27 @@ export default {
|
|
// 获取货品信息
|
|
// 获取货品信息
|
|
handletwoList() {
|
|
handletwoList() {
|
|
// this.searchForm.type
|
|
// this.searchForm.type
|
|
-
|
|
|
|
const paramss = {
|
|
const paramss = {
|
|
pageNum: this.currentPage,
|
|
pageNum: this.currentPage,
|
|
pageSize: this.pageSize,
|
|
pageSize: this.pageSize,
|
|
policyId: this.comCode,
|
|
policyId: this.comCode,
|
|
saleTypeCode: "",
|
|
saleTypeCode: "",
|
|
};
|
|
};
|
|
- console.log(45454);
|
|
|
|
|
|
+
|
|
getMaterialList(paramss)
|
|
getMaterialList(paramss)
|
|
.then((result) => {
|
|
.then((result) => {
|
|
- this.dataList = result.data.records;
|
|
|
|
|
|
+ result.data.records.forEach(k=>{
|
|
|
|
+ k.walletIds = []
|
|
|
|
+ k.materialNumber = k.materialId
|
|
|
|
+ k.specification = k.materialId
|
|
|
|
+ k.walletRelaList.forEach(l=>{
|
|
|
|
+ l.id = l.walletId
|
|
|
|
+ l.name = l.walletName
|
|
|
|
+ k.walletIds = [...k.walletIds,l.walletId]
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
|
|
|
|
+ this.dataList = [...this.dataList,...result.data.records];
|
|
this.listTotal = result.data.total;
|
|
this.listTotal = result.data.total;
|
|
})
|
|
})
|
|
.catch((err) => {
|
|
.catch((err) => {
|
|
@@ -568,7 +693,7 @@ export default {
|
|
title: "",
|
|
title: "",
|
|
type: "",
|
|
type: "",
|
|
...this.searchForm,
|
|
...this.searchForm,
|
|
- imgSrc: this.fileList.length ? this.fileList[0].url : ""
|
|
|
|
|
|
+ imgSrc: this.fileList.length ? this.fileList[0].url : "",
|
|
};
|
|
};
|
|
console.log(this.fileList);
|
|
console.log(this.fileList);
|
|
addPoliy(params).then((res) => {
|
|
addPoliy(params).then((res) => {
|
|
@@ -583,13 +708,105 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//删除
|
|
//删除
|
|
- hanleDelete(id) {
|
|
|
|
- const params = { policyMaterialId: id };
|
|
|
|
- deleteMaterialPolicy(params).then((res) => {
|
|
|
|
- this.$successMsg("删除成功");
|
|
|
|
- this.handletwoList();
|
|
|
|
|
|
+ hanleDelete(id, index) {
|
|
|
|
+ if (id) {
|
|
|
|
+ const params = { policyMaterialId: id };
|
|
|
|
+ deleteMaterialPolicy(params).then((res) => {
|
|
|
|
+ this.$successMsg("删除成功");
|
|
|
|
+ this.handletwoList();
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ this.dataList.splice(index, 1);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ handleNewInfo() {
|
|
|
|
+ // 物料列表
|
|
|
|
+ getK3List({
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageSize:10,
|
|
|
|
+ keyword: '',
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ this.k3List = res.data.records
|
|
|
|
+ });
|
|
|
|
+ // 非返利钱包
|
|
|
|
+ getNoRebateWalletList({ walletName: "" }).then((res) => {
|
|
|
|
+ this.NoRebateWalletList = res.data;
|
|
|
|
+ });
|
|
|
|
+ const params = {
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageSize: -1,
|
|
|
|
+ saleCode: "",
|
|
|
|
+ saleName: "",
|
|
|
|
+ status: "",
|
|
|
|
+ };
|
|
|
|
+ // 获取销售类型列表
|
|
|
|
+ getTypeList(params).then((res) => {
|
|
|
|
+ this.typeList = res.data.records;
|
|
|
|
+ });
|
|
|
|
+ this.dataList.push({
|
|
|
|
+ id:'',
|
|
|
|
+ discAmount: "",
|
|
|
|
+ materialId: "",
|
|
|
|
+ materialName: "",
|
|
|
|
+ materialNumber: "",
|
|
|
|
+ policyId: this.comCode,
|
|
|
|
+ price: "",
|
|
|
|
+ remark: "",
|
|
|
|
+ saleTypeCode: "",
|
|
|
|
+ saleTypeId: "",
|
|
|
|
+ saleTypeName: "",
|
|
|
|
+ specification: "",
|
|
|
|
+ walletIds: "",
|
|
|
|
+ walletRelaList: [],
|
|
});
|
|
});
|
|
|
|
+ // this.dataList.push(this.addList[this.addList.length-1])
|
|
|
|
+ },
|
|
|
|
+ handleSave(){
|
|
|
|
+ this.dataList.forEach(k=>{
|
|
|
|
+ if (!k.materialId) {
|
|
|
|
+ this.$errorMsg('请选择货品')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (!k.saleTypeId) {
|
|
|
|
+ this.$errorMsg('请选择销售类型')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (!k.discAmount) {
|
|
|
|
+ this.$errorMsg('请输入格力折扣')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (!k.price) {
|
|
|
|
+ this.$errorMsg('请输入单价')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (!k.walletIds.length) {
|
|
|
|
+ this.$errorMsg('请选择钱包')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if ( typeof k.walletIds == 'object') {
|
|
|
|
+ console.log(44444);
|
|
|
|
+ k.walletIds = k.walletIds.join(',')
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ savePolicy(
|
|
|
|
+ this.dataList
|
|
|
|
+ ).then(res=>{
|
|
|
|
+ this.dataList = []
|
|
|
|
+ this.$successMsg('保存成功')
|
|
|
|
+ this.handletwoList()
|
|
|
|
+ })
|
|
},
|
|
},
|
|
|
|
+ handleK3List(e,row){
|
|
|
|
+ const item = this.k3List.filter(k=>{
|
|
|
|
+ return k.id ==e
|
|
|
|
+ })[0]
|
|
|
|
+ // this.$set(row,'materialNumber',item.number)
|
|
|
|
+ this.$set(row,'materialName',item.name)
|
|
|
|
+ this.$set(row,'specification',item.specification)
|
|
|
|
+ this.$set(row,'materialId',item.id)
|
|
|
|
+ }
|
|
},
|
|
},
|
|
components: {
|
|
components: {
|
|
Transfer,
|
|
Transfer,
|