浏览代码

Merge branch 'purchaseDev' into 'dev'

Purchase dev

See merge request new-business/drp-web!63
黄梓星 2 年之前
父节点
当前提交
04ef37a5fd

+ 10 - 0
src/api/business/purchase/purchase-order.js

@@ -80,6 +80,15 @@ const documentsReturn = (data) => {
   });
 }
 
+// 采购订单退回
+const close = (data) => {
+  return request({
+    url: `/pu/order/close`,
+    method: "post",
+    data,
+  });
+}
+
 export default {
   list,
   details,
@@ -90,5 +99,6 @@ export default {
   remove,
   getPrice,
   documentsReturn,
+  close,
 
 }

+ 71 - 0
src/components/computed-input/index.vue

@@ -0,0 +1,71 @@
+<template>
+  <el-input
+    v-model="value"
+    readonly
+    :size="size"
+    :placeholder="placeholder"
+    style="width: 100%"
+  ></el-input>
+</template>
+
+<script>
+export default {
+  name: "ComputedInput",
+  props: {
+    // v-model
+    value: {
+      type: [Number, String],
+      require: true,
+    },
+    // v-model
+    computed: {
+      type: Function,
+      default: () => {
+        return () => {};
+      },
+      require: true,
+    },
+    // 源数据
+    source: {
+      type: Object,
+      require: true,
+    },
+    // 组件大小
+    size: {
+      type: String,
+      dafault: () => {
+        return "mini";
+      },
+    },
+    // 提示
+    placeholder: {
+      type: String,
+      dafault: () => {
+        return "";
+      },
+    },
+  },
+  data() {
+    return {};
+  },
+  computed: {
+    newSource() {
+      return this.$props.source;
+    },
+  },
+  watch: {
+    newSource: {
+      handler: function (newProp) {
+        const { computed } = this.$props;
+        this.$emit("input", computed(newProp));
+      },
+      deep: true,
+    },
+  },
+  methods: {},
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<style scoped></style>

+ 3 - 0
src/main.js

@@ -51,6 +51,8 @@ import DictData from "@/components/DictData";
 import PopoverSelect from "@/components/popover-select/index.vue";
 //
 import PopoverTreeSelect from "@/components/popover-tree-select/index.vue";
+//
+import ComputedInput from "@/components/computed-input/index.vue";
 
 // 全局方法挂载
 Vue.prototype.getDicts = getDicts;
@@ -73,6 +75,7 @@ Vue.component("ImageUpload", ImageUpload);
 Vue.component("ImagePreview", ImagePreview);
 Vue.component("DrPopoverSelect", PopoverSelect);
 Vue.component("DrPopoverTreeSelect", PopoverTreeSelect);
+Vue.component("DrComputedInput", ComputedInput);
 
 Vue.use(directive);
 Vue.use(plugins);

+ 24 - 10
src/views/purchase/PurchaseDemandList/add.vue

@@ -16,7 +16,7 @@
 
         <el-col :span="1.5">
             <el-form-item label="组织">
-              <el-select size="small" v-model="basicForm.org" :disabled="sonDisable" @focus="chooseOrg('ORG_PARAM', true, '选择组织')" style="width: 200px">
+              <el-select clearable size="small" v-model="basicForm.org" :disabled="sonDisable" @focus="chooseOrg('ORG_PARAM', true, '选择组织')" style="width: 200px">
                 <el-option v-for="item in orgOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -42,7 +42,7 @@
 
          <el-col :span="1.5">
             <el-form-item label="需求客户">
-              <el-select size="small" v-model="basicForm.customer" :disabled="sonDisable" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')" style="width: 200px">
+              <el-select clearable size="small" v-model="basicForm.customer" :disabled="sonDisable" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')" style="width: 200px">
                 <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -62,7 +62,7 @@
 
          <el-col :span="1.5">
             <el-form-item label="需求人员">
-                <el-select size="small" v-model="basicForm.demandPersonal" :disabled="sonDisable" @focus="chooseOrg('CONTACTS_PARAM', true, '需求人员')" style="width: 200px">
+                <el-select clearable size="small" v-model="basicForm.demandPersonal" :disabled="sonDisable" @focus="chooseOrg('CONTACTS_PARAM', true, '需求人员')" style="width: 200px">
                   <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.code" />
                 </el-select>
             </el-form-item>
@@ -70,7 +70,7 @@
 
          <el-col :span="1.5">
             <el-form-item label="需求部门">
-              <el-select v-model="basicForm.demandDept" size="small" :disabled="sonDisable" @focus="chooseOrg('DEPT_PARAM', true, '需求部门')" style="width: 200px">
+              <el-select clearable v-model="basicForm.demandDept" size="small" :disabled="sonDisable" @focus="chooseOrg('DEPT_PARAM', true, '需求部门')" style="width: 200px">
                 <el-option
                   v-for="item in deptOptions"
                   :key="item.id"
@@ -86,6 +86,7 @@
               <el-date-picker
                 v-model="basicForm.demandDate"
                 :disabled="sonDisable"
+                clearable
                 type="date"
                 value-format="yyyy-MM-dd"
                 size="small"
@@ -106,7 +107,7 @@
 
          <el-col :span="1.5">
             <el-form-item label="业务类型">
-              <el-select v-model="basicForm.billType" :disabled="sonDisable" size="small" style="width: 200px">
+              <el-select clearable v-model="basicForm.billType" @change="changeBillType" :disabled="sonDisable" size="small" style="width: 200px">
                 <el-option v-for=" dict in dict.type.sys_business" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
               </el-select>
@@ -115,7 +116,7 @@
 
           <el-col :span="1.5">
             <el-form-item label="是否客户指定">
-              <el-select v-model="basicForm.isSpeical" :disabled="sonDisable" size="small" style="width: 200px">
+              <el-select clearable v-model="basicForm.isSpeical" :disabled="sonDisable" size="small" style="width: 200px">
                 <el-option v-for=" item in options" :key="item.value" :label="item.label" :value="item.value">
                 </el-option>
               </el-select>
@@ -288,7 +289,7 @@
               <el-form-item class="hang">
                 <el-switch
                   v-model="scope.row.isReplenishment"
-                  :disabled="sonDisable"
+                  disabled
                   active-value="Y"
                   inactive-value="N"
                   active-color="#13ce66"
@@ -354,7 +355,7 @@
               <el-form-item class="hang">
                 <el-switch
                   v-model="scope.row.isUrgency"
-                  :disabled="sonDisable"
+                  disabled
                   active-value="Y"
                   inactive-value="N"
                   active-color="#13ce66"
@@ -556,6 +557,19 @@ export default {
     }
   },
   methods: {
+    // 更改业务类型调整明细行内补单或紧急标识
+    changeBillType() {
+      if (this.basicForm.billType == 'BDXQ' && this.basicForm.puDemandItemList.length != 0) {
+        this.basicForm.puDemandItemList.forEach(item => {item.isReplenishment = 'Y'})
+      } else {
+        this.basicForm.puDemandItemList.forEach(item => { item.isReplenishment = 'N' })
+      }
+      if (this.basicForm.billType == 'JJXQ' && this.basicForm.puDemandItemList.length != 0) {
+        this.basicForm.puDemandItemList.forEach(item => {item.isUrgency = 'Y'})
+      } else {
+        this.basicForm.puDemandItemList.forEach(item => { item.isUrgency = 'N' })
+      }
+    },
     hangStatus(row) {
       switch (row.status) {
         case '0':
@@ -677,8 +691,8 @@ export default {
         demandPeriod: null,
         forecastClassify: null,
         deliveryDate: null,
-        isUrgency: 'N',
-        isReplenishment: 'N',
+        isUrgency: this.basicForm.billType == 'JJXQ' ? 'Y' : 'N',
+        isReplenishment: this.basicForm.billType == 'BDXQ'? 'Y': 'N',
         isBatchLock: 'N',
         remark: null,
         puRemark: null,

+ 8 - 0
src/views/purchase/contract/add/index.vue

@@ -255,6 +255,14 @@ export default {
                     :placeholder="cColumn.placeholder"
                     style="width: 100%"
                   ></el-input>
+                  <dr-computed-input
+                    v-if="cColumn.inputType === 'ComputedInput'"
+                    v-model="scope.row[cColumn.key]"
+                    :source="scope.row"
+                    :computed="cColumn.computed"
+                    :placeholder="cColumn.placeholder"
+                    style="width: 100%"
+                  ></dr-computed-input>
                   <dr-popover-select
                     v-else-if="cColumn.inputType === 'PopoverSelect'"
                     v-model="scope.row[cColumn.key]"

+ 40 - 11
src/views/purchase/contract/column.js

@@ -108,8 +108,9 @@ export const Columns = [
   {
     key: "contractFormat",
     title: "合同格式",
-    inputType: "Input",
+    inputType: "Select",
     require: true,
+    referName: "puarchase_contract_contract_format",
   },
   {
     key: "productName",
@@ -246,21 +247,21 @@ export const Columns = [
     title: "对外附件",
     inputType: "Upload",
     span: 24,
-    fileType: ["pdf", "xls"],
+    fileType: ["pdf"],
   },
   {
     key: "puFile",
     title: "采购商盖章合同附件",
     inputType: "Upload",
     span: 24,
-    fileType: ["pdf", "xls"],
+    fileType: ["pdf"],
   },
   {
     key: "supplierFile",
     title: "供应商盖章合同附件",
     inputType: "Upload",
     span: 24,
-    fileType: ["pdf", "xls"],
+    fileType: ["pdf"],
   },
   { key: "projectCode", title: "项目编号", inputType: "Input" },
   { key: "projectName", title: "项目名称", inputType: "Input" },
@@ -364,17 +365,24 @@ export const TabColumns = [
         title: "采购数量",
         key: "qty",
         inputType: "InputNumber",
-
         width: 200,
       },
       {
         title: "含税单价",
         key: "taxPrice",
         inputType: "InputNumber",
-
         width: 200,
       },
-      { title: "含税金额合计", key: "taxMoney", width: 200 },
+      {
+        title: "含税金额合计",
+        key: "taxMoney",
+        inputType: "ComputedInput",
+        width: 200,
+        computed: (prop) => {
+          const { qty, taxPrice } = prop;
+          return qty && taxPrice ? qty * taxPrice : null;
+        },
+      },
       { title: "无税单价", key: "taxFreePrice" },
       { title: "无税金额合计", key: "taxFreeMoney", width: 200 },
       {
@@ -448,8 +456,20 @@ export const TabColumns = [
       { title: "账期天数", key: "paymetDays", inputType: "Input", width: 200 },
       { title: "付款比例%", key: "ratio", inputType: "Input", width: 200 },
       { title: "付款金额", key: "money", inputType: "Input", width: 200 },
-      { title: "是否预付款", key: "isAdvance", width: 200 },
-      { title: "是否质保金", key: "isQuality", width: 200 },
+      {
+        title: "是否预付款",
+        key: "isAdvance",
+        width: 200,
+        inputType: "Select",
+        referName: "sys_yes_no",
+      },
+      {
+        title: "是否质保金",
+        key: "isQuality",
+        width: 200,
+        inputType: "Select",
+        referName: "sys_yes_no",
+      },
       {
         title: "结算方式",
         key: "paymentMeans",
@@ -474,8 +494,17 @@ export const TabColumns = [
     title: "合同执行组织范围",
     key: "contractApplyOrgList",
     tableColumns: [
-      { title: "组织名称", key: "orgName", inputType: "Input" },
-      { title: "组织编码", key: "org", inputType: "Input" },
+      {
+        title: "组织名称",
+        key: "orgName",
+        inputType: "PopoverSelect",
+        referName: "ORG_PARAM",
+        dataMapping: {
+          org: "code",
+          orgName: "name",
+        },
+      },
+      { title: "组织编码", key: "org" },
     ],
   },
 ];

+ 36 - 12
src/views/purchase/purchase-order/add/column.js

@@ -122,13 +122,13 @@ export const Columns = [
     key: "qty",
     title: "总数量",
     inputType: "InputNumber",
-    config: { controlsPosition: "right" },
+    controlsPosition: "right",
   },
   {
     key: "originalQty",
     title: "原始总数量",
     inputType: "InputNumber",
-    config: { controlsPosition: "right" },
+    controlsPosition: "right",
   },
   { key: "money", title: "价税合计", inputType: "Input", },
   { key: "originalMoney", title: "原始总金额", inputType: "Input", },
@@ -210,7 +210,19 @@ export const Columns = [
   { key: "isUrgency", title: "紧急程度", inputType: "Checkbox", },
   { key: "isSendWms", title: "已同步WMS", inputType: "Checkbox", },
   // { key: "agent", title: "代理人", inputType: "Input", }, // 建议删除
-  // { key: "agentName", title: "代理人名称", },
+  {
+    key: "agentName",
+    title: "代理人",
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "CONTACTS_PARAM",
+    dataMapping: {
+      agent: 'id',
+      agentName: 'name'
+    },
+    queryParams: () => ({}),
+    width: 200,
+  },
   { key: "isClose", title: "最终关闭", inputType: "Checkbox", },
   {
     key: "closeTime",
@@ -350,7 +362,13 @@ export const TabColumns = [
       { key: "manufacturer", title: "生产厂家代理人", inputType: "Input", width: 180 },
       { key: "isDrug", title: "物料药品属性", inputType: "Input", width: 180 },
       { key: "unit", title: "单位", inputType: "Input", },
-      { key: "qty", title: "数量", inputType: "Input", },
+      {
+        key: "qty",
+        title: "数量",
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        width: 120
+      },
       { key: "taxPrice", title: "含税单价", inputType: "Input", },
       { key: "money", title: "价税合计", inputType: "Input", },
       { key: "tax", title: "税率", inputType: "Input", },
@@ -359,11 +377,11 @@ export const TabColumns = [
       { key: "unarrivedQty", title: "未到货数量", inputType: "Input", },
       { key: "notaxMoney", title: "无税金额", inputType: "Input", },
       { key: "priceSource", title: "价格目录ID", inputType: "Input", },
-      { key: "isStorage", title: "入库关闭", inputType: "Input", },
-      { key: "isInvoice", title: "开票关闭", inputType: "Input", },
-      { key: "isArrival", title: "到货关闭", inputType: "Input", },
-      { key: "isPayment", title: "付款关闭", inputType: "Input", },
-      { key: "isGift", title: "赠品", inputType: "Input", width: 180 },
+      { key: "isStorage", title: "入库关闭", inputType: "Checkbox", },
+      { key: "isInvoice", title: "开票关闭", inputType: "Checkbox", },
+      { key: "isArrival", title: "到货关闭", inputType: "Checkbox", },
+      { key: "isPayment", title: "付款关闭", inputType: "Checkbox", },
+      { key: "isGift", title: "赠品", inputType: "Checkbox", },
       {
         key: "warehouseName",
         title: "收货仓库", //WMS入库仓库
@@ -400,8 +418,8 @@ export const TabColumns = [
         width: 180
       },
 
-      { key: "isBatchLock", title: "批号锁定标识", inputType: "Input", },
-      { key: "isReplenishment", title: "补单标识", inputType: "Input", },
+      { key: "isBatchLock", title: "批号锁定标识", inputType: "Checkbox", },
+      { key: "isReplenishment", title: "补单标识", inputType: "Checkbox", },
       { key: "isUrgency", title: "紧急标识", inputType: "Input", },
       { key: "originalQty", title: "原始数量", inputType: "Input", },
       { key: "originalMoney", title: "原始金额", inputType: "Input", },
@@ -453,7 +471,13 @@ export const TabColumns = [
         width: 180
       },
       { key: "specification", title: "规格", inputType: "Input", },
-      { key: "qty", title: "数量", inputType: "Input", },
+      {
+        key: "qty",
+        title: "数量",
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        width: 120
+      },
       { key: "stroageQty", title: "累计到货主数量", inputType: "Input", width: 120 },
       { key: "stockQty", title: "累计入库主数量", inputType: "Input", width: 120 },
       { key: "invoiceQty", title: "累计开票主数量", inputType: "Input", width: 120 },

+ 71 - 36
src/views/purchase/purchase-order/add/index.vue

@@ -57,7 +57,6 @@ export default {
     "params": {
       handler(nVal, oVal) {
 
-
         // 组织变化
         if (nVal.puOrg != oVal.puOrg) {
           console.log(nVal.puOrg, 'nVal.puOrg', oVal.puOrg, 'oVal.puOrg');
@@ -94,6 +93,41 @@ export default {
     setVisible(prop) {
       this.visible = prop;
     },
+    // 复制赋值
+    async setCopyParams(id) {
+      console.log(id, 'iid-----------------------');
+      try {
+        const { code, msg, data } = await orderApi.details(id);
+
+        if (code === 200) {
+
+          this.params = {
+            ...data,
+            id: '',
+            code: '',
+            status: '0',
+            source: '3',
+          };
+
+          for (const key in this.params) {
+
+            if (Array.isArray(this.params[key])) {
+
+              this.params[key].forEach(v => {
+
+                v.id = '';
+
+              })
+            }
+          }
+
+        }
+      } catch (err) {
+        //
+      } finally {
+        // this.loading = false;
+      }
+    },
     // 增行
     addTableRow(prop) {
       for (const key in this.params) {
@@ -185,36 +219,36 @@ export default {
     },
     // 保存并新增
     async handleSubmit() {
-      // this.$refs["orderAddForm"].validate(async (valid) => {
-      //   if (valid) {
-      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 orderApi.create({
-          createById,
-          createByName,
-          updateById,
-          updateByName,
-          ...this.params,
-        });
-        if (code === 200) {
-          this.$notify.success({ title: msg });
-          this.setVisible(false);
+      this.$refs["orderAddForm"].validate(async (valid) => {
+        if (valid) {
+          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 orderApi.create({
+              createById,
+              createByName,
+              updateById,
+              updateByName,
+              ...this.params,
+            });
+            if (code === 200) {
+              this.$notify.success({ title: msg });
+              this.setVisible(false);
+            } else {
+              this.$notify.warning({ title: msg });
+            }
+          } catch (err) {
+            this.$notify.error({ title: "error", message: err });
+          } finally {
+            // this.setVisible(false);
+          }
         } else {
-          this.$notify.warning({ title: msg });
+          console.log("error submit!!");
+          return false;
         }
-      } catch (err) {
-        this.$notify.error({ title: "error", message: err });
-      } finally {
-        // this.setVisible(false);
-      }
-      //   } else {
-      //     console.log("error submit!!");
-      //     return false;
-      //   }
-      // });
+      });
     },
     // 子表参照改变之后
     handleReferChange(val, source, type) {
@@ -229,7 +263,7 @@ export default {
       }
     },
 
-    // 子表input
+    // 子表inputNumber
     handleInputChange(row, type) {
       console.log(type, 'type');
       // 物料数量变化----询价
@@ -278,9 +312,9 @@ export default {
           <div style="text-align: right">
             <el-button size="mini" @click="handleCancel">取消</el-button>
             <el-button size="mini" type="danger" @click="handleSava">保存</el-button>
-            <el-button size="mini" type="info" @click="handleSubmit">
+            <!-- <el-button size="mini" type="info" @click="handleSubmit">
               保存并新增
-            </el-button>
+            </el-button> -->
           </div>
         </div>
         <el-row style="display:flex; flex-wrap: wrap;">
@@ -302,7 +336,7 @@ export default {
               </el-input>
 
               <el-input-number v-if="column.inputType === 'InputNumber'" v-model="params[column.key]"
-                :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
+                :controls-position="column.controlsPosition" :placeholder="column.placeholder"
                 :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
               </el-input-number>
               <el-select v-if="column.inputType === 'Select'" v-model="params[column.key]" :disabled="column.disabled"
@@ -359,7 +393,7 @@ export default {
                   </el-tag>
                   <el-input v-if="cColumn.inputType === 'Input'" v-model="scope.row[cColumn.key]"
                     :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
-                    size="mini" style="width: 100%" @change="handleInputChange(scope.row, cColumn.key)">
+                    size="mini" style="width: 100%">
                   </el-input>
 
                   <!--  -->
@@ -371,8 +405,9 @@ export default {
                   </dr-popover-select>
 
                   <el-input-number v-if="cColumn.inputType === 'InputNumber'" v-model="scope.row[cColumn.key]"
-                    :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" size="mini" style="width: 100%">
+                    :controls-position="cColumn.controlsPosition" :placeholder="cColumn.placeholder"
+                    @change="handleInputChange(scope.row, cColumn.key)" :clearable="cColumn.clearable"
+                    :disabled="cColumn.disabled" size="mini" style="width: 100%">
                   </el-input-number>
 
                   <el-select v-if="cColumn.inputType === 'Select'" v-model="scope.row[cColumn.key]" size="mini"

+ 125 - 38
src/views/purchase/purchase-order/column.js

@@ -1,62 +1,100 @@
+import {
+  initPage,
+  initLayout,
+  initPageSizes,
+  initParams,
+  initColumns,
+  initDicts,
+} from "@/utils/init";
+
 export const TableColumns = [
   // { key: "id", title: "主键" },
   // { key: "puOrg", title: "采购组织" },
-  { key: "puOrgName", title: "采购组织名称", search: true, type: "Input" },
+  { key: "puOrgName", title: "采购组织名称", search: true, inputType: "Input" },
   {
     key: "billType",
     title: "订单类型",
     inputType: "Select",
     referName: "sys_order_type",
   },
-  { key: "code", title: "订单编号", search: true, type: "Input" },
+  { key: "code", title: "订单编号", search: true, inputType: "Input" },
   { key: "billDate", title: "订单日期" },
   // { key: "supplier", title: "供应商" },
-  { key: "supplierName", title: "供应商名称", search: true, type: "Input" },
-  { key: "paymentAgreement", title: "付款协议" },
+  { key: "supplierName", title: "供应商", search: true, inputType: "Input" },
+  { key: "paymentAgreementName", title: "付款协议" },
+  // { key: "paymentAgreement", title: "付款协议" },
   // { key: "currency", title: "币种" },
-  { key: "currencyName", title: "币种名称" },
-  // { key: "buyer", title: "采购员" },
+  { key: "currencyName", title: "币种" },
+  // { key: "buyer", title: "采购员" },ut
   { key: "buyerName", title: "采购员" },
   // { key: "puDept", title: "采购部门" },
-  { key: "puDeptName", title: "采购部门名称" },
+  { key: "puDeptName", title: "采购部门" },
   // { key: "customer", title: "收货客户" },
-  { key: "customerName", title: "收货客户名称" },
+  { key: "customerName", title: "收货客户" },
   { key: "isDeliver", title: "是否发货" },
-  { key: "isArrival", title: "到货超期" },
-  { key: "isBack", title: "退货" },
+  {
+    key: "isArrival",
+    title: "到货超期",
+    inputType: 'Checkbox',
+  },
+  {
+    key: "isBack",
+    title: "退货",
+    inputType: 'Checkbox',
+  },
   // { key: "freezeCause", title: "冻结原因" },
   { key: "qty", title: "总数量" },
   { key: "money", title: "总数量" },
-  { key: "isMarketing", title: "已协同生成销售订单" },
-  { key: "isMarketingSource", title: "由销售订单协同生成" },
+  {
+    key: "isMarketing",
+    title: "已协同生成销售订单",
+    inputType: 'Checkbox',
+  },
+  {
+    key: "isMarketingSource",
+    title: "由销售订单协同生成",
+    inputType: 'Checkbox',
+  },
   // { key: "personal", title: "人员" },
-  { key: "personalName", title: "人员名称" },
+  { key: "personalName", title: "人员" },
   // { key: "isSendSrm", title: "是否同步SRM" },
-  { key: "isInvoice", title: "发票标识" },
+  {
+    key: "isInvoice",
+    title: "发票标识",
+    inputType: 'Checkbox',
+  },
   { key: "rebateMoney", title: "订单使用返利金额" },
   { key: "deductionMoney", title: "订单抵扣余款金额" },
   // { key: "warehouse", title: "WMS入库仓库" },
   { key: "warehouseName", title: "收货仓库" }, //WMS入库仓库名称
   // { key: "goodsAllocation", title: "货位" },
-  { key: "goodsAllocationName", title: "货位名称" },
+  { key: "goodsAllocationName", title: "货位" },
   // { key: "customerDept", title: "客户部门" },
-  { key: "customerDeptName", title: "客户部门名称" },
+  { key: "customerDeptName", title: "客户部门" },
   // { key: "supplierContacts", title: "供应商业务联系人" },
-  { key: "supplierContactsName", title: "供应商业务联系人名称" },
-  { key: "isUrgency", title: "紧急程度" },
+  { key: "supplierContactsName", title: "供应商业务联系人" },
+  {
+    key: "isUrgency",
+    title: "紧急程度",
+    inputType: 'Checkbox',
+  },
   // { key: "agent", title: "代理人" }, // 建议删除
-  { key: "agentName", title: "代理人名称" },
-  { key: "isClose", title: "最终关闭" },
+  { key: "agentName", title: "代理人" },
+  {
+    key: "isClose",
+    title: "最终关闭",
+    inputType: 'Checkbox',
+  },
   { key: "applyPaymentMoney", title: "累计付款申请金额" },
   { key: "paymentMoney", title: "累计付款金额" },
   { key: "invoiceMoney", title: "发票金额" },
   // { key: "supplierPersonal", title: "供应商业务员" },
-  { key: "supplierPersonalName", title: "供应商业务员名称" },
+  { key: "supplierPersonalName", title: "供应商业务员" },
   { key: "marketingCode", title: "销售订单号" },
   // { key: "tenantId", title: "租户号" },
   // { key: "revision", title: "乐观锁" },
-  { key: "createByName", title: "创建人名称" },
-  { key: "updateByName", title: "更新人名称" },
+  { key: "createByName", title: "创建人" },
+  { key: "updateByName", title: "更新人" },
   // { key: "delFlag", title: "删除标记" },
   { key: "flowId", title: "OA流程ID" },
   { key: "approver", title: "审批人" },
@@ -74,7 +112,11 @@ export const TableColumns = [
   { key: "oaDemandNo", title: "OA需求单号" },
   { key: "address", title: "收货地址" },
   { key: "contacts", title: "收获联系人" },
-  { key: "isSendWms", title: "已同步WMS" },
+  {
+    key: "isSendWms",
+    title: "已同步WMS",
+    inputType: 'Checkbox',
+  },
   { key: "retReason", title: "退换原因" },
   { key: "closeTime", title: "最终关闭日期" },
   { key: "processType", title: "处理方式" },
@@ -99,7 +141,12 @@ export const TabColumns = [
       { key: "materialManufacturersCode", title: "厂家物料编码", width: 180 },
       { key: "specification", title: "规格", width: 180 },
       { key: "model", title: "型号", width: 180 },
-      { key: "isMedcine", title: "医药物料", width: 180 },
+      {
+        key: "isMedcine",
+        title: "医药物料",
+        width: 180,
+        inputType: 'Checkbox',
+      },
       { key: "manufacturer", title: "生产厂家代理人", width: 180 },
       { key: "isDrug", title: "物料药品属性", width: 180 },
       { key: "unit", title: "单位", width: 180 },
@@ -112,11 +159,31 @@ export const TabColumns = [
       { 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: "isStorage",
+        title: "入库关闭",
+        inputType: 'Checkbox',
+      },
+      {
+        key: "isInvoice",
+        title: "开票关闭",
+        inputType: 'Checkbox',
+      },
+      {
+        key: "isArrival",
+        title: "到货关闭",
+        inputType: 'Checkbox',
+      },
+      {
+        key: "isPayment",
+        title: "付款关闭",
+        inputType: 'Checkbox',
+      },
+      {
+        key: "isGift",
+        title: "赠品",
+        inputType: 'Checkbox',
+      },
       { key: "warehouse", title: "收货仓库", width: 180 },
       { key: "place", title: "收货地点", width: 180 },
       { key: "address", title: "收货地址", width: 180 },
@@ -137,8 +204,16 @@ export const TabColumns = [
         inputType: "Select",
         referName: "sys_conditions_carriage", // 字典名
       },
-      { key: "isBatchLock", title: "批号锁定标识" },
-      { key: "isReplenishment", title: "补单标识" },
+      {
+        key: "isBatchLock",
+        title: "批号锁定标识",
+        inputType: 'Checkbox',
+      },
+      {
+        key: "isReplenishment",
+        title: "补单标识",
+        inputType: 'Checkbox',
+      },
       { key: "isUrgency", title: "紧急标识" },
       { key: "originalQty", title: "原始数量" },
       { key: "originalMoney", title: "原始金额" },
@@ -161,17 +236,17 @@ export const TabColumns = [
       { key: "isDistributionPrice", title: "配送价" },
       // { key: "tenantId", title: "租户号" },
       // { key: "revision", title: "乐观锁" },
-      { key: "createByName", title: "创建人名称" },
-      { key: "updateByName", title: "更新人名称" },
+      { key: "createByName", title: "创建人" },
+      { key: "updateByName", title: "更新人" },
       // { key: "delFlag", title: "删除标记" },
       // { key: "materialClassifyOne", title: "物料一级分类" },
-      { key: "materialClassifyOneName", title: "物料一级分类名称", width: 180 },
+      { key: "materialClassifyOneName", title: "物料一级分类", width: 180 },
       // { key: "materialClassifyTwo", title: "物料二级分类" },
-      { key: "materialClassifyTwoName", title: "物料二级分类名称", width: 180 },
+      { key: "materialClassifyTwoName", title: "物料二级分类", width: 180 },
       // { key: "materialClassifyThree", title: "物料三级分类" },
-      { key: "materialClassifyThreeName", title: "物料三级分类名称", width: 180 },
+      { key: "materialClassifyThreeName", title: "物料三级分类", width: 180 },
       // { key: "materialClassifyFour", title: "物料四级分类" },
-      { key: "materialClassifyFourName", title: "物料四级分类名称", width: 180 },
+      { key: "materialClassifyFourName", title: "物料四级分类", width: 180 },
       { key: "price", title: "无税单价" }
     ]
   },
@@ -202,3 +277,15 @@ export const TabColumns = [
 ];
 
 export const SearchColumns = TableColumns.filter((element) => element.search);
+
+const NewColumns = initColumns(TableColumns);
+const NewTabColumns = TabColumns.map((element) => ({
+  ...element,
+  tableColumns: initColumns(element.tableColumns),
+}));
+// 
+export const SelectColumns = NewColumns.filter(column => column.inputType === 'Select')
+
+NewTabColumns.forEach(column => {
+  SelectColumns.push(...column.tableColumns.filter(cColumn => cColumn.inputType === 'Select'))
+});

+ 83 - 32
src/views/purchase/purchase-order/edit/index.vue

@@ -1,18 +1,19 @@
 <script>
-import { Columns, TabColumns } from "../add/column";
+// import { Columns, TabColumns } from "../add/column";
+import { editColumns, editTabColumns, forbidden, SelectColumns } from "./initColumn";
 import orderApi from "@/api/business/purchase/purchase-order";
 import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
 
-const NewColumns = initColumns(Columns);
-const NewTabColumns = TabColumns.map((element) => ({
-  ...element,
-  tableColumns: initColumns(element.tableColumns),
-}));
+// const NewColumns = initColumns(Columns);
+// const NewTabColumns = TabColumns.map((element) => ({
+//   ...element,
+//   tableColumns: initColumns(element.tableColumns),
+// }));
 // 
-const SelectColumns = NewColumns.filter(column => column.inputType === 'Select')
-NewTabColumns.forEach(column => {
-  SelectColumns.push(...column.tableColumns.filter(cColumn => cColumn.inputType === 'Select'))
-});
+// const SelectColumns = NewColumns.filter(column => column.inputType === 'Select')
+// NewTabColumns.forEach(column => {
+//   SelectColumns.push(...column.tableColumns.filter(cColumn => cColumn.inputType === 'Select'))
+// });
 
 export default {
   name: "EditPurchaseOrderDrawer",
@@ -25,22 +26,22 @@ export default {
       size: "mini",
       visible: false,
       loading: false,
-      columns: NewColumns,
-      rules: initRules(NewColumns),
+      columns: editColumns,
+      rules: initRules(editColumns),
       params: {
-        ...initParams(NewColumns),
+        ...initParams(editColumns),
         puOrderItemList: [],
         puOrderExecuteList: [],
       },
 
-      tabColumns: NewTabColumns,
+      tabColumns: editTabColumns,
       tabName: "puOrderItemList",
     };
   },
   computed: {},
   watch: {
     "params.contractType": function (newProp) {
-      this.tabColumns = NewTabColumns.filter((element) =>
+      this.tabColumns = editTabColumns.filter((element) =>
         newProp === "1" ? element.key !== "puOrderItemList" : element
       );
       this.tabName = this.tabColumns[0].key;
@@ -78,6 +79,13 @@ export default {
         this.params[key2][index].materialCode = item.materialCode;
       })
     },
+    // 判断属性是否禁用
+    handleIsForbidden(status) {
+      console.log(status);
+      let { editColumns, editTabColumns } = forbidden(status != '2');
+      this.columns = editColumns;
+      this.tabColumns = editTabColumns;
+    },
     // 查询详细
     async fetchItem(prop) {
       try {
@@ -85,7 +93,8 @@ export default {
         const { code, msg, data } = await orderApi.details(prop);
         if (code === 200) {
           this.params = { ...this.params, ...data };
-          console.log(this.params, 'this.params----------');
+          console.log(this.params, 'this.params----------123');
+          this.handleIsForbidden(this.params.status);
           this.$notify.success({ title: msg });
         } else {
           this.$notify.warning({ title: msg });
@@ -166,7 +175,40 @@ export default {
     },
     beforeOpen() {
     },
-    handleReferChange(val, source) { },
+    // 子表参照改变之后
+    handleReferChange(val, source, type) {
+      console.log(val, 'val');
+      console.log(source, 'source');
+      console.log(type, 'type');
+
+      // 触发物料参照
+      if (type == 'MATERIAL_PARAM' && source.qty && source.qty != '') {
+
+        this.handleGetPrice();
+      }
+    },
+    // 子表inputNumber
+    handleInputChange(row, type) {
+      console.log(type, 'type');
+      // 物料数量变化----询价
+      if (type == 'qty' && row.material) {
+        this.handleGetPrice();
+      }
+    },
+    // 询价 getPrice
+    async handleGetPrice() {
+      try {
+        // let { puOrg, priceType, customer, assignSupplier, material, } = data;
+        let { code, data } = await orderApi.getPrice({ ...this.params })
+        if (code == 200) {
+          this.params = data;
+        }
+      } catch (error) {
+
+      } finally {
+
+      }
+    },
     // 判断修订还是编辑
     handleIsRevise(status) {
       return status == '2';
@@ -175,6 +217,8 @@ export default {
   created() {
     console.log("EDIT CREATED");
     console.log(this.params, 'this.params');
+
+
   },
   mounted() { },
   destroyed() { },
@@ -201,7 +245,7 @@ export default {
             <el-button :size="size" type="danger" @click="handleSava">更 新</el-button>
           </div>
         </div>
-        <el-row  style="display:flex; flex-wrap: wrap;">
+        <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-input v-if="column.inputType === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
@@ -210,14 +254,15 @@ export default {
               <dr-popover-select v-if="column.inputType === 'PopoverSelect'" v-model="params[column.key]" size="mini"
                 :value-key="column.valueKey" :source.sync="params" :title="column.title" :type="column.referName"
                 :multiple="column.multiple" :placeholder="column.placeholder" :data-mapping="column.dataMapping"
-                :query-params="column.queryParams(params)">
+                :disabled="column.disabled" :query-params="column.queryParams(params)">
               </dr-popover-select>
               <el-input v-if="column.inputType === 'Textarea'" v-model="params[column.key]" type="textarea"
                 :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
                 style="width: 100%">
               </el-input>
               <el-input-number v-if="column.inputType === 'InputNumber'" v-model="params[column.key]"
-                :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
+                :max="handleIsRevise(params.status) ? params[column.key] : 'Infinity'"
+                :controls-position="column.controlsPosition" :placeholder="column.placeholder"
                 :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
               </el-input-number>
               <el-select v-if="column.inputType === 'Select'" v-model="params[column.key]" :disabled="column.disabled"
@@ -226,8 +271,8 @@ export default {
                   :value="item.value">
                 </el-option>
               </el-select>
-              <el-select v-if="column.inputType === 'TagSelect'" v-model="params[column.key]" multiple clearable collapse-tags
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+              <el-select v-if="column.inputType === 'TagSelect'" v-model="params[column.key]" multiple clearable
+                collapse-tags :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
                 style="width: 100%">
                 <template #prefix>
                   <el-icon class="el-icon-view" style="cursor: pointer" @click.stop="$message.info(234)"></el-icon>
@@ -242,8 +287,8 @@ export default {
               <el-checkbox v-if="column.inputType === 'Checkbox'" v-model="params[column.key]" :disabled="column.disabled"
                 true-label="Y" false-label="N">
               </el-checkbox>
-              <el-upload v-if="column.inputType === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled" drag
-                action="https://sy.derom.com/document-center/fastdfs/upload" multiple>
+              <el-upload v-if="column.inputType === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled"
+                drag action="https://sy.derom.com/document-center/fastdfs/upload" multiple>
                 <i class="el-icon-upload"></i>
                 <div class="el-upload__text">
                   将文件拖到此处,或<em>点击上传</em>
@@ -285,9 +330,9 @@ export default {
 
                   <dr-popover-select v-if="cColumn.inputType === 'PopoverSelect'" v-model="scope.row[cColumn.key]"
                     :source.sync="scope.row" :title="cColumn.title" :value-key="cColumn.valueKey"
-                    :type="cColumn.referName" :multiple="cColumn.multiple" :placeholder="cColumn.placeholder"
-                    :data-mapping="cColumn.dataMapping" :query-params="cColumn.queryParams(scope.row)" size="mini"
-                    @change="handleReferChange">
+                    :disabled="cColumn.disabled" :type="cColumn.referName" :multiple="cColumn.multiple"
+                    :placeholder="cColumn.placeholder" :data-mapping="cColumn.dataMapping"
+                    :query-params="cColumn.queryParams(scope.row)" size="mini" @change="handleReferChange">
                   </dr-popover-select>
 
                   <el-select v-if="cColumn.inputType === 'Select'" v-model="scope.row[cColumn.key]" size="mini"
@@ -298,18 +343,24 @@ export default {
                     </el-option>
                   </el-select>
 
-                  <el-checkbox v-if="cColumn.inputType === 'Checkbox'" v-model="scope.row[cColumn.key]" true-label="Y"
-                    false-label="N">
+                  <el-checkbox v-if="cColumn.inputType === 'Checkbox'" v-model="scope.row[cColumn.key]"
+                    :disabled="cColumn.disabled" true-label="Y" false-label="N">
                   </el-checkbox>
                   <el-input-number v-if="cColumn.inputType === 'InputNumber'" v-model="scope.row[cColumn.key]"
-                    :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
+                    :controls-position="cColumn.controlsPosition"
+                    :max="handleIsRevise(params.status) ? scope.row[cColumn.key] : 'Infinity'"
+                    @change="handleInputChange(scope.row, cColumn.key)" :placeholder="cColumn.placeholder"
                     :clearable="cColumn.clearable" :disabled="cColumn.disabled" :size="size" style="width: 100%">
                   </el-input-number>
                 </template>
               </el-table-column>
+
+
+              <!-- 修订:不可删除、增行
+              编辑:自制:可删可增 -->
               <el-table-column fixed="right" label="操作" width="120">
                 <template slot-scope="scope">
-                  <el-button @click.native.prevent="
+                  <el-button  v-if="params.source == '3'&& !handleIsRevise(params.status)" @click.native.prevent="
                     delTableRow(params[tabName], scope.$index)
                     " type="text" size="small">
                     删行
@@ -320,7 +371,7 @@ export default {
           </el-tab-pane>
         </el-tabs>
         <el-row style="position: absolute; top: 20px; right: 20px">
-          <el-button :size="size" @click="addTableRow(params[tabName])">增行</el-button>
+          <el-button v-if="params.source == '3'&& !handleIsRevise(params.status)" :size="size" @click="addTableRow(params[tabName])">增行</el-button>
         </el-row>
       </el-card>
     </el-form>

+ 80 - 0
src/views/purchase/purchase-order/edit/initColumn.js

@@ -0,0 +1,80 @@
+import { Columns, TabColumns } from "../add/column";
+import { initColumns, initParams } from "@/utils/init";
+
+
+export const editColumns = initColumns(Columns);
+
+export const editTabColumns = TabColumns.map((element) => ({
+  ...element,
+  tableColumns: initColumns(element.tableColumns),
+}));
+
+export const SelectColumns = editColumns.filter(column => column.inputType === 'Select')
+
+editTabColumns.forEach(column => {
+
+  SelectColumns.push(...column.tableColumns.filter(cColumn => cColumn.inputType === 'Select'))
+
+});
+
+
+
+// 禁用项
+export const forbidden = (isEdit) => {
+
+  console.log(isEdit, 'isEdit');
+  if (isEdit) {
+    console.log('编辑');
+    // 编辑
+    editColumns.forEach(item => {
+      item.disabled = false;
+      item.readonly = false;
+    })
+
+    editTabColumns.forEach(item => {
+
+      item.tableColumns.forEach(t => {
+        t.disabled = false;
+        t.readonly = false;
+      })
+    })
+  } else {
+    console.log('修订');
+    // 修订
+    editColumns.forEach(item => {
+
+      if (item.key == 'buyerName' || item.key == 'puDeptName' || item.key == 'deductionMoney' ||
+        item.key == 'supplierContactsName' || item.key == 'agentName' || item.key == 'isInvoice' ||
+        item.key == 'rebateMoney') {
+        item.disabled = false;
+        item.readonly = false;
+      } else {
+        item.disabled = true;
+        item.readonly = true;
+      }
+    })
+
+    editTabColumns.forEach(item => {
+
+      item.tableColumns.forEach(t => {
+
+        if (t.key == 'unit' || t.key == 'qty' ||
+          t.key == 'place' || t.key == 'arrivalDatePlan' || t.key == 'storageCondition' ||
+          t.key == 'carriageCondition' || t.key == 'customerName' || t.key == 'isBatchLock' ||
+          t.key == 'isReplenishment' || t.key == 'originalQty' || t.key == 'originalMoney'
+        ) {
+
+          t.disabled = false;
+          t.readonly = false;
+        } else {
+          t.disabled = true;
+          t.readonly = true;
+        }
+      })
+    })
+
+  }
+
+  return { editColumns, editTabColumns }
+
+}

+ 101 - 33
src/views/purchase/purchase-order/index.vue

@@ -1,6 +1,6 @@
 <!-- 采购订单修订—— 列表 -->
 <script>
-import { TableColumns, SearchColumns, TabColumns } from "./column";
+import { TableColumns, SearchColumns, TabColumns, SelectColumns } from "./column";
 import orderApi from "@/api/business/purchase/purchase-order";
 import {
   initPage,
@@ -11,17 +11,6 @@ import {
   initDicts,
 } from "@/utils/init";
 
-const NewColumns = initColumns(TableColumns);
-const NewTabColumns = TabColumns.map((element) => ({
-  ...element,
-  tableColumns: initColumns(element.tableColumns),
-}));
-// 
-const SelectColumns = NewColumns.filter(column => column.inputType === 'Select')
-NewTabColumns.forEach(column => {
-  SelectColumns.push(...column.tableColumns.filter(cColumn => cColumn.inputType === 'Select'))
-});
-console.log(SelectColumns, 'SelectColumns------------');
 
 export default {
   name: "PuchaseOrder",
@@ -51,11 +40,11 @@ export default {
         puOrderExecuteList: [],
       },
       checkedList: [],
+      checkedTabList: [],
     };
   },
   computed: {
     showSearchColumns() {
-      console.log(this.searchColumns, 'this.searchColumns');
       return this.isSimpleSearch
         ? this.searchColumns.slice(0, 4)
         : this.searchColumns;
@@ -75,8 +64,6 @@ export default {
           this.page.total = total;
           this.tableData = rows;
           this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
         }
       } catch (err) {
         //
@@ -117,9 +104,23 @@ export default {
     },
     handleTabClick() { },
     // 新增
-    handleOpenAddDrawer() {
-      const { setVisible } = this.$refs.addDrawerFef;
+    handleOpenAddDrawer(copyVal) {
+      const { setVisible, setCopyParams } = this.$refs.addDrawerFef;
       setVisible(true);
+
+      copyVal.id && copyVal.id != '' && setCopyParams(copyVal.id);
+    },
+    // 复制
+    handleCopy() {
+
+      // let rowDetails = {
+      //   ... this.checkedList[0],
+      //   id: '',
+      //   code: '',
+      //   status: '0',
+      //   source: '3',
+      // };
+      this.handleOpenAddDrawer(this.checkedList[0]);
     },
     // 查看
     async handleOpenSeeDrawer(row) {
@@ -146,8 +147,6 @@ export default {
             this.tabTableDatas[key] = data[key];
           }
           this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
         }
       } catch (err) {
         //
@@ -163,10 +162,7 @@ export default {
         console.log(id, 'id');
         const { code, msg } = await orderApi.remove(id);
         if (code === 200) {
-          this.$notify.success({ title: msg });
           this.fetchList(this.params, this.page);
-        } else {
-          this.$notify.warning({ title: msg });
         }
       } catch (err) {
         //
@@ -176,7 +172,21 @@ export default {
     },
     // 提交
     async handleSubmit(row) {
+      try {
+
+        this.loading = true;
+
+        let { code } = await orderApi.submit({ puOrderId: row.id });
 
+        if (code === 200) {
+          this.fetchList(this.params, this.page);
+        }
+
+      } catch (error) {
+
+      } finally {
+        this.loading = false;
+      }
     },
     // 判断“退回”按钮
     judgeIsAllSendBack() {
@@ -209,11 +219,60 @@ export default {
         this.loading = false;
       }
     },
+    // 判断是否满足整单关闭
+    judgeIsAllClose() {
+
+      if (this.checkedList.length == 1) {
+
+        if (this.checkedList[0].status == 0) {
+          // 未审批状态下整单关闭
+
+          return false
+        }
+      }
+      return true;
+
+    },
+    // 整单关闭
+    async handleAllClose() {
+      // 未审批状态下整单关闭
+      try {
+
+        this.loading = true;
+
+        let puOrderIds = this.checkedList.map(order => {
+
+          return order.id;
+
+        })
+
+        let { code } = await orderApi.close({ puOrderIds });
+
+        if (code === 200) {
+
+          this.fetchList(this.params, this.page);
+
+        }
+
+      } catch (error) {
+
+      } finally {
+        this.loading = false;
+      }
+    },
     handleSelect(selection, row) {
+
       this.checkedList = selection;
+
       console.log(this.checkedList, 'this.checkedList');
+
+    },
+
+    handleTabSelect(selection, row) {
+      this.checkedTabList = selection; 
     },
 
+
   },
 };
 </script>
@@ -255,20 +314,21 @@ export default {
         <el-button-group style="margin-left: 10px">
           <el-button size="mini" type="danger" @click="handleOpenAddDrawer"
             v-hasPermi="['material:order:add']">新增</el-button>
-          <el-button size="mini">复制</el-button>
+          <el-button size="mini" :disabled="checkedList.length != 1" @click="handleCopy">复制</el-button>
 
         </el-button-group>
 
-        <el-button-group style="margin-left: 10px">
+        <!-- <el-button-group style="margin-left: 10px">
           <el-button size="mini" @click="handleAllSendBack" :key="checkedList.length"
             :disabled="judgeIsAllSendBack()">整单退回</el-button>
-        </el-button-group>
+        </el-button-group> -->
 
         <el-button-group style="margin-left: 10px">
-          <el-button size="mini">采购退货</el-button>
-          <el-button size="mini">整单关闭</el-button>
-          <el-button size="mini">附件管理</el-button>
-          <el-button size="mini">单据追溯</el-button>
+          <!-- <el-button size="mini">采购退货</el-button> -->
+          <el-button size="mini" @click="handleAllClose" :key="checkedList.length"
+            :disabled="judgeIsAllClose()">整单关闭</el-button>
+          <!-- <el-button size="mini">附件管理</el-button>
+          <el-button size="mini">单据追溯</el-button> -->
         </el-button-group>
       </el-col>
     </el-row>
@@ -279,9 +339,14 @@ export default {
       <el-table-column type="index" width="50" label="序号"></el-table-column>
       <el-table-column v-for="(column, index) in tableColumns" :key="index" :prop="column.key" :label="column.title"
         :width="column.width || 180" :show-overflow-tooltip="column.showOverflowTooltip || true">
+
         <template slot-scope="scope">
           <dict-tag v-if="column.referName" size="small" :value="scope.row[column.key]"
             :options="dict.type[column.referName]" />
+
+          <el-checkbox v-else-if="column.inputType === 'Checkbox'" v-model="scope.row[column.key]" disabled true-label="Y"
+            false-label="N">
+          </el-checkbox>
           <span v-else>{{ scope.row[column.key] }}</span>
         </template>
       </el-table-column>
@@ -295,7 +360,7 @@ export default {
           <el-button type="text" size="small" @click.stop="handleDeleteList(scope.row)"
             v-hasPermi="['material:order:remove']">删除</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>
+            v-hasPermi="['material:order:toOa']" @click.stop="handleSubmit(scope.row)">提交</el-button>
         </template>
       </el-table-column>
 
@@ -307,17 +372,20 @@ export default {
 
     <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-table :data="tabTableDatas[column.key]" style="width: 100%" highlight-current-row
-          :height="tabTableDatas[column.key].length ? 300 : 100">
 
+        <el-table :data="tabTableDatas[column.key]" style="width: 100%" highlight-current-row @select="handleTabSelect"
+          :height="tabTableDatas[column.key].length ? 300 : 100">
+          <el-table-column type="selection" width="45"></el-table-column>
           <el-table-column type="index" width="50" label="序号"></el-table-column>
-
           <el-table-column v-for="(cColumn, cIndex)  in column.tableColumns" :key="cIndex" :prop="cColumn.key"
             :label="cColumn.title" :width="cColumn.width || 180"
             :show-overflow-tooltip="cColumn.showOverflowTooltip || true">
             <template slot-scope="scope">
               <dict-tag v-if="cColumn.referName" size="small" :value="scope.row[cColumn.key]"
                 :options="dict.type[cColumn.referName]" />
+              <el-checkbox v-else-if="cColumn.inputType === 'Checkbox'" v-model="scope.row[cColumn.key]" disabled
+                true-label="Y" false-label="N">
+              </el-checkbox>
               <span v-else>{{ scope.row[cColumn.key] }}</span>
             </template>
           </el-table-column>

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

@@ -112,7 +112,7 @@ export default {
               </el-input>
 
               <el-input-number v-if="column.inputType === 'InputNumber'" v-model="params[column.key]"
-                :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
+                :controls-position="column.controlsPosition" :placeholder="column.placeholder"
                 :clearable="column.clearable" disabled style="width: 100%">
               </el-input-number>
               <el-select v-if="column.inputType === 'Select'" v-model="params[column.key]" disabled size="mini"
@@ -178,7 +178,7 @@ export default {
                   </dr-popover-select>
 
                   <el-input-number v-if="cColumn.inputType === 'InputNumber'" v-model="scope.row[cColumn.key]"
-                    :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
+                    :controls-position="cColumn.controlsPosition" :placeholder="cColumn.placeholder"
                     :clearable="cColumn.clearable" disabled size="mini" style="width: 100%">
                   </el-input-number>