Jelajahi Sumber

添加协议管理状态控制

caojunjie 4 tahun lalu
induk
melakukan
5361a15cae

+ 12 - 0
src/api/agreement/agreement.js

@@ -67,6 +67,18 @@ export function updateAgreement(data) {
   })
 }
 
+// 修改仓储费
+export function updateAgreements(fId, fStatus) {
+  return request({
+    url: '/warehouseBusiness/agreementTask',
+    method: 'put',
+    data: {
+      fId:fId,
+      fBillstatus:fStatus
+    }
+  })
+}
+
 // 删除仓储费
 export function delAgreement(fId) {
   return request({

+ 11 - 0
src/api/warehouseBusiness/agreement.js

@@ -59,6 +59,17 @@ export function updateAgreement(data) {
     data: data
   })
 }
+// 修改仓储费
+export function updateAgreement_s(fId, fStatus) {
+  return request({
+    url: '/warehouseBusiness/agreementStorage',
+    method: 'put',
+    data: {
+      fId:fId,
+      fBillstatus:fStatus
+    }
+  })
+}
 
 // 删除仓储费
 export function delAgreement(fId) {

+ 27 - 1
src/views/agreement/agreementTask/index.vue

@@ -152,7 +152,16 @@
         </template>
       </el-table-column>
       <!--      <el-table-column label="状态" align="center" prop="fId" />-->
-      <el-table-column label="状态" align="center" prop="fBillstatus"/>
+      <el-table-column label="状态" align="center" prop="fBillstatus">
+        <template slot-scope="scope">
+          <el-switch
+            v-model="scope.row.fBillstatus"
+            active-value="0"
+            inactive-value="1"
+            @change="handleStatusChange(scope.row)"
+          ></el-switch>
+        </template>
+      </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -374,12 +383,14 @@ import {
   exportAgreement,
   listAgreementitems,
   queryUserVal,
+  updateAgreements
 } from '@/api/agreement/agreement'
 import { listCorps } from '@/api/basicdata/corps'
 import { listGoods } from '@/api/basicdata/goods'
 import { delWarehousebills } from '@/api/warehouseBusiness/warehouseInStock'
 import { listGoodsTransfer } from '@/api/warehouseBusiness/goodsTransfer'
 import { listFees } from '@/api/basicdata/fees'
+import { updateAgreement_s } from '@/api/warehouseBusiness/agreement'
 // import { listUser, queryUserVal } from '@/api/system/user'
 
 export default {
@@ -640,6 +651,21 @@ export default {
         console.log(this.fWbuOptions)
       });
     },
+    // 作业费状态修改
+    handleStatusChange(row) {
+      let text = row.fBillstatus === "0" ? "启用" : "停用";
+      this.$confirm('确认要"' + text + '""' + row.fCorpid + '"用户吗?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return updateAgreements(row.fId, row.fBillstatus);
+      }).then(() => {
+        this.msgSuccess(text + "成功");
+      }).catch(function() {
+        row.fBillstatus = row.fBillstatus === "0" ? "1" : "0";
+      });
+    },
     /** 新增按钮操作 */
     handleAdd() {
       this.reset()

+ 30 - 2
src/views/warehouseBusiness/agreement/index.vue

@@ -152,7 +152,16 @@
         </template>
       </el-table-column>
       <!--      <el-table-column label="状态" align="center" prop="fId" />-->
-      <el-table-column label="状态" align="center" prop="fBillstatus"/>
+      <el-table-column label="状态" align="center" prop="fBillstatus">
+        <template slot-scope="scope">
+          <el-switch
+            v-model="scope.row.fBillstatus"
+            active-value="0"
+            inactive-value="1"
+            @change="handleStatusChange(scope.row)"
+          ></el-switch>
+        </template>
+      </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -391,6 +400,7 @@ import {
   delAgreement,
   addAgreement,
   updateAgreement,
+  updateAgreement_s,
   exportAgreement,
   listAgreementitems,
   queryUserVal,
@@ -400,6 +410,7 @@ import { listGoods } from '@/api/basicdata/goods'
 import { delWarehousebills } from '@/api/warehouseBusiness/warehouseInStock'
 import { listGoodsTransfer } from '@/api/warehouseBusiness/goodsTransfer'
 import { listFees } from '@/api/basicdata/fees'
+import { changeUserStatus } from '@/api/system/user'
 // import { listUser, queryUserVal } from '@/api/system/user'
 
 export default {
@@ -408,6 +419,7 @@ export default {
   data() {
     return {
       dataList: '',
+      value_s:[],
       // 遮罩层
       loading: true,
       loading_s: false,
@@ -499,6 +511,21 @@ export default {
     });
   },
   methods: {
+    // 仓储费状态修改
+    handleStatusChange(row) {
+      let text = row.fBillstatus === "0" ? "启用" : "停用";
+      this.$confirm('确认要"' + text + '""' + row.fCorpid + '"用户吗?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return updateAgreement_s(row.fId, row.fBillstatus);
+      }).then(() => {
+        this.msgSuccess(text + "成功");
+      }).catch(function() {
+        row.fBillstatus = row.fBillstatus === "0" ? "1" : "0";
+      });
+    },
     test_s(){
       console.log(this.agreementitemsList)
     },
@@ -570,6 +597,7 @@ export default {
       }
       let queryParams = { pageNum: 1, pageSize: 10, fName: name };
       listFees(queryParams).then((response) => {
+        console.log(this.fWbuOptions)
         // this.fWbuOptions = response.rows;
         let fWbuOptions = this.fWbuOptions.concat(response.rows)
         this.fWbuOptions = Array.from(new Set(fWbuOptions))
@@ -682,7 +710,7 @@ export default {
       this.reset()
       const fId = row.fId || this.ids
       getAgreement(fId).then(response => {
-
+        console.log(response)
         this.deptName = response.data.dept.deptName
         this.form = response.data.tWarehouseAgreement
         this.fMblnoOptions = response.data.corps