howie 3 vuotta sitten
vanhempi
commit
428f09e1f1

BIN
src/assets/login/background.png


BIN
src/assets/login/logo.png


+ 57 - 27
src/views/sales_policy/components/AddPolicy.vue

@@ -57,15 +57,18 @@
                 </el-form-item>
               </el-col>
               <el-col :xs="24" :ms="12" :lg="12">
-                <el-form-item label="产品品类" prop="name">
-                  <el-select v-model="value" placeholder="请选择">
+                <el-form-item label="产品品类" prop="mainId">
+                  <el-select
+                    v-model="searchForm.mainId"
+                    :disabled="dataList.length ? true : false"
+                    placeholder="请选择"
+                    @change="handelStop"
+                  >
                     <el-option
-                      v-for="(item, index) in walletList"
-                      :key="index"
-                      :label="item.mainName"
-                      :value="item.mainId"
-                    >
-                    </el-option>
+                      v-for="item in dictList"
+                      :label="item.dictValue"
+                      :value="item.sysDictId"
+                    ></el-option>
                   </el-select>
                 </el-form-item>
               </el-col>
@@ -115,15 +118,25 @@
                 <h4 style="display: inline-block; margin-right: 20px">
                   货品信息
                 </h4>
-                <el-upload
+                <template>
+                  <el-upload
+                    v-show="fang == true"
+                    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>
+                </template>
+                <el-button
+                  size="small"
                   class="import-btn"
-                  :action="baseURL + 'student/import'"
-                  :http-request="handleImport"
-                  :file-list="importFileList"
-                  :show-file-list="false"
+                  v-show="fang == false"
+                  @click="handelStop"
+                  >导入货品价格表</el-button
                 >
-                  <el-button size="small">导入货品价格表</el-button>
-                </el-upload>
                 <el-button size="small" @click="hanleDownloadFiles"
                   >下载模板</el-button
                 >
@@ -141,8 +154,7 @@
             stripe
           >
             <el-table-column
-              fixed
-              prop="num"
+              type="index"
               label="序号"
               width="50"
               align="center"
@@ -169,7 +181,6 @@
             <el-table-column
               prop="saleTypeCode"
               label="销售类型编码"
-              width="500"
               align="center"
             >
             </el-table-column>
@@ -179,6 +190,8 @@
               align="center"
             >
             </el-table-column>
+            <el-table-column prop="discAmount" label="格力折扣" align="center">
+            </el-table-column>
             <el-table-column prop="price" label="单价" align="center">
             </el-table-column>
             <el-table-column label="支付钱包" align="center">
@@ -268,7 +281,7 @@
               align="center"
             >
               <template slot-scope="scope">
-                                <!-- <el-button
+                <!-- <el-button
                   type="text"
                   size="small"
                   @click="isCondition=1"
@@ -317,6 +330,7 @@ import {
   getConditionList,
   deleteMaterialPolicy,
 } from "@/api/policy_list";
+import { getDictList } from "@/api/common";
 import { downloadFiles, handleImport } from "@/utils/util";
 import Transfer from "./Transfer";
 import AddCondition from "./AddCondition";
@@ -326,6 +340,7 @@ export default {
   mixins: [Minxin],
   data() {
     return {
+      fang: false,
       input: "",
       baseURL: "",
       isCondition: 0,
@@ -336,6 +351,8 @@ export default {
         remark: "",
         startTime: "",
         title: "",
+        mainId: "",
+        mainName: "",
         type: "",
       },
       listLoading: false,
@@ -362,6 +379,7 @@ export default {
         },
       ],
       conditionList: [],
+      dictList: [],
     };
   },
   computed: mapState({
@@ -381,11 +399,10 @@ export default {
     this.searchForm.code = this.comCode;
   },
   updated() {
-        console.log(this.comCode, "kkjk");
+    console.log(this.comCode, "kkjk");
     this.searchForm.code = this.comCode;
   },
   created() {
-
     this.getCommonApi();
     if (this.$parent.isFlag) {
       // this.handletwoList()
@@ -400,7 +417,10 @@ export default {
     handleCondition(id, index) {
       deleteCondition({ id }).then((res) => {
         this.conditionList.splice(index, 1);
-        Object.assign(this.$children[9].$data,this.$children[9].$options.data())
+        Object.assign(
+          this.$children[9].$data,
+          this.$children[9].$options.data()
+        );
         this.$successMsg("删除成功");
       });
     },
@@ -430,6 +450,9 @@ export default {
       getWalletList(walletParams).then((res) => {
         this.walletList = res.data.records;
       });
+      getDictList({ sysDictEnum: "PRODUCT_TYPE" }).then((res) => {
+        this.dictList = res.data;
+      });
     },
     handleSubmitCon() {
       const params = {
@@ -440,6 +463,13 @@ export default {
         this.conditionList = res.data;
       });
     },
+    handelStop() {
+      if (this.searchForm.mainId) {
+        this.fang = true;
+      } else {
+        this.$errorMsg("请选择产品品类");
+      }
+    },
     // 导入
     async handleImport(param) {
       this.importLoading = true;
@@ -491,9 +521,6 @@ export default {
     },
     // 提交审核
     handleAddPolicy(policyCustomers) {
-      //     console.log(this.fileList,'上传图片');
-      // return
-      console.log(policyCustomers, "选择的经销商");
       if (policyCustomers.length) {
         var arr = [];
 
@@ -510,15 +537,18 @@ export default {
             remark: "",
           });
         });
+        this.dictList.forEach((k) => {
+          if (k.mainId == this.searchForm.sysDictId) {
+            this.searchForm.mainName = k.dictValue;
+          }
+        });
         const params = {
           adminCompanyId: "",
           code: "",
           customerCount: 0,
-
           examineBy: "",
           examineRemark: "",
           examineStatus: "",
-
           id: "",
           imgSrc: this.fileList.length ? this.fileList[0].url : "",
           policyCustomers: arr,

+ 21 - 24
src/views/sales_policy/policy_list.vue

@@ -41,7 +41,7 @@
                   type="datetime"
                   size="small"
                   placeholder="生效日期"
-                   value-format="yyyy-MM-dd HH:mm:ss"
+                  value-format="yyyy-MM-dd HH:mm:ss"
                 >
                 </el-date-picker>
               </el-form-item>
@@ -55,7 +55,7 @@
                   type="datetime"
                   size="small"
                   placeholder="结束日期"
-                   value-format="yyyy-MM-dd HH:mm:ss"
+                  value-format="yyyy-MM-dd HH:mm:ss"
                 >
                 </el-date-picker>
               </el-form-item>
@@ -68,7 +68,7 @@
                   type="datetime"
                   size="small"
                   placeholder="制表日期"
-                   value-format="yyyy-MM-dd HH:mm:ss"
+                  value-format="yyyy-MM-dd HH:mm:ss"
                 >
                 </el-date-picker>
               </el-form-item>
@@ -95,8 +95,6 @@
             </el-col>
           </el-row>
           <el-row :gutter="20">
-
-
             <el-col :xs="24" :ms="6" :lg="6">
               <el-form-item label="" prop="status">
                 <el-select
@@ -134,9 +132,7 @@
                 </el-select>
               </el-form-item>
             </el-col>
-            <el-col :xs="24" :ms="6" :lg="6">
-
-            </el-col>
+            <el-col :xs="24" :ms="6" :lg="6"> </el-col>
             <el-col :xs="24" :ms="6" :lg="6" class="tr">
               <el-form-item>
                 <el-button type="primary" size="small" @click="submitScreenForm"
@@ -153,9 +149,11 @@
     </div>
     <div class="btn-group">
       <el-row type="flex">
-        <el-button  size="small"
-              type="primary"
-              icon="el-icon-plus"   @click="hanlenewInfo"
+        <el-button
+          size="small"
+          type="primary"
+          icon="el-icon-plus"
+          @click="hanlenewInfo"
           >新增</el-button
         >
       </el-row>
@@ -183,12 +181,10 @@
               type="text"
               v-if="scope.row.examineStatus == 'WAIT'"
               @click="
-
                 (isShow = 8),
                   (id = scope.row.id),
                   (policyId = scope.row.policyId),
                   (code = scope.row.code)
-
               "
               size="small"
               >审核</el-button
@@ -206,6 +202,7 @@
             </el-popconfirm>
 
             <el-popconfirm
+              v-if="scope.row.examineStatus != 'OK'"
               style="margin-left: 10px"
               title="删除吗?"
               @onConfirm="hanleDelete(scope.row.id)"
@@ -216,12 +213,12 @@
             </el-popconfirm>
           </template>
         </el-table-column>
-        <el-table-column label="状态" width="120" align="center">
+        <!-- <el-table-column label="状态" width="120" align="center">
           <template slot-scope="scope">
             <el-tag v-if="scope.row.status == '1'">已生效</el-tag>
             <el-tag v-else-if="scope.row.status == '0'">未生效 </el-tag>
           </template>
-        </el-table-column>
+        </el-table-column> -->
         <el-table-column label="状态" width="120" align="center">
           <template slot-scope="scope">
             <el-tag v-if="scope.row.examineStatus == 'SAVE'">保存</el-tag>
@@ -246,8 +243,11 @@
           align="center"
         >
         </el-table-column>
-        <!-- <el-table-column prop="address" label="部门" align="center"></el-table-column> -->
-
+        <el-table-column
+          prop="mainName"
+          label="产品品类"
+          align="center"
+        ></el-table-column>
         <el-table-column
           prop="remark"
           label="表头备注"
@@ -327,7 +327,7 @@ export default {
       id: "",
       code: "",
       codeId: "",
-listLoading:false,
+      listLoading: false,
       policyId: "",
 
       isShow: 1,
@@ -394,7 +394,7 @@ listLoading:false,
       this.$store.dispatch("sales/hanlenewInfo");
     },
     getList() {
-        this.listLoading = true
+      this.listLoading = true;
       const params = {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
@@ -411,15 +411,13 @@ listLoading:false,
         startTime2: this.screenForm.startTime2,
         status: this.screenForm.status,
         title: this.screenForm.title,
-
       };
-      console.log(params,123);
+      console.log(params, 123);
       getList(params).then((res) => {
         this.dataList = res.data.records;
         console.log(this.dataList);
         this.listTotal = res.data.total;
-        this.listLoading = false
-
+        this.listLoading = false;
       });
       const paramsType = {
         pageNum: 1,
@@ -473,7 +471,6 @@ listLoading:false,
       }
     },
     handlesubmit(e) {
-
       getpolicySubmit({ policyId: e.id }).then((res) => {
         this.$successMsg("已提交");
         this.getList();

+ 26 - 15
src/views/supply/policy/components/retail_detail.vue

@@ -141,22 +141,19 @@
           min-width="100"
           show-overflow-tooltip
         ></el-table-column>
-        <el-table-column
+         <el-table-column
           align="center"
           label="返利类型"
-          prop="customerWalletName2"
-          min-width="200"
+          prop="rebateWallets"
+          min-width="100"
           show-overflow-tooltip
         >
-          <template slot-scope="scope">
-            <el-tag
-              type="success"
-              size="small"
-              v-if="scope.row.customerWalletName2"
-            >
-              {{ scope.row.customerWalletName2 }}
-            </el-tag>
-          </template>
+        <template slot-scope="scope">
+          <el-tag type="success" size="small" v-for="item in scope.row.rebateWallets">
+          {{item.name}}
+          </el-tag>
+
+        </template>
         </el-table-column>
         <el-table-column
           align="center"
@@ -172,13 +169,20 @@
           min-width="100"
           show-overflow-tooltip
         ></el-table-column>
-        <el-table-column
+       <el-table-column
           align="center"
           label="现金钱包"
-          prop="customerWalletName"
+          prop="wallets"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        >
+          <template slot-scope="scope">
+          <el-tag type="success" size="small" v-for="item in scope.row.wallets">
+          {{item.name}}
+          </el-tag>
+
+        </template>
+        </el-table-column>
         <el-table-column
           align="center"
           label="金额"
@@ -408,11 +412,18 @@
             show-overflow-tooltip
           >
             <template slot-scope="scope">
+
+              <template v-if="scope.row.isDirectTransfer == '是'">
               <el-input
                 v-model="scope.row.adjustNum"
                 size="small"
                 type="number"
               ></el-input>
+              </template>
+              <template v-else>
+                {{scope.row.adjustNum || 0 }}
+              </template>
+
             </template>
           </el-table-column>
           <el-table-column

+ 19 - 5
src/views/supply/policy/components/retail_examine.vue

@@ -122,10 +122,17 @@
         <el-table-column
           align="center"
           label="返利类型"
-          prop="walletRebateName"
+          prop="rebateWallets"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        >
+        <template slot-scope="scope">
+          <el-tag type="success" size="small" v-for="item in scope.row.rebateWallets">
+          {{item.name}}
+          </el-tag>
+
+        </template>
+        </el-table-column>
         <el-table-column
           align="center"
           label="返利金额"
@@ -136,17 +143,24 @@
         <el-table-column
           align="center"
           label="格力折扣"
-          prop="deductAmount"
+          prop="discAmount"
           min-width="100"
           show-overflow-tooltip
         ></el-table-column>
         <el-table-column
           align="center"
           label="现金钱包"
-          prop="walletRebateName2"
+          prop="wallets"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        >
+          <template slot-scope="scope">
+          <el-tag type="success" size="small" v-for="item in scope.row.wallets">
+          {{item.name}}
+          </el-tag>
+
+        </template>
+        </el-table-column>
         <el-table-column
           align="center"
           label="实付金额"

+ 3 - 5
src/views/supply/policy/components/retail_form2.vue

@@ -172,9 +172,9 @@
           min-width="100"
           show-overflow-tooltip
         >
-          <!-- <template slot-scope="scope">
+          <template slot-scope="scope">
             <el-input v-model="scope.row.qty" size="small"></el-input>
-          </template> -->
+          </template>
         </el-table-column>
         <el-table-column
           align="center"
@@ -833,7 +833,7 @@ export default {
     },
     hanlePopData() {
       this.multipleData.push(this.multipleSelection);
-      if (this.multipleData.length) {
+      if (this.multipleData.length && this.multipleSelection.length) {
         let arrData = [];
         console.log(this.multipleData, "datga");
         for (let i = 0; i < this.multipleData.length; i++) {
@@ -844,8 +844,6 @@ export default {
           }else{
             this.goodsList = arrData
           }
-
-         console.log(this.goodsList,'jjjj');
         this.goodsList.forEach((item) => {
           this.$set(item, "status1", "");
           this.$set(item, "status2", "");

+ 28 - 11
src/views/supply/policy/components/retail_return.vue

@@ -58,10 +58,10 @@
         <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="返利类型" prop="walletRebateName" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="返利钱包" prop="customerWalletName2" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="返利金额" prop="rebateAmount" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="格力折扣" prop="deductAmount" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="现金钱包" prop="walletRebateName2" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="格力折扣" prop="totalDiscAmount" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="现金钱包" prop="customerWalletName" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="是否直调" prop="isDirectTransfer" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
@@ -69,7 +69,12 @@
           </template>
         </el-table-column>
         <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="原订单数量" prop="oldQty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="可退数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="退订数量" prop="tdQty" min-width="100" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.tdQty" size="small" type="number"></el-input>
+          </template>
+        </el-table-column>
         <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
       </el-table>
@@ -88,10 +93,10 @@
           <div class="label">退订日期</div>
           <div class="value">{{nowDate}}</div>
         </el-col>
-        <el-col :span="24" class="item">
+        <!-- <el-col :span="24" class="item">
           <div class="label">退订说明</div>
           <div class="value"><el-input v-model="mainForm.remark" placeholder="请输入内容"></el-input></div>
-        </el-col>
+        </el-col> -->
       </el-row>
     </div>
 
@@ -106,7 +111,7 @@
 </template>
 
 <script>
-import { getDetail, returnData } from "@/api/supply/policy";
+import { getDetail, returnData } from "@/api/supply/retail";
 
 export default {
   name: 'RetailReturn',
@@ -131,7 +136,6 @@ export default {
 
       formLoading: false,
       mainForm: {
-        status: true,
         remark: '',
       }
     }
@@ -181,13 +185,26 @@ export default {
       })
     },
 
-    // 提交审批
+    // 提交
     clickSubmitForm() {
+      for(let i=0; i<this.detailData.retailOrderItemList.length; i++) {
+        if(this.detailData.retailOrderItemList[i].tdQty === '' || this.detailData.retailOrderItemList[i].tdQty === null) {
+          this.$errorMsg('请填写退订数量');
+          return;
+        }
+        if(Number(this.detailData.retailOrderItemList[i].tdQty) < 0) {
+          this.$errorMsg('退订数量不可为负数');
+          return;
+        }
+      }
+
       this.formLoading = true;
       returnData({
         id: this.listItem.id,
-        examineStatus: this.mainForm.status ? 'OK' : 'FAIL',
-        examineRemark: this.mainForm.remark,
+        type: 1, // 1:普通零售单,2:政策零售单
+        // examineRemark: this.mainForm.remark,
+        theTime: this.detailData.theTime,
+        retailOrderItemList: this.detailData.retailOrderItemList
       }).then(res => {
         this.$successMsg('退订成功');
         this.goBack();

+ 1 - 1
src/views/supply/policy/policy_list.vue

@@ -170,7 +170,7 @@
             <el-table-column
               align="center"
               label="销售政策说明"
-              prop="policyRemark"
+              prop="policyTitle"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>