Bladeren bron

销售政策货品添加 。。。

howie 3 jaren geleden
bovenliggende
commit
ecf76c6630

+ 45 - 0
src/api/policy_list.js

@@ -34,6 +34,37 @@ export function getConditionList(params) {
   });
 }
 
+
+//物料列表
+export function getK3List(params) {
+  return request({
+    url: '/k3/material/list',
+    method: 'get',
+    params
+  })
+}
+
+
+// 现金钱包(非返利钱包)
+export function getNoRebateWalletList(params) {
+  return request({
+    url: "/wallet/list",
+    method: "get",
+    params,
+  });
+}
+
+
+//政策货品-保存(不传id新增,传id修改)
+export function savePolicy(params) {
+  return request({
+    url: "/policy/material/save",
+    method: "post",
+    data: params,
+  });
+}
+
+
 export function updatePolicy(params) {
   return request({
     url: "/policy/update",
@@ -274,6 +305,16 @@ export function getProductList(params) {
   });
 }
 
+//政策-作废
+export function cancelPolicy(params) {
+  return request({
+    url: "/policy/cancel",
+    method: "post",
+    params,
+  });
+}
+
+
 //获取轮播图列表
 export function getImgCarouseList(params) {
   return request({
@@ -360,6 +401,8 @@ export function getWalletRebateSaletypeDetail(params) {
     params,
   });
 }
+
+
 //返利钱包列表
 export function getWalletRebateList(params) {
   return request({
@@ -384,3 +427,5 @@ export function getWalletRebateSaletypeUpdate(data) {
     data,
   });
 }
+
+

+ 73 - 30
src/views/basic_data/material/components/modify_list-apply.vue

@@ -75,6 +75,15 @@
         </el-row>
       </el-form>
     </div>
+    <!-- <div class="btn-group clearfix"> <el-upload
+                    class="import-btn"
+                    :action="baseURL + 'student/import'"
+                    :http-request="handleImport"
+                    :file-list="importFileList"
+                    :show-file-list="false"
+                  >
+                    <el-button size="small">导入价格表</el-button>
+                  </el-upload></div> -->
     <div class="mymain-container">
       <!-- 列表 -->
       <div class="table">
@@ -734,8 +743,15 @@
                 ></el-input>
               </el-form-item>
             </el-col>
-
-            <el-col :xs="24" :sm="12" :lg="18" class="tr">
+       <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="规格" prop="specification">
+                <el-input
+                  placeholder="请输入规格"
+                  v-model="screenForm.specification"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="12" class="tr">
               <el-form-item label="">
                 <el-button size="small" @click="resetScreenForm"
                   >清空</el-button
@@ -869,6 +885,7 @@ import {
   getWalletList,
   handleEdit,
 } from "@/api/basic_data/material";
+import {  handleImport } from "@/utils/util";
 
 import MaterialListDetail from "./material_list-detail.vue";
 import Mixin from "@/mixin/index";
@@ -877,8 +894,13 @@ export default {
   props: ["cid"],
   data() {
     return {
+      baseURL:'',
+      importFileList:[],
       listLoading: false,
-      screenForm: {},
+      screenForm: {
+          keyword:'',
+        specification:''
+      },
       base: {
         adminCompanyId: "",
         adminWebsitId: "",
@@ -910,9 +932,7 @@ export default {
       startDate: "",
       userList: [],
       centerDialogVisible: false,
-      screenForm: {
-        keyword: "",
-      },
+
       selectData: [],
       walleList: [],
       fang: true,
@@ -921,30 +941,7 @@ export default {
     };
   },
   mounted() {
-    let params = {
-      pageNum: 1,
-      pageSize: -1,
-      saleCode: "",
-      saleName: "",
-      status: "",
-    };
-    getTypeList(params).then((res) => {
-      this.typeList = res.data.records;
-    });
-    getUserList({
-      pageNum: 1,
-      pageSize: -1,
-      adminWebsitId: "",
-      isCustomer: 0,
-      roleId: "",
-      status: "",
-      userName: "",
-    }).then((res) => {
-      this.userList = res.data.records;
-    });
-    // getWalletList({ mainId: "", walletName: "" }).then((res) => {
-    //   this.walleList = res.data;
-    // });
+
   },
   methods: {
     handleSale(e, index, saleTypes) {
@@ -1267,6 +1264,7 @@ export default {
           pageNum: this.currentPage,
           pageSize: 10 || this.pageSize,
           keyword: this.screenForm.keyword,
+          specification: this.screenForm.specification,
           bindMain: true,
         };
         getMaterialList(params).then((res) => {
@@ -1274,6 +1272,28 @@ export default {
           this.listTotal = res.data.total;
           this.listLoading = false;
         });
+          let params1 = {
+      pageNum: 1,
+      pageSize: -1,
+      saleCode: "",
+      saleName: "",
+      status: "",
+    };
+    getTypeList(params1).then((res) => {
+      this.typeList = res.data.records;
+    });
+    getUserList({
+      pageNum: 1,
+      pageSize: -1,
+      adminWebsitId: "",
+      isCustomer: 0,
+      roleId: "",
+      status: "",
+      userName: "",
+    }).then((res) => {
+      this.userList = res.data.records;
+    });
+
       }
     },
     /**
@@ -1367,6 +1387,29 @@ export default {
       this.saleTypeId = "";
       this.items = [];
     },
+      // 导入
+    async handleImport(param) {
+      this.importLoading = true;
+      const file = param.file;
+      console.log(file, 123);
+      const formData = new FormData();
+      formData.append("file", file);
+      // formData.append("policyId", this.searchForm.code);
+      // formData.append("mainId", this.searchForm.mainId);
+      let result = await handleImport("/policy/material/import", formData);
+      this.importLoading = false;
+      this.importFileList = [];
+      if (result.code == 200) {
+        this.$alert(result.message, "导入成功", {
+          confirmButtonText: "确定",
+        });
+        this.handletwoList();
+      } else {
+        this.$alert(result.message, "导入失败", {
+          confirmButtonText: "确定",
+        });
+      }
+    },
   },
 };
 </script>

+ 7 - 6
src/views/engin_deposit/components/deposit_list-detail.vue

@@ -243,18 +243,19 @@
           <el-col :xs="12" :sm="12" :lg="12" class="item">
             <div class="label" >是否退押</div>
             <div class="value">
-
-              <template v-if="!(details.examineStatus =='WAIT' || details.examineStatus == 'SAVE' )">
+              <template v-if="!(details.examineStatus =='WAIT' || details.examineStatus == 'SAVE'  || details.examineStatus =='CLOSE')">
                 {{ details.isRefundDeposit == true ? "是" : "否" }}
                 </template>
-
             </div>
 
           </el-col>
           <el-col :xs="12" :sm="12" :lg="12" class="item">
             <div class="label">审批结果</div>
-            <div class="value">
-              {{ details.examineResult == 0 ? "驳回" : "通过" }}
+            <div class="value" v-if="details.examineStatus =='Ok'">
+              通过
+            </div>
+            <div class="value" v-if="details.confirmName && details.examineStatus =='SAVE'">
+              驳回
             </div>
           </el-col>
           <el-col :xs="24" :sm="24" :lg="24" class="item">
@@ -393,7 +394,7 @@
             <el-table-column
               align="center"
               label="数量"
-              prop="qty"
+              prop="refundableQty"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>

+ 4 - 3
src/views/engin_deposit/deposit_list.vue

@@ -116,7 +116,7 @@
             <el-table-column
               align="center"
               label="工程登录编码"
-              prop="refProjectNo"
+              prop="refEnginRecordNo"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
@@ -226,17 +226,18 @@
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
-            <el-table-column
+            <!-- <el-table-column
               align="center"
               label="是否已发货"
               prop=""
               min-width="160"
               show-overflow-tooltip
-            ></el-table-column>
+            ></el-table-column> -->
             <el-table-column
               align="center"
               label="操作"
               min-width="160"
+               fixed="right"
               show-overflow-tooltip
             >
               <template slot-scope="scope">

+ 267 - 50
src/views/sales_policy/components/AddPolicy.vue

@@ -125,11 +125,16 @@
                     :file-list="importFileList"
                     :show-file-list="false"
                   >
-                    <el-button size="small">导入货品价格表</el-button>
+                    <el-button type="primary" size="small"
+                      >导入货品价格表</el-button
+                    >
                   </el-upload>
                 </template>
 
-                <el-button size="small" @click="hanleDownloadFiles"
+                <el-button
+                  type="primary"
+                  size="small"
+                  @click="hanleDownloadFiles"
                   >下载模板</el-button
                 >
               </el-col>
@@ -157,6 +162,20 @@
               label="货品编码"
               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
               prop="materialName"
@@ -169,32 +188,100 @@
               label="规格型号"
               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
-              prop="saleTypeCode"
-              label="销售类型编码"
+              prop="saleTypeName"
+              label="销售类型"
               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
-              prop="saleTypeName"
-              label="销售类型"
+              prop="saleTypeCode"
+              label="销售类型编码"
               align="center"
             >
             </el-table-column>
+
             <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 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 label="支付钱包" align="center">
               <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"
                   type="success"
                   size="small"
                   v-for="item in scope.row.walletRelaList"
                   >{{ 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>
             </el-table-column>
             <el-table-column fixed="right" label="操作" align="center">
@@ -205,7 +292,7 @@
                   icon="el-icon-info"
                   icon-color="red"
                   title="内容确定删除吗?"
-                  @onConfirm="hanleDelete(scope.row.id)"
+                  @onConfirm="hanleDelete(scope.row.id, scope.$index)"
                 >
                   <el-button
                     slot="reference"
@@ -218,7 +305,20 @@
             </el-table-column>
           </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
               @size-change="handleSizeChange"
               @current-change="handleCurrentChange"
@@ -230,6 +330,7 @@
             >
             </el-pagination>
           </div>
+
           <el-row>
             <el-divider></el-divider>
             <el-row type="flex">
@@ -237,7 +338,7 @@
                 <h4 style="display: inline-block; margin-right: 20px">
                   条件信息
                 </h4>
-                <el-button size="small" @click="isCondition = 1"
+                <el-button type="primary" size="small" @click="isCondition = 1"
                   >添加</el-button
                 ></el-col
               >
@@ -265,7 +366,7 @@
               <template slot-scope="scope">
                 <el-input
                   v-model="scope.row.name"
-                  style="text-align:center"
+                  style="text-align: center"
                   placeholder="请输入名称"
                   :disabled="scope.row.fang"
                   @blur="handleConditionName(scope.row)"
@@ -321,19 +422,23 @@ import { mapGetters, mapMutations } from "vuex";
 import Minxin from "@/mixin";
 import {
   addPoliy,
+  getK3List,
+  savePolicy,
   getTypeList,
   getWalletList,
+  updateCondition,
   getMaterialList,
   deleteCondition,
   getConditionList,
   deleteMaterialPolicy,
-  updateCondition,
+  getNoRebateWalletList,
 } from "@/api/policy_list";
 import { getDictList } from "@/api/common";
 import { downloadFiles, handleImport } from "@/utils/util";
 import Transfer from "./Transfer";
 import AddCondition from "./AddCondition";
 import ImageUpload from "@/components/Common/image-upload.vue";
+import { type } from "os";
 
 export default {
   mixins: [Minxin],
@@ -354,8 +459,10 @@ export default {
         mainName: "",
         type: "",
       },
+      dataList: [],
+      addList:[],
       listLoading: false,
-
+      dialogVisible: false,
       importFileList: [],
       fileList: [],
       options: {},
@@ -374,6 +481,8 @@ export default {
       ],
       conditionList: [],
       dictList: [],
+      k3List:[],
+      NoRebateWalletList:[],
     };
   },
   computed: {
@@ -414,34 +523,39 @@ export default {
     },
     getCommonApi() {
       // 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) {
       console.log(row.name);
       updateCondition({ id: row.id, name: row.name }).then((res) => {
@@ -449,6 +563,7 @@ export default {
         row.fang = true;
       });
     },
+    //提交信息
     handleSubmitCon() {
       const params = {
         policyId: this.comCode,
@@ -461,6 +576,7 @@ export default {
         this.conditionList = res.data;
       });
     },
+    // 视图部分已注释,废弃的功能 fucn
     handelStop() {
       if (this.searchForm.mainId) {
         this.fang = true;
@@ -499,18 +615,27 @@ export default {
     // 获取货品信息
     handletwoList() {
       // this.searchForm.type
-
       const paramss = {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
         policyId: this.comCode,
         saleTypeCode: "",
       };
-      console.log(45454);
+
       getMaterialList(paramss)
         .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;
         })
         .catch((err) => {
@@ -568,7 +693,7 @@ export default {
           title: "",
           type: "",
           ...this.searchForm,
-          imgSrc: this.fileList.length ? this.fileList[0].url : ""
+          imgSrc: this.fileList.length ? this.fileList[0].url : "",
         };
         console.log(this.fileList);
         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: {
     Transfer,

+ 19 - 1
src/views/sales_policy/policy_list.vue

@@ -183,6 +183,7 @@
               "
               >详情</el-button
             >
+
             <el-button
               type="text"
               v-if="
@@ -209,7 +210,16 @@
                 >提审</el-button
               >
             </el-popconfirm>
-
+              <el-popconfirm
+              v-if="scope.row.endTime || (scope.row.endTime && scope.row.startTime)"
+              style="margin-left: 10px"
+              title="作废?"
+              @onConfirm="handleNullify(scope.row)"
+            >
+              <el-button type="text" size="small" slot="reference"
+                >作废</el-button
+              >
+            </el-popconfirm>
             <el-popconfirm
               v-if="scope.row.examineStatus != 'OK'"
               style="margin-left: 10px"
@@ -315,6 +325,7 @@ import {
   getId,
   getList,
   getTypeList,
+  cancelPolicy,
   deletePolicy,
   getpolicySubmit,
   toExamine,
@@ -448,6 +459,13 @@ export default {
         });
       });
     },
+    // 作废
+    handleNullify(row){
+      cancelPolicy({id:row.id}).then(res=>{
+        this.$successMsg('已作废')
+        this.getList()
+      })
+    },
     // 导出文档
     handleExport() {
       let screenData = {

+ 1 - 0
src/views/supply/policy/components/retail_detail.vue

@@ -148,6 +148,7 @@
           <template slot-scope="scope">
               <!-- v-for="item in scope.row.rebateWallets" -->
             <el-tag
+            v-if="scope.row.customerWalletName2"
               type="success"
               size="small"
 

+ 1 - 0
src/views/supply/policy/components/retail_examine.vue

@@ -138,6 +138,7 @@
        <template slot-scope="scope">
               <!-- v-for="item in scope.row.rebateWallets" -->
             <el-tag
+            v-if="scope.row.customerWalletName2"
               type="success"
               size="small"