ソースを参照

采购订单:
1.新增取消之后,子表增行无反应,之前数据未清空
2.订单编号不可编辑,创建人、更新人、OA流程ID、审批人、审批时间、提交时间字段只在查看时展示
3.去掉参照弹窗接口提示

002390 2 年 前
コミット
71c9019d1e

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

@@ -137,10 +137,7 @@ export default {
         if (code === 200) {
           this.data = rows;
           this.page.total = total;
-          this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
-        }
+        } 
       } catch (err) {
         //
       } finally {

+ 71 - 38
src/views/purchase/purchase-order/add/column.js

@@ -11,21 +11,30 @@ export const Columns = [
     },
     queryParams: () => ({}),
     require: true,
+    isShow:true,
   },
   {
     key: "billType",
     title: "订单类型",
     inputType: "Select",
     referName: "sys_order_type", // 字典名
+    isShow:true,
+  },
+  { key: "oaDemandNo", title: "OA需求单号", inputType: "Input",  isShow:true,},
+  {
+    key: "code",
+    title: "订单编号",
+    inputType: "Input",
+    readonly: true,
+    disabled: true,
+    isShow:true,
   },
-  { key: "oaDemandNo", title: "OA需求单号", inputType: "Input", },
-  { key: "code", title: "订单编号", inputType: "Input", },
   {
     key: "billDate",
     title: "订单日期",
     inputType: "DatePicker",
     valueFormat: "yyyy-MM-dd",
-    width: 200,
+    width: 200, isShow:true,
   },
   {
     key: "supplierName",
@@ -39,6 +48,7 @@ export const Columns = [
     },
     queryParams: () => ({}),
     require: true,
+    isShow:true,
   },
   {
     key: "paymentAgreementName",
@@ -51,7 +61,7 @@ export const Columns = [
       paymentAgreementName: 'name'
     },
     queryParams: () => ({}),
-
+    isShow:true,
   },
   {
     key: "finalTypeName",
@@ -64,6 +74,7 @@ export const Columns = [
       finalTypeName: 'name'
     },
     queryParams: () => ({}),
+    isShow:true,
   },
   {
     key: "currencyName",
@@ -76,7 +87,7 @@ export const Columns = [
       currencyName: 'name'
     },
     queryParams: () => ({}),
-
+    isShow:true,
   },
   {
     key: "buyerName",
@@ -90,6 +101,7 @@ export const Columns = [
     },
     queryParams: () => ({}),
     require: true,
+    isShow:true,
   },
   {
     key: "puDeptName",
@@ -103,6 +115,7 @@ export const Columns = [
     },
     queryParams: () => ({}),
     require: true,
+    isShow:true,
   },
   {
     key: "customerName",
@@ -117,33 +130,37 @@ export const Columns = [
       customerName: 'name'
     },
     queryParams: () => ({}),
+    isShow:true,
   },
   {
     key: "qty",
     title: "总数量",
     inputType: "InputNumber",
     controlsPosition: "right",
+    isShow:true,
   },
   {
     key: "originalQty",
     title: "原始总数量",
     inputType: "InputNumber",
     controlsPosition: "right",
+    isShow:true,
   },
-  { key: "money", title: "价税合计", inputType: "Input", },
-  { key: "originalMoney", title: "原始总金额", inputType: "Input", },
-  { key: "notaxMoney", title: "无税金额", inputType: "Input", },
+  { key: "money", title: "价税合计", inputType: "Input", isShow:true, },
+  { key: "originalMoney", title: "原始总金额", inputType: "Input",  isShow:true,},
+  { key: "notaxMoney", title: "无税金额", inputType: "Input",  isShow:true,},
   {
     key: "status",
     title: "单据状态",
     inputType: "Select",
     referName: "sys_status", // 字典名
     disabled: true,
+    isShow:true,
   },
-  { key: "freezeCause", title: "冻结原因", inputType: "Checkbox", },
-  { key: "isBack", title: "退货", inputType: "Input", inputType: "Checkbox", },
-  { key: "isMarketing", title: "已协同生成销售订单", inputType: "Checkbox", },
-  { key: "isMarketingSource", title: "由销售订单协同生成", inputType: "Checkbox", },
+  { key: "freezeCause", title: "冻结原因", inputType: "Checkbox", isShow:true, },
+  { key: "isBack", title: "退货", inputType: "Input", inputType: "Checkbox",  isShow:true,},
+  { key: "isMarketing", title: "已协同生成销售订单", inputType: "Checkbox",  isShow:true,},
+  { key: "isMarketingSource", title: "由销售订单协同生成", inputType: "Checkbox",  isShow:true,},
   {
     key: "warehouseName",
     title: "WMS入库仓库", // 收货仓库
@@ -155,7 +172,10 @@ export const Columns = [
       warehouse: 'id',
       warehouseName: 'name'
     },
-    queryParams: () => ({}),
+    queryParams: (params) => ({
+      pkOrg: params.puOrg,
+    }),
+    isShow:true,
   },
   {
     key: "goodsAllocationName",
@@ -168,18 +188,19 @@ export const Columns = [
       goodsAllocation: 'id',
       goodsAllocationName: 'name'
     },
+     isShow:true,
     queryParams: (params) => ({
-      pkOrg: params.puOrg,
+      stordocId: params.warehouse,
     }),
     width: 200,
   },
-  { key: "isSendSrm", title: "是否同步SRM", inputType: "Checkbox", },
-  { key: "isInvoice", title: "发票标识", inputType: "Checkbox", },
-  { key: "supplierOrderNo", title: "供应商订单号", inputType: "Input", },
-  { key: "rebateMoney", title: "订单使用返利金额", inputType: "Input", },
-  { key: "deductionMoney", title: "订单抵扣余款金额", inputType: "Input", },
-  { key: "address", title: "收货地址", inputType: "Input", },
-  { key: "contacts", title: "收货联系人", inputType: "Input", },
+  { key: "isSendSrm", title: "是否同步SRM", inputType: "Checkbox",isShow:true, },
+  { key: "isInvoice", title: "发票标识", inputType: "Checkbox", isShow:true,},
+  { key: "supplierOrderNo", title: "供应商订单号", inputType: "Input",isShow:true, },
+  { key: "rebateMoney", title: "订单使用返利金额", inputType: "Input",isShow:true, },
+  { key: "deductionMoney", title: "订单抵扣余款金额", inputType: "Input",isShow:true, },
+  { key: "address", title: "收货地址", inputType: "Input",isShow:true, },
+  { key: "contacts", title: "收货联系人", inputType: "Input",isShow:true, },
   {
     key: "customerDeptName",
     title: "客户部门",
@@ -191,6 +212,7 @@ export const Columns = [
       customerDept: 'id',
       customerDeptName: 'name'
     },
+     isShow:true,
     queryParams: () => ({}),
 
   },
@@ -205,11 +227,12 @@ export const Columns = [
       supplierContacts: 'id',
       supplierContactsName: 'name'
     },
+     isShow:true,
     queryParams: () => ({}),
     width: 200,
   },
-  { key: "isUrgency", title: "紧急程度", inputType: "Checkbox", },
-  { key: "isSendWms", title: "已同步WMS", inputType: "Checkbox", },
+  { key: "isUrgency", title: "紧急程度", inputType: "Checkbox",isShow:true, },
+  { key: "isSendWms", title: "已同步WMS", inputType: "Checkbox",isShow:true, },
   // { key: "agent", title: "代理人", inputType: "Input", }, // 建议删除
   {
     key: "agentName",
@@ -221,19 +244,21 @@ export const Columns = [
       agent: 'id',
       agentName: 'name'
     },
+     isShow:true,
     queryParams: () => ({}),
     width: 200,
   },
-  { key: "isClose", title: "最终关闭", inputType: "Checkbox", },
+  { key: "isClose", title: "最终关闭", inputType: "Checkbox", isShow:true, },
   {
     key: "closeTime",
     title: "最终关闭日期",
     inputType: "DatePicker",
     valueFormat: "yyyy-MM-dd",
+    isShow:true,
   },
-  { key: "applyPaymentMoney", title: "累计付款申请金额", inputType: "Input", },
-  { key: "paymentMoney", title: "累计付款金额", inputType: "Input", },
-  { key: "invoiceMoney", title: "发票金额", inputType: "Input", },
+  { key: "applyPaymentMoney", title: "累计付款申请金额", inputType: "Input", isShow:true,},
+  { key: "paymentMoney", title: "累计付款金额", inputType: "Input", isShow:true,},
+  { key: "invoiceMoney", title: "发票金额", inputType: "Input",isShow:true, },
   {
     key: "supplierPersonalName",
     title: "供应商业务员",
@@ -244,10 +269,11 @@ export const Columns = [
       supplierPersonal: 'id',
       supplierPersonalName: 'name'
     },
+     isShow:true,
     queryParams: () => ({}),
     require: true,
   },
-  { key: "isDeliver", title: "是否发货", inputType: "Checkbox", },
+  { key: "isDeliver", title: "是否发货", inputType: "Checkbox",  isShow:true,},
   {
     key: "retReasonName",
     title: "退换原因",
@@ -259,6 +285,7 @@ export const Columns = [
       retReason: 'id',
       retReasonName: 'name'
     },
+     isShow:true,
     queryParams: () => ({}),
   },
   {
@@ -272,9 +299,10 @@ export const Columns = [
       processType: 'id',
       processTypeName: 'name'
     },
+     isShow:true,
     queryParams: () => ({}),
   },
-  { key: "isEnd", title: "整单关闭标识", inputType: "Input", },
+  { key: "isEnd", title: "整单关闭标识", inputType: "Input", isShow:true, },
   {
     key: "projectNowName",
     title: "在建工程项目",
@@ -286,6 +314,7 @@ export const Columns = [
       projectNow: 'id',
       projectNowName: 'name'
     },
+     isShow:true,
     queryParams: () => ({}),
   },
   {
@@ -299,35 +328,39 @@ export const Columns = [
       operatingItems: 'id',
       operatingItemsName: 'name'
     },
+     isShow:true,
     queryParams: () => ({}),
 
   },
-  { key: "isArrivalReson", title: "到货超期原因", inputType: "Input", },
-  { key: "midOrderNo", title: "中台采购订单号", inputType: "Input", },
-  { key: "marketingCode", title: "销售订单号", inputType: "Input", },
-  { key: "isArrival", title: "到货超期", inputType: "Checkbox", },
-  { key: "createByName", title: "创建人名称", inputType: "Input", },
-  { key: "updateByName", title: "更新人名称", inputType: "Input", },
-  { key: "flowId", title: "OA流程ID", inputType: "Input", },
-  { key: "approver", title: "审批人", inputType: "Input", },
+  { key: "isArrivalReson", title: "到货超期原因", inputType: "Input", isShow:true, },
+  { key: "midOrderNo", title: "中台采购订单号", inputType: "Input", isShow:true, },
+  { key: "marketingCode", title: "销售订单号", inputType: "Input", isShow:true, },
+  { key: "isArrival", title: "到货超期", inputType: "Checkbox",  isShow:true,},
+  { key: "createByName", title: "创建人名称", inputType: "Input", isShow:false, },
+  { key: "updateByName", title: "更新人名称", inputType: "Input", isShow:false, },
+  { key: "flowId", title: "OA流程ID", inputType: "Input", isShow:false, },
+  { key: "approver", title: "审批人", inputType: "Input", isShow:false, },
   {
     key: "approverFinishTime",
     title: "审批时间",
     inputType: "DatePicker",
     valueFormat: "yyyy-MM-dd",
+    isShow:false,
   },
   {
     key: "approveTime",
     title: "提交时间",
     inputType: "DatePicker",
     valueFormat: "yyyy-MM-dd",
+    isShow:false,
   },
   {
     key: "sysFileRecordList",
     title: "附件",
     inputType: "Upload",
     // fileType: ["pdf",""],
-    span: 24
+    span: 24,
+    isShow:true,
   },
 
 ];

+ 15 - 12
src/views/purchase/purchase-order/add/index.vue

@@ -21,6 +21,7 @@ export default {
   dicts: initDicts(SelectColumns),
   components: {
     FileUploadCenter: () => import('../components/FileUploadCenter/index.vue'),
+    popDialog: () => import('@/components/PopDialog/index.vue'),
   },
 
   data() {
@@ -44,22 +45,20 @@ export default {
   watch: {
     "params.puOrderItemList": {
       handler(nVal, oVal) {
-        console.log(nVal, 'nVal', oVal, 'oVal');
-        this.handleSynchronousMaterial("puOrderItemList", "puOrderExecuteList");
+        this.visible && this.handleSynchronousMaterial("puOrderItemList", "puOrderExecuteList");
       },
       deep: true,
     },
     "params.puOrderExecuteList": {
       handler(nVal, oVal) {
-        this.handleSynchronousMaterial("puOrderExecuteList", "puOrderItemList");
+        this.visible && this.handleSynchronousMaterial("puOrderExecuteList", "puOrderItemList");
       },
       deep: true,
     },
     "params": {
       handler(nVal, oVal) {
-
         // 组织变化
-        if (nVal.puOrg != oVal.puOrg) {
+        if (this.visible && (nVal.puOrg != oVal.puOrg)) {
           console.log(nVal.puOrg, 'nVal.puOrg', oVal.puOrg, 'oVal.puOrg');
           for (const key in this.params) {
             if (Array.isArray(this.params[key])) {
@@ -89,7 +88,7 @@ export default {
       this.params.puDept = deptId;
       this.params.puDeptName = deptName;
       // this.params.status = '0';
-
+      console.log(this.params, ' this.params----------打开');
     },
     setVisible(prop) {
       this.visible = prop;
@@ -192,22 +191,26 @@ export default {
     handleCancel() {
       this.setVisible(false);
       this.params = initParams(this.columns, "key", "value");
+      this.params = {
+        ...initParams(this.columns),
+        puOrderItemList: [],
+        puOrderExecuteList: [],
+      }
+
+      console.log(this.params, ' this.params------------取消');
+
     },
     // 保存
     async handleSava() {
       // orderAddForm
       console.log(this.params.sysFileRecordList, "params");
 
-      this.params.sysFileRecordList.forEach(item => {
-
-        item['']
-      })
       // this.$refs['orderAddForm'].validate(async (valid) => {
       //   if (valid) {
       try {
         const { code, msg } = await orderApi.create(this.params);
         if (code === 200) {
-          this.setVisible(false);
+          this.handleCancel();
         }
       } catch (err) {
         //
@@ -319,7 +322,7 @@ export default {
         </div>
         <el-row style="display:flex; flex-wrap: wrap;">
           <el-col v-for="(column, index) in columns" :key="index" :span="column.span || 6">
-            <el-form-item :prop="column.key" :label="column.title">
+            <el-form-item :prop="column.key" :label="column.title" v-if="column.isShow">
 
               <el-input v-if="column.inputType === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
                 :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">

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

@@ -1,10 +1,10 @@
 <template>
   <div class="upload-file">
-    <el-upload multiple :action="uploadFileUrl" :before-upload="handleBeforeUpload" :file-list="fileList" :limit="limit"
-      :on-error="handleUploadError" :on-exceed="handleExceed" :on-success="handleUploadSuccess" :show-file-list="false"
-      class="upload-file-uploader" ref="fileUpload">
+    <el-upload multiple :action="uploadFileUrl" :disabled="disabled" :before-upload="handleBeforeUpload"
+      :file-list="fileList" :limit="limit" :on-error="handleUploadError" :on-exceed="handleExceed"
+      :on-success="handleUploadSuccess" :show-file-list="false" class="upload-file-uploader" ref="fileUpload">
       <!-- 上传按钮 -->
-      <el-button size="mini" type="primary">选取文件</el-button>
+      <el-button size="mini" type="primary" :disabled="disabled">选取文件</el-button>
       <!-- 上传提示 -->
       <div class="el-upload__tip" slot="tip" v-if="showTip">
         请上传
@@ -21,13 +21,15 @@
     <!-- 文件列表 -->
     <transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
 
-      <li :key="file.fileUrl" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
+      <li :key="file.fileUrl" class="el-upload-list__item ele-upload-list__item-content"
+        v-for="(file, index) in fileList">
+        <!-- <el-link :href="`${baseUrl}${file.fileUrl}`" :underline="false" target="_blank"> -->
         <el-link :href="`${baseUrl}${file.fileUrl}`" :underline="false" target="_blank">
           <!-- <span class="el-icon-document"> {{ getFileName(file.name) }} </span> -->
           <span class="el-icon-document"> {{ file.fileName }} </span>
         </el-link>
         <div class="ele-upload-list__item-content-action">
-          <el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
+          <el-link :underline="false" @click="handleDelete(index)" :disabled="disabled" type="danger">删除</el-link>
         </div>
       </li>
     </transition-group>
@@ -55,13 +57,18 @@ export default {
     // 文件类型, 例如['png', 'jpg', 'jpeg']
     fileType: {
       type: Array,
-      default: () => ["doc", "xls", "ppt", "txt", "pdf"],
+      default: () => ["doc", "xls", "ppt", "txt", "pdf", "jpg"],
     },
     // 是否显示提示
     isShowTip: {
       type: Boolean,
       default: true,
     },
+    // 是否禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+    }
   },
   data() {
     console.log(process.env, 'process.env');

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

@@ -241,7 +241,7 @@ export default {
         </div>
         <el-row style="display:flex; flex-wrap: wrap;">
           <el-col v-for="(column, index) in columns" :key="index" :span="column.span || 6">
-            <el-form-item :prop="column.key" :label="column.title">
+            <el-form-item :prop="column.key" :label="column.title" v-if="column.isShow">
               <el-input v-if="column.inputType === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
                 :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
               </el-input>
@@ -282,7 +282,7 @@ export default {
                 true-label="Y" false-label="N">
               </el-checkbox>
               <file-upload-center v-if="column.inputType === 'Upload'" v-model="params[column.key]"
-                :file-type="column.fileType">
+                :file-type="column.fileType" :disabled="handleIsRevise(params.status)">
               </file-upload-center>
             </el-form-item>
           </el-col>

+ 7 - 11
src/views/purchase/purchase-order/see/index.vue

@@ -24,6 +24,9 @@ NewTabColumns.forEach(column => {
 export default {
   name: "SeePurchaseOrderDrawer",
   dicts: initDicts(SelectColumns),
+  components: {
+    FileUploadCenter: () => import('../components/FileUploadCenter/index.vue'),
+  },
   data() {
     return {
       visible: false,
@@ -53,7 +56,7 @@ export default {
         const { code, msg, data } = await orderApi.details(prop);
         if (code === 200) {
           this.params = data;
-        } 
+        }
       } catch (err) {
         //
       } finally {
@@ -134,16 +137,9 @@ export default {
               <el-checkbox v-if="column.inputType === 'Checkbox'" v-model="params[column.key]" disabled true-label="Y"
                 false-label="N">
               </el-checkbox>
-              <el-upload v-if="column.inputType === 'Upload'" :file-list="params[column.key]" disabled drag
-                action="https://jsonplaceholder.typicode.com/posts/" multiple>
-                <i class="el-icon-upload"></i>
-                <div class="el-upload__text">
-                  将文件拖到此处,或<em>点击上传</em>
-                </div>
-                <div class="el-upload__tip" slot="tip">
-                  只能上传jpg/png文件,且不超过500kb
-                </div>
-              </el-upload>
+              <file-upload-center v-if="column.inputType === 'Upload'" v-model="params[column.key]"
+                :file-type="column.fileType" :disabled="true">
+              </file-upload-center>
             </el-form-item>
           </el-col>
         </el-row>

+ 2 - 1
vue.config.js

@@ -57,7 +57,8 @@ module.exports = {
         pathRewrite: { [`^/drp-admin/mock34`]: "" },
       },
       "/file": {
-        target: process.env.NODE_ENV == "development" ? `https://test-sy.derom.com` : `https://sy.derom.com`,
+        // target: process.env.NODE_ENV == "development" ? `https://test-sy.derom.com` : `https://sy.derom.com`,
+        target: `https://sy.derom.com`,
         changeOrigin: true,
         pathRewrite: { [`^/file`]: "" },
       },