ソースを参照

Merge branch 'purchaseDev' into 'dev'

Purchase dev

See merge request new-business/drp-web!73
黄梓星 2 年 前
コミット
9b789f9a90

+ 4 - 1
src/components/FileUpload/index.vue

@@ -99,7 +99,10 @@ export default {
       separator: ";",
       uploadList: [],
       baseUrl: "https://sy.derom.com/document-center/fastdfs/download",
-      uploadFileUrl: "/drp-file/document-center/fastdfs/upload",
+      uploadFileUrl:
+        process.env.NODE_ENV == "development"
+          ? "/document-center/fastdfs/upload"
+          : "/drp-file/document-center/fastdfs/upload",
       headers: {
         Authorization: "Bearer " + getToken(),
       },

+ 3 - 2
src/components/computed-input/index.vue

@@ -1,11 +1,12 @@
 <template>
-  <el-input
+  <!-- <el-input
     v-model="value"
     readonly
     :size="size"
     :placeholder="placeholder"
     style="width: 100%"
-  ></el-input>
+  ></el-input> -->
+  <span>{{ value || "- -" }}</span>
 </template>
 
 <script>

+ 1 - 9
src/components/popover-select/api/index.js

@@ -1,14 +1,6 @@
 import request from "@/utils/request";
 
-export function list(url, params) {
-  return request({
-    url: `/pu/contract/${url}/list`,
-    method: "get",
-    params: params,
-  });
-}
-
-export function refer(data, params) {
+export function REFER(data, params) {
   return request({
     url: "/refer/query",
     method: "POST",

+ 20 - 2
src/components/popover-select/components/MATERIAL_PARAM.js

@@ -1,13 +1,31 @@
 export default [
   {
     key: "code",
-    title: "物料编码",
+    title: "编码",
     type: "Input",
     search: true,
   },
   {
     key: "name",
-    title: "物料名称",
+    title: "名称",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "specification",
+    title: "规格",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "manufacturerIdName",
+    title: "生产厂家",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "unitIdName",
+    title: "单位",
     type: "Input",
     search: true,
   },

+ 4 - 4
src/components/popover-select/index.vue

@@ -1,5 +1,5 @@
 <script>
-import { refer } from "./api/index";
+import { REFER } from "./api/index";
 export default {
   name: "PopoverSelect",
   props: {
@@ -130,14 +130,14 @@ export default {
       try {
         this.loading = true;
         const { pageNum, pageSize } = page;
-        const { code, msg, rows, total } = await refer(prop, {
+        const { code, rows, total } = await REFER(prop, {
           pageNum,
           pageSize,
         });
         if (code === 200) {
           this.data = rows;
           this.page.total = total;
-        } 
+        }
       } catch (err) {
         //
       } finally {
@@ -210,7 +210,7 @@ export default {
       }
       this.$emit("update:source", source);
       // emit change
-      this.$emit("change", prop, source, type);
+      this.$emit("change", prop, type, source);
     },
   },
   created() {},

+ 2 - 2
src/components/popover-tree-select/components/index.vue

@@ -1,5 +1,5 @@
 <script>
-import { refer } from "../api/index";
+import { REFER } from "../api/index";
 
 export default {
   name: "TableDialog",
@@ -48,7 +48,7 @@ export default {
       try {
         this.loading = true;
         const { type, queryParams } = this.$props;
-        const { code, msg, rows } = await refer({
+        const { code, msg, rows } = await REFER({
           type: type,
           ...prop,
           ...queryParams,

+ 28 - 7
src/views/purchase/contract/add/index.vue

@@ -1,5 +1,6 @@
 <script>
 import { Columns, TabColumns } from "../column";
+import { REFER } from "@/components/popover-select/api";
 import { ADD, CODE } from "@/api/business/purchase/contract";
 import { initDicts, initRules, initParams } from "@/utils/init";
 
@@ -75,12 +76,35 @@ export default {
         const code = await CODE();
         this.params.code = code;
       } catch (err) {
-        //
+        // catch
       } finally {
+        // finally
         this.loading = false;
       }
     },
     //
+    async fetchRefer(prop, type, source) {
+      const { rateCode } = prop;
+      if (type === "MATERIAL_PARAM") {
+        try {
+          this.loading = true;
+          const { code, rows } = await REFER({
+            search: rateCode,
+            type: "TAX_RATE_PARAM",
+          });
+          if (code === 200) {
+            const [{ ntaxrate }] = rows;
+            source.tax = ntaxrate;
+          }
+        } catch (err) {
+          // catch
+        } finally {
+          // finally
+          this.loading = false;
+        }
+      }
+    },
+    //
     rowAdd(prop) {
       const tab = this.tabColumns.find((element) => element.key === prop);
       this.params[prop].push(initParams(tab.tableColumns));
@@ -90,10 +114,6 @@ export default {
       prop.splice(index, 1);
     },
     //
-    sava() {
-      this.visible = false;
-    },
-    //
     submit(prop) {
       this.$refs[prop].validate(async (valid) => {
         if (valid) {
@@ -244,6 +264,7 @@ export default {
                 :prop="cColumn.key"
                 :label="cColumn.title"
                 :width="cColumn.width"
+                show-overflow-tooltip
               >
                 <template slot-scope="scope">
                   <el-input
@@ -256,7 +277,7 @@ export default {
                     style="width: 100%"
                   ></el-input>
                   <dr-computed-input
-                    v-if="cColumn.inputType === 'ComputedInput'"
+                    v-else-if="cColumn.inputType === 'ComputedInput'"
                     v-model="scope.row[cColumn.key]"
                     :source="scope.row"
                     :computed="cColumn.computed"
@@ -275,6 +296,7 @@ export default {
                     :clearable="cColumn.clearable"
                     :placeholder="cColumn.placeholder"
                     :data-mapping="cColumn.dataMapping"
+                    @change="fetchRefer"
                   >
                   </dr-popover-select>
                   <el-input-number
@@ -334,7 +356,6 @@ export default {
       </el-form-item>
       <el-form-item label-width="0" style="text-align: right">
         <el-button :size="size" @click="hide">取 消</el-button>
-        <el-button :size="size" @click="sava">保 存</el-button>
         <el-button :size="size" @click="submit('ruleForm')"> 新 增 </el-button>
       </el-form-item>
     </el-form>

+ 4 - 0
src/views/purchase/contract/column.js

@@ -315,6 +315,10 @@ export const TabColumns = [
         dataMapping: {
           material: "code",
           materialName: "name",
+          puUnit: "unitIdName",
+          registration: "registrationNo",
+          specification: "specification",
+          manufacturer: "manufacturerIdName",
         },
       },
       { title: "物料编码", key: "material", width: 200 },

+ 2 - 1
src/views/purchase/contract/edit/index.vue

@@ -271,6 +271,7 @@ export default {
                 :prop="cColumn.key"
                 :label="cColumn.title"
                 :width="cColumn.width"
+                show-overflow-tooltip
               >
                 <template slot-scope="scope">
                   <el-input
@@ -283,7 +284,7 @@ export default {
                     style="width: 100%"
                   ></el-input>
                   <dr-computed-input
-                    v-if="cColumn.inputType === 'ComputedInput'"
+                    v-else-if="cColumn.inputType === 'ComputedInput'"
                     v-model="scope.row[cColumn.key]"
                     :source="scope.row"
                     :computed="cColumn.computed"

+ 1 - 1
src/views/purchase/contract/index.vue

@@ -164,7 +164,7 @@ export default {
         :prop="column.key"
         :label="column.title"
         :width="column.width || 180"
-        :show-overflow-tooltip="column.showOverflowTooltip || true"
+        show-overflow-tooltip
       >
         <template slot-scope="scope">
           <dict-tag

+ 1 - 1
src/views/purchase/purchase-order/add/index.vue

@@ -250,7 +250,7 @@ export default {
       });
     },
     // 子表参照改变之后
-    handleReferChange(val, source, type) {
+    handleReferChange(val,type, source) {
       console.log(val, 'val');
       console.log(source, 'source');
       console.log(type, 'type');

+ 26 - 12
src/views/purchase/purchase-order/column.js

@@ -1,7 +1,5 @@
 import {
   initPage,
-  initLayout,
-  initPageSizes,
   initParams,
   initColumns,
   initDicts,
@@ -18,6 +16,13 @@ export const TableColumns = [
     referName: "sys_order_type",
   },
   { key: "code", title: "订单编号", search: true, inputType: "Input" },
+  {
+    key: "status",
+    title: "单据状态",
+    inputType: "Select",
+    width:80,
+    referName: "sys_status", // 字典名
+  },
   { key: "billDate", title: "订单日期" },
   // { key: "supplier", title: "供应商" },
   { key: "supplierName", title: "供应商", search: true, inputType: "Input" },
@@ -36,11 +41,13 @@ export const TableColumns = [
     key: "isArrival",
     title: "到货超期",
     inputType: 'Checkbox',
+    width:80,
   },
   {
     key: "isBack",
     title: "退货",
     inputType: 'Checkbox',
+    width:80,
   },
   // { key: "freezeCause", title: "冻结原因" },
   { key: "qty", title: "总数量" },
@@ -62,6 +69,7 @@ export const TableColumns = [
     key: "isInvoice",
     title: "发票标识",
     inputType: 'Checkbox',
+    width:80,
   },
   { key: "rebateMoney", title: "订单使用返利金额" },
   { key: "deductionMoney", title: "订单抵扣余款金额" },
@@ -77,6 +85,7 @@ export const TableColumns = [
     key: "isUrgency",
     title: "紧急程度",
     inputType: 'Checkbox',
+    width:80,
   },
   // { key: "agent", title: "代理人" }, // 建议删除
   { key: "agentName", title: "代理人" },
@@ -84,6 +93,7 @@ export const TableColumns = [
     key: "isClose",
     title: "最终关闭",
     inputType: 'Checkbox',
+    width:80,
   },
   { key: "applyPaymentMoney", title: "累计付款申请金额" },
   { key: "paymentMoney", title: "累计付款金额" },
@@ -103,12 +113,7 @@ export const TableColumns = [
   { key: "createTime", title: "制单日期/创建时间" },
   { key: "remark", title: "备注" },
   { key: "updateTime", title: "最后修改时间" },
-  {
-    key: "status",
-    title: "单据状态",
-    inputType: "Select",
-    referName: "sys_status", // 字典名
-  },
+
   { key: "oaDemandNo", title: "OA需求单号" },
   { key: "address", title: "收货地址" },
   { key: "contacts", title: "收获联系人" },
@@ -116,13 +121,14 @@ export const TableColumns = [
     key: "isSendWms",
     title: "已同步WMS",
     inputType: 'Checkbox',
+    width:120,
   },
-  { key: "retReason", title: "退换原因" },
+  { key: "retReasonName", title: "退换原因" },
   { key: "closeTime", title: "最终关闭日期" },
-  { key: "processType", title: "处理方式" },
+  { key: "processTypeName", title: "处理方式" },
   { key: "isEnd", title: "整单关闭标识" },
-  { key: "projectNow", title: "在建工程项目" },
-  { key: "operatingItems", title: "经营性项目" },
+  { key: "projectNowName", title: "在建工程项目" },
+  { key: "operatingItemsName", title: "经营性项目" },
   { key: "isArrivalReson", title: "到货超期原因" },
   { key: "midOrderNo", title: "中台采购订单号" }
 ];
@@ -146,6 +152,7 @@ export const TabColumns = [
         title: "医药物料",
         width: 180,
         inputType: 'Checkbox',
+        width:80,
       },
       { key: "manufacturer", title: "生产厂家代理人", width: 180 },
       { key: "isDrug", title: "物料药品属性", width: 180 },
@@ -163,26 +170,31 @@ export const TabColumns = [
         key: "isStorage",
         title: "入库关闭",
         inputType: 'Checkbox',
+        width:80,
       },
       {
         key: "isInvoice",
         title: "开票关闭",
         inputType: 'Checkbox',
+        width:80,
       },
       {
         key: "isArrival",
         title: "到货关闭",
         inputType: 'Checkbox',
+        width:80,
       },
       {
         key: "isPayment",
         title: "付款关闭",
         inputType: 'Checkbox',
+        width:80,
       },
       {
         key: "isGift",
         title: "赠品",
         inputType: 'Checkbox',
+        width:80,
       },
       { key: "warehouse", title: "收货仓库", width: 180 },
       { key: "place", title: "收货地点", width: 180 },
@@ -208,11 +220,13 @@ export const TabColumns = [
         key: "isBatchLock",
         title: "批号锁定标识",
         inputType: 'Checkbox',
+        width:80,
       },
       {
         key: "isReplenishment",
         title: "补单标识",
         inputType: 'Checkbox',
+        width:80,
       },
       { key: "isUrgency", title: "紧急标识" },
       { key: "originalQty", title: "原始数量" },

+ 1 - 1
src/views/purchase/purchase-order/components/FileUploadCenter/index.vue

@@ -57,7 +57,7 @@ export default {
     // 文件类型, 例如['png', 'jpg', 'jpeg']
     fileType: {
       type: Array,
-      default: () => ["doc", "xls", "ppt", "txt", "pdf", "jpg"],
+      default: () => ["doc", "xls", "ppt", "txt", "pdf", "jpg", "png"],
     },
     // 是否显示提示
     isShowTip: {

+ 1 - 1
src/views/purchase/purchase-order/edit/index.vue

@@ -183,7 +183,7 @@ export default {
     beforeOpen() {
     },
     // 子表参照改变之后
-    handleReferChange(val, source, type) {
+    handleReferChange(val,  type,source) {
       console.log(val, 'val');
       console.log(source, 'source');
       console.log(type, 'type');

+ 9 - 24
src/views/purchase/purchase-order/index.vue

@@ -4,8 +4,6 @@ import { TableColumns, SearchColumns, TabColumns, SelectColumns } from "./column
 import orderApi from "@/api/business/purchase/purchase-order";
 import {
   initPage,
-  initLayout,
-  initPageSizes,
   initParams,
   initColumns,
   initDicts,
@@ -25,8 +23,7 @@ export default {
     return {
       loading: false,
       isSimpleSearch: true,
-      pageSizes: initPageSizes(),
-      layout: initLayout(),
+      pageSizes: [10, 20, 50, 100],
       page: initPage(),
       searchColumns: SearchColumns,
       params: initParams(SearchColumns),
@@ -75,16 +72,7 @@ export default {
       //   title: this.isSimpleSearch ? "Simple Search" : "All Search",
       // });
     },
-    // 页大小变
-    handleSizeChange(prop) {
-      this.page.pageSize = prop;
-      this.fetchList(this.params, this.page);
-    },
-    // 当前页变
-    handleCurrentChange(prop) {
-      this.page.pageNum = prop;
-      this.fetchList(this.params, this.page);
-    },
+
     // 刷新操作
     handleRefreshList() {
       this.fetchList(this.params, this.page);
@@ -399,17 +387,14 @@ export default {
       </el-table-column>
 
     </el-table>
-    <el-pagination 
-      @size-change="handleSizeChange" 
-      @current-change="handleCurrentChange" 
+
+    <pagination
+      v-show="page.total>0"
       :total="page.total"
-      :page-sizes="pageSizes" 
-      :page-size="page.pageSize" 
-      :current-page="page.pageNum" 
-      hide-on-single-page 
-      :layout="layout"
-      style="text-align: right;margin-top: 10px;"
-    ></el-pagination>
+      :page.sync="page.pageNum"
+      :limit.sync="page.pageSize"
+      @pagination="fetchList(params, page)"
+    />
 
     <el-tabs v-model="tabName" @tab-click="handleTabClick" style="width: 100%;padding: 20px 10px">
       <el-tab-pane 

+ 26 - 21
src/views/purchase/purchase-order/see/index.vue

@@ -68,17 +68,19 @@ export default {
       this.setVisible(false);
       this.params = initParams(Columns);
     },
+    handleRefresh(){
+      let {id} = this.params;
+      this.fetchItem(id);
+    },
     // 发送NC
     async handleSendNC(){
       console.log('发送NC');
 
       try {
-        let {code,deliveryMsg} = await orderApi.toNc({
-          puOrderId:this.params.id
-        });
+        let {code} = await orderApi.toNc({ puOrderId:this.params.id});
 
         if(code == 200){
-
+          this.handleRefresh();
         }
       } catch (error) {
         
@@ -91,7 +93,6 @@ export default {
 
       let {source,status,deliveryStatus} = this.params;
 
-      console.log('deliveryStatus' in  this.params,'deliveryStatus');
       // 自制 & 状态为:自由态、驳回
       if(source === '3' &&(status === '0' || status === '3')){
 
@@ -133,23 +134,27 @@ export default {
           ">
           <h3>查看</h3>
           <div style="text-align: right">
-            <el-button size="mini" @click="handleCancel">取 消</el-button>
-            <el-tooltip
-              v-if="judgeIsToNC()"
-              class="box-item"
-              effect="dark"
-              :content="params.deliveryMsg"
-              placement="bottom-end"
-            >
-              <el-button 
+            <el-button size="mini" @click="handleRefresh">刷新</el-button>
+            <template v-if="judgeIsToNC()">
+              <el-tooltip
+                class="box-item"
+                effect="dark"
                 :key="params.deliveryStatus"
-                size="mini" 
-                type="primary"
-                @click="handleSendNC"
-              >{{  params.deliveryStatus === '1' ? '发送中' :
-                  (params.deliveryStatus === '2'? '重新发送' : '发送NC')
-               }}</el-button>
-            </el-tooltip>
+                :content="params.deliveryMsg"
+                placement="bottom-end"
+              >
+                <el-button 
+                  :key="params.deliveryStatus"
+                  :disabled="params.deliveryStatus === '1' "
+                  size="mini" 
+                  type="primary"
+                  @click="handleSendNC"
+                >{{  params.deliveryStatus === '1' ? '发送中' :
+                    (params.deliveryStatus === '2'? '重新发送NC' : '发送NC')
+                }}</el-button>
+              </el-tooltip>
+            </template>
+            <el-button size="mini" @click="handleCancel">取 消</el-button>
           </div>
         </div>
         <el-row style="display:flex; flex-wrap: wrap;">

+ 1 - 1
vue.config.js

@@ -53,7 +53,7 @@ module.exports = {
         },
       },
       "/drp-file": {
-        target: `https://sy.derom.com`,
+        target: `https://test-sy.derom.com`,
         changeOrigin: true,
         pathRewrite: { [`^/drp-file`]: "" },
       },