Browse Source

采购订单-新增编辑子表添加参照与字典类型

002390 2 years ago
parent
commit
b0128dc4b8

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

@@ -27,10 +27,28 @@ const create = (data) => {
   });
   });
 }
 }
 
 
+// 采购订单提交
+const submit = (data) => {
+  return request({
+    url: `/pu/order/submit`,
+    method: "post",
+    data,
+  });
+}
+
 // 采购订单编辑
 // 采购订单编辑
 const edit = (data) => {
 const edit = (data) => {
   return request({
   return request({
-    url: `/pu/order/item`,
+    url: `/pu/order`,
+    method: "put",
+    data,
+  });
+}
+
+// 采购订单修订
+const revision = (data) => {
+  return request({
+    url: `/pu/order/revision`,
     method: "put",
     method: "put",
     data,
     data,
   });
   });
@@ -44,12 +62,23 @@ const remove = (data) => {
   });
   });
 }
 }
 
 
+// 采购订单-询价
+const getPrice = (data) => {
+  return request({
+    url: `/pu/order/getPrice`,
+    method: "post",
+    data,
+  });
+}
 
 
 export default {
 export default {
   list,
   list,
   details,
   details,
   create,
   create,
+  submit,
   edit,
   edit,
+  revision,
   remove,
   remove,
+  getPrice,
 
 
 }
 }

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

@@ -172,7 +172,7 @@ export const Columns = [
         goodsAllocationName: "name",
         goodsAllocationName: "name",
       },
       },
       queryParams: {
       queryParams: {
-        puOrg: 'puOrg',
+        pkOrg: 'puOrg',
       }
       }
     },
     },
     width: 200,
     width: 200,
@@ -413,7 +413,7 @@ export const TabColumns = [
       { key: "materialClassifyThreeName", title: "物料三级分类名称", type: "Input", },
       { key: "materialClassifyThreeName", title: "物料三级分类名称", type: "Input", },
       // { key: "materialClassifyFour", title: "物料四级分类",type: "Input", },
       // { key: "materialClassifyFour", title: "物料四级分类",type: "Input", },
       { key: "materialClassifyFourName", title: "物料四级分类名称", type: "Input", },
       { key: "materialClassifyFourName", title: "物料四级分类名称", type: "Input", },
-      { key: "price", title: "无税单价" }
+      { key: "price", title: "无税单价", type: "Input", }
     ]
     ]
   },
   },
   {
   {

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

@@ -31,11 +31,6 @@ export default {
       tabColumns: NewTabColumns,
       tabColumns: NewTabColumns,
 
 
       tabName: "puOrderItemList",
       tabName: "puOrderItemList",
-      // tabTableParams: {
-      //   puOrderItemList: [],
-      //   puOrderExecuteList: [],
-      // },
-      // currentComponent: { name: "", title: "", value: "", row: {}, source: {} },
     };
     };
   },
   },
   computed: {},
   computed: {},
@@ -54,12 +49,14 @@ export default {
     setVisible(prop) {
     setVisible(prop) {
       this.visible = prop;
       this.visible = prop;
     },
     },
+    // 增行
     addTableRow(prop) {
     addTableRow(prop) {
       const arr = this.tabColumns.find(
       const arr = this.tabColumns.find(
         (element) => element.key === this.tabName
         (element) => element.key === this.tabName
       ).tableColumns;
       ).tableColumns;
       prop.push(initParams(arr, "key", "value"));
       prop.push(initParams(arr, "key", "value"));
     },
     },
+    // 删行
     delTableRow(prop, index) {
     delTableRow(prop, index) {
       prop.splice(index, 1);
       prop.splice(index, 1);
     },
     },
@@ -223,14 +220,24 @@ export default {
                   <el-input-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"
                   <el-input-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"
                     :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
                     :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
                     :clearable="cColumn.clearable" :disabled="cColumn.disabled" size="mini"
                     :clearable="cColumn.clearable" :disabled="cColumn.disabled" size="mini"
-                    style="width: 100%"></el-input-number>
-                  <el-input v-if="column.type === 'InputDialog'" v-model="params[column.key]"
+                    style="width: 100%">
+                  </el-input-number>
+                  <el-select v-if="cColumn.type === 'Select'" v-model="params[cColumn.key]"
+                    :placeholder="column.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
+                    style="width: 100%">
+                    <el-option v-for="item in dict.type[cColumn.config.optionsName]" :key="item.value" :label="item.label"
+                      :value="item.value">
+                    </el-option>
+                  </el-select>
+                  <el-checkbox v-else-if="cColumn.type === 'Checkbox'" v-model="params[cColumn.key]" true-label="Y"
+                    false-label="N"></el-checkbox>
+                  <!-- <el-input v-if="column.type === 'InputDialog'" v-model="params[column.key]"
                     :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
                     :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
                     :readonly="column.readonly" style="width: 100%; cursor: pointer">
                     :readonly="column.readonly" style="width: 100%; cursor: pointer">
                     <template #suffix>
                     <template #suffix>
                       <el-icon class="el-icon-thumb"></el-icon>
                       <el-icon class="el-icon-thumb"></el-icon>
                     </template>
                     </template>
-                  </el-input>
+                  </el-input> -->
                 </template>
                 </template>
               </el-table-column>
               </el-table-column>
               <el-table-column fixed="right" label="操作" width="120">
               <el-table-column fixed="right" label="操作" width="120">

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

@@ -75,4 +75,105 @@ export const TableColumns = [
       { key: "midOrderNo", title: "中台采购订单号" }
       { key: "midOrderNo", title: "中台采购订单号" }
 ];
 ];
 
 
+export const TabColumns = [
+   {
+     title: '物料信息',
+     key: 'puOrderItemList',
+     tableColumns: [
+       { key: "rowNo", title: "行号" },
+       { key: "orderId", title: "采购订单ID" },
+       { key: "material", title: "物料" },
+       { key: "materialName", title: "物料名称" },
+       { key: "materialCode", title: "物料编码" },
+       { key: "materialClassify", title: "物料分类" },
+       { key: "materialManufacturersCode", title: "厂家物料编码" },
+       { key: "specification", title: "规格" },
+       { key: "model", title: "型号" },
+       { key: "isMedcine", title: "医药物料" },
+       { key: "manufacturer", title: "生产厂家代理人" },
+       { key: "isDrug", title: "物料药品属性" },
+       { key: "unit", title: "单位" },
+       { key: "qty", title: "数量" },
+       { key: "taxPrice", title: "含税单价" },
+       { key: "money", title: "价税合计" },
+       { key: "tax", title: "税率" },
+       { key: "taxDeductMoneya", title: "折扣金额" },
+       { key: "arrivalQty", title: "已到货数量" },
+       { key: "unarrivedQty", title: "未到货数量" },
+       { key: "notaxMoney", title: "无税金额" },
+       { key: "priceSource", title: "价格目录ID" },
+       { key: "isStorage", title: "入库关闭" },
+       { key: "isInvoice", title: "开票关闭" },
+       { key: "isArrival", title: "到货关闭" },
+       { key: "isPayment", title: "付款关闭" },
+       { key: "isGift", title: "赠品" },
+       { key: "warehouse", title: "收货仓库" },
+       { key: "place", title: "收货地点" },
+       { key: "address", title: "收货地址" },
+       { key: "productBatch", title: "产品批号" },
+       { key: "manufactureDate", title: "生产日期" },
+       { key: "efficacyLoseDate", title: "有效期至/失效日期" },
+       { key: "approvalNumber", title: "批准文号" },
+       { key: "registration", title: "注册证号" },
+       { key: "storageCondition", title: "存储条件" },
+       { key: "carriageCondition", title: "运输条件" },
+       { key: "isBatchLock", title: "批号锁定标识" },
+       { key: "isReplenishment", title: "补单标识" },
+       { key: "isUrgency", title: "紧急标识" },
+       { key: "originalQty", title: "原始数量" },
+       { key: "originalMoney", title: "原始金额" },
+       { key: "directProductBatch", title: "直运产品批号" },
+       { key: "discountRule", title: "折扣规则编码" },
+       { key: "reservedQty", title: "预留数量" },
+       { key: "reservedPeriod", title: "预留周期" },
+       { key: "taxDeductClassify", title: "扣税类别" },
+       { key: "exchangeRate", title: "折本汇率" },
+       { key: "source", title: "上游单据号" },
+       { key: "sourceId", title: "上游单据ID" },
+       { key: "demandCode", title: "采购需求单号" },
+       { key: "arrivalDatePlan", title: "计划到货日期" },
+       { key: "priceType", title: "价格类型" },
+       { key: "isDistributionPrice", title: "配送价" },
+       // { key: "tenantId", title: "租户号" },
+       // { key: "revision", title: "乐观锁" },
+       { key: "createByName", title: "创建人名称" },
+       { key: "updateByName", title: "更新人名称" },
+       // { key: "delFlag", title: "删除标记" },
+       // { key: "materialClassifyOne", title: "物料一级分类" },
+       { key: "materialClassifyOneName", title: "物料一级分类名称" },
+       // { key: "materialClassifyTwo", title: "物料二级分类" },
+       { key: "materialClassifyTwoName", title: "物料二级分类名称" },
+       // { key: "materialClassifyThree", title: "物料三级分类" },
+       { key: "materialClassifyThreeName", title: "物料三级分类名称" },
+       // { key: "materialClassifyFour", title: "物料四级分类" },
+       { key: "materialClassifyFourName", title: "物料四级分类名称" },
+       { key: "price", title: "无税单价" }
+     ]
+   },
+   {
+     title: '执行结果',
+     key: 'puOrderExecuteList',
+     tableColumns: [
+       // { key: "id", title: "主键" },
+       { key: "orderId", title: "采购订单ID" },
+       { key: "rowno", title: "行号" },
+       { key: "material", title: "物料" },
+       { key: "materialName", title: "物料名称" },
+       { key: "specification", title: "规格" },
+       { key: "qty", title: "数量" },
+       { key: "stroageQty", title: "累计到货主数量" },
+       { key: "stockQty", title: "累计入库主数量" },
+       { key: "invoiceQty", title: "累计开票主数量" },
+       { key: "rollbackQty", title: "累计退货主数量" },
+       { key: "backStockQty", title: "累计退库主数量" },
+       { key: "floatQty", title: "未到货数量" },
+       // { key: "tenantId", title: "租户号" },
+       // { key: "revision", title: "乐观锁" },
+       { key: "createByName", title: "创建人名称" },
+       { key: "updateByName", title: "更新人名称" },
+       // { key: "delFlag", title: "删除标记" }
+     ]
+   },
+ ];
+
 export const SearchColumns = TableColumns.filter((element) => element.search);
 export const SearchColumns = TableColumns.filter((element) => element.search);

+ 61 - 53
src/views/purchase/purchase-order/edit/index.vue

@@ -24,28 +24,25 @@ export default {
       rules: initRules(NewColumns),
       rules: initRules(NewColumns),
       params: {
       params: {
         ...initParams(NewColumns),
         ...initParams(NewColumns),
-        contractItemList: [],
-        contractClauseList: [],
-        contractExpenseList: [],
-        contractAgreementList: [],
-        contractApplyOrgList: [],
+        puOrderItemList: [],
+        puOrderExecuteList: [],
       },
       },
 
 
       tabColumns: NewTabColumns,
       tabColumns: NewTabColumns,
-      tabName: "contractItemList",
+      tabName: "puOrderItemList",
     };
     };
   },
   },
   computed: {},
   computed: {},
   watch: {
   watch: {
     "params.contractType": function (newProp) {
     "params.contractType": function (newProp) {
       this.tabColumns = NewTabColumns.filter((element) =>
       this.tabColumns = NewTabColumns.filter((element) =>
-        newProp === "1" ? element.key !== "contractItemList" : element
+        newProp === "1" ? element.key !== "puOrderItemList" : element
       );
       );
       this.tabName = this.tabColumns[0].key;
       this.tabName = this.tabColumns[0].key;
     },
     },
     tabName: function (newProp) {
     tabName: function (newProp) {
       const { id } = this.params;
       const { id } = this.params;
-      this.fetchTable(id, newProp);
+      // this.fetchTable(id, newProp);
     },
     },
   },
   },
   methods: {
   methods: {
@@ -70,22 +67,22 @@ export default {
       }
       }
     },
     },
     // 查询详情关联TABLE
     // 查询详情关联TABLE
-    async fetchTable(prop, name) {
-      try {
-        this.loading = true;
-        const { code, msg, rows } = await itemTableList({ id: prop }, name);
-        if (code === 200) {
-          this.params[name] = rows;
-          this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
-        }
-      } catch (err) {
-        this.$notify.error({ title: "error", message: err });
-      } finally {
-        this.loading = false;
-      }
-    },
+    // async fetchTable(prop, name) {
+    //   try {
+    //     this.loading = true;
+    //     const { code, msg, rows } = await itemTableList({ id: prop }, name);
+    //     if (code === 200) {
+    //       this.params[name] = rows;
+    //       this.$notify.success({ title: msg });
+    //     } else {
+    //       this.$notify.warning({ title: msg });
+    //     }
+    //   } catch (err) {
+    //     this.$notify.error({ title: "error", message: err });
+    //   } finally {
+    //     this.loading = false;
+    //   }
+    // },
     // 新增行
     // 新增行
     addTableRow(prop) {
     addTableRow(prop) {
       const arr = this.tabColumns.find(
       const arr = this.tabColumns.find(
@@ -103,36 +100,33 @@ export default {
       this.params = initParams(this.columns, "key", "value");
       this.params = initParams(this.columns, "key", "value");
     },
     },
     // 保存
     // 保存
-    handleSava() {
-      this.setVisible(false);
-    },
-    // 保存并新增
-    async handleSubmit() {
+    async handleSava() {
+
       try {
       try {
-        const createById = this.params.buyer;
-        const createByName = this.params.buyerName;
-        const updateById = this.$store.state.user.id;
-        const updateByName = this.$store.state.user.name;
-        const { code, msg } = await edit({
-          createById,
-          createByName,
-          updateById,
-          updateByName,
-          ...this.params,
-        });
+        this.loading = true;
+        const { code, msg } = await (this.handleIsRevise(this.params.status) ?
+          orderApi.revision(this.params)
+          : orderApi.edit(this.params)
+        )
         if (code === 200) {
         if (code === 200) {
-          this.$notify.success({ title: msg });
           this.setVisible(false);
           this.setVisible(false);
+          this.$notify.success({ title: msg });
         } else {
         } else {
           this.$notify.warning({ title: msg });
           this.$notify.warning({ title: msg });
         }
         }
       } catch (err) {
       } catch (err) {
         this.$notify.error({ title: "error", message: err });
         this.$notify.error({ title: "error", message: err });
       } finally {
       } finally {
-        // this.setVisible(false);
+        this.loading = false;
       }
       }
+
+    },
+    beforeOpen() {
+    },
+    // 判断修订还是编辑
+    handleIsRevise(status) {
+      return status == '2';
     },
     },
-    beforeOpen() { },
   },
   },
   created() {
   created() {
     console.log("ADD CREATED");
     console.log("ADD CREATED");
@@ -155,7 +149,7 @@ export default {
             justify-content: space-between;
             justify-content: space-between;
             align-items: center;
             align-items: center;
           ">
           ">
-          <h3>{{ params.status == '2' ? '修订' : '编辑' }}</h3>
+          <h3>{{ handleIsRevise(params.status) ? '修订' : '编辑' }}</h3>
           <div style="text-align: right">
           <div style="text-align: right">
             <el-button :size="size" @click="handleCancel">取 消</el-button>
             <el-button :size="size" @click="handleCancel">取 消</el-button>
             <el-button :size="size" type="danger" @click="handleSava">更 新</el-button>
             <el-button :size="size" type="danger" @click="handleSava">更 新</el-button>
@@ -165,7 +159,8 @@ export default {
           <el-col v-for="(column, index) in columns" :key="index" :span="column.span || 6">
           <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">
               <el-input v-if="column.type === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
               <el-input v-if="column.type === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input>
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
+              </el-input>
               <dr-input-dialog v-if="column.type === 'InputDialog'" v-model="params[column.key]"
               <dr-input-dialog v-if="column.type === 'InputDialog'" v-model="params[column.key]"
                 :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
                 :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
                 :readonly="column.readonly" :title="column.title" :type="column.config.componentName"
                 :readonly="column.readonly" :title="column.title" :type="column.config.componentName"
@@ -173,10 +168,12 @@ export default {
               </dr-input-dialog>
               </dr-input-dialog>
               <el-input v-if="column.type === 'Textarea'" v-model="params[column.key]" type="textarea"
               <el-input v-if="column.type === 'Textarea'" v-model="params[column.key]" type="textarea"
                 :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
                 :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                style="width: 100%"></el-input>
+                style="width: 100%">
+              </el-input>
               <el-input-number v-if="column.type === 'InputNumber'" v-model="params[column.key]"
               <el-input-number v-if="column.type === 'InputNumber'" v-model="params[column.key]"
                 :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
                 :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input-number>
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
+              </el-input-number>
               <el-select v-if="column.type === 'Select'" v-model="params[column.key]" :placeholder="column.placeholder"
               <el-select v-if="column.type === 'Select'" v-model="params[column.key]" :placeholder="column.placeholder"
                 :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
                 :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
                 <el-option v-for="item in dict.type[column.config.optionsName]" :key="item.value" :label="item.label"
                 <el-option v-for="item in dict.type[column.config.optionsName]" :key="item.value" :label="item.label"
@@ -196,8 +193,9 @@ export default {
                 :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
                 :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
                 :picker-options="column.pickerOptions" style="width: 100%">
                 :picker-options="column.pickerOptions" style="width: 100%">
               </el-date-picker>
               </el-date-picker>
-              <el-checkbox v-else-if="column.type === 'Checkbox'" v-model="params[column.key]" true-label="Y"
-                false-label="N"></el-checkbox>
+              <el-checkbox v-else-if="column.type === 'Checkbox'" v-model="params[column.key]" :disabled="column.disabled"
+                true-label="Y" false-label="N">
+              </el-checkbox>
               <el-upload v-if="column.type === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled" drag
               <el-upload v-if="column.type === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled" drag
                 action="https://sy.derom.com/document-center/fastdfs/upload" multiple>
                 action="https://sy.derom.com/document-center/fastdfs/upload" multiple>
                 <i class="el-icon-upload"></i>
                 <i class="el-icon-upload"></i>
@@ -233,18 +231,28 @@ export default {
                     {{ scope.row[cColumn.key] }}</span>
                     {{ scope.row[cColumn.key] }}</span>
                   <el-input v-if="cColumn.type === 'Input'" v-model="scope.row[cColumn.key]"
                   <el-input v-if="cColumn.type === 'Input'" v-model="scope.row[cColumn.key]"
                     :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
                     :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
-                    :size="size" style="width: 100%"></el-input>
+                    :size="size" style="width: 100%">
+                  </el-input>
                   <dr-input-dialog v-if="cColumn.type === 'InputDialog'" v-model="scope.row[cColumn.key]"
                   <dr-input-dialog v-if="cColumn.type === 'InputDialog'" v-model="scope.row[cColumn.key]"
                     :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
                     :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
                     :readonly="cColumn.readonly" :title="cColumn.title" :type="cColumn.config.componentName"
                     :readonly="cColumn.readonly" :title="cColumn.title" :type="cColumn.config.componentName"
                     :data-mapping="cColumn.config.dataMapping" :source.sync="scope.row" :size="size">
                     :data-mapping="cColumn.config.dataMapping" :source.sync="scope.row" :size="size">
                   </dr-input-dialog>
                   </dr-input-dialog>
-                  <el-checkbox v-else-if="column.type === 'Checkbox'" v-model="params[column.key]" true-label="Y"
-                    false-label="N"></el-checkbox>
+                  <el-select v-if="cColumn.type === 'Select'" v-model="params[cColumn.key]"
+                    :placeholder="column.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
+                    style="width: 100%">
+                    <el-option v-for="item in dict.type[cColumn.config.optionsName]" :key="item.value" :label="item.label"
+                      :value="item.value">
+                    </el-option>
+                  </el-select>
+                  <el-checkbox v-else-if="cColumn.type === 'Checkbox'" v-model="params[cColumn.key]" true-label="Y"
+                    false-label="N">
+                  </el-checkbox>
                   <el-input-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"
                   <el-input-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"
                     :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
                     :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
                     :clearable="cColumn.clearable" :disabled="cColumn.disabled" :size="size"
                     :clearable="cColumn.clearable" :disabled="cColumn.disabled" :size="size"
-                    style="width: 100%"></el-input-number>
+                    style="width: 100%">
+                  </el-input-number>
                 </template>
                 </template>
               </el-table-column>
               </el-table-column>
               <el-table-column fixed="right" label="操作" width="120">
               <el-table-column fixed="right" label="操作" width="120">

+ 120 - 121
src/views/purchase/purchase-order/index.vue

@@ -1,6 +1,6 @@
 <!-- 采购订单修订—— 列表 -->
 <!-- 采购订单修订—— 列表 -->
 <script>
 <script>
-import { TableColumns, SearchColumns } from "./column";
+import { TableColumns, SearchColumns, TabColumns } from "./column";
 import orderApi from "@/api/business/purchase/purchase-order";
 import orderApi from "@/api/business/purchase/purchase-order";
 import { initPage, initLayout, initPageSizes, initParams } from "@/utils/init";
 import { initPage, initLayout, initPageSizes, initParams } from "@/utils/init";
 export default {
 export default {
@@ -12,107 +12,107 @@ export default {
   },
   },
   data() {
   data() {
 
 
-    const tabColumns = [
-      {
-        title: '物料信息',
-        key: 'first',
-        tableColumns: [
-          { key: "rowNo", title: "行号" },
-          { key: "orderId", title: "采购订单ID" },
-          { key: "material", title: "物料" },
-          { key: "materialName", title: "物料名称" },
-          { key: "materialCode", title: "物料编码" },
-          { key: "materialClassify", title: "物料分类" },
-          { key: "materialManufacturersCode", title: "厂家物料编码" },
-          { key: "specification", title: "规格" },
-          { key: "model", title: "型号" },
-          { key: "isMedcine", title: "医药物料" },
-          { key: "manufacturer", title: "生产厂家代理人" },
-          { key: "isDrug", title: "物料药品属性" },
-          { key: "unit", title: "单位" },
-          { key: "qty", title: "数量" },
-          { key: "taxPrice", title: "含税单价" },
-          { key: "money", title: "价税合计" },
-          { key: "tax", title: "税率" },
-          { key: "taxDeductMoneya", title: "折扣金额" },
-          { key: "arrivalQty", title: "已到货数量" },
-          { key: "unarrivedQty", title: "未到货数量" },
-          { key: "notaxMoney", title: "无税金额" },
-          { key: "priceSource", title: "价格目录ID" },
-          { key: "isStorage", title: "入库关闭" },
-          { key: "isInvoice", title: "开票关闭" },
-          { key: "isArrival", title: "到货关闭" },
-          { key: "isPayment", title: "付款关闭" },
-          { key: "isGift", title: "赠品" },
-          { key: "warehouse", title: "收货仓库" },
-          { key: "place", title: "收货地点" },
-          { key: "address", title: "收货地址" },
-          { key: "productBatch", title: "产品批号" },
-          { key: "manufactureDate", title: "生产日期" },
-          { key: "efficacyLoseDate", title: "有效期至/失效日期" },
-          { key: "approvalNumber", title: "批准文号" },
-          { key: "registration", title: "注册证号" },
-          { key: "storageCondition", title: "存储条件" },
-          { key: "carriageCondition", title: "运输条件" },
-          { key: "isBatchLock", title: "批号锁定标识" },
-          { key: "isReplenishment", title: "补单标识" },
-          { key: "isUrgency", title: "紧急标识" },
-          { key: "originalQty", title: "原始数量" },
-          { key: "originalMoney", title: "原始金额" },
-          { key: "directProductBatch", title: "直运产品批号" },
-          { key: "discountRule", title: "折扣规则编码" },
-          { key: "reservedQty", title: "预留数量" },
-          { key: "reservedPeriod", title: "预留周期" },
-          { key: "taxDeductClassify", title: "扣税类别" },
-          { key: "exchangeRate", title: "折本汇率" },
-          { key: "source", title: "上游单据号" },
-          { key: "sourceId", title: "上游单据ID" },
-          { key: "demandCode", title: "采购需求单号" },
-          { key: "arrivalDatePlan", title: "计划到货日期" },
-          { key: "priceType", title: "价格类型" },
-          { key: "isDistributionPrice", title: "配送价" },
-          // { key: "tenantId", title: "租户号" },
-          // { key: "revision", title: "乐观锁" },
-          { key: "createByName", title: "创建人名称" },
-          { key: "updateByName", title: "更新人名称" },
-          // { key: "delFlag", title: "删除标记" },
-          // { key: "materialClassifyOne", title: "物料一级分类" },
-          { key: "materialClassifyOneName", title: "物料一级分类名称" },
-          // { key: "materialClassifyTwo", title: "物料二级分类" },
-          { key: "materialClassifyTwoName", title: "物料二级分类名称" },
-          // { key: "materialClassifyThree", title: "物料三级分类" },
-          { key: "materialClassifyThreeName", title: "物料三级分类名称" },
-          // { key: "materialClassifyFour", title: "物料四级分类" },
-          { key: "materialClassifyFourName", title: "物料四级分类名称" },
-          { key: "price", title: "无税单价" }
-        ]
-      },
-      {
-        title: '执行结果',
-        key: 'second',
-        tableColumns: [
-          // { key: "id", title: "主键" },
-          { key: "orderId", title: "采购订单ID" },
-          { key: "rowno", title: "行号" },
-          { key: "material", title: "物料" },
-          { key: "materialName", title: "物料名称" },
-          { key: "specification", title: "规格" },
-          { key: "qty", title: "数量" },
-          { key: "stroageQty", title: "累计到货主数量" },
-          { key: "stockQty", title: "累计入库主数量" },
-          { key: "invoiceQty", title: "累计开票主数量" },
-          { key: "rollbackQty", title: "累计退货主数量" },
-          { key: "backStockQty", title: "累计退库主数量" },
-          { key: "floatQty", title: "未到货数量" },
-          // { key: "tenantId", title: "租户号" },
-          // { key: "revision", title: "乐观锁" },
-          { key: "createByName", title: "创建人名称" },
-          { key: "updateByName", title: "更新人名称" },
-          // { key: "delFlag", title: "删除标记" }
-        ]
-      },
-    ];
-    const initTabColumns = () => tabColumns;
+    // const tabColumns = [
+    //   {
+    //     title: '物料信息',
+    //     key: 'first',
+    //     tableColumns: [
+    //       { key: "rowNo", title: "行号" },
+    //       { key: "orderId", title: "采购订单ID" },
+    //       { key: "material", title: "物料" },
+    //       { key: "materialName", title: "物料名称" },
+    //       { key: "materialCode", title: "物料编码" },
+    //       { key: "materialClassify", title: "物料分类" },
+    //       { key: "materialManufacturersCode", title: "厂家物料编码" },
+    //       { key: "specification", title: "规格" },
+    //       { key: "model", title: "型号" },
+    //       { key: "isMedcine", title: "医药物料" },
+    //       { key: "manufacturer", title: "生产厂家代理人" },
+    //       { key: "isDrug", title: "物料药品属性" },
+    //       { key: "unit", title: "单位" },
+    //       { key: "qty", title: "数量" },
+    //       { key: "taxPrice", title: "含税单价" },
+    //       { key: "money", title: "价税合计" },
+    //       { key: "tax", title: "税率" },
+    //       { key: "taxDeductMoneya", title: "折扣金额" },
+    //       { key: "arrivalQty", title: "已到货数量" },
+    //       { key: "unarrivedQty", title: "未到货数量" },
+    //       { key: "notaxMoney", title: "无税金额" },
+    //       { key: "priceSource", title: "价格目录ID" },
+    //       { key: "isStorage", title: "入库关闭" },
+    //       { key: "isInvoice", title: "开票关闭" },
+    //       { key: "isArrival", title: "到货关闭" },
+    //       { key: "isPayment", title: "付款关闭" },
+    //       { key: "isGift", title: "赠品" },
+    //       { key: "warehouse", title: "收货仓库" },
+    //       { key: "place", title: "收货地点" },
+    //       { key: "address", title: "收货地址" },
+    //       { key: "productBatch", title: "产品批号" },
+    //       { key: "manufactureDate", title: "生产日期" },
+    //       { key: "efficacyLoseDate", title: "有效期至/失效日期" },
+    //       { key: "approvalNumber", title: "批准文号" },
+    //       { key: "registration", title: "注册证号" },
+    //       { key: "storageCondition", title: "存储条件" },
+    //       { key: "carriageCondition", title: "运输条件" },
+    //       { key: "isBatchLock", title: "批号锁定标识" },
+    //       { key: "isReplenishment", title: "补单标识" },
+    //       { key: "isUrgency", title: "紧急标识" },
+    //       { key: "originalQty", title: "原始数量" },
+    //       { key: "originalMoney", title: "原始金额" },
+    //       { key: "directProductBatch", title: "直运产品批号" },
+    //       { key: "discountRule", title: "折扣规则编码" },
+    //       { key: "reservedQty", title: "预留数量" },
+    //       { key: "reservedPeriod", title: "预留周期" },
+    //       { key: "taxDeductClassify", title: "扣税类别" },
+    //       { key: "exchangeRate", title: "折本汇率" },
+    //       { key: "source", title: "上游单据号" },
+    //       { key: "sourceId", title: "上游单据ID" },
+    //       { key: "demandCode", title: "采购需求单号" },
+    //       { key: "arrivalDatePlan", title: "计划到货日期" },
+    //       { key: "priceType", title: "价格类型" },
+    //       { key: "isDistributionPrice", title: "配送价" },
+    //       // { key: "tenantId", title: "租户号" },
+    //       // { key: "revision", title: "乐观锁" },
+    //       { key: "createByName", title: "创建人名称" },
+    //       { key: "updateByName", title: "更新人名称" },
+    //       // { key: "delFlag", title: "删除标记" },
+    //       // { key: "materialClassifyOne", title: "物料一级分类" },
+    //       { key: "materialClassifyOneName", title: "物料一级分类名称" },
+    //       // { key: "materialClassifyTwo", title: "物料二级分类" },
+    //       { key: "materialClassifyTwoName", title: "物料二级分类名称" },
+    //       // { key: "materialClassifyThree", title: "物料三级分类" },
+    //       { key: "materialClassifyThreeName", title: "物料三级分类名称" },
+    //       // { key: "materialClassifyFour", title: "物料四级分类" },
+    //       { key: "materialClassifyFourName", title: "物料四级分类名称" },
+    //       { key: "price", title: "无税单价" }
+    //     ]
+    //   },
+    //   {
+    //     title: '执行结果',
+    //     key: 'second',
+    //     tableColumns: [
+    //       // { key: "id", title: "主键" },
+    //       { key: "orderId", title: "采购订单ID" },
+    //       { key: "rowno", title: "行号" },
+    //       { key: "material", title: "物料" },
+    //       { key: "materialName", title: "物料名称" },
+    //       { key: "specification", title: "规格" },
+    //       { key: "qty", title: "数量" },
+    //       { key: "stroageQty", title: "累计到货主数量" },
+    //       { key: "stockQty", title: "累计入库主数量" },
+    //       { key: "invoiceQty", title: "累计开票主数量" },
+    //       { key: "rollbackQty", title: "累计退货主数量" },
+    //       { key: "backStockQty", title: "累计退库主数量" },
+    //       { key: "floatQty", title: "未到货数量" },
+    //       // { key: "tenantId", title: "租户号" },
+    //       // { key: "revision", title: "乐观锁" },
+    //       { key: "createByName", title: "创建人名称" },
+    //       { key: "updateByName", title: "更新人名称" },
+    //       // { key: "delFlag", title: "删除标记" }
+    //     ]
+    //   },
+    // ];
+    const initTabColumns = () => TabColumns;
     return {
     return {
       loading: false,
       loading: false,
       isSimpleSearch: true,
       isSimpleSearch: true,
@@ -125,12 +125,11 @@ export default {
       tableColumns: TableColumns,
       tableColumns: TableColumns,
       tableData: [],
       tableData: [],
       tabColumns: initTabColumns(),
       tabColumns: initTabColumns(),
-      tabName: "first",
+      tabName: "puOrderItemList",
       tabTableDatas: {
       tabTableDatas: {
-        first: [],
-        second: [],
+        puOrderItemList: [],
+        puOrderExecuteList: [],
       },
       },
-      checkedData: {}
     };
     };
   },
   },
   computed: {
   computed: {
@@ -204,7 +203,7 @@ export default {
     handleResetList() {
     handleResetList() {
 
 
       this.page = initPage();
       this.page = initPage();
-      this.params = initParams();
+      this.params = initParams(SearchColumns);
       this.fetchList(this.params, this.page);
       this.fetchList(this.params, this.page);
     },
     },
     handleTabClick() { },
     handleTabClick() { },
@@ -233,10 +232,10 @@ export default {
       try {
       try {
         const { code, msg, data } = await orderApi.details(row.id);
         const { code, msg, data } = await orderApi.details(row.id);
         if (code === 200) {
         if (code === 200) {
-          this.checkedData = data;
           // 物料信息:puOrderItemList   执行结果:puOrderExecuteList
           // 物料信息:puOrderItemList   执行结果:puOrderExecuteList
-          this.tabTableDatas.first = data.puOrderItemList;
-          this.tabTableDatas.second = data.puOrderExecuteList;
+          for (const key in this.tabTableDatas) {
+            this.tabTableDatas[key] = data[key];
+          }
           this.$notify.success({ title: msg });
           this.$notify.success({ title: msg });
         } else {
         } else {
           this.$notify.warning({ title: msg });
           this.$notify.warning({ title: msg });
@@ -248,10 +247,10 @@ export default {
       }
       }
     },
     },
     // 删除操作
     // 删除操作
-    async handleDeleteList(prop) {
+    async handleDeleteList(row) {
       try {
       try {
         this.loading = true;
         this.loading = true;
-        const { id } = prop;
+        const { id } = row;
         console.log(id, 'id');
         console.log(id, 'id');
         const { code, msg } = await orderApi.remove(id);
         const { code, msg } = await orderApi.remove(id);
         if (code === 200) {
         if (code === 200) {
@@ -266,6 +265,10 @@ export default {
         this.loading = false;
         this.loading = false;
       }
       }
     },
     },
+    // 提交
+    async handleSubmit(row) {
+
+    }
 
 
   },
   },
 };
 };
@@ -307,11 +310,10 @@ export default {
         <el-button-group style="margin-left: 10px">
         <el-button-group style="margin-left: 10px">
           <el-button size="mini" type="danger" @click="handleOpenAddDrawer">新增</el-button>
           <el-button size="mini" type="danger" @click="handleOpenAddDrawer">新增</el-button>
           <el-button size="mini">复制</el-button>
           <el-button size="mini">复制</el-button>
-          <el-button size="mini">提交</el-button>
+
         </el-button-group>
         </el-button-group>
 
 
         <el-button-group style="margin-left: 10px">
         <el-button-group style="margin-left: 10px">
-          <!-- <el-button size="mini" :disabled="checkedData.status != '2'">修订</el-button> -->
           <el-button size="mini">退回</el-button>
           <el-button size="mini">退回</el-button>
         </el-button-group>
         </el-button-group>
 
 
@@ -332,10 +334,13 @@ export default {
       </el-table-column>
       </el-table-column>
       <el-table-column fixed="right" label="操作" width="120">
       <el-table-column fixed="right" label="操作" width="120">
         <template slot-scope="scope">
         <template slot-scope="scope">
-          <el-button @click.stop="handleOpenSeeDrawer(scope.row)" type="text" size="small">查看</el-button>
+          <!-- <el-button @click.stop="handleOpenSeeDrawer(scope.row)" type="text" size="small">查看</el-button> -->
           <el-button type="text" size="small" @click.stop="handleOpenEditDrawer(scope.row)">
           <el-button type="text" size="small" @click.stop="handleOpenEditDrawer(scope.row)">
             {{ scope.row.status == '2' ? '修订' : '编辑' }}</el-button>
             {{ scope.row.status == '2' ? '修订' : '编辑' }}</el-button>
+          <!-- 0=自由态,1=审批中,2=已审核,3=已驳回 -->
           <el-button type="text" size="small" @click.stop="handleDeleteList(scope.row)">删除</el-button>
           <el-button type="text" size="small" @click.stop="handleDeleteList(scope.row)">删除</el-button>
+          <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" type="text" size="mini"
+            @click.stop="handleSubmit(scope.row)">提交</el-button>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
 
 
@@ -345,11 +350,6 @@ export default {
       :layout="layout">
       :layout="layout">
     </el-pagination>
     </el-pagination>
 
 
-    <!-- <el-card :body-style="{
-      padding: '20px',
-      display: 'flex',
-      'flex-wrap': 'wrap',
-    }" style="margin: 10px"> -->
     <el-tabs v-model="tabName" @tab-click="handleTabClick" style="width: 100%;padding: 20px 10px">
     <el-tabs v-model="tabName" @tab-click="handleTabClick" style="width: 100%;padding: 20px 10px">
       <el-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
       <el-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
         <el-table :data="tabTableDatas[column.key]" style="width: 100%" highlight-current-row>
         <el-table :data="tabTableDatas[column.key]" style="width: 100%" highlight-current-row>
@@ -360,7 +360,6 @@ export default {
         </el-table>
         </el-table>
       </el-tab-pane>
       </el-tab-pane>
     </el-tabs>
     </el-tabs>
-    <!-- </el-card> -->
 
 
   </el-card>
   </el-card>
 </template>
 </template>

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

@@ -12,7 +12,10 @@ import orderApi from "@/api/business/purchase/purchase-order";
 const NewColumns = initColumns(Columns, { disabled: true, readonly: true });
 const NewColumns = initColumns(Columns, { disabled: true, readonly: true });
 const NewTabColumns = TabColumns.map((element) => ({
 const NewTabColumns = TabColumns.map((element) => ({
   ...element,
   ...element,
-  tableColumns: initColumns(element.tableColumns),
+  tableColumns: initColumns(element.tableColumns, {
+    disabled: true,
+    readonly: true,
+  }),
 }));
 }));
 
 
 
 
@@ -107,7 +110,8 @@ export default {
                 </el-option>
                 </el-option>
               </el-select>
               </el-select>
               <el-checkbox v-else-if="column.type === 'Checkbox'" v-model="params[column.key]" true-label="Y"
               <el-checkbox v-else-if="column.type === 'Checkbox'" v-model="params[column.key]" true-label="Y"
-                false-label="N"></el-checkbox>
+                false-label="N" :disabled="column.disabled" :readonly="column.readonly">
+              </el-checkbox>
 
 
               <el-date-picker v-else-if="column.type === 'DatePicker'" v-model="params[column.key]"
               <el-date-picker v-else-if="column.type === 'DatePicker'" v-model="params[column.key]"
                 :type="column.config.type" :placeholder="column.placeholder" :clearable="column.clearable"
                 :type="column.config.type" :placeholder="column.placeholder" :clearable="column.clearable"
@@ -148,21 +152,21 @@ export default {
                   </el-tag>
                   </el-tag>
                   <el-input v-if="cColumn.type === 'Input'" v-model="scope.row[cColumn.key]"
                   <el-input v-if="cColumn.type === 'Input'" v-model="scope.row[cColumn.key]"
                     :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
                     :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
-                    size="mini" style="width: 100%"></el-input>
+                    :readonly="cColumn.readonly" size="mini" style="width: 100%"></el-input>
                   <el-input-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"
                   <el-input-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"
                     :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
                     :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" size="mini"
+                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" :readonly="cColumn.readonly" size="mini"
                     style="width: 100%"></el-input-number>
                     style="width: 100%"></el-input-number>
                   <el-input v-if="column.type === 'InputDialog'" v-model="params[column.key]"
                   <el-input v-if="column.type === 'InputDialog'" v-model="params[column.key]"
-                    :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                    :readonly="column.readonly" style="width: 100%; cursor: pointer"
+                    :placeholder="column.placeholder" :clearable="column.clearable" :disabled="cColumn.disabled"
+                    :readonly="cColumn.readonly" style="width: 100%; cursor: pointer"
                     @click.native.stop="openAsyncInputDialog(column, params)">
                     @click.native.stop="openAsyncInputDialog(column, params)">
                     <template #suffix>
                     <template #suffix>
                       <el-icon class="el-icon-thumb"></el-icon>
                       <el-icon class="el-icon-thumb"></el-icon>
                     </template>
                     </template>
                   </el-input>
                   </el-input>
                   <el-checkbox v-else-if="column.type === 'Checkbox'" v-model="params[column.key]" true-label="Y"
                   <el-checkbox v-else-if="column.type === 'Checkbox'" v-model="params[column.key]" true-label="Y"
-                    false-label="N"></el-checkbox>
+                    :disabled="cColumn.disabled" false-label="N"></el-checkbox>
                 </template>
                 </template>
               </el-table-column>
               </el-table-column>
               <!-- <el-table-column fixed="right" label="操作" width="120">
               <!-- <el-table-column fixed="right" label="操作" width="120">