001295 1 жил өмнө
parent
commit
93e2980d55

+ 28 - 1
src/api/expend/customerExpend.js

@@ -4,7 +4,7 @@ import request from '@/utils/request'
 export function queryList(data) {
   return request({
     url: `/pu/ccd/list`,
-    method: 'post',
+    method: 'get',
     data: data
   })
 }
@@ -23,4 +23,31 @@ export function editItem(data) {
     method: 'put',
     data: data,
   })
+}
+
+// 提交
+export function submit(data) {
+  return request({
+    url: `/pu/ccd/submit`,
+    method: 'post',
+    data: data,
+  })
+}
+
+// 转销售订单
+export function toSaleOrder(data) {
+  return request({
+    url: `/pu/ccd/toSaleOrder`,
+    method: 'post',
+    data: data,
+  })
+}
+
+// 操作状态
+export function operationStatus(data) {
+  return request({
+    url: `/pu/ccd/operationStatus`,
+    method: 'post',
+    data: data,
+  })
 }

+ 33 - 2
src/views/expend/customerExpend/che-hui/index.vue

@@ -1,6 +1,10 @@
 <script>
+import { rebacktWork } from "@/api/purchase/workSpace.js";
 export default {
   name: "OpenOrClose",
+  dicts: [
+    "oa_templete_id",
+  ],
   props: {
     selectData: {
       type: Array,
@@ -10,6 +14,7 @@ export default {
   data() {
     return {
       title: "撤回",
+      loading: false,
     };
   },
   computed: {
@@ -25,14 +30,40 @@ export default {
     },
   },
   methods: {
-    useClick() {},
+    //收回
+    useClick() {
+      if(this.selectData.length != 1){
+        this.$modal.msgWarning("请选择一条数据进行撤回!");
+        return;
+      }
+      this.$modal.loading("收回中...");
+      let row = this.selectData[0];
+      let params = {
+        billCode: row.code,
+        fdId: row.flowId,
+        fdTemplateId: this.dict.type.oa_templete_id.find((item) => {
+          return item.label == "采购需求单";
+        }).value,
+        billMaker: row.createBy,
+      };
+      rebacktWork(params).then((res) => {
+        if (res.code === 200) {
+          this.$modal.notifySuccess("收回成功");
+          this.$modal.closeLoading();
+          // this.getList(this.params, this.Pages);
+        }
+      })
+      .catch((err) => {
+        this.$modal.closeLoading();
+      });
+    },
   },
   created() {},
 };
 </script>
 
 <template>
-  <el-button @click="useClick" :disabled="disabled" v-bind="$attrs">{{
+  <el-button v-loading="loading" @click="useClick" :disabled="disabled" v-bind="$attrs">{{
     title
   }}</el-button>
 </template>

+ 16 - 2
src/views/expend/customerExpend/hdk-hgb/index.vue

@@ -1,4 +1,5 @@
 <script>
+import { operationStatus } from "@/api/expend/customerExpend";
 export default {
   name: "OpenOrClose",
   props: {
@@ -10,6 +11,7 @@ export default {
   data() {
     return {
       title: "行打开/关闭",
+      loading: false,
     };
   },
   computed: {
@@ -25,14 +27,26 @@ export default {
     },
   },
   methods: {
-    useClick() {},
+    //操作状态
+    useClick() {
+      let that = this;
+      this.$modal.confirm('确认操作行状态吗?').then(async function() {
+        that.loading = true;
+        return await operationStatus(that.selectData);
+      }).then(() => {
+        that.$modal.msgSuccess("操作成功");
+        that.loading = false;
+      }).catch(() => {
+        that.loading = false;
+      });
+    },
   },
   created() {},
 };
 </script>
 
 <template>
-  <el-button @click="useClick" :disabled="disabled" v-bind="$attrs">{{
+  <el-button v-loading="loading" @click="useClick" :disabled="disabled" v-bind="$attrs">{{
     title
   }}</el-button>
 </template>

+ 20 - 2
src/views/expend/customerExpend/ti-jiao/index.vue

@@ -1,4 +1,5 @@
 <script>
+import { submit } from "@/api/expend/customerExpend";
 export default {
   name: "OpenOrClose",
   props: {
@@ -10,6 +11,7 @@ export default {
   data() {
     return {
       title: "提交",
+      loading: false,
     };
   },
   computed: {
@@ -25,14 +27,30 @@ export default {
     },
   },
   methods: {
-    useClick() {},
+    //提交
+    useClick() {
+      if(this.selectData.length != 1){
+        this.$modal.msgWarning("请选择一条数据进行提交!");
+        return;
+      }
+      let that = this;
+      this.$modal.confirm('确认提交吗?').then(async function() {
+        that.loading = true;
+        return await submit(that.selectData[0]);
+      }).then(() => {
+        that.$modal.msgSuccess("提交成功");
+        that.loading = false;
+      }).catch(() => {
+        that.loading = false;
+      });
+    },
   },
   created() {},
 };
 </script>
 
 <template>
-  <el-button @click="useClick" :disabled="disabled" v-bind="$attrs">{{
+  <el-button v-loading="loading" @click="useClick" :disabled="disabled" v-bind="$attrs">{{
     title
   }}</el-button>
 </template>

+ 16 - 2
src/views/expend/customerExpend/zxsdd/index.vue

@@ -1,4 +1,5 @@
 <script>
+import { toSaleOrder } from "@/api/expend/customerExpend";
 export default {
   name: "ResaleOrder",
   props: {
@@ -10,6 +11,7 @@ export default {
   data() {
     return {
       title: "转销售订单",
+      loading: false,
     };
   },
   computed: {
@@ -25,14 +27,26 @@ export default {
     },
   },
   methods: {
-    useClick() {},
+    //转销售订单
+    useClick() {
+      let that = this;
+      this.$modal.confirm('确认转销售订单吗?').then(async function() {
+        that.loading = true;
+        return await toSaleOrder(that.selectData);
+      }).then(() => {
+        that.$modal.msgSuccess("成功");
+        that.loading = false;
+      }).catch(() => {
+        that.loading = false;
+      });
+    },
   },
   created() {},
 };
 </script>
 
 <template>
-  <el-button @click="useClick" :disabled="disabled" v-bind="$attrs">{{
+  <el-button v-loading="loading" @click="useClick" :disabled="disabled" v-bind="$attrs">{{
     title
   }}</el-button>
 </template>