Bläddra i källkod

Merge branch 'feature/Feature-basic_data' of https://gogs.zfire.top/zfire-front/supply-front into feature/Feature-basic_data

chen 3 år sedan
förälder
incheckning
51120d0bae

+ 18 - 0
src/api/supply/engin.js

@@ -239,6 +239,15 @@ export function withdrawHome(params) {
   })
 }
 
+// 家用工程订单 - 弃审
+export function abandonHome(params) {
+  return request({
+    url: '/engin-order/home-abandon',
+    method: 'post',
+    params
+  })
+}
+
 // 家用工程订单 - 删除
 export function deleteHome(params) {
   return request({
@@ -351,6 +360,15 @@ export function withdrawCom(params) {
   })
 }
 
+// 商用工程订单 - 弃审
+export function abandonCom(params) {
+  return request({
+    url: '/engin-order/trade-abandon',
+    method: 'post',
+    params
+  })
+}
+
 // 商用工程订单 - 删除
 export function deleteCom(params) {
   return request({

+ 8 - 0
src/api/supply/policy.js

@@ -182,6 +182,14 @@ export function getMaterialTypeList(params) {
   })
 }
 
+// 弃审
+export function abandonData(params) {
+  return request({
+    url: '/retail/abandon',
+    method: 'post',
+    params
+  })
+}
 
 
 

+ 36 - 24
src/views/basic_data/material/components/modify_list-apply.vue

@@ -971,7 +971,7 @@ export default {
       return arr1.filter((v) => arr2.every((val) => val.id != v.id));
     },
     // xua
-    handelWallets(e, index, row) {
+  handelWallets(e, index, row) {
       let id = row.cid || row.id;
       if (e &&  e.length) {
     for (let i = 0; i < e.length; i++) {
@@ -1006,14 +1006,14 @@ export default {
 
     },
   handleRemove2(e, index, row) {
-         const copxyWall = JSON.parse(JSON.stringify(row.rebateWallets))
-        for (let i = 0; i < row.rebateWallets.length; i++) {
-        if (this.wall2.includes(e) && row.rebateWallets[i].walletId==e) {
+         const copxyWall = JSON.parse(JSON.stringify(row.wallets))
+        for (let i = 0; i < row.wallets.length; i++) {
+        if (this.wall2.includes(e) && row.wallets[i].walletId==e) {
                 copxyWall.splice(i,1)
                 this.wall2.splice(i,1)
               }
         }
-        this.$set(row,'rebateWallets',copxyWall)
+        this.$set(row,'wallets',copxyWall)
 
     }
 ,
@@ -1022,8 +1022,8 @@ export default {
      if (e &&  e.length) {
     for (let i = 0; i < e.length; i++) {
      if (!this.wall2.includes(e[e.length - 1])) {
-        this.$set(row, "rebateWallets", [
-          ...row.rebateWallets,
+        this.$set(row, "wallets", [
+          ...row.wallets,
           {
             type: "REBATE",
             id: "",
@@ -1229,7 +1229,7 @@ export default {
             }
             this.$set(res.data.items[i], "walletsId", walletIds);
             this.$set(res.data.items[i], "walletRebateId", walletRebateIds);
-            console.log(res.data.items[i].walletRebateId);
+
             this.rebateList.forEach((k) => {
               k.saleTypes.forEach((j) => {
                 if (
@@ -1241,7 +1241,7 @@ export default {
                 }
               });
             });
-
+                    console.log(rebateList,res.data.items[i].walletRebateId);
             res.data.items[i].walleList = this.walleList;
             res.data.items[i].rebateList = rebateList;
             res.data.items[i].fang = false;
@@ -1314,21 +1314,33 @@ export default {
       });
     },
     hanleSave() {
-      console.log(this.items);
-      handleEdit({
-         ...this.base,
-        items: this.items,
-        saleTypeId: this.saleTypeId,
-        adminWebsitId: this.adminWebsitId,
-        serviceId: this.serviceId,
-        adminCompanyName: this.adminCompanyName,
-        serviceName: this.nickName,
-      }).then((res) => {
-        this.$successMsg("成功");
-        this.$parent.cid = "";
-        this.$parent.show = 1;
-        this.$parent.getList();
-      });
+
+      for (let i = 0; i < this.items.length; i++) {
+          //   const  wallets = []
+          //     if (this.items[i].wallets.length) {
+          //        wallets = [...wallets,...this.items[i].wallets]
+          //     }else if(this.items[i].rebateWallets.length){
+          //       console.log(444);
+          //         wallets = [...wallets,...this.items[i].rebateWallets]
+          //     }
+          // this.items[i].wallets = wallets
+                    console.log(this.items[i]);
+
+      }
+      // handleEdit({
+      //    ...this.base,
+      //   items: this.items,
+      //   saleTypeId: this.saleTypeId,
+      //   adminWebsitId: this.adminWebsitId,
+      //   serviceId: this.serviceId,
+      //   adminCompanyName: this.adminCompanyName,
+      //   serviceName: this.nickName,
+      // }).then((res) => {
+      //   this.$successMsg("成功");
+      //   this.$parent.cid = "";
+      //   this.$parent.show = 1;
+      //   this.$parent.getList();
+      // });
     },
     handleReseat() {
       this.base = {

+ 12 - 1
src/views/supply/engin/commerce_list.vue

@@ -139,6 +139,9 @@
                 </el-popconfirm>
                 <el-button type="text" @click="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles) && scope.row.examineStatus === 'SAVE'">编辑</el-button>
                 <el-button type="text" @click="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">审批</el-button>
+                <el-popconfirm style="margin-left: 10px;" title="确定弃审吗?" @onConfirm="handleAbandon(scope.row.parentId)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'" >
+                  <el-button slot="reference" type="text">弃审</el-button>
+                </el-popconfirm>
                 <el-button type="text" @click="toReturn(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles)">退订</el-button>
                 <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
                 <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.parentId)" v-if="$checkBtnRole('del', $route.meta.roles)">
@@ -175,7 +178,7 @@
 </template>
 
 <script>
-import { getOrderList, applyCom, withdrawCom, deleteCom, editDateCom } from "@/api/supply/engin";
+import { getOrderList, applyCom, withdrawCom, deleteCom, editDateCom, abandonCom } from "@/api/supply/engin";
 import CommerceDetail from "@/views/supply/engin/components/commerce_detail";
 import CommerceForm from "@/views/supply/engin/components/commerce_form";
 import CommerceExamine from "@/views/supply/engin/components/commerce_examine";
@@ -382,6 +385,14 @@ export default {
       })
     },
 
+    // 弃审
+    handleAbandon(id) {
+      abandonCom({id}).then(res => {
+        this.$successMsg();
+        this.getList();
+      })
+    },
+
     // 删除
     handleDelete(id) {
       deleteCom({ids: id}).then(res => {

+ 6 - 2
src/views/supply/engin/components/home_form.vue

@@ -158,11 +158,15 @@
         <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.price" size="small" type="number"></el-input>
+          </template>
+        </el-table-column>
         <el-table-column align="center" label="工程登录数量" prop="enginNum" min-width="120" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
-            <el-input v-model="scope.row.qty" size="small"></el-input>
+            <el-input v-model="scope.row.qty" size="small" type="number"></el-input>
           </template>
         </el-table-column>
         <el-table-column align="center" label="订单金额" min-width="100" show-overflow-tooltip>

+ 12 - 1
src/views/supply/engin/home_list.vue

@@ -139,6 +139,9 @@
                 </el-popconfirm>
                 <el-button type="text" @click="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles) && (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'FAIL')">编辑</el-button>
                 <el-button type="text" @click="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">审批</el-button>
+                <el-popconfirm style="margin-left: 10px;" title="确定弃审吗?" @onConfirm="handleAbandon(scope.row.parentId)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'" >
+                  <el-button slot="reference" type="text">弃审</el-button>
+                </el-popconfirm>
                 <el-button type="text" @click="toReturn(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus !== 'FAIL'">退订</el-button>
                 <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
                 <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.parentId)" v-if="$checkBtnRole('del', $route.meta.roles)">
@@ -175,7 +178,7 @@
 </template>
 
 <script>
-import { getOrderList, applyHome, withdrawHome, deleteHome, editDateHome } from "@/api/supply/engin";
+import { getOrderList, applyHome, withdrawHome, deleteHome, editDateHome, abandonHome } from "@/api/supply/engin";
 import HomeDetail from "@/views/supply/engin/components/home_detail";
 import HomeForm from "@/views/supply/engin/components/home_form";
 import HomeExamine from "@/views/supply/engin/components/home_examine";
@@ -376,6 +379,14 @@ export default {
       })
     },
 
+    // 弃审
+    handleAbandon(id) {
+      abandonHome({id}).then(res => {
+        this.$successMsg();
+        this.getList();
+      })
+    },
+
     // 删除
     handleDelete(id) {
       deleteHome({ids: id}).then(res => {

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

@@ -385,6 +385,9 @@
                   @click="toForm(scope.row)"
                   >编辑</el-button
                 >
+                      <el-popconfirm style="margin-left: 10px;" title="确定弃审吗?" @onConfirm="handleAbandon(scope.row.id)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'" >
+                  <el-button slot="reference" type="text">弃审</el-button>
+                </el-popconfirm>
                 <el-popconfirm
                   v-if="
                     scope.row.examineStatus == 'WAIT' &&
@@ -402,6 +405,7 @@
                   @click="toDetail(scope.row)"
                   >详情</el-button
                 >
+
                 <el-button
                   type="text"
                   @click="toReturn(scope.row)"
@@ -475,6 +479,7 @@ import {
   editData,
   closeData,
   submitData,
+  abandonData,
   submitCancel,
 } from "@/api/supply/policy";
 import RetailDetail from "./components/retail_detail";
@@ -643,7 +648,13 @@ export default {
       this.queryItem = item;
       this.isShowReturn = true;
     },
-
+// 弃审
+    handleAbandon(id) {
+      abandonData({id}).then(res => {
+        this.$successMsg();
+        this.getList();
+      })
+    },
     backList() {
       this.queryItem = {};
       this.isShowDetail = false;