Bläddra i källkod

Merge branch 'purchaseDev' of http://172.16.100.139/new-business/drp-web into purchaseDev

002390 2 år sedan
förälder
incheckning
e8dfb06cf0

+ 4 - 0
src/components/PopDialog/fourClass.vue

@@ -6,6 +6,7 @@
       :close-on-click-modal="false"
       :append-to-body="true"
       v-dialogDrag
+      @close="resetParam"
       class="userDialog"
       :visible.sync="visible"
     >
@@ -137,6 +138,9 @@ export default {
       //   resolve(node.data.childrens.sort((a, b) => a.code - b.code));
       // else resolve(this.threedata);
     },
+    resetParam() {
+      this.filterText = ''
+    }
   },
 };
 </script>

+ 13 - 3
src/views/purchase/DemandSummary/add.vue

@@ -14,6 +14,7 @@
           :data="tableList" 
           fit
           max-height="680"
+          style="font-size: 12px;"
           @selection-change="handleSelectionChange"
         >
         <el-table-column show-overflow-tooltip type="selection" width="55" />
@@ -220,13 +221,18 @@ export default {
     },
     cancelEdit() {
       this.lineDisable = true
+      let param = this.query
+      param.sumFlag = this.row.sumFlag
+      this.getDetails(param)
     },
     saveLine() {
       editSummaryMx(this.tableList).then(res => {
         if (res.code === 200) {
           this.$modal.msgSuccess("保存成功");
           this.lineDisable = true
-          this.getDetails(this.row)
+          let param = this.query
+          param.sumFlag = this.row.sumFlag
+          this.getDetails(param)
         }
       })
     },
@@ -239,7 +245,9 @@ export default {
         shutDownSummary(param).then(res => {
           if (res.code === 200) {
             this.$modal.msgSuccess("操作成功");
-            this.getDetails(this.row)
+            let param = this.query
+            param.sumFlag = this.row.sumFlag
+            this.getDetails(param)
           }
         })
       }
@@ -250,7 +258,9 @@ export default {
       reloadBatch(param).then(res => {
         if (res.code === 200) {
           this.$modal.msgSuccess("操作成功");
-          this.getDetails(this.row)
+          let param = this.query
+          param.sumFlag = this.row.sumFlag
+          this.getDetails(param)
         }
       })
       

+ 7 - 5
src/views/purchase/DemandSummary/index.vue

@@ -256,6 +256,7 @@
           show-summary
           :summary-method="getSummaries"
           max-height="550"
+          style="font-size: 12px;"
           @selection-change="handleSelectionChange"
           :key="isUpdate"
         >
@@ -291,7 +292,7 @@
           <el-table-column show-overflow-tooltip label="人工调整数" align="center" prop="artificialAdjust" width="100px"/>
           <el-table-column show-overflow-tooltip label="修改原因" align="center" prop="modifyReason" width="150px">
             <template slot-scope="scope">
-                <el-input :disabled="scope.row.status !== '1'|| lineDisable" v-model="scope.row.modifyReason"/>
+                <el-input :disabled="scope.row.status !== '1'|| lineDisable || scope.row.artificialAdjust == '0'" v-model="scope.row.modifyReason"/>
             </template>
           </el-table-column>
           <el-table-column show-overflow-tooltip label="建议采购量" align="center" prop="suggestionPurchase" width="100px"/>
@@ -349,8 +350,8 @@
           background
           @size-change="handleSizeChange"
           @current-change="handleCurrentChange"
-          :current-page="1"
-          :page-sizes="[5, 10, 15, 20]"
+          :current-page="queryParams.pageNum"
+          :page-sizes="[10, 15, 20]"
           :page-size="100"
           layout="total, sizes, prev, pager, next, jumper"
           :total=total>
@@ -463,7 +464,7 @@ export default {
         demandDate: '',
         approverFinishTime: '',
         pageNum: 1,
-        pageSize: 5
+        pageSize: 10
       },
       personOptions: [],
       classOptions: [],
@@ -557,7 +558,7 @@ export default {
         demandDate: '',
         approverFinishTime: '',
         pageNum: 1,
-        pageSize: 5
+        pageSize: 10
       }
       this.getList(this.queryParams)
     },
@@ -603,6 +604,7 @@ export default {
     },
     cancelEdit() {
       this.lineDisable = true
+      this.getList(this.queryParams)
     },
     saveList() {
       editSummaryList(this.tableList).then(res => {

+ 10 - 4
src/views/purchase/MaterialClassDivision/index.vue

@@ -210,6 +210,7 @@
           :data="tableList" 
           fit
           max-height="480"
+          style="font-size: 12px;"
           @selection-change="handleSelectionChange"
         >
           <el-table-column show-overflow-tooltip type="selection" width="55" />
@@ -246,10 +247,11 @@
         </el-table>
 
         <el-pagination
+          background
           @size-change="handleSizeChange"
           @current-change="handleCurrentChange"
-          :current-page="1"
-          :page-sizes="[5, 10, 15, 20]"
+          :current-page="queryParams.pageNum"
+          :page-sizes="[10, 15, 20]"
           :page-size="100"
           layout="total, sizes, prev, pager, next, jumper"
           :total=total>
@@ -316,7 +318,7 @@ export default {
         manufacturer: '',
         remark: '',
         pageNum: 1,
-        pageSize: 5
+        pageSize: 10
       },
       options: [{
         value: 'Y', label: '是',
@@ -368,7 +370,7 @@ export default {
         manufacturer: '',
         remark: '',
         pageNum: 1,
-        pageSize: 5
+        pageSize: 10
       }
       this.getList(this.queryParams)
     },
@@ -469,4 +471,8 @@ export default {
 .lines {
   margin-top: 0;
 }
+.el-pagination {
+  margin-top: 10px;
+  text-align: right;
+}
 </style>

+ 1 - 0
src/views/purchase/PurchaseDemandList/add.vue

@@ -164,6 +164,7 @@
           :data="basicForm.puDemandItemList" 
           fit
           max-height="300"
+          style="font-size: 12px;"
           @selection-change="handleSelectionChange"
         >
           <el-table-column show-overflow-tooltip type="selection"/>

+ 30 - 6
src/views/purchase/PurchaseDemandList/index.vue

@@ -163,6 +163,7 @@
           :data="tableList" 
           fit
           max-height="550"
+          style="font-size: 12px;"
           @selection-change="handleSelectionChange"
         >
           <el-table-column show-overflow-tooltip type="selection" width="55" />
@@ -199,8 +200,8 @@
           background
           @size-change="handleSizeChange"
           @current-change="handleCurrentChange"
-          :current-page="1"
-          :page-sizes="[5, 10, 15, 20]"
+          :current-page="queryParams.pageNum"
+          :page-sizes="[10, 15, 20]"
           :page-size="100"
           layout="total, sizes, prev, pager, next, jumper"
           :total=total>
@@ -240,7 +241,7 @@
     </el-dialog>
 
     <!-- 模板下载新增参数 -->
-    <el-dialog title="需求模板下载" :visible.sync="download.open" width="400px">
+    <el-dialog title="需求模板下载" :visible.sync="download.open" @close="clearDownload" width="400px">
       <el-row style="margin-bottom: 20px;">
         <span style="margin-right: 10px;">需求客户</span>
         <el-select clearable size="mini" v-model="download.customer" @clear="download.customer = ''" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')">
@@ -255,7 +256,7 @@
       </el-row>
       <el-row style="margin-bottom: 20px;">
         <span style="margin-right: 10px;">供应货位</span>
-        <el-select clearable size="mini" v-model="download.cargoSpace" @clear="download.cargoSpace = ''" @focus="chooseOrg('ALLOCATION_PARAM', true, '选择货位', download.warehouseId)">
+        <el-select clearable size="mini" v-model="download.cargoSpace" @clear="download.cargoSpace = ''" @focus="mbHuowei('ALLOCATION_PARAM', true, '选择货位', download.warehouseId)">
           <el-option v-for="item in mBcargoSpace" :key="item.id" :label="item.name" :value="item.code" />
         </el-select>
       </el-row>
@@ -350,7 +351,7 @@ export default {
         materialCode: '',
         status: '',
         pageNum: 1,
-        pageSize: 5
+        pageSize: 10
       },
       referCondition: {
         type: '',
@@ -436,7 +437,7 @@ export default {
         materialCode: '',
         status: '',
         pageNum: 1,
-        pageSize: 5
+        pageSize: 10
       }
       this.getList(this.queryParams)
     },
@@ -473,6 +474,18 @@ export default {
         this.download.open = false
       })
     },
+    // 关闭模板下载弹窗清空参数
+    clearDownload() {
+      // 模板下载参数
+      this.download =  {
+        open: false,
+        customer: '',
+        warehouse: '',
+        warehouseId: '',
+        cargoSpace: '',
+        category: ''
+      }
+    },
     handleCommand(command) {
       // alert(command)
       if(command == '模板下载') {
@@ -642,6 +655,17 @@ export default {
         this.queryParams.demandDept = selection[0].id
       }
     },
+    mbHuowei(type, isPage, title, stordocId) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      if(stordocId) {
+        this.referCondition.stordocId = stordocId
+        this.$refs.refer.init(this.referCondition)
+      } else {
+        this.$modal.msgWarning("请先选择仓库")
+      }
+    },
     cleanMb() {
       this.download.warehouse = ''
       this.download.warehouseId = ''

+ 5 - 5
src/views/purchase/apply/add/column.js

@@ -26,7 +26,7 @@ export const FormColumns = [
     require: true,
   },
   {
-    key: "supplierCode",
+    key: "supplier",
     title: "供应商编码",
     inputType: "Input",
     disabled: true,
@@ -46,7 +46,7 @@ export const FormColumns = [
     require: true,
   },
   {
-    key: "puOrgCode",
+    key: "puOrg",
     title: "采购组织编码",
     inputType: "Input",
     disabled: true,
@@ -65,7 +65,7 @@ export const FormColumns = [
     require: true,
   },
   {
-    key: "currencyCode",
+    key: "currency",
     title: "币种编码",
     inputType: "Input",
     disabled: true,
@@ -108,7 +108,7 @@ export const FormColumns = [
     require: true,
   },
   {
-    key: "puDeptCode",
+    key: "puDept",
     title: "采购部门编码",
     inputType: "Input",
     disabled: true,
@@ -411,7 +411,7 @@ export const TabColumns = [
           orgName: "name",
         },
       },
-      { title: "组织编码", key: "orgCode" },
+      { title: "组织编码", key: "org" },
       // { title: "组织ID", key: "org" },
       {
         title: "创建人名称",

+ 3 - 1
src/views/purchase/apply/add/index.vue

@@ -4,6 +4,7 @@ import useData from "../hooks/data";
 import useDicts from "../hooks/dicts";
 import useWatch from "../hooks/watch";
 import useMethods from "../hooks/function";
+import { initParams } from "@/utils/init";
 import { ITEM, SAVE } from "@/api/business/purchase/apply";
 const { watchPuOrgName } = useWatch();
 
@@ -85,7 +86,8 @@ export default {
     async useRowAdd(prop) {
       const {
         $notify,
-        params: { tabColumns, puOrgName, supplierName },
+        tabColumns,
+        params: { puOrgName, supplierName },
       } = this;
       if (!supplierName) {
         return $notify.info("请选择供应商");

+ 25 - 23
src/views/purchase/apply/delete/index.vue

@@ -11,30 +11,32 @@ export default {
   methods: {
     //
     open(prop) {
-      return this.$confirm("是否删除数据项?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "info",
-      })
-        .then(async () => {
-          try {
-            // try
-            const ids = prop.map((item) => item.id).join(",");
-            const { msg, code } = await REMOVE(ids);
-            if (code === 200) {
-              this.$emit("success");
-              this.$notify.success(msg);
-            }
-          } catch (err) {
-            // catch
-            console.error(err);
-          } finally {
-            // finally
-          }
+      return new Promise((resolve, reject) => {
+        this.$confirm("是否删除数据项?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "info",
         })
-        .catch((err) => {
-          console.error(err);
-        });
+          .then(async () => {
+            try {
+              // try
+              const ids = prop.map((item) => item.id).join(",");
+              const { msg, code } = await REMOVE(ids);
+              if (code === 200) {
+                resolve(true);
+                this.$emit("success");
+                this.$notify.success(msg);
+              }
+            } catch (err) {
+              // catch
+              reject(false);
+              console.error(err);
+            } finally {
+              // finally
+            }
+          })
+          .catch(() => reject(false));
+      });
     },
   },
   created() {},

+ 3 - 1
src/views/purchase/apply/edit/index.vue

@@ -4,6 +4,7 @@ import useData from "../hooks/data";
 import useDicts from "../hooks/dicts";
 import useWatch from "../hooks/watch";
 import useMethods from "../hooks/function";
+import { initParams } from "@/utils/init";
 import { ITEM, SAVE } from "@/api/business/purchase/apply";
 const { watchPuOrgName, watchPriceApplyOrgs, watchPriceApplyItems } =
   useWatch();
@@ -92,7 +93,8 @@ export default {
     async useRowAdd(prop) {
       const {
         $notify,
-        params: { tabColumns, puOrgName, supplierName },
+        tabColumns,
+        params: { puOrgName, supplierName },
       } = this;
       if (!supplierName) {
         return $notify.info("请选择供应商");

+ 0 - 3
src/views/purchase/apply/see/index.vue

@@ -2,7 +2,6 @@
 import Column from "../add/column";
 import useData from "../hooks/data";
 import useDicts from "../hooks/dicts";
-import useMethods from "../hooks/function";
 import { ITEM } from "@/api/business/purchase/apply";
 
 export default {
@@ -49,8 +48,6 @@ export default {
     //
     async hide() {
       this.visible = false;
-      this.params = this.resetParams();
-      this.tabName = this.tabColumns[0].key;
     },
     //
     async useDelete(prop) {

+ 25 - 23
src/views/purchase/apply/submit/index.vue

@@ -11,30 +11,32 @@ export default {
   methods: {
     //
     open(prop) {
-      return this.$confirm("是否提交审核数据项?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "info",
-      })
-        .then(async () => {
-          try {
-            // try
-            const ids = prop.map((item) => item.id).join(",");
-            const { msg, code } = await SUBMIT(ids);
-            if (code === 200) {
-              this.$emit("success");
-              this.$notify.success(msg);
-            }
-          } catch (err) {
-            // catch
-            console.error(err);
-          } finally {
-            // finally
-          }
+      return new Promise((resolve, reject) => {
+        this.$confirm("是否提交审核数据项?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "info",
         })
-        .catch((err) => {
-          console.error(err);
-        });
+          .then(async () => {
+            try {
+              // try
+              const ids = prop.map((item) => item.id).join(",");
+              const { msg, code } = await SUBMIT(ids);
+              if (code === 200) {
+                resolve(true);
+                this.$emit("success");
+                this.$notify.success(msg);
+              }
+            } catch (err) {
+              // catch
+              reject(false);
+              console.error(err);
+            } finally {
+              // finally
+            }
+          })
+          .catch(() => reject(false));
+      });
     },
   },
   created() {},

+ 25 - 23
src/views/purchase/catalogue/enable/index.vue

@@ -11,30 +11,32 @@ export default {
   methods: {
     //
     open(prop, status) {
-      return this.$confirm("是否启停数据项?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "info",
-      })
-        .then(async () => {
-          try {
-            // try
-            const ids = prop.map((item) => item.id);
-            const { msg, code } = await ENABLE({ ids, enableStatus: status });
-            if (code === 200) {
-              this.$emit("success");
-              this.$notify.success(msg);
-            }
-          } catch (err) {
-            // catch
-            console.error(err);
-          } finally {
-            // finally
-          }
+      return new Promise((resolve, reject) => {
+        this.$confirm("是否启停数据项?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "info",
         })
-        .catch((err) => {
-          console.error(err);
-        });
+          .then(async () => {
+            try {
+              // try
+              const ids = prop.map((item) => item.id);
+              const { msg, code } = await ENABLE({ ids, enableStatus: status });
+              if (code === 200) {
+                resolve(true);
+                this.$emit("success");
+                this.$notify.success(msg);
+              }
+            } catch (err) {
+              // catch
+              reject(false);
+              console.error(err);
+            } finally {
+              // finally
+            }
+          })
+          .catch(() => reject(false));
+      });
     },
   },
   created() {},

+ 0 - 32
src/views/purchase/catalogue/hooks/function.js

@@ -1,32 +0,0 @@
-import { ITEM } from "@/api/business/purchase/catalogue";
-
-export default function useMethods() {
-  const fetchItem = async ({ _this, prop }) => {
-    try {
-      // try
-      _this.loading = true;
-      const { code, data } = await ITEM(prop);
-      if (code === 200) {
-        _this.params = data;
-      }
-    } catch (err) {
-      // catch
-      console.error(err);
-    } finally {
-      // finally
-      _this.loading = false;
-    }
-  };
-  const open = ({ _this }) => {
-    _this.visible = true;
-  };
-  const hide = ({ _this }) => {
-    _this.visible = false;
-  };
-
-  return {
-    open,
-    hide,
-    fetchItem,
-  };
-}

+ 25 - 23
src/views/purchase/catalogue/invalid/index.vue

@@ -11,30 +11,32 @@ export default {
   methods: {
     //
     open(prop) {
-      return this.$confirm("是否失效数据项?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "info",
-      })
-        .then(async () => {
-          try {
-            // try
-            const ids = prop.map((item) => item.id);
-            const { msg, code } = await INVALID({ ids });
-            if (code === 200) {
-              this.$emit("success");
-              this.$notify.success(msg);
-            }
-          } catch (err) {
-            // catch
-            console.error(err);
-          } finally {
-            // finally
-          }
+      return new Promise((resolve, reject) => {
+        this.$confirm("是否失效数据项?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "info",
         })
-        .catch((err) => {
-          console.error(err);
-        });
+          .then(async () => {
+            try {
+              // try
+              const ids = prop.map((item) => item.id);
+              const { msg, code } = await INVALID({ ids });
+              if (code === 200) {
+                resolve(true);
+                this.$emit("success");
+                this.$notify.success(msg);
+              }
+            } catch (err) {
+              // catch
+              reject(false);
+              console.error(err);
+            } finally {
+              // finally
+            }
+          })
+          .catch(() => reject(false));
+      });
     },
   },
   created() {},

+ 47 - 31
src/views/purchase/catalogue/see/index.vue

@@ -2,7 +2,7 @@
 import Column from "../column";
 import useData from "../hooks/data";
 import useDicts from "../hooks/dicts";
-import useMethods from "../hooks/function";
+import { ITEM } from "@/api/business/purchase/catalogue";
 
 export default {
   name: "SeeDrawer",
@@ -15,44 +15,59 @@ export default {
     };
   },
   computed: {
-    hasPowerEnable: function () {
-      return this.$parent.$parent.hasPowerEnable;
-    },
-    hasPowerInvalid: function () {
-      return this.$parent.$parent.hasPowerInvalid;
+    root: function () {
+      return this.$parent.$parent;
     },
   },
   watch: {},
   methods: {
     //
+    async fetchItem(prop) {
+      try {
+        // try
+        this.loading = true;
+        const { code, data } = await ITEM(prop);
+        if (code === 200) {
+          this.params = data;
+          return true;
+        } else {
+          return false;
+        }
+      } catch (err) {
+        // catch
+        console.error(err);
+      } finally {
+        // finally
+        this.loading = false;
+      }
+    },
+    //
     async open(prop) {
-      const { open, fetchItem } = useMethods();
-      await open({ _this: this });
-      await fetchItem({ _this: this, prop });
+      this.visible = await this.fetchItem(prop);
     },
     //
     async hide() {
-      const { hide } = useMethods();
-      await hide({ _this: this });
+      this.visible = false;
     },
     //
     async useInvalid(prop) {
-      const { useInvalid } = this.$parent.$parent;
-      await useInvalid(prop).then(() => {
-        const [{ id }] = prop;
-        const { fetchItem } = useMethods();
-        fetchItem({ _this: this, prop: id });
-      });
+      await this.root
+        .useInvalid(prop)
+        .then(() => {
+          this.fetchItem(this.params.id);
+        })
+        .catch(() => {});
     },
     //
     async useEnable(prop) {
-      const [{ id, enableStatus }] = prop;
-      const { useEnable } = this.$parent.$parent;
+      const [{ enableStatus }] = prop;
       const status = enableStatus === "2" ? "0" : "2";
-      await useEnable(prop, status).then(() => {
-        const { fetchItem } = useMethods();
-        fetchItem({ _this: this, prop: id });
-      });
+      await this.root
+        .useEnable(prop, status)
+        .then(() => {
+          this.fetchItem(this.params.id);
+        })
+        .catch(() => {});
     },
   },
   created() {},
@@ -70,14 +85,8 @@ export default {
     <template slot="title">
       <span>{{ title }}</span>
       <span>
-        <el-button
-          :size="size"
-          circle
-          icon="el-icon-close"
-          @click="hide"
-        ></el-button>
         <el-tooltip
-          v-if="hasPowerInvalid([params])"
+          v-if="root.hasPowerInvalid([params])"
           effect="dark"
           content="失 效"
           placement="bottom-end"
@@ -90,7 +99,7 @@ export default {
           ></el-button>
         </el-tooltip>
         <el-tooltip
-          v-if="hasPowerEnable([params])"
+          v-if="root.hasPowerEnable([params])"
           effect="dark"
           :content="params.enableStatus === '2' ? '启 用' : '停 用'"
           placement="bottom-end"
@@ -102,6 +111,13 @@ export default {
             @click="useEnable([params])"
           ></el-button>
         </el-tooltip>
+        <el-button
+          :size="size"
+          circle
+          type="danger"
+          icon="el-icon-close"
+          @click="hide"
+        ></el-button>
       </span>
     </template>
     <el-descriptions :size="size" :column="column" border style="margin: 10px">

+ 10 - 4
src/views/purchase/deliveryAddress/index.vue

@@ -171,6 +171,7 @@
           :data="tableList" 
           fit
           max-height="480"
+          style="font-size: 12px;"
           @selection-change="handleSelectionChange"
         >
           <el-table-column show-overflow-tooltip type="selection" width="55" />
@@ -205,10 +206,11 @@
         </el-table>
 
         <el-pagination
+          background
           @size-change="handleSizeChange"
           @current-change="handleCurrentChange"
-          :current-page="1"
-          :page-sizes="[5, 10, 15, 20]"
+          :current-page="queryParams.pageNum"
+          :page-sizes="[10, 15, 20]"
           :page-size="100"
           layout="total, sizes, prev, pager, next, jumper"
           :total=total>
@@ -263,7 +265,7 @@ export default {
         sendStatus: '',
         remark: '',
         pageNum: 1,
-        pageSize: 5
+        pageSize: 10
       },
       options: [{
         value: 'Y', label: '是',
@@ -322,7 +324,7 @@ export default {
         sendStatus: '',
         remark: '',
         pageNum: 1,
-        pageSize: 5
+        pageSize: 10
       }
       this.getList(this.queryParams)
     },
@@ -419,4 +421,8 @@ export default {
 .lines {
   margin-top: 0;
 }
+.el-pagination {
+  margin-top: 10px;
+  text-align: right;
+}
 </style>

+ 25 - 21
src/views/purchase/task/close/index.vue

@@ -10,28 +10,32 @@ export default {
   methods: {
     //
     open(prop) {
-      this.$confirm("是否关闭数据项?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "info",
-      })
-        .then(async () => {
-          try {
-            this.loading = true;
-            const { demandItemId } = prop;
-            const { code } = await SHUTDOWN(demandItemId);
-            if (code === 200) {
-              this.$emit("success");
-            }
-          } catch (err) {
-            // catch
-          } finally {
-            // finally
-          }
+      return new Promise((resolve, reject) => {
+        this.$confirm("是否关闭数据项?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "info",
         })
-        .catch((err) => {
-          console.error(err);
-        });
+          .then(async () => {
+            try {
+              this.loading = true;
+              const { demandItemId } = prop;
+              const { msg, code } = await SHUTDOWN(demandItemId);
+              if (code === 200) {
+                resolve(true);
+                this.$emit("success");
+                this.$notify.success(msg);
+              }
+            } catch (err) {
+              // catch
+              reject(false);
+              console.error(err);
+            } finally {
+              // finally
+            }
+          })
+          .catch(() => reject(false));
+      });
     },
   },
   created() {},

+ 31 - 89
src/views/purchase/task/documents-return/index.vue

@@ -4,50 +4,42 @@ export default {
   name: "DocumentsReturnDialog",
   components: {},
   data() {
-    return {
-      size: "mini",
-      title: "退回需求",
-      visible: false,
-      loading: false,
-      params: { baskCause: "", documentIds: [] },
-    };
+    return {};
   },
   computed: {},
   watch: {},
   methods: {
     //
     open(prop) {
-      this.visible = true;
-      const documentIds = prop.map((item) => item.id);
-      this.params.documentIds = documentIds;
-    },
-    //
-    hide() {
-      this.visible = false;
-      this.params.baskCause = "";
-      this.params.documentIds = [];
-    },
-    //
-    async submit(prop) {
-      try {
-        // try
-        this.loading = true;
-        const { baskCause, documentIds } = prop;
-        const { msg, code } = await DOCUMENTSRETURN({
-          baskCause,
-          documentIds,
-        });
-        if (code === 200) {
-          this.hide();
-          this.$emit("success");
-          this.$notify.success({ title: msg });
-        }
-      } catch (err) {
-        // catch
-      } finally {
-        // finally
-        this.loading = false;
-      }
+      return new Promise((resolve, reject) => {
+        this.$prompt("请填写退单原因", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "info",
+        })
+          .then(async ({ value: baskCause }) => {
+            try {
+              this.loading = true;
+              const documentIds = prop.map((item) => item.id);
+              const { msg, code } = await DOCUMENTSRETURN({
+                baskCause,
+                documentIds,
+              });
+              if (code === 200) {
+                resolve(true);
+                this.$emit("success");
+                this.$notify.success(msg);
+              }
+            } catch (err) {
+              // catch
+              reject(false);
+              console.error(err);
+            } finally {
+              // finally
+            }
+          })
+          .catch(() => reject(false));
+      });
     },
   },
   created() {},
@@ -56,56 +48,6 @@ export default {
 };
 </script>
 
-<template>
-  <el-dialog
-    width="25%"
-    :show-close="false"
-    :visible.sync="visible"
-    @close="hide"
-  >
-    <div
-      slot="title"
-      style="display: flex; justify-content: space-between; align-items: center"
-    >
-      <span>{{ title }}</span>
-      <span>
-        <el-button
-          :size="size"
-          :disabled="loading"
-          circle
-          icon="el-icon-close"
-          @click="visible = false"
-        >
-        </el-button>
-        <el-button
-          :size="size"
-          :disabled="loading"
-          circle
-          icon="el-icon-check"
-          @click="submit(params)"
-        >
-        </el-button>
-      </span>
-    </div>
-    <el-alert
-      title="请填写退单原因"
-      type="info"
-      show-icon
-      :closable="false"
-      style="margin-bottom: 10px"
-    >
-    </el-alert>
-    <el-form
-      :size="size"
-      :model="params"
-      label-width="0px"
-      label-position="right"
-    >
-      <el-form-item prop="" label="">
-        <el-input v-model="params.baskCause" :size="size"></el-input>
-      </el-form-item>
-    </el-form>
-  </el-dialog>
-</template>
+<template></template>
 
 <style scoped></style>

+ 7 - 6
src/views/purchase/task/first-direct/index.vue

@@ -93,16 +93,17 @@ export default {
         <el-button
           :size="size"
           circle
-          icon="el-icon-close"
-          @click="visible = false"
-        ></el-button>
-        <el-button
-          :size="size"
-          circle
           icon="el-icon-check"
           @click="submit(data)"
         >
         </el-button>
+        <el-button
+          :size="size"
+          circle
+          type="danger"
+          icon="el-icon-close"
+          @click="visible = false"
+        ></el-button>
       </span>
     </template>
     <div v-for="(item, index) in data" :key="index" style="margin: 10px">

+ 5 - 4
src/views/purchase/task/modify-buyer/index.vue

@@ -76,16 +76,17 @@ export default {
           :size="size"
           :disabled="loading"
           circle
-          icon="el-icon-close"
-          @click="visible = false"
+          icon="el-icon-check"
+          @click="submit(params)"
         >
         </el-button>
         <el-button
           :size="size"
           :disabled="loading"
           circle
-          icon="el-icon-check"
-          @click="submit(params)"
+          type="danger"
+          icon="el-icon-close"
+          @click="visible = false"
         >
         </el-button>
       </span>

+ 6 - 6
src/views/purchase/task/see/index.vue

@@ -21,11 +21,6 @@ export default {
   computed: {},
   watch: {},
   methods: {
-    //
-    open(prop) {
-      this.visible = true;
-      this.fetchItem(prop);
-    },
     // 查 询
     async fetchItem(prop) {
       try {
@@ -33,8 +28,9 @@ export default {
         const { code, data } = await ITEM(prop);
         if (code === 200) {
           this.params = data;
+          return true;
         } else {
-          this.$notify.warning({ title: msg });
+          return false;
         }
       } catch (err) {
         // catch
@@ -43,6 +39,10 @@ export default {
         this.loading = false;
       }
     },
+    //
+    open(prop) {
+      this.visible = this.fetchItem(prop);
+    },
   },
   created() {},
   mounted() {},

+ 4 - 0
src/views/purchase/transferOrder/add.vue

@@ -244,6 +244,7 @@
           :data="materialInfo" 
           fit
           max-height="480"
+          style="font-size: 12px;"
           >
           <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno">
               <template slot-scope="scope">
@@ -389,6 +390,7 @@
           :data="receiveInfo" 
           fit
           max-height="480"
+          style="font-size: 12px;"
           >
           <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno"/>
           <el-table-column show-overflow-tooltip label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
@@ -427,6 +429,7 @@
           :data="priceList" 
           fit
           max-height="480"
+          style="font-size: 12px;"
           >
           <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno"/>
           <el-table-column show-overflow-tooltip label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
@@ -461,6 +464,7 @@
           :data="resultList" 
           fit
           max-height="480"
+          style="font-size: 12px;"
           >
           <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno"/>
           <el-table-column show-overflow-tooltip label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>

+ 6 - 1
src/views/purchase/transferOrder/index.vue

@@ -98,6 +98,7 @@
           show-summary
           highlight-current-row
           max-height="680"
+          style="font-size: 12px;"
           ref="multipleTable"
           @row-click="select"
         >
@@ -151,7 +152,7 @@
           background
           @size-change="handleSizeChange"
           @current-change="handleCurrentChange"
-          :current-page="1"
+          :current-page="queryParams.pageNum"
           :page-sizes="[5, 10, 15, 20]"
           :page-size="100"
           layout="total, sizes, prev, pager, next, jumper"
@@ -164,6 +165,7 @@
             :data="materialInfo" 
             fit
             max-height="380"
+            style="font-size: 12px;"
             >
             <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno"/>
             <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="materialCode" width="150px"/>
@@ -208,6 +210,7 @@
             :data="receiveInfo" 
             fit
             max-height="380"
+            style="font-size: 12px;"
             >
             <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno"/>
             <el-table-column show-overflow-tooltip label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
@@ -246,6 +249,7 @@
             :data="priceList" 
             fit
             max-height="380"
+            style="font-size: 12px;"
             >
             <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno"/>
             <el-table-column show-overflow-tooltip label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
@@ -280,6 +284,7 @@
             :data="resultList" 
             fit
             max-height="380"
+            style="font-size: 12px;"
             >
             <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno"/>
             <el-table-column show-overflow-tooltip label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>

+ 0 - 1
vue.config.js

@@ -45,7 +45,6 @@ module.exports = {
         // target: `http://172.16.13.152:8000/drp-admin`, //豪哥本地
         // target: `http://172.16.13.47:8000/drp-admin`, //这是一个美女的本地
         // target: `http://172.16.13.113:8000/drp-admin`, //DWT本地
-        // target: `http://172.16.13.77:8000/drp-admin`, //TQ本地
         // target: `http://172.16.13.21:8000/drp-admin`, // 雪豹的本地
         changeOrigin: true,
         pathRewrite: {