Quellcode durchsuchen

1.采购订单维护页面加转派功能
2.采购订单生成页面增加行关闭功能
3.采购订单生成、维护增加查询条件:紧急标识和补单标识;

002390 vor 1 Jahr
Ursprung
Commit
91a36e6406

+ 12 - 1
src/api/business/purchase/purchase-order.js

@@ -189,6 +189,15 @@ export function oaBack(data) {
   });
 }
 
+// 转派
+export function modifyBuyer(data) {
+  return request({
+    url: "/pu/order/modifyBuyer",
+    method: "PUT",
+    data: data,
+  });
+}
+
 
 export default {
   list,
@@ -211,5 +220,7 @@ export default {
   orderExport,
   orderImport,
   downloadFailData,
-  oaBack
+  oaBack,
+  modifyBuyer,
+  
 }

+ 9 - 0
src/api/business/purchase/task.js

@@ -72,3 +72,12 @@ export function PRINT(params) {
     params: params,
   });
 }
+
+export function ROWClOSE(data) {
+  return request({
+    url: "/pu/order/generate/rowClose",
+    method: "PUT",
+    data: data,
+  });
+}
+

+ 22 - 0
src/views/purchase/purchase-order/column.js

@@ -1308,6 +1308,28 @@ export const SearchColumns = [
       dictName: "order_delivery_status",
     },
   },
+  {
+    item: { 
+      key: "isUrgency", 
+      title: "紧急标识",
+    },
+    attr: { 
+      clearable: true,
+      is: "el-select", 
+      dictName: "sys_yes_no" 
+    },
+  },
+  {
+    item: { 
+      key: "isReplenishment", 
+      title: "补单标识",
+    },
+    attr: { 
+      clearable: true,
+      is: "el-select", 
+      dictName: "sys_yes_no" 
+    },
+  },
   
   // {
   //   item:{

+ 15 - 6
src/views/purchase/purchase-order/index.vue

@@ -28,6 +28,7 @@ export default {
     ElSuperTable: () => import("@/components/super-table/index.vue"),
     ElSuperSearch: () => import("@/components/super-search/index.vue"),
     Retrieve: () => import("@/components/Retrieve/index.vue"),
+    ZpButton: () => import("./zhuan-pai/index.vue"),
     },
   data() {
     const initTabColumns = () => TabColumns;
@@ -52,6 +53,7 @@ export default {
       primaryResource:{},
       timer:300,
       timeOut:null,
+      size:'mini',
     };
   },
 
@@ -691,17 +693,17 @@ export default {
     <!-- 操作 -->
     <el-row :gutter="24" type="flex" justify="end" style="margin: 20px 0;">
       <el-col :span="24" style="text-align: right;">
-        <el-button size="mini" type="primary" @click="handleOpenAddDrawer"
+        <el-button :size="size" type="primary" @click="handleOpenAddDrawer"
           v-hasPermi="['material:order:add']">新增</el-button>
        
         <el-button-group style="margin-left: 10px">
-          <el-button type="primary" size="mini" :disabled="checkedList.length != 1" @click="handleCopy">复制</el-button>
-          <el-button type="primary" size="mini" @click="handleBatchSubmit">批量提交</el-button>
+          <el-button type="primary" :size="size" :disabled="checkedList.length != 1" @click="handleCopy">复制</el-button>
+          <el-button type="primary" :size="size" @click="handleBatchSubmit">批量提交</el-button>
         </el-button-group>
 
         <el-button-group style="margin-left: 10px" :key="checkedList.length + 1">
-          <el-button type="primary" size="mini" @click="handleAllReturn" :disabled="judgeIsAllReturn()">整单退回</el-button>
-          <!-- <el-button type="primary" size="mini" @click="handleAllClose" :disabled="judgeIsAllClose()">整单关闭</el-button> -->
+          <el-button type="primary" :size="size" @click="handleAllReturn" :disabled="judgeIsAllReturn()">整单退回</el-button>
+          <!-- <el-button type="primary" :size="size" @click="handleAllClose" :disabled="judgeIsAllClose()">整单关闭</el-button> -->
         </el-button-group>
 
         <el-button-group style="margin:0 10px">
@@ -718,7 +720,14 @@ export default {
           >批量导出</el-button>
           
         </el-button-group>
-        
+        <el-button-group>
+          <zp-button
+            :size="size"
+            :select-data="checkedList"
+            @success="handleQueryList"
+          >
+          </zp-button>
+        </el-button-group>
 
 
       </el-col>

+ 155 - 0
src/views/purchase/purchase-order/zhuan-pai/index.vue

@@ -0,0 +1,155 @@
+<script>
+import { modifyBuyer } from "@/api/business/purchase/purchase-order";
+export default {
+  name: "ModifyBuyerDialog",
+  props: {
+    selectData: {
+      type: [Array],
+      require: true,
+    },
+  },
+  components: {
+    ElPopoverSelectV2: () => import("@/components/popover-select-v2/index.vue"),
+  },
+  data() {
+    return {
+      title: "转 派",
+      visible: false,
+      loading: false,
+      // params: { id: "", buyer: "", buyerName: "" },
+      params:[],
+      buyerModel:{buyer: "", buyerName: ""},
+    };
+  },
+  computed: {
+    disabled: {
+      get() {
+        // return this.selectData.length !== 1;
+        // add by wjie
+        return this.selectData.length < 1;
+      },
+      set() {},
+    },
+  },
+  watch: {},
+  methods: {
+    //
+    open(prop) {
+      // let arr = prop.filter((element) => element.status != '0' && element.status != '3');
+      // let arr = prop.filter((element) => element.status != '0' || (element.status === '0' && element.source === '3'));
+
+      // if(arr.length > 0){
+      //   this.$modal.notifyWarning("您所选的单据中存在非自由态或手工单,无法进行操作,请确认数据!");
+      //   return;
+      // }
+      this.params = prop;
+      this.visible = true;
+    },
+    //
+    hide() {
+      this.visible = false;
+      // this.params.id = "";
+      // this.params.buyer = "";
+      // this.params.buyerName = "";
+      this.params = [];
+      this.buyerModel = {buyer: "", buyerName: ""};
+    },
+    //
+    async submit(prop) {
+      try {
+        // try
+        this.loading = true;
+        const { buyer, buyerName } = prop;
+        // for(let i in this.selectData){
+        //   this.selectData[i].buyer = buyer;
+        //   this.selectData[i].buyerName = buyerName;
+        // }
+
+        let params = {
+          puOrderIds:[...this.selectData.map(item => item.id)],
+          buyer,
+          buyerName
+        }
+
+        console.log(params,'params');
+        const { msg, code } = await modifyBuyer(params);
+        if (code === 200) {
+          this.hide();
+          this.$emit("success");
+          this.$notify.success({ title: msg });
+        }
+      } catch (err) {
+        // catch
+      } finally {
+        // finally
+        this.loading = false;
+      }
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+
+<template>
+  <el-button
+    v-bind="$attrs"
+    v-on="$listeners"
+    :disabled="disabled"
+    @click="open(selectData)"
+  >
+    {{ title }}
+    <el-dialog
+      :title="title"
+      :visible.sync="visible"
+      width="25%"
+      append-to-body
+      @close="hide"
+    >
+      <div slot="footer">
+        <el-button
+          :size="$attrs.size"
+          :loading="loading"
+          @click="visible = false"
+          >取 消</el-button
+        >
+        <el-button
+          type="primary"
+          :size="$attrs.size"
+          :loading="loading"
+          @click="submit(buyerModel)"
+          >确 认</el-button
+        >
+      </div>
+      <!-- <el-alert
+        title="转派后,采购任务将会从您的采购任务清单中删除,转移到转派目标人员的已受理采购任务清单中,您确定要转派吗?"
+        type="info"
+        show-icon
+        :closable="false"
+        style="margin-bottom: 10px"
+      >
+      </el-alert> -->
+      <el-form
+        :size="$attrs.size"
+        :model="buyerModel"
+        label-width="0px"
+        label-position="right"
+        style="padding: 0"
+      >
+        <el-form-item prop="" label="">
+          <el-popover-select-v2
+            v-model="buyerModel.buyerName"
+            :source.sync="buyerModel"
+            :data-mapping="{ buyer: 'code', buyerName: 'name' }"
+            valueKey="name"
+            referName="CONTACTS_PARAM"
+          >
+          </el-popover-select-v2>
+        </el-form-item>
+      </el-form>
+    </el-dialog>
+  </el-button>
+</template>
+
+<style scoped></style>

+ 28 - 20
src/views/purchase/task/columns.js

@@ -40,6 +40,12 @@ export default function useColumns() {
         isSummary:true,
       },
     },
+    {
+      item: { key: "closeQty", title: "关闭数量",width :100 },
+      attr: {
+        isSummary:true,
+      },
+    },
     { item: { key: "buyerName", title: "采购员",width :100 }, attr: {} },
     {
       item: { key: "customerName", title: "收货客户",width :100 },
@@ -236,26 +242,28 @@ export default function useColumns() {
         valueKey: "name",
       },
     },
-    // {
-    //   item: { 
-    //     key: "", 
-    //     title: "紧急标识",
-    //   },
-    //   attr: { 
-    //     is: "el-select", 
-    //     dictName: "sys_yes_no" 
-    //   },
-    // },
-    // {
-    //   item: { 
-    //     key: "", 
-    //     title: "补单标识",
-    //   },
-    //   attr: { 
-    //     is: "el-select", 
-    //     dictName: "sys_yes_no" 
-    //   },
-    // },
+    {
+      item: { 
+        key: "isUrgency", 
+        title: "紧急标识",
+      },
+      attr: { 
+        clearable: true,
+        is: "el-select", 
+        dictName: "sys_yes_no" 
+      },
+    },
+    {
+      item: { 
+        key: "isReplenishment", 
+        title: "补单标识",
+      },
+      attr: { 
+        clearable: true,
+        is: "el-select", 
+        dictName: "sys_yes_no" 
+      },
+    },
     {
       item: {
         key: "documentsCodes",

+ 7 - 0
src/views/purchase/task/index.vue

@@ -12,6 +12,7 @@ export default {
     ZpButton: () => import("./zhuan-pai/index.vue"),
     ThxqButton: () => import("./tui-hui-xu-qiu/index.vue"),
     XyzcButton: () => import("./xie-yi-zhi-cai/index.vue"),
+    lcButton: () => import("./line-close/index.vue"),
     ElSuperTable: () => import("@/components/super-table/index.vue"),
     ElSuperSearch: () => import("@/components/super-search/index.vue"),
   },
@@ -154,6 +155,12 @@ export default {
           @success="useQuery(params, page)"
         >
         </zp-button>
+        <lc-button
+          :size="size"
+          :select-data="selectData"
+          @success="useQuery(params, page)"
+        >
+        </lc-button>
       </el-button-group>
       <!-- <el-button-group>
         <dc-button

+ 75 - 0
src/views/purchase/task/line-close/index.vue

@@ -0,0 +1,75 @@
+
+<script>
+import { ROWClOSE } from "@/api/business/purchase/task";
+export default {
+  name:'lineClose',
+  props:{
+    selectData: {
+      type: [Array],
+      require: true,
+    },
+  },
+  data(){
+    return {
+      title:'行关闭',
+    }
+  },
+  computed:{
+    disabled:{
+      get(){
+        return this.selectData.length < 1;
+      },
+      set(){},
+    }
+  },
+  watch: {},
+  methods: {
+     open(prop){
+      console.log(prop);
+
+      this.$confirm('是否继续进行行关闭操作?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(async() => {
+
+          try {
+            let documentIds = this.selectData.map(item => item.id);
+            
+            let { code, msg } = await ROWClOSE(documentIds);
+
+            if (code === 200) {
+              this.$emit("success");
+              this.$notify.success({ title: msg });
+            }
+
+          } catch (error) {
+            
+          }
+          
+        }).catch(() => {
+               
+        });
+
+
+    
+    }
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+
+}
+</script>
+
+<template>
+  <el-button
+    v-bind="$attrs"
+    v-on="$listeners"
+    :disabled="disabled"
+    @click="open(selectData)"
+  >
+    {{ title }}
+   
+  </el-button>
+</template>