Browse Source

Merge branch 'purchaseDev' into 'dev'

Purchase dev

See merge request new-business/drp-web!140
黄梓星 2 years ago
parent
commit
d5aec61f3f

+ 8 - 0
src/api/business/purchase/catalogue.js

@@ -40,6 +40,14 @@ export function ENABLE(data) {
   });
 }
 
+export function EXIST(data) {
+  return request({
+    url: "/pu/price/catalogue/priceIsExist",
+    method: "POST",
+    data: data,
+  });
+}
+
 export function EXPORT(data) {
   return request({
     url: "/pu/price/catalogue/export",

+ 7 - 2
src/views/purchase/PurchaseDemandList/add.vue

@@ -528,7 +528,7 @@ export default {
         demandDept: '',
         demandDate: '',
         source: '4',
-        billType: '',
+        billType: 'ZQBH',
         isSpeical: '',
         isProcess: '',
         isMonthleyCalculate: '',
@@ -670,7 +670,12 @@ export default {
                 console.log(333)
                 if (res.code === 200) {
                   this.$modal.msgSuccess("保存成功");
-                  this.back()
+                  this.$emit('jugislist', true)
+                  let queryParams = {
+                    pageNum: 1,
+                    pageSize: 10
+                  }
+                  this.$emit('refresh', queryParams)
                 }
               })
             } else if (this.sonPageStu == 'edit') {

+ 9 - 9
src/views/purchase/PurchaseDemandList/reserved.vue

@@ -71,14 +71,14 @@
       <el-table style="margin-top: 50px" :data="tableList2">
         <el-table-column show-overflow-tooltip prop="material" label="物料编码" width="150"></el-table-column>
         <el-table-column show-overflow-tooltip prop="materialName" label="物料名称" width="150"></el-table-column>
-        <el-table-column show-overflow-tooltip prop="unit" label="单位" width="150"></el-table-column>
+        <!-- <el-table-column show-overflow-tooltip prop="unit" label="单位" width="150"></el-table-column> -->
         <el-table-column show-overflow-tooltip prop="unitName" label="单位名称" width="150"></el-table-column>
         <el-table-column show-overflow-tooltip prop="reservedQty" label="预留数量" width="150"></el-table-column>
         <el-table-column show-overflow-tooltip prop="reservedProportion" label="预留比例" width="150"></el-table-column>
         <el-table-column show-overflow-tooltip prop="reservedPeriod" label="预留周期" width="150"></el-table-column>
-        <el-table-column show-overflow-tooltip prop="warehouse" label="仓库" width="150"></el-table-column>
+        <!-- <el-table-column show-overflow-tooltip prop="warehouse" label="仓库" width="150"></el-table-column> -->
         <el-table-column show-overflow-tooltip prop="warehouseName" label="仓库名称" width="150"></el-table-column>
-        <el-table-column show-overflow-tooltip prop="allocation" label="货位" width="150"></el-table-column>
+        <!-- <el-table-column show-overflow-tooltip prop="allocation" label="货位" width="150"></el-table-column> -->
         <el-table-column show-overflow-tooltip prop="allocationName" label="货位名称" width="150"></el-table-column>
         <el-table-column show-overflow-tooltip prop="qty" label="可用量" width="150"></el-table-column>
         <el-table-column show-overflow-tooltip prop="usedQty" label="已用量" width="150"></el-table-column>
@@ -86,20 +86,20 @@
       <el-table style="margin-top: 50px" :data="tableList3">
         <el-table-column show-overflow-tooltip prop="material" label="物料编码" width="150"></el-table-column>
         <el-table-column show-overflow-tooltip prop="materialName" label="物料名称" width="150"></el-table-column>
-        <el-table-column show-overflow-tooltip prop="unit" label="单位" width="150"></el-table-column>
+        <!-- <el-table-column show-overflow-tooltip prop="unit" label="单位" width="150"></el-table-column> -->
         <el-table-column show-overflow-tooltip prop="unitName" label="单位名称" width="150"></el-table-column>
         <el-table-column show-overflow-tooltip prop="reservedQty" label="预留数量" width="150"></el-table-column>
         <el-table-column show-overflow-tooltip prop="reservedProportion" label="预留比例" width="150"></el-table-column>
         <el-table-column show-overflow-tooltip prop="reservedPeriod" label="预留周期" width="150"></el-table-column>
-        <el-table-column show-overflow-tooltip prop="deliveryWarehouse" label="调出仓库" width="150"></el-table-column>
+        <!-- <el-table-column show-overflow-tooltip prop="deliveryWarehouse" label="调出仓库" width="150"></el-table-column> -->
         <el-table-column show-overflow-tooltip prop="deliveryWarehouseName" label="调出仓库名称" width="150"></el-table-column>
-        <el-table-column show-overflow-tooltip prop="deliveryAllocation" label="调出货位" width="150"></el-table-column>
+        <!-- <el-table-column show-overflow-tooltip prop="deliveryAllocation" label="调出货位" width="150"></el-table-column> -->
         <el-table-column show-overflow-tooltip prop="deliveryAllocationName" label="调出货位名称" width="150"></el-table-column>
-        <el-table-column show-overflow-tooltip prop="storageWarehouse" label="调入仓库" width="150"></el-table-column>
+        <!-- <el-table-column show-overflow-tooltip prop="storageWarehouse" label="调入仓库" width="150"></el-table-column> -->
         <el-table-column show-overflow-tooltip prop="storageWarehouseName" label="调入仓库名称" width="150"></el-table-column>
-        <el-table-column show-overflow-tooltip prop="storageAllocation" label="调入货位" width="150"></el-table-column>
+        <!-- <el-table-column show-overflow-tooltip prop="storageAllocation" label="调入货位" width="150"></el-table-column> -->
         <el-table-column show-overflow-tooltip prop="storageAllocationName" label="调入货位名称" width="150"></el-table-column>
-        <el-table-column show-overflow-tooltip prop="allotQty" label="调拨数量" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="allotQty" label="操作数量" width="150"></el-table-column>
       </el-table>
     </el-dialog>
   </div>

+ 13 - 3
src/views/purchase/apply/add/column.js

@@ -278,12 +278,18 @@ export const TabColumns = [
         title: "价格有效期(起)",
         inputType: "DatePicker",
         valueFormat: "yyyy-MM-dd",
+        value: new Date(),
       },
       {
         key: "periodEnd",
         title: "价格有效期(止)",
         inputType: "DatePicker",
         valueFormat: "yyyy-MM-dd",
+        pickerOptions: {
+          disabledDate(time) {
+            return time.getTime() < Date.now() + 3600 * 1000 * 24 * 365;
+          },
+        },
       },
       {
         title: "客户名称",
@@ -301,18 +307,22 @@ export const TabColumns = [
         key: "customer",
       },
       {
+        title: "最近价格",
+        key: "recentlyPrice",
+      },
+      {
         title: "首次报批",
         key: "isApprovalFirst",
         width: 200,
         inputType: "Select",
-        referName: "sys_yes_no",
+        referName: "is_effective",
       },
       {
         title: "价格调整",
         key: "isPriceAdjustment",
         width: 200,
         inputType: "Select",
-        referName: "sys_yes_no",
+        referName: "is_effective",
       },
       {
         key: "priceType",
@@ -325,7 +335,7 @@ export const TabColumns = [
         key: "isDistributionPrice",
         width: 200,
         inputType: "Select",
-        referName: "sys_yes_no",
+        referName: "is_effective",
       },
       {
         title: "创建人名称",

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

@@ -16,7 +16,12 @@ export default {
     };
   },
   computed: {},
-  watch: {},
+  watch: {
+    "params.priceApplyItems": {
+      handler: function () {},
+      deep: true,
+    },
+  },
   methods: {
     //
     async fetchRefer(prop, type, source) {
@@ -245,6 +250,7 @@ export default {
                   <el-table-column fixed="right" label="操作" width="100">
                     <template slot="header" slot-scope="scope">
                       <el-button
+                        v-if="params.puOrg && params.supplier"
                         circle
                         icon="el-icon-plus"
                         :size="size"

+ 20 - 0
src/views/purchase/apply/hooks/function.js

@@ -1,4 +1,5 @@
 import { REFER } from "@/components/popover-select/api";
+import { EXIST } from "@/api/business/purchase/catalogue";
 import { SAVE, ITEM } from "@/api/business/purchase/apply";
 
 export default function useMethods() {
@@ -24,6 +25,7 @@ export default function useMethods() {
       try {
         // try
         _this.loading = true;
+        // task 1
         const { code, rows } = await REFER({
           search: rateCode,
           type: "TAX_RATE_PARAM",
@@ -32,6 +34,24 @@ export default function useMethods() {
           const [{ ntaxrate }] = rows;
           source.tax = ntaxrate === "0E-8" ? "0.00000000" : ntaxrate;
         }
+        // task 2
+        const { materialCode } = source;
+        const { puOrg, customer, supplier } = _this.params;
+        const {
+          code: code2,
+          data: { recentlyPrice, isApprovalFirst, isPriceAdjustment },
+        } = await EXIST({
+          puOrg,
+          customer,
+          supplier,
+          materialCode,
+        });
+        if (code2 === 200) {
+          source.recentlyPrice = recentlyPrice;
+          source.isApprovalFirst = isApprovalFirst;
+          source.isPriceAdjustment = isPriceAdjustment;
+// _this.$u
+        }
       } catch (err) {
         // catch
         console.error(err);

+ 1 - 1
src/views/purchase/purchase-order/add/column.js

@@ -421,7 +421,7 @@ export const Columns = [
     valueFormat: "yyyy-MM-dd",
     isShow:false,
   },
-  { key: "approver", title: "审批人", inputType: "Input", isShow:false, },
+  { key: "approverName", title: "审批人", inputType: "Input", isShow:false, },
   {
     key: "approverFinishTime",
     title: "审批时间",

+ 1 - 1
src/views/purchase/purchase-order/column.js

@@ -132,7 +132,7 @@ export const TableColumns = [
   { key: "createByName", title: "创建人" ,width:100,},
   { key: "createTime", title: "制单日期/创建时间", },
   { key: "approveTime", title: "提交时间" ,width:100,},
-  { key: "approver", title: "审批人" ,width:100,},
+  { key: "approverName", title: "审批人" ,width:100,},
   { key: "approverFinishTime", title: "审批时间",width:100, },
   { key: "updateByName", title: "更新人" ,width:100,},
   { key: "updateTime", title: "最后修改时间" },

+ 17 - 41
src/views/purchase/purchase-order/index.vue

@@ -52,18 +52,23 @@ export default {
     },
   },
   created() {
-    this.fetchList(this.params, this.page);
+    // this.fetchList(this.params, this.page);
+    this.handleRefreshList();
   },
   methods: {
     async fetchList(data, params) {
+
       try {
         this.loading = true;
         params['isAsc'] = 'desc';
         params['orderByColumn'] = 'updateTime';
         
         const { code, msg, rows, total } = await orderApi.list(data, params);
+
         if (code === 200) {
+
           this.page.total = total;
+
           this.tableData = rows;
         }
       } catch (err) {
@@ -86,13 +91,18 @@ export default {
     // 刷新操作
     handleRefreshList() {
       this.page = initPage();
+      this.checkedList = [];
+              
+      this.checkedTabList = [];
+
+      this.primaryResource = {};
       this.fetchList(this.params, this.page);
     },
     // 查询操作
     handleQueryList() {
       let {date} = this.params;
-        this.params.startDate = date ? date[0] :'';
-        this.params.endDate = date ? date[1] : '';
+      this.params.startDate = date ? date[0] :'';
+      this.params.endDate = date ? date[1] : '';
       this.fetchList(this.params, this.page);
     },
     // 重置操作
@@ -187,7 +197,7 @@ export default {
 
           if (code === 200) {
 
-            this.fetchList(this.params, this.page);
+            this.handleRefreshList();
 
           }
         })
@@ -209,7 +219,7 @@ export default {
  
          if (code == 200) {
  
-           this.fetchList(this.params, this.page);
+          this.handleRefreshList();
  
          }
 
@@ -234,34 +244,6 @@ export default {
     handleAllReturn() {
 
       this.handleReturn(this.checkedList[0].id,[]);
-      // this.$prompt('请输入退回原因', '提示', {
-      //     confirmButtonText: '确定',
-      //     cancelButtonText: '取消',
-      //     inputPattern: /\s*\S+?/,
-      //     inputErrorMessage: '退回原因不能为空'
-      //   }).then(async ({ value }) => {
-
-      //     let data = {
-      //       id: this.checkedList[0].id,
-      //       documentIds: [],
-      //       baskCause: value,
-      //     };
-
-      //     console.log(data);
-
-      //     try {
-
-      //       let { code, msg } = await orderApi.documentsReturn(data);
-
-      //       if (code === 200) {
-
-      //         this.fetchList(this.params, this.page);
-
-      //       }
-      //     } catch (error) {
-      //       console.log(error,'error------------');
-      //     }
-      //   }).catch(() => {   });
       
     },
      // 判断“行退回”按钮
@@ -308,13 +290,7 @@ export default {
 
             if (code === 200) {
 
-              this.fetchList(this.params, this.page);
-
-              this.checkedList = [];
-              
-              this.checkedTabList = [];
-
-              this.primaryResource = {};
+              this.handleRefreshList();
 
             }
           } catch (error) {
@@ -353,7 +329,7 @@ export default {
 
           if (code === 200) {
 
-            this.fetchList(this.params, this.page);
+            this.handleRefreshList();
 
           }
         })

+ 11 - 6
src/views/purchase/transferOrder/add.vue

@@ -789,7 +789,12 @@ export default {
         addOrder(this.basicForm).then(res => {
           if (res.code === 200) {
             this.$modal.msgSuccess("保存成功");
-            this.back()
+            this.$emit('jugislist', true)
+            let queryParams = {
+              pageNum: 1,
+              pageSize: 5
+            }
+            this.$emit('refresh', queryParams)
           }
         })
       } else if (this.pageStu == 'edit') {
@@ -807,11 +812,11 @@ export default {
     },
     back() {
       this.$emit('jugislist', true)
-      let queryParams = {
-        pageNum: 1,
-        pageSize: 5
-      }
-      this.$emit('refresh', queryParams)
+      // let queryParams = {
+      //   pageNum: 1,
+      //   pageSize: 5
+      // }
+      // this.$emit('refresh', queryParams)
     },
     // 如果需要回显则调用详情接口
     getDetails(row) {