Browse Source

Merge branch 'purchaseDev' into 'dev'

Purchase dev

See merge request new-business/drp-web!96
黄梓星 2 years ago
parent
commit
9695ff996a

+ 1 - 0
.gitignore

@@ -22,3 +22,4 @@ selenium-debug.log
 package-lock.json
 yarn.lock
 vue.config.js
+vue.config.js

+ 1 - 1
src/api/business/purchase/contract.js

@@ -79,7 +79,7 @@ export function TABLELIST(params, name) {
 
 export function TABLEADD(data, name) {
   return request({
-    url: `${switchUrl(name)}`,
+    url: `${switchUrl(name)}/add`,
     method: "POST",
     data: data,
   });

+ 22 - 11
src/api/business/purchase/purchase-order.js

@@ -100,17 +100,28 @@ const toNc = (data) => {
   });
 }
 // 付款协议  https://sy.derom.com/apiproxy/service/ssoRegServlet?userCode=000156&busiCenter=001
-const payRequest = (userCode) => {
-
-  return new Promise(resolve => {
-    // 当前 Promise 的状态由传入的 Promise 去决定
-    axios.get(`${process.env.NODE_ENV == "development" ? '/sy-derom' : 'https://sy.derom.com'}/apiproxy/service/ssoRegServlet?userCode=${userCode}&busiCenter=001`)
-    .then(res =>{
-      if(res.status == 200){
-        resolve(res.data)
-      }
-    })
-  })
+const payRequest = () => {
+
+  return request({
+    url: `/pu/order/paymentRequest`,
+    method: "get",
+    // params,
+  });
+
+  // return new Promise(resolve => {
+
+
+  //   // 当前 Promise 的状态由传入的 Promise 去决定
+  //   // axios.get(`${process.env.NODE_ENV == "development" ? '/sy-derom' : ''}/apiproxy/service/ssoRegServlet?userCode=${userCode}&busiCenter=001`)
+  //   let url =`${process.env.VUE_APP_BASE_API}/pu/order/paymentRequest`;
+    
+  //   axios.get(url)
+  //   .then(res =>{
+  //     if(res.status == 200){
+  //       resolve(res.data)
+  //     }
+  //   })
+  // })
   
 }
 

+ 8 - 0
src/components/popover-select/components/MATERIAL_PARAM.js

@@ -37,4 +37,12 @@ export default [
       return prop.materialMedcine.registrationNo;
     },
   },
+  {
+    key: "isDrug",
+    title: "物料药品属性",
+    type: "ComputedInput",
+    computed: (prop) => {
+      return prop.materialMedcine.isDrug == '0' ? 'Y' : 'N';
+    },
+  },
 ];

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

@@ -167,8 +167,10 @@ export default {
     },
     // cancel
     useCancel(prop) {
-      const { multiple } = this.$props;
-      this.useUpdate(multiple ? prop : prop[0]);
+      if (prop.length) {
+        const { multiple } = this.$props;
+        this.useUpdate(multiple ? prop : prop[0]);
+      }
       this.hide();
     },
     // confirm

+ 1 - 1
src/utils/request.js

@@ -28,7 +28,7 @@ service.interceptors.request.use(
     // 是否需要防止数据重复提交
     const isRepeatSubmit = (config.headers || {}).repeatSubmit === false;
     // 是否存在列表查询
-    const isQueryList = config.url.includes("/list");
+    const isQueryList = config.url.includes("/list") || config.url.includes("/query");
     if (getToken() && !isToken) {
       config.headers["Authorization"] = "Bearer " + getToken(); // 让每个请求携带自定义token 请根据实际情况自行修改
     }

+ 6 - 6
src/views/purchase/DemandSummary/index.vue

@@ -21,7 +21,7 @@
           <el-col :span="1.5">
             <el-form-item label="品类">
               <el-select
-              v-model="queryParams.materialName"
+              v-model="queryParams.materialClassifyFourName"
               size="small"
               clearable
               @focus="chooseTreeRefer('MATERIALCLASSIFY_PARAM', false, '选择品类')"
@@ -56,7 +56,7 @@
               <el-form-item label="预测分类">
                 <el-select v-model="queryParams.forecastClassification" size="small" style="width: 200px" clearable>
                   <el-option
-                    v-for="dict in dict.type.predictive_classify" :key="dict.value" :label="dict.label" :value="dict.value">
+                    v-for="dict in dict.type.predictive_classify" :key="dict.value" :label="dict.label" :value="dict.label">
                   </el-option>
                 </el-select>
               </el-form-item>
@@ -467,7 +467,7 @@ export default {
         rowStatus: [],
         buyer: '',
         buyerName: '',
-        materialName: '',
+        materialClassifyFourName: '',
         manufacturer: '',
         forecastClassification: '',
         periodUnit: '',
@@ -563,7 +563,7 @@ export default {
         rowStatus: [],
         buyer: '',
         buyerName: '',
-        materialName: '',
+        materialClassifyFourName: '',
         manufacturer: '',
         forecastClassification: '',
         periodUnit: '',
@@ -743,14 +743,14 @@ export default {
     },
     selectionsToInput2(selection) {
       this.classOptions.push(selection)
-      this.queryParams.materialName = selection.name
+      this.queryParams.materialClassifyFourName = selection.name
     },
     // 搜索区物料编码
     chooseMaterial() {
       this.$refs.materialRefer.init()
     },
     selectMaterial(selection) {
-      this.queryParams.materialCode = selection[0].id
+      this.queryParams.materialCode = selection[0].code
       this.queryParams.names = selection[0].name
     },
         // 明细行选择业务部门参照带出业务部门数据

+ 6 - 4
src/views/purchase/PurchaseDemandList/add.vue

@@ -370,7 +370,7 @@
           <!-- <el-table-column show-overflow-tooltip label="末级供应调拨待入量" align="center"  prop="lastStockQty" width="150px"/> -->
           <!-- <el-table-column show-overflow-tooltip label="上级供应中心现存量" align="center"  prop="superiorCenterQty" width="200px"/> -->
           <!-- <el-table-column show-overflow-tooltip label="上级库存被调拨占用量" align="center"  prop="superiorAllotQty" width="200px"/> -->
-          <!-- <el-table-column show-overflow-tooltip label="可用量" align="center"  prop="availableQty"/> -->
+          <el-table-column show-overflow-tooltip label="可用量" align="center"  prop="availableQty"/>
           <el-table-column show-overflow-tooltip label="调拨状态" align="center"  prop="statusAllot" width="100px">
             <template slot-scope="scope">
               <el-form-item class="hang">
@@ -429,7 +429,7 @@
           <el-table-column show-overflow-tooltip label="详细地址" align="center"  prop="address" width="200px"/>
           <el-table-column show-overflow-tooltip label="价格类型" align="center"  prop="priceType" width="150px">
             <template slot-scope="scope">
-              <el-form-item class="hang">
+              <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'priceType'" :rules="{ required: true, message: '请选择价格类型', trigger: 'blur' }">
                 <el-select clearable :disabled="sonDisable" size="small" v-model="scope.row.priceType">
                   <el-option v-for=" dict in dict.type.sys_price_type" :key="dict.value" :label="dict.label" :value="dict.value">
                   </el-option>
@@ -605,12 +605,14 @@ export default {
       this.getDetails(this.row)
       this.basicForm.id = ''
       this.basicForm.code = ''
+      this.basicForm.createBy = ''
     },
     handleData() {
       console.log('222')
-      // 复制新增把id,编码置为空,子表去掉id
+      // 复制新增把id,编码,创建人置为空,子表去掉id
       this.basicForm.id = ''
       this.basicForm.code = ''
+      this.basicForm.createBy = ''
       if (this.basicForm.puDemandItemList.length !== 0) {
         this.basicForm.puDemandItemList.forEach(item => {
           if (item.id) {
@@ -746,7 +748,7 @@ export default {
         contactsPhone: null,
         address: null,
         source: null,
-        priceType: null,
+        priceType: 'order',
         puManagerApprover: null,
         puManagerApproverName: null,
         processTime: null,

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

@@ -22,7 +22,7 @@
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="是否客户指定">
-              <el-select clearable v-model="queryParams.isProcess" size="small" style="width: 200px" clearable placeholder="请选择">
+              <el-select clearable v-model="queryParams.isProcess" size="small" style="width: 200px" placeholder="请选择">
                 <el-option
                   v-for="item in options"
                   :key="item.value"

+ 531 - 0
src/views/purchase/contract/add/column.js

@@ -0,0 +1,531 @@
+export const Columns = [
+  {
+    key: "puOrgName",
+    title: "采购组织",
+    inputType: "PopoverSelect",
+    referName: "ORG_PARAM",
+    dataMapping: {
+      puOrg: "code",
+      puOrgName: "name",
+    },
+    require: true,
+  },
+  { key: "code", title: "合同编码", inputType: "Input" },
+  {
+    key: "lastPuMoney",
+    title: "上年度采购额",
+    inputType: "Input",
+    require: true,
+  },
+  {
+    key: "buyerName",
+    title: "采购员",
+    inputType: "PopoverSelect",
+    referName: "CONTACTS_PARAM",
+    dataMapping: {
+      buyer: "code",
+      buyerName: "name",
+      puDept: "deptId",
+      puDeptName: "deptName",
+    },
+    require: true,
+  },
+  {
+    key: "supplierName",
+    title: "供应商",
+    inputType: "PopoverSelect",
+    referName: "SUPPLIER_PARAM",
+    dataMapping: {
+      supplier: "code",
+      supplierName: "name",
+    },
+    require: true,
+  },
+  {
+    key: "contractType",
+    title: "合同类型",
+    inputType: "Select",
+    require: true,
+    referName: "puarchase_contract_contract_type",
+  },
+  {
+    key: "puMoneyYear",
+    title: "本年度采购额",
+    inputType: "InputNumber",
+    require: true,
+  },
+  {
+    key: "puDeptName",
+    title: "采购部门",
+    inputType: "PopoverSelect",
+    referName: "DEPT_PARAM",
+    dataMapping: {
+      puDept: "code",
+      puDeptName: "name",
+    },
+    require: true,
+  },
+  {
+    key: "supplierTier",
+    title: "供应商层级",
+    inputType: "Select",
+    require: true,
+    referName: "puarchase_contract_supplier_tier",
+  },
+  { key: "contractName", title: "合同名称", inputType: "Input", require: true },
+  {
+    key: "grossRateAverage",
+    title: "平均毛利率",
+    inputType: "Input",
+    require: true,
+  },
+  {
+    key: "approveFlow",
+    title: "审批流程",
+    inputType: "Select",
+    require: true,
+    referName: "puarchase_contract_approve_flow",
+  },
+  {
+    key: "consumableClass",
+    title: "耗材类别",
+    inputType: "Select",
+    require: true,
+    referName: "puarchase_contract_consumable_class",
+  },
+  {
+    key: "effectiveDate",
+    title: "合同生效日期",
+    inputType: "DatePicker",
+    require: true,
+  },
+  {
+    key: "brandGrossRate",
+    title: "同类品牌及毛利率",
+    inputType: "Input",
+    require: true,
+  },
+  {
+    key: "contractFormat",
+    title: "合同格式",
+    inputType: "Select",
+    require: true,
+    referName: "puarchase_contract_contract_format",
+  },
+  {
+    key: "productName",
+    title: "产品类别&名称",
+    inputType: "Input",
+    require: true,
+  },
+  {
+    key: "endDate",
+    title: "合同终止日期",
+    inputType: "DatePicker",
+    require: true,
+  },
+  {
+    key: "invoiceTax",
+    title: "发票税率",
+    inputType: "PopoverSelect",
+    referName: "TAX_RATE_PARAM",
+    dataMapping: {
+      invoiceTax: "ntaxrate",
+    },
+    require: true,
+  },
+  {
+    key: "emergencyDegree",
+    title: "紧急程度",
+    inputType: "Select",
+    require: true,
+    referName: "puarchase_contract_emergency_degree",
+  },
+  { key: "project", title: "项目医院", inputType: "Input", require: true },
+  {
+    key: "signDate",
+    title: "合同签订日期",
+    inputType: "DatePicker",
+    require: true,
+  },
+  {
+    key: "deliveryType",
+    title: "交货方式",
+    inputType: "Select",
+    referName: "puarchase_contract_delivery_type",
+  },
+  {
+    key: "source",
+    title: "合同来源",
+    inputType: "Input",
+    value: "自制",
+    disabled: true,
+  },
+  {
+    key: "contractPartycName",
+    title: "合同丙方",
+    inputType: "PopoverSelect",
+    referName: "SUPPLIER_PARAM",
+    dataMapping: {
+      contractPartyc: "code",
+      contractPartycName: "name",
+    },
+  },
+  {
+    key: "guaranteePeriodEnd",
+    title: "质保期限",
+    inputType: "Input",
+    require: true,
+  },
+  {
+    key: "freightMethods",
+    title: "运费承担方式",
+    inputType: "Select",
+    referName: "puarchase_contract_freight_methods",
+  },
+  {
+    key: "signDate",
+    title: "合同创建时间",
+    inputType: "DatePicker",
+    disabled: true,
+  },
+  {
+    key: "isTarget",
+    title: "是否有指标",
+    inputType: "Select",
+    require: true,
+    referName: "sys_yes_no",
+  },
+  {
+    key: "contractTarget",
+    title: "合同指标",
+    inputType: "Input",
+    require: true,
+    placeholder: '当【是否有指标】="有"时,必填',
+  },
+  {
+    key: "exemptionPostageCondtion",
+    title: "包邮条件",
+    inputType: "Input",
+    placeholder:
+      "当运费承担方式为供应商有条件承担时,该字段必填,填写要求,写明什么条件下供应商承担全部,什么条件下我方承担,什么条件下分别承担",
+    span: 12,
+  },
+  {
+    key: "isRebate",
+    title: "是否有返利",
+    inputType: "Select",
+    require: true,
+    referName: "sys_yes_no",
+  },
+  {
+    key: "rebatePolicy",
+    title: "返利政策",
+    inputType: "Input",
+    placeholder: '当【是否有返利】="有"时,必填',
+    span: 18,
+  },
+  { key: "externalContract", title: "外部合同号", inputType: "Input" },
+  {
+    key: "rollbackPolicy",
+    title: "退换货政策",
+    inputType: "Input",
+    require: true,
+  },
+  { key: "enquiryCode", title: "询价单号", inputType: "Input" },
+  {
+    key: "contractContent",
+    title: "合同主要内容",
+    inputType: "Textarea",
+    require: true,
+    span: 24,
+  },
+  { key: "refusalReasons", title: "拒绝理由", inputType: "Input", span: 24 },
+
+  {
+    key: "externalFile",
+    title: "对外附件",
+    inputType: "Upload",
+    span: 24,
+    fileType: ["pdf"],
+  },
+  {
+    key: "puFile",
+    title: "采购商盖章合同附件",
+    inputType: "Upload",
+    span: 24,
+    fileType: ["pdf"],
+  },
+  {
+    key: "supplierFile",
+    title: "供应商盖章合同附件",
+    inputType: "Upload",
+    span: 24,
+    fileType: ["pdf"],
+  },
+  { key: "projectCode", title: "项目编号", inputType: "Input" },
+  { key: "projectName", title: "项目名称", inputType: "Input" },
+  { key: "area", title: "区域", inputType: "Input" },
+  { key: "consigneePhone", title: "收货人联系方式", inputType: "Input" },
+  {
+    key: "paymentAgreement",
+    title: "付款协议",
+    inputType: "PopoverSelect",
+    referName: "PAYAGREEMENT_PARAM",
+    dataMapping: {
+      paymentAgreement: "code",
+      paymentAgreementName: "name",
+    },
+    require: true,
+  },
+  {
+    key: "taxPrice",
+    title: "价税合计",
+    inputType: "InputNumber",
+  },
+  {
+    key: "currencyName",
+    title: "币种",
+    inputType: "PopoverSelect",
+    referName: "CURRENCY_PARAM",
+    dataMapping: {
+      currency: "code",
+      currencyName: "name",
+    },
+    require: true,
+  },
+  { key: "guaranteePeriod", title: "质保期", inputType: "Input" },
+];
+
+export const SearchColumns = [
+  { key: "contractName", title: "合同名称", search: true, inputType: "Input" },
+];
+
+export const TabColumns = [
+  {
+    title: "物料基本信息",
+    key: "contractItemList",
+    tableColumns: [
+      {
+        title: "物料名称",
+        key: "materialName",
+        inputType: "PopoverSelect",
+        width: 200,
+        referName: "MATERIAL_PARAM",
+        dataMapping: {
+          material: "code",
+          materialName: "name",
+          puUnit: "unitIdName",
+          registration: "registrationNo",
+          specification: "specification",
+          manufacturer: "manufacturerIdName",
+        },
+      },
+      { title: "物料编码", key: "material", width: 200 },
+      {
+        title: "规格",
+        key: "specification",
+        width: 200,
+      },
+      // {
+      //   title: "品牌",
+      //   key: "brand",
+      //   inputType: "PopoverSelect",
+      //   width: 200,
+      //   referName: "MATERIAL_PARAM",
+      //   dataMapping: {
+      //     material: "code",
+      //     materialName: "name",
+      //   },
+      // },
+      {
+        title: "生产厂家",
+        key: "manufacturer",
+        inputType: "Input",
+        width: 200,
+      },
+      {
+        title: "采购单位",
+        key: "puUnit",
+        inputType: "PopoverSelect",
+        width: 200,
+        referName: "UNIT_PARAM",
+        dataMapping: {
+          puUnit: "name",
+        },
+      },
+      {
+        title: "税率%",
+        key: "tax",
+        inputType: "PopoverSelect",
+        referName: "TAX_RATE_PARAM",
+        dataMapping: {
+          tax: "ntaxrate",
+        },
+        width: 200,
+      },
+      {
+        title: "采购数量",
+        key: "qty",
+        inputType: "InputNumber",
+        width: 200,
+      },
+      {
+        title: "含税单价",
+        key: "taxPrice",
+        inputType: "InputNumber",
+        width: 200,
+      },
+      {
+        title: "含税金额合计",
+        key: "taxMoney",
+        inputType: "ComputedInput",
+        width: 200,
+        computed: (prop) => {
+          const { qty, taxPrice } = prop;
+          const taxMoney = (qty * taxPrice).toFixed(8);
+          return taxMoney === "NaN" ? null : taxMoney;
+        },
+      },
+      {
+        title: "无税单价",
+        key: "taxFreePrice",
+        inputType: "ComputedInput",
+        width: 200,
+        computed: (prop) => {
+          const { tax, taxPrice } = prop;
+          const newTax = Number(tax) / 100;
+          const taxFreePrice = (taxPrice / (1 + newTax)).toFixed(8);
+          return taxFreePrice === "NaN" ? null : taxFreePrice;
+        },
+      },
+      {
+        title: "无税金额合计",
+        key: "taxFreeMoney",
+        inputType: "ComputedInput",
+        width: 200,
+        computed: (prop) => {
+          const { qty, taxFreePrice } = prop;
+          const taxFreeMoney = (qty * taxFreePrice).toFixed(8);
+          return taxFreeMoney === "NaN" ? null : taxFreeMoney;
+        },
+      },
+      {
+        title: "注册证号及备案凭证号",
+        key: "registration",
+        inputType: "Input",
+        width: 200,
+      },
+      {
+        title: "收货客户",
+        key: "customerName",
+        inputType: "PopoverSelect",
+        width: 200,
+        referName: "CUSTOMER_PARAM",
+        dataMapping: {
+          customer: "code",
+          customerName: "name",
+        },
+      },
+      { title: "备注", key: "remark", inputType: "Input", width: 200 },
+    ],
+  },
+  {
+    title: "合同条款",
+    key: "contractClauseList",
+    tableColumns: [
+      { title: "条款编码", key: "code", inputType: "Input" },
+      { title: "条款名称", key: "name", inputType: "Input" },
+      { title: "条款内容", key: "content", inputType: "Input" },
+      { title: "变量序号", key: "variableRowno" },
+      { title: "变量内容", key: "variableContent", inputType: "Input" },
+      { title: "备注", key: "remark", inputType: "Input" },
+    ],
+  },
+  {
+    title: "合同费用",
+    key: "contractExpenseList",
+    tableColumns: [
+      { title: "费用编码", key: "code", inputType: "Input" },
+      { title: "费用名称", key: "name", inputType: "Input" },
+      {
+        title: "费用金额",
+        key: "money",
+        inputType: "InputNumber",
+        width: 200,
+      },
+      { title: "备注", key: "remark", inputType: "Input" },
+    ],
+  },
+  {
+    title: "付款协议信息",
+    key: "contractAgreementList",
+    tableColumns: [
+      {
+        title: "付款阶段",
+        key: "satge",
+        inputType: "InputNumber",
+        width: 200,
+      },
+      {
+        title: "付款起点",
+        key: "origin",
+        width: 200,
+        inputType: "Select",
+        referName: "puarchase_contract_origin",
+      },
+      { 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,
+        inputType: "Select",
+        referName: "sys_yes_no",
+      },
+      {
+        title: "是否质保金",
+        key: "isQuality",
+        width: 200,
+        inputType: "Select",
+        referName: "sys_yes_no",
+      },
+      {
+        title: "结算方式",
+        key: "paymentMeans",
+        inputType: "PopoverSelect",
+        width: 200,
+        referName: "BALATYPE_PARAM",
+        dataMapping: {
+          paymentMeans: "name",
+        },
+      },
+      { title: "备注", key: "remark", inputType: "Input", width: 200 },
+      {
+        title: "需进度确认",
+        key: "schedule",
+        inputType: "Select",
+        referName: "sys_yes_no",
+        width: 200,
+      },
+    ],
+  },
+  {
+    title: "合同执行组织范围",
+    key: "contractApplyOrgList",
+    tableColumns: [
+      {
+        title: "组织名称",
+        key: "orgName",
+        inputType: "PopoverSelect",
+        referName: "ORG_PARAM",
+        dataMapping: {
+          org: "code",
+          orgName: "name",
+        },
+      },
+      { title: "组织编码", key: "org" },
+    ],
+  },
+];

+ 4 - 45
src/views/purchase/contract/add/index.vue

@@ -1,12 +1,7 @@
 <script>
-import { Columns, TabColumns } from "../column";
+import { Columns, TabColumns } from "./column";
 import { REFER } from "@/components/popover-select/api";
-import {
-  ADD,
-  CODE,
-  TABLEADD,
-  TABLEROMOVE,
-} from "@/api/business/purchase/contract";
+import { ADD, CODE } from "@/api/business/purchase/contract";
 import { initDicts, initRules, initParams } from "@/utils/init";
 
 export default {
@@ -117,37 +112,8 @@ export default {
       this.params[prop].push(initParams(tab.tableColumns));
     },
     //
-    async rowDelete(prop, { row: { id }, $index }) {
-      if (id) {
-        try {
-          this.loading = true;
-          const { code } = await TABLEROMOVE(id, prop);
-          if (code === 200) {
-            this.fetchTable(this.params.code, prop);
-          }
-        } catch (err) {
-          // catch
-        } finally {
-          // finally
-          this.loading = false;
-        }
-      } else {
-        this.params[prop].splice($index, 1);
-      }
-    },
-    //
-    async rowSubmit(prop, { row }) {
-      try {
-        this.loading = true;
-        const { code } = this.params;
-        await TABLEADD({ ...row, contractId: code }, prop);
-      } catch (err) {
-        // catch
-        console.error(err);
-      } finally {
-        // finally
-        this.loading = false;
-      }
+    async rowDelete(prop, { $index }) {
+      this.params[prop].splice($index, 1);
     },
     //
     submit(prop) {
@@ -378,13 +344,6 @@ export default {
                 <template slot-scope="scope">
                   <el-button
                     circle
-                    icon="el-icon-check"
-                    :size="size"
-                    @click.native.prevent="rowSubmit(tabName, scope)"
-                  >
-                  </el-button>
-                  <el-button
-                    circle
                     icon="el-icon-minus"
                     :size="size"
                     @click.native.prevent="rowDelete(tabName, scope)"

+ 7 - 41
src/views/purchase/contract/edit/index.vue

@@ -53,23 +53,9 @@ export default {
           this.tabColumns = TabColumns;
         }
         this.tabName = this.tabColumns[0].key;
-        this.fetchTable(this.params.code, this.tabName);
       },
       immediate: true,
     },
-    // "params.contractItemList": {
-    //   handler: function (newProp, oldProp) {
-    //     console.log(newProp, oldProp);
-    //     if (newProp.length === oldProp.length) {
-    //       const index = newProp.findIndex(
-    //         (item, index) =>
-    //           JSON.stringify(item) === JSON.stringify(oldProp[index])
-    //       );
-    //       console.log(index);
-    //     }
-    //   },
-    //   deep: true,
-    // },
   },
   methods: {
     //
@@ -99,25 +85,8 @@ export default {
       }
     },
     //
-    async fetchTable(prop, name) {
-      try {
-        this.loading = true;
-        const { code, rows } = await TABLELIST({ contractId: prop }, name);
-        if (code === 200) {
-          this.params[name] = rows.map((item) => ({
-            ...item,
-            status: "success",
-          }));
-        }
-      } catch (err) {
-        // catch
-      } finally {
-        // finally
-        this.loading = false;
-      }
-    },
-    //
     async fetchRefer(prop, type, source) {
+      console.log("prop", prop);
       const { rateCode } = prop;
       if (type === "MATERIAL_PARAM") {
         try {
@@ -150,7 +119,7 @@ export default {
           this.loading = true;
           const { code } = await TABLEROMOVE(id, prop);
           if (code === 200) {
-            this.fetchTable(this.params.code, prop);
+            this.fetchItem(this.params.id);
           }
         } catch (err) {
           // catch
@@ -166,13 +135,14 @@ export default {
     async rowSubmit(prop, { row }) {
       try {
         this.loading = true;
+        const { id } = this.params;
         const { contractId } = row;
         if (contractId) {
           await TABLEEDIT(row, prop);
         } else {
-          const { code } = this.params;
-          await TABLEADD({ ...row, contractId: code }, prop);
+          await TABLEADD({ ...row, contractId: id }, prop);
         }
+        await this.fetchItem(id);
       } catch (err) {
         // catch
       } finally {
@@ -309,12 +279,7 @@ export default {
         </el-col>
       </el-row>
       <el-form-item label-width="0">
-        <el-tabs
-          v-model="tabName"
-          tab-position="left"
-          style="width: 100%"
-          @tab-click="fetchTable(params.code, tabName)"
-        >
+        <el-tabs v-model="tabName" tab-position="left" style="width: 100%">
           <el-tab-pane
             v-for="(column, index) in tabColumns"
             :key="index"
@@ -344,6 +309,7 @@ export default {
                     :clearable="cColumn.clearable"
                     :placeholder="cColumn.placeholder"
                     style="width: 100%"
+                    @change="fetchRefer"
                   ></el-input>
                   <dr-computed-input
                     v-else-if="cColumn.inputType === 'ComputedInput'"

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

@@ -11,6 +11,7 @@ export default {
     EditModel: () => import("./edit/index.vue"),
     ExportModel: () => import("./export/index.vue"),
     ImportModel: () => import("./import/index.vue"),
+    RecordModel: () => import("./record/index.vue"),
     DeleteModel: () => import("./delete/index.vue"),
   },
   data() {
@@ -94,6 +95,11 @@ export default {
       const { open } = this.$refs.ImportModel;
       await open();
     },
+    // 期初补录
+    async useRecord() {
+      const { open } = this.$refs.RecordModel;
+      await open();
+    },
   },
 };
 </script>
@@ -111,6 +117,7 @@ export default {
   >
     <see-model ref="SeeModel"></see-model>
     <add-model ref="AddModel" @success="useReset"></add-model>
+    <record-model ref="RecordModel" @success="useReset"></record-model>
     <edit-model ref="EditModel" @success="useQuery(params, page)"></edit-model>
     <export-model ref="ExportModel"></export-model>
     <import-model ref="ImportModel"></import-model>
@@ -149,7 +156,8 @@ export default {
       <el-button :size="size" @click="useReset"> 重 置 </el-button>
       <el-button :size="size" @click="useAdd"> 新 增 </el-button>
       <el-button :size="size" @click="useExport(params)"> 导 出 </el-button>
-      <el-button :size="size" @click="useImport"> 导 入 </el-button>
+      <el-button :size="size" @click="useRecord"> 期初补录 </el-button>
+      <!-- <el-button :size="size" @click="useImport"> 导 入 </el-button> -->
     </el-row>
     <el-table
       :size="size"

+ 531 - 0
src/views/purchase/contract/record/column.js

@@ -0,0 +1,531 @@
+export const Columns = [
+  {
+    key: "puOrgName",
+    title: "采购组织",
+    inputType: "PopoverSelect",
+    referName: "ORG_PARAM",
+    dataMapping: {
+      puOrg: "code",
+      puOrgName: "name",
+    },
+    require: true,
+  },
+  { key: "code", title: "合同编码", inputType: "Input" },
+  {
+    key: "lastPuMoney",
+    title: "上年度采购额",
+    inputType: "Input",
+    require: true,
+  },
+  {
+    key: "buyerName",
+    title: "采购员",
+    inputType: "PopoverSelect",
+    referName: "CONTACTS_PARAM",
+    dataMapping: {
+      buyer: "code",
+      buyerName: "name",
+      puDept: "deptId",
+      puDeptName: "deptName",
+    },
+    require: true,
+  },
+  {
+    key: "supplierName",
+    title: "供应商",
+    inputType: "PopoverSelect",
+    referName: "SUPPLIER_PARAM",
+    dataMapping: {
+      supplier: "code",
+      supplierName: "name",
+    },
+    require: true,
+  },
+  {
+    key: "contractType",
+    title: "合同类型",
+    inputType: "Select",
+    require: true,
+    referName: "puarchase_contract_contract_type",
+  },
+  {
+    key: "puMoneyYear",
+    title: "本年度采购额",
+    inputType: "InputNumber",
+    require: true,
+  },
+  {
+    key: "puDeptName",
+    title: "采购部门",
+    inputType: "PopoverSelect",
+    referName: "DEPT_PARAM",
+    dataMapping: {
+      puDept: "code",
+      puDeptName: "name",
+    },
+    require: true,
+  },
+  {
+    key: "supplierTier",
+    title: "供应商层级",
+    inputType: "Select",
+    require: true,
+    referName: "puarchase_contract_supplier_tier",
+  },
+  { key: "contractName", title: "合同名称", inputType: "Input", require: true },
+  {
+    key: "grossRateAverage",
+    title: "平均毛利率",
+    inputType: "Input",
+    require: true,
+  },
+  {
+    key: "approveFlow",
+    title: "审批流程",
+    inputType: "Select",
+    require: true,
+    referName: "puarchase_contract_approve_flow",
+  },
+  {
+    key: "consumableClass",
+    title: "耗材类别",
+    inputType: "Select",
+    require: true,
+    referName: "puarchase_contract_consumable_class",
+  },
+  {
+    key: "effectiveDate",
+    title: "合同生效日期",
+    inputType: "DatePicker",
+    require: true,
+  },
+  {
+    key: "brandGrossRate",
+    title: "同类品牌及毛利率",
+    inputType: "Input",
+    require: true,
+  },
+  {
+    key: "contractFormat",
+    title: "合同格式",
+    inputType: "Select",
+    require: true,
+    referName: "puarchase_contract_contract_format",
+  },
+  {
+    key: "productName",
+    title: "产品类别&名称",
+    inputType: "Input",
+    require: true,
+  },
+  {
+    key: "endDate",
+    title: "合同终止日期",
+    inputType: "DatePicker",
+    require: true,
+  },
+  {
+    key: "invoiceTax",
+    title: "发票税率",
+    inputType: "PopoverSelect",
+    referName: "TAX_RATE_PARAM",
+    dataMapping: {
+      invoiceTax: "ntaxrate",
+    },
+    require: true,
+  },
+  {
+    key: "emergencyDegree",
+    title: "紧急程度",
+    inputType: "Select",
+    require: true,
+    referName: "puarchase_contract_emergency_degree",
+  },
+  { key: "project", title: "项目医院", inputType: "Input", require: true },
+  {
+    key: "signDate",
+    title: "合同签订日期",
+    inputType: "DatePicker",
+    require: true,
+  },
+  {
+    key: "deliveryType",
+    title: "交货方式",
+    inputType: "Select",
+    referName: "puarchase_contract_delivery_type",
+  },
+  {
+    key: "source",
+    title: "合同来源",
+    inputType: "Input",
+    value: "期初补录",
+    disabled: true,
+  },
+  {
+    key: "contractPartycName",
+    title: "合同丙方",
+    inputType: "PopoverSelect",
+    referName: "SUPPLIER_PARAM",
+    dataMapping: {
+      contractPartyc: "code",
+      contractPartycName: "name",
+    },
+  },
+  {
+    key: "guaranteePeriodEnd",
+    title: "质保期限",
+    inputType: "Input",
+    require: true,
+  },
+  {
+    key: "freightMethods",
+    title: "运费承担方式",
+    inputType: "Select",
+    referName: "puarchase_contract_freight_methods",
+  },
+  {
+    key: "signDate",
+    title: "合同创建时间",
+    inputType: "DatePicker",
+    disabled: true,
+  },
+  {
+    key: "isTarget",
+    title: "是否有指标",
+    inputType: "Select",
+    require: true,
+    referName: "sys_yes_no",
+  },
+  {
+    key: "contractTarget",
+    title: "合同指标",
+    inputType: "Input",
+    require: true,
+    placeholder: '当【是否有指标】="有"时,必填',
+  },
+  {
+    key: "exemptionPostageCondtion",
+    title: "包邮条件",
+    inputType: "Input",
+    placeholder:
+      "当运费承担方式为供应商有条件承担时,该字段必填,填写要求,写明什么条件下供应商承担全部,什么条件下我方承担,什么条件下分别承担",
+    span: 12,
+  },
+  {
+    key: "isRebate",
+    title: "是否有返利",
+    inputType: "Select",
+    require: true,
+    referName: "sys_yes_no",
+  },
+  {
+    key: "rebatePolicy",
+    title: "返利政策",
+    inputType: "Input",
+    placeholder: '当【是否有返利】="有"时,必填',
+    span: 18,
+  },
+  { key: "externalContract", title: "外部合同号", inputType: "Input" },
+  {
+    key: "rollbackPolicy",
+    title: "退换货政策",
+    inputType: "Input",
+    require: true,
+  },
+  { key: "enquiryCode", title: "询价单号", inputType: "Input" },
+  {
+    key: "contractContent",
+    title: "合同主要内容",
+    inputType: "Textarea",
+    require: true,
+    span: 24,
+  },
+  { key: "refusalReasons", title: "拒绝理由", inputType: "Input", span: 24 },
+
+  {
+    key: "externalFile",
+    title: "对外附件",
+    inputType: "Upload",
+    span: 24,
+    fileType: ["pdf"],
+  },
+  {
+    key: "puFile",
+    title: "采购商盖章合同附件",
+    inputType: "Upload",
+    span: 24,
+    fileType: ["pdf"],
+  },
+  {
+    key: "supplierFile",
+    title: "供应商盖章合同附件",
+    inputType: "Upload",
+    span: 24,
+    fileType: ["pdf"],
+  },
+  { key: "projectCode", title: "项目编号", inputType: "Input" },
+  { key: "projectName", title: "项目名称", inputType: "Input" },
+  { key: "area", title: "区域", inputType: "Input" },
+  { key: "consigneePhone", title: "收货人联系方式", inputType: "Input" },
+  {
+    key: "paymentAgreement",
+    title: "付款协议",
+    inputType: "PopoverSelect",
+    referName: "PAYAGREEMENT_PARAM",
+    dataMapping: {
+      paymentAgreement: "code",
+      paymentAgreementName: "name",
+    },
+    require: true,
+  },
+  {
+    key: "taxPrice",
+    title: "价税合计",
+    inputType: "InputNumber",
+  },
+  {
+    key: "currencyName",
+    title: "币种",
+    inputType: "PopoverSelect",
+    referName: "CURRENCY_PARAM",
+    dataMapping: {
+      currency: "code",
+      currencyName: "name",
+    },
+    require: true,
+  },
+  { key: "guaranteePeriod", title: "质保期", inputType: "Input" },
+];
+
+export const SearchColumns = [
+  { key: "contractName", title: "合同名称", search: true, inputType: "Input" },
+];
+
+export const TabColumns = [
+  {
+    title: "物料基本信息",
+    key: "contractItemList",
+    tableColumns: [
+      {
+        title: "物料名称",
+        key: "materialName",
+        inputType: "PopoverSelect",
+        width: 200,
+        referName: "MATERIAL_PARAM",
+        dataMapping: {
+          material: "code",
+          materialName: "name",
+          puUnit: "unitIdName",
+          registration: "registrationNo",
+          specification: "specification",
+          manufacturer: "manufacturerIdName",
+        },
+      },
+      { title: "物料编码", key: "material", width: 200 },
+      {
+        title: "规格",
+        key: "specification",
+        width: 200,
+      },
+      // {
+      //   title: "品牌",
+      //   key: "brand",
+      //   inputType: "PopoverSelect",
+      //   width: 200,
+      //   referName: "MATERIAL_PARAM",
+      //   dataMapping: {
+      //     material: "code",
+      //     materialName: "name",
+      //   },
+      // },
+      {
+        title: "生产厂家",
+        key: "manufacturer",
+        inputType: "Input",
+        width: 200,
+      },
+      {
+        title: "采购单位",
+        key: "puUnit",
+        inputType: "PopoverSelect",
+        width: 200,
+        referName: "UNIT_PARAM",
+        dataMapping: {
+          puUnit: "name",
+        },
+      },
+      {
+        title: "税率%",
+        key: "tax",
+        inputType: "PopoverSelect",
+        referName: "TAX_RATE_PARAM",
+        dataMapping: {
+          tax: "ntaxrate",
+        },
+        width: 200,
+      },
+      {
+        title: "采购数量",
+        key: "qty",
+        inputType: "InputNumber",
+        width: 200,
+      },
+      {
+        title: "含税单价",
+        key: "taxPrice",
+        inputType: "InputNumber",
+        width: 200,
+      },
+      {
+        title: "含税金额合计",
+        key: "taxMoney",
+        inputType: "ComputedInput",
+        width: 200,
+        computed: (prop) => {
+          const { qty, taxPrice } = prop;
+          const taxMoney = (qty * taxPrice).toFixed(8);
+          return taxMoney === "NaN" ? null : taxMoney;
+        },
+      },
+      {
+        title: "无税单价",
+        key: "taxFreePrice",
+        inputType: "ComputedInput",
+        width: 200,
+        computed: (prop) => {
+          const { tax, taxPrice } = prop;
+          const newTax = Number(tax) / 100;
+          const taxFreePrice = (taxPrice / (1 + newTax)).toFixed(8);
+          return taxFreePrice === "NaN" ? null : taxFreePrice;
+        },
+      },
+      {
+        title: "无税金额合计",
+        key: "taxFreeMoney",
+        inputType: "ComputedInput",
+        width: 200,
+        computed: (prop) => {
+          const { qty, taxFreePrice } = prop;
+          const taxFreeMoney = (qty * taxFreePrice).toFixed(8);
+          return taxFreeMoney === "NaN" ? null : taxFreeMoney;
+        },
+      },
+      {
+        title: "注册证号及备案凭证号",
+        key: "registration",
+        inputType: "Input",
+        width: 200,
+      },
+      {
+        title: "收货客户",
+        key: "customerName",
+        inputType: "PopoverSelect",
+        width: 200,
+        referName: "CUSTOMER_PARAM",
+        dataMapping: {
+          customer: "code",
+          customerName: "name",
+        },
+      },
+      { title: "备注", key: "remark", inputType: "Input", width: 200 },
+    ],
+  },
+  {
+    title: "合同条款",
+    key: "contractClauseList",
+    tableColumns: [
+      { title: "条款编码", key: "code", inputType: "Input" },
+      { title: "条款名称", key: "name", inputType: "Input" },
+      { title: "条款内容", key: "content", inputType: "Input" },
+      { title: "变量序号", key: "variableRowno" },
+      { title: "变量内容", key: "variableContent", inputType: "Input" },
+      { title: "备注", key: "remark", inputType: "Input" },
+    ],
+  },
+  {
+    title: "合同费用",
+    key: "contractExpenseList",
+    tableColumns: [
+      { title: "费用编码", key: "code", inputType: "Input" },
+      { title: "费用名称", key: "name", inputType: "Input" },
+      {
+        title: "费用金额",
+        key: "money",
+        inputType: "InputNumber",
+        width: 200,
+      },
+      { title: "备注", key: "remark", inputType: "Input" },
+    ],
+  },
+  {
+    title: "付款协议信息",
+    key: "contractAgreementList",
+    tableColumns: [
+      {
+        title: "付款阶段",
+        key: "satge",
+        inputType: "InputNumber",
+        width: 200,
+      },
+      {
+        title: "付款起点",
+        key: "origin",
+        width: 200,
+        inputType: "Select",
+        referName: "puarchase_contract_origin",
+      },
+      { 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,
+        inputType: "Select",
+        referName: "sys_yes_no",
+      },
+      {
+        title: "是否质保金",
+        key: "isQuality",
+        width: 200,
+        inputType: "Select",
+        referName: "sys_yes_no",
+      },
+      {
+        title: "结算方式",
+        key: "paymentMeans",
+        inputType: "PopoverSelect",
+        width: 200,
+        referName: "BALATYPE_PARAM",
+        dataMapping: {
+          paymentMeans: "name",
+        },
+      },
+      { title: "备注", key: "remark", inputType: "Input", width: 200 },
+      {
+        title: "需进度确认",
+        key: "schedule",
+        inputType: "Select",
+        referName: "sys_yes_no",
+        width: 200,
+      },
+    ],
+  },
+  {
+    title: "合同执行组织范围",
+    key: "contractApplyOrgList",
+    tableColumns: [
+      {
+        title: "组织名称",
+        key: "orgName",
+        inputType: "PopoverSelect",
+        referName: "ORG_PARAM",
+        dataMapping: {
+          org: "code",
+          orgName: "name",
+        },
+      },
+      { title: "组织编码", key: "org" },
+    ],
+  },
+];

+ 364 - 0
src/views/purchase/contract/record/index.vue

@@ -0,0 +1,364 @@
+<script>
+import { Columns, TabColumns } from "./column";
+import { REFER } from "@/components/popover-select/api";
+import { ADD, CODE } from "@/api/business/purchase/contract";
+import { initDicts, initRules, initParams } from "@/utils/init";
+
+export default {
+  name: "RecordDialog",
+  dicts: Array.from(
+    new Set([
+      ...initDicts(Columns),
+      ...initDicts(
+        TabColumns.map((item) => item.tableColumns)
+          .flat()
+          .filter((item) => item.inputType === "Select")
+      ),
+    ])
+  ),
+  components: {},
+  data() {
+    return {
+      size: "mini",
+      visible: false,
+      loading: false,
+      columns: Columns,
+      rules: initRules(Columns),
+      params: {
+        ...initParams(Columns),
+        contractItemList: [],
+        contractClauseList: [],
+        contractExpenseList: [],
+        contractAgreementList: [],
+        contractApplyOrgList: [],
+      },
+      tabColumns: TabColumns,
+      tabName: "contractItemList",
+    };
+  },
+  computed: {},
+  watch: {
+    "params.contractType": function (newProp) {
+      this.tabColumns = TabColumns.filter((element) =>
+        newProp === "1" ? element.key !== "contractItemList" : element
+      );
+      this.tabName = this.tabColumns[0].key;
+    },
+  },
+  methods: {
+    //
+    open() {
+      const {
+        deptId: puDept,
+        deptName: puDeptName,
+        name: buyer,
+        nickName: buyerName,
+        orgId: puOrg,
+        orgName: puOrgName,
+      } = this.$store.state.user;
+      this.params.puOrg = puOrg;
+      this.params.puOrgName = puOrgName;
+      this.params.buyer = buyer;
+      this.params.buyerName = buyerName;
+      this.params.puDept = puDept;
+      this.params.puDeptName = puDeptName;
+      this.fetchCode();
+      this.visible = true;
+    },
+    //
+    hide() {
+      this.visible = false;
+      this.params = initParams(this.columns);
+      this.tabName = this.tabColumns[0].key;
+    },
+    //
+    async fetchCode() {
+      try {
+        this.loading = true;
+        const code = await CODE();
+        this.params.code = code;
+      } catch (err) {
+        // catch
+      } finally {
+        // finally
+        this.loading = false;
+      }
+    },
+    //
+    async fetchRefer(prop, type, source) {
+      const { rateCode } = prop;
+      if (type === "MATERIAL_PARAM") {
+        try {
+          this.loading = true;
+          const { code, rows } = await REFER({
+            search: rateCode,
+            type: "TAX_RATE_PARAM",
+          });
+          if (code === 200) {
+            const [{ ntaxrate }] = rows;
+            source.tax = ntaxrate === "0E-8" ? "0.00000000" : ntaxrate;
+          }
+        } catch (err) {
+          // catch
+        } finally {
+          // finally
+          this.loading = false;
+        }
+      }
+    },
+    //
+    rowAdd(prop) {
+      const tab = this.tabColumns.find((element) => element.key === prop);
+      this.params[prop].push(initParams(tab.tableColumns));
+    },
+    //
+    async rowDelete(prop, { $index }) {
+      this.params[prop].splice($index, 1);
+    },
+    //
+    submit(prop) {
+      this.$refs[prop].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 ADD({
+              createById,
+              createByName,
+              updateById,
+              updateByName,
+              ...this.params,
+            });
+            if (code === 200) {
+              this.hide();
+              this.$emit("success");
+            } else {
+              this.$notify.warning({ title: msg });
+            }
+          } catch (err) {
+            //
+          } finally {
+            //
+          }
+        } else {
+          return false;
+        }
+      });
+    },
+  },
+  created() {
+    console.log(this);
+  },
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template>
+  <el-dialog :visible.sync="visible" title="期初补录" fullscreen @close="hide">
+    <el-form
+      ref="ruleForm"
+      v-loading="loading"
+      :size="size"
+      :rules="rules"
+      :model="params"
+      label-width="auto"
+      label-position="right"
+    >
+      <el-row :gutter="20" 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]"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              style="width: 100%"
+            ></el-input>
+            <dr-popover-select
+              v-if="column.inputType === 'PopoverSelect'"
+              v-model="params[column.key]"
+              :source.sync="params"
+              :title="column.title"
+              :type="column.referName"
+              :disabled="column.disabled"
+              :readonly="column.readonly"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              :data-mapping="column.dataMapping"
+            >
+            </dr-popover-select>
+            <el-input
+              v-if="column.inputType === 'Textarea'"
+              v-model="params[column.key]"
+              type="textarea"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              style="width: 100%"
+            ></el-input>
+            <el-input-number
+              v-if="column.inputType === 'InputNumber'"
+              v-model="params[column.key]"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              :controls-position="column.controlsPosition"
+              style="width: 100%"
+            ></el-input-number>
+            <el-select
+              v-if="column.inputType === 'Select'"
+              v-model="params[column.key]"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              style="width: 100%"
+            >
+              <el-option
+                v-for="item in dict.type[column.referName]"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+            <el-date-picker
+              v-if="column.inputType === 'DatePicker'"
+              v-model="params[column.key]"
+              :type="column.type"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              :picker-options="column.pickerOptions"
+              style="width: 100%"
+            >
+            </el-date-picker>
+            <file-upload
+              v-if="column.inputType === 'Upload'"
+              v-model="params[column.key]"
+              :file-type="column.fileType"
+            ></file-upload>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-form-item label-width="0">
+        <el-tabs v-model="tabName" tab-position="left" style="width: 100%">
+          <el-tab-pane
+            v-for="(column, index) in tabColumns"
+            :key="index"
+            :label="column.title"
+            :name="column.key"
+          >
+            <el-table :data="params[column.key]" style="width: 100%">
+              <el-table-column label="序号">
+                <template slot-scope="scope">
+                  {{ scope.$index + 1 }}
+                </template>
+              </el-table-column>
+              <el-table-column
+                v-for="(cColumn, cIndex) in column.tableColumns"
+                :key="cIndex"
+                :prop="cColumn.key"
+                :label="cColumn.title"
+                :width="cColumn.width"
+                show-overflow-tooltip
+              >
+                <template slot-scope="scope">
+                  <el-input
+                    v-if="cColumn.inputType === 'Input'"
+                    v-model="scope.row[cColumn.key]"
+                    :size="size"
+                    :disabled="cColumn.disabled"
+                    :clearable="cColumn.clearable"
+                    :placeholder="cColumn.placeholder"
+                    style="width: 100%"
+                  ></el-input>
+                  <dr-computed-input
+                    v-else-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]"
+                    :size="size"
+                    :title="cColumn.title"
+                    :source.sync="scope.row"
+                    :type="cColumn.referName"
+                    :disabled="cColumn.disabled"
+                    :readonly="cColumn.readonly"
+                    :clearable="cColumn.clearable"
+                    :placeholder="cColumn.placeholder"
+                    :data-mapping="cColumn.dataMapping"
+                    @change="fetchRefer"
+                  >
+                  </dr-popover-select>
+                  <el-input-number
+                    v-else-if="cColumn.inputType === 'InputNumber'"
+                    v-model="scope.row[cColumn.key]"
+                    :size="size"
+                    :disabled="cColumn.disabled"
+                    :clearable="cColumn.clearable"
+                    :placeholder="cColumn.placeholder"
+                    :controls-position="cColumn.controlsPosition"
+                    style="width: 100%"
+                  ></el-input-number>
+                  <el-select
+                    v-else-if="cColumn.inputType === 'Select'"
+                    v-model="scope.row[cColumn.key]"
+                    :disabled="cColumn.disabled"
+                    :clearable="cColumn.clearable"
+                    :placeholder="cColumn.placeholder"
+                    style="width: 100%"
+                  >
+                    <el-option
+                      v-for="item in dict.type[cColumn.referName]"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value"
+                    >
+                    </el-option>
+                  </el-select>
+                  <span v-else> {{ scope.row[cColumn.key] }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column fixed="right" label="操作" width="100">
+                <template slot="header" slot-scope="scope">
+                  <el-button
+                    circle
+                    icon="el-icon-plus"
+                    :size="size"
+                    @click="rowAdd(tabName)"
+                  >
+                  </el-button>
+                </template>
+                <template slot-scope="scope">
+                  <el-button
+                    circle
+                    icon="el-icon-minus"
+                    :size="size"
+                    @click.native.prevent="rowDelete(tabName, scope)"
+                  >
+                  </el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-tab-pane>
+        </el-tabs>
+      </el-form-item>
+      <el-form-item label-width="0" style="text-align: right">
+        <el-button :size="size" @click="hide">取 消</el-button>
+        <el-button :size="size" @click="submit('ruleForm')"> 新 增 </el-button>
+      </el-form-item>
+    </el-form>
+  </el-dialog>
+</template>

+ 6 - 28
src/views/purchase/contract/see/index.vue

@@ -49,29 +49,11 @@ export default {
     async fetchItem(prop) {
       try {
         this.loading = true;
-        const { code,data } = await ITEM(prop);
+        const { code, data } = await ITEM(prop);
         if (code === 200) {
           this.params = data;
-          
+
           this.tabName = this.tabColumns[0].key;
-          this.fetchTable(this.params.code, this.tabName);
-        } else {
-          this.$notify.warning({ title: msg });
-        }
-      } catch (err) {
-        //
-      } finally {
-        this.loading = false;
-      }
-    },
-    //
-    async fetchTable(prop, name) {
-      try {
-        this.loading = true;
-        const { code,rows } = await TABLELIST({ contractId: prop }, name);
-        if (code === 200) {
-          this.params[name] = rows;
-          
         } else {
           this.$notify.warning({ title: msg });
         }
@@ -95,13 +77,14 @@ export default {
 };
 </script>
 <template>
-  <el-dialog :visible.sync="visible" title="明细" @close="hide">
-    <el-descriptions :column="2" border>
+  <el-dialog :visible.sync="visible" title="明细" fullscreen @close="hide">
+    <el-descriptions :column="4" border>
       <el-descriptions-item
         v-if="params[column.key]"
         v-for="(column, index) in columns"
         :key="index"
         :label="column.title"
+        :labelStyle="{ width: '100px' }"
       >
         <dict-tag
           v-if="column.inputType === 'Select'"
@@ -128,12 +111,7 @@ export default {
         <span v-else>{{ params[column.key] }}</span>
       </el-descriptions-item>
     </el-descriptions>
-    <el-tabs
-      v-model="tabName"
-      tab-position="left"
-      style="width: 100%"
-      @tab-click="fetchTable(params.code, tabName)"
-    >
+    <el-tabs v-model="tabName" tab-position="top" style="width: 100%">
       <el-tab-pane
         v-for="(column, index) in tabColumns"
         :key="index"

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

@@ -452,6 +452,8 @@ export const TabColumns = [
           materialClassifyTwoName:'twoClass',
           materialClassifyThreeName:'threeClass',
           materialClassifyFourName:'fourClass',
+          registration:'registrationNo',
+          isDrug:'isDrug',
         },
         queryParams: () => ({}),
       },
@@ -622,7 +624,8 @@ export const TabColumns = [
         key: "registration",
          title: "注册证号", 
          inputType: "Input", 
-         width: 180 
+         width: 180 ,
+         disabled:true,
         },
 
       { //storageCondition storageConditionName
@@ -753,6 +756,8 @@ export const TabColumns = [
           materialClassifyTwoName:'twoClass',
           materialClassifyThreeName:'threeClass',
           materialClassifyFourName:'fourClass',
+          registration:'registrationNo',
+          isDrug:'isDrug',
         },
         queryParams: () => ({}),
         width: 180

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

@@ -294,9 +294,9 @@ export default {
         this.handleGetPrice();
       }
 
-      if(type == "MATERIAL_PARAM"){
-        source.isDrug = val.materialMedcine.isDrug  == '0' ? 'Y' : 'N';
-      }
+      // if(type == "MATERIAL_PARAM"){
+      //   source.isDrug = val.materialMedcine.isDrug  == '0' ? 'Y' : 'N';
+      // }
     },
 
     // 子表下拉框改变

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

@@ -290,17 +290,17 @@ export default {
     async handlePaymentRequest(){
       // name:工号
       try {
-        let {name} = this.$store.state.user;
+        // let {name} = this.$store.state.user;
 
-        await orderApi.payRequest(name).then(res=>{
+        let {code,msg} = await orderApi.payRequest();
 
-          if(res){
+        if(code == 200){
+          msg.replace(/\/n/g,'');
+          let url = `uclient://start/http://172.16.100.2:8081?ssoKey=${msg}&uiloader=nc.uap.lfw.applet.PortalUILoader&nodeId=40040407`
 
-            let url = `uclient://start/http://172.16.100.2:8081?ssoKey=${res}&uiloader=nc.uap.lfw.applet.PortalUILoader&nodeId=40040407`
+          window.location.href = url;
 
-            window.location.href = url;
-          }
-        });
+        }
 
       } catch (error) {
         

+ 9 - 6
src/views/purchase/task/column.js

@@ -1,5 +1,11 @@
 export const TableColumns = [
   { key: "code", title: "订单生成单号", width: 250 },
+  {
+    key: "status",
+    title: "状态",
+    inputType: "Select",
+    referName: "purchase_task_status",
+  },
   { key: "demandCode", title: "需求单号", width: 250 },
   { key: "materialCode", title: "物料编码" },
   { key: "materialName", title: "物料名称" },
@@ -7,6 +13,8 @@ export const TableColumns = [
   { key: "materialDesc", title: "物料描述" },
   { key: "manufacturerName", title: "生产厂家" },
   { key: "puQty", title: "采购数量" },
+  { key: "executeQty", title: "已执行数量" },
+  { key: "residueQty", title: "未执行数量" },
   {
     key: "priceType",
     title: "价格类型",
@@ -15,12 +23,7 @@ export const TableColumns = [
   },
   { key: "puUnitName", title: "采购单位" },
   // { key: "id", title: "主键" },
-  {
-    key: "status",
-    title: "状态",
-    inputType: "Select",
-    referName: "purchase_task_status",
-  },
+
   // { key: "manufacturer", title: "生产厂家" },
   // { key: "buyer", title: "采购员" },
   { key: "buyerName", title: "采购员" },

+ 5 - 2
src/views/purchase/task/first-direct/column.js

@@ -12,8 +12,6 @@ export const TableColumns = [
   { key: "tax", title: "税率" },
   { key: "taxFreePrice", title: "无税单价" },
   { key: "taxPrice", title: "主含税单价" },
-  { key: "executeQty", title: "已执行数量" },
-  { key: "residueQty", title: "未执行数量" },
   {
     key: "purchaseQuantity",
     title: "本次采购数量",
@@ -29,6 +27,11 @@ export const TableColumns = [
     inputType: "DatePicker",
     valueFormat: "yyyy-MM-dd",
     width: 200,
+    pickerOptions: {
+      disabledDate(time) {
+        return time.getTime() < Date.now();
+      },
+    },
   },
   { key: "note", title: "备注", inputType: "Textarea", width: 200 },
 ];

+ 2 - 3
src/views/purchase/task/first-direct/index.vue

@@ -30,10 +30,9 @@ export default {
     async fetchItem(prop) {
       try {
         this.loading = true;
-        const { code,data } = await FIRSTDIRECT(prop);
+        const { code, data } = await FIRSTDIRECT(prop);
         if (code === 200) {
           this.data = data;
-          
         } else {
           this.hide();
           this.$notify.warning({ title: msg });
@@ -59,7 +58,7 @@ export default {
         if (code === 200) {
           this.hide();
           this.$emit("success");
-          
+          this.$notify.success({ title: msg });
         } else {
           this.$notify.warning({ title: msg });
         }

+ 15 - 11
src/views/purchase/task/index.vue

@@ -32,6 +32,13 @@ export default {
     this.useQuery(this.params, this.page);
   },
   methods: {
+    // selectable
+    selectable(row) {
+      const { status } = row;
+      if (status === "1") return false;
+      else if (status === "3") return false;
+      else return true;
+    },
     //
     async fetchList(prop, page) {
       try {
@@ -72,16 +79,7 @@ export default {
     },
     // 选 择
     useSelect(prop) {
-      if (prop && prop.length) {
-        // const lastIndex = prop.length - 1;
-        // const { status } = prop[lastIndex];
-        // if (status === "1") {
-        //   this.selectData.splice(lastIndex, 1);
-        // } else {
-        this.selectData = prop;
-        // }
-      }
-      console.log(this.selectData);
+      this.selectData = prop;
     },
     // 行 关
     async useClose(prop) {
@@ -273,7 +271,13 @@ export default {
       @row-dblclick="useSee"
       @selection-change="useSelect"
     >
-      <el-table-column fixed width="55" align="center" type="selection">
+      <el-table-column
+        fixed
+        width="55"
+        align="center"
+        type="selection"
+        :selectable="selectable"
+      >
       </el-table-column>
       <el-table-column
         v-for="(column, index) in tableColumns"

+ 8 - 4
src/views/purchase/transferOrder/add.vue

@@ -232,10 +232,11 @@
           max-height="480"
           >
           <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno"/>
-          <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="material" width="230px">
+          <el-table-column show-overflow-tooltip label="采购需求单单号" align="center" prop="demandCode" width="200px"/>
+          <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="materialCode" width="230px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.material" @focus="chooseMaterial(scope.$index)">
+                <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.materialCode" @focus="chooseMaterial(scope.$index)">
                   <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMaterial(scope.$index)"></el-button>
                 </el-input>
               </el-form-item>
@@ -818,7 +819,9 @@ export default {
     addLine() {
       const newLine = {
         rowno: null,
+        demandCode: null,
         material: null,
+        materialCode: null,
         materialName: null,
         deliveryCode: null,
         storageCode: null,
@@ -955,7 +958,8 @@ export default {
     },
     selectMaterial(selection) {
       console.log('选中的物料', selection)
-      this.materialInfo[this.tableIndex].material = selection[0].code
+      this.materialInfo[this.tableIndex].material = selection[0].id
+      this.materialInfo[this.tableIndex].materialCode = selection[0].code
       this.materialInfo[this.tableIndex].materialName = selection[0].name
       this.materialInfo[this.tableIndex].specification = selection[0].specification
       this.materialInfo[this.tableIndex].model = selection[0].model
@@ -975,7 +979,7 @@ export default {
     chooseBatch(index) {
       this.tableIndex = index
       this.referConditionMx.orgCode = this.basicForm.deliveryInventoryOrgCode
-      this.referConditionMx.materialCode = this.materialInfo[this.tableIndex].material
+      this.referConditionMx.materialCode = this.materialInfo[this.tableIndex].materialCode
       this.referConditionMx.unitCode = this.materialInfo[this.tableIndex].unitCode
       this.referConditionMx.warehouseCode = this.basicForm.deliveryWarehouseCode
       this.$refs.batchRefer.init(this.referConditionMx)

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

@@ -164,7 +164,7 @@
             max-height="380"
             >
             <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno"/>
-            <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="material" width="150px"/>
+            <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="materialCode" width="150px"/>
             <el-table-column show-overflow-tooltip label="物料名称" align="center" prop="materialName" width="150px"/>
             <el-table-column show-overflow-tooltip label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
             <el-table-column show-overflow-tooltip label="调拨入库单号" align="center" prop="storageCode" width="150px"/>