Răsfoiți Sursa

Merge branch 'purchaseDev' into 'dev'

Purchase dev

See merge request new-business/drp-web!358
黄梓星 1 an în urmă
părinte
comite
0d24a67e3e

+ 1 - 0
package.json

@@ -58,6 +58,7 @@
     "quill": "1.3.7",
     "screenfull": "5.0.2",
     "sortablejs": "1.10.2",
+    "umy-ui": "^1.1.6",
     "vue": "2.6.12",
     "vue-amap": "^0.5.10",
     "vue-count-to": "1.0.13",

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

@@ -145,6 +145,13 @@ const returnedGoods = (data) =>{
   });
 }
 
+const toOA =(userName, fdId) => {
+  return request({
+    url: `/oaflow/redirectToOa/${userName}/${fdId}`,
+    method: 'get',
+  })
+}
+
 export default {
   list,
   details,
@@ -162,6 +169,6 @@ export default {
   REFER,
   putInStorage,
   returnedGoods,
-
+  toOA,
 
 }

+ 0 - 17
src/components/super-form/index.vue

@@ -64,14 +64,6 @@ export default {
         return prop.disabled;
       }
     },
-    //
-    getPickerOptions(prop, value) {
-      if (typeof prop.disabled === "function") {
-        return prop.pickerOptions(value);
-      } else {
-        return prop.pickerOptions;
-      }
-    },
     // 继承el-table的Method
     extendMethod() {
       const refMethod = Object.entries(this.$refs["superForm"]);
@@ -159,15 +151,6 @@ export default {
             >
             </component>
             <component
-              v-else-if="attr.is === 'el-date-picker'"
-              v-bind="attr"
-              v-model="innerValue[item.key]"
-              :disabled="getFormItemDisabled(attr, innerValue)"
-              :pickerOptions="getPickerOptions(attr, innerValue)"
-              style="width: 100%"
-            >
-            </component>
-            <component
               v-else
               v-bind="attr"
               v-model="innerValue[item.key]"

+ 4 - 0
src/main.js

@@ -58,6 +58,9 @@ import ComputedInput from "@/components/computed-input";
 import FilePreview from "@/components/file-preview";
 //打印
 import Print from "vue-print-nb";
+// 引入umy-ui
+import UmyUi from 'umy-ui'
+import 'umy-ui/lib/theme-chalk/index.css';// 引入样式
 
 // 全局方法挂载
 Vue.prototype.getDicts = getDicts;
@@ -93,6 +96,7 @@ Vue.use(directive);
 Vue.use(plugins);
 Vue.use(VueMeta);
 Vue.use(Print); //注册
+Vue.use(UmyUi);
 DictData.install();
 
 // el-table无限滚动解决页面渲染卡死

+ 11 - 11
src/views/material/basicFile/details.vue

@@ -1796,9 +1796,9 @@
       // 保存修改
       handleSave() {
         console.log('保存修改');
-        this.$refs['basicMessageRef'].validate(async (valid) => {
+        // this.$refs['basicMessageRef'].validate(async (valid) => {
 
-          if (valid) {
+        //   if (valid) {
             this.loading = true;
             // 普通保存修改
             this.updateButtonGroup && this.handleSaveMaterial(() => {
@@ -1811,16 +1811,16 @@
               this.maintainNewVersion = false;
               this.handleRefresh();
             })
-          } else {
-            this.$notify.error({
-              title: '错误',
-              message: '存在必填项未填写!'
-            });
+        //   } else {
+        //     this.$notify.error({
+        //       title: '错误',
+        //       message: '存在必填项未填写!'
+        //     });
             
-            console.log('error submit!!');
-            return false;
-          }
-        })
+        //     console.log('error submit!!');
+        //     return false;
+        //   }
+        // })
 
       },
       // 物料类别列表选中

+ 27 - 25
src/views/material/requisition/add.vue

@@ -337,6 +337,12 @@
                 </el-form-item>
               </el-col>
               <el-col :span="8">
+                <el-form-item label="启用状态" prop="isEnable">
+                  <el-input v-show="false" disabled v-model="basicForm.isEnable"></el-input>
+                  <el-input disabled value="启用"></el-input>
+                </el-form-item>
+              </el-col>
+              <!-- <el-col :span="8">
                 <el-form-item label="业务线" prop="businessLine">
                   <el-select ref="lines" v-model="basicForm.businessLine" placeholder="请选择" clearable
                              :disabled="disable"
@@ -344,7 +350,7 @@
                     <el-option v-for="item in lineOptions" :key="item.id" :label="item.name" :value="item.id"/>
                   </el-select>
                 </el-form-item>
-              </el-col>
+              </el-col> -->
             </el-row>
             <el-row :gutter="20">
               <el-col :span="8">
@@ -410,19 +416,29 @@
                 </el-form-item>
               </el-col>
               <el-col :span="8">
-                <el-form-item label="业务部门" prop="businessDepartment">
-                  <el-select ref="departs" v-model="basicForm.businessDepartment" placeholder="请选择" clearable
-                             :disabled="disable || orgControl" @focus="chooseDepart">
-                    <el-option v-for="item in departOptions" :key="item.id" :label="item.label" :value="item.id"/>
+                <el-form-item label="内包装单位" prop="innerPackingUnit">
+                  <!-- <el-input :disabled="disable" v-model="basicForm.innerPackingUnit"></el-input> -->
+                  <el-select ref="innerPackingUnits" v-model="basicForm.innerPackingUnit" placeholder="请选择" clearable
+                             :disabled="disable" @focus="chooseInnerPackingUnit">
+                    <el-option v-for="item in innerPackingUnitOptions" :key="item.id" :label="item.name"
+                               :value="item.id"/>
                   </el-select>
                 </el-form-item>
               </el-col>
               <el-col :span="8">
-                <el-form-item label="启用状态" prop="isEnable">
-                  <el-input v-show="false" disabled v-model="basicForm.isEnable"></el-input>
-                  <el-input disabled value="启用"></el-input>
+                <el-form-item label="内包装数" prop="innerPackingQty">
+                  <el-input type="number" min="0" :disabled="disable" v-model="basicForm.innerPackingQty"></el-input>
                 </el-form-item>
               </el-col>
+              <!-- <el-col :span="8">
+                <el-form-item label="业务部门" prop="businessDepartment">
+                  <el-select ref="departs" v-model="basicForm.businessDepartment" placeholder="请选择" clearable
+                             :disabled="disable || orgControl" @focus="chooseDepart">
+                    <el-option v-for="item in departOptions" :key="item.id" :label="item.label" :value="item.id"/>
+                  </el-select>
+                </el-form-item>
+              </el-col> -->
+              
             </el-row>
             <el-row :gutter="20">
               <el-col :span="8">
@@ -437,29 +453,15 @@
                   </el-select>
                 </el-form-item>
               </el-col>
-              <el-col :span="8">
-                <el-form-item label="内包装单位" prop="innerPackingUnit">
-                  <!-- <el-input :disabled="disable" v-model="basicForm.innerPackingUnit"></el-input> -->
-                  <el-select ref="innerPackingUnits" v-model="basicForm.innerPackingUnit" placeholder="请选择" clearable
-                             :disabled="disable" @focus="chooseInnerPackingUnit">
-                    <el-option v-for="item in innerPackingUnitOptions" :key="item.id" :label="item.name"
-                               :value="item.id"/>
-                  </el-select>
-                </el-form-item>
-              </el-col>
-            </el-row>
-            <el-row :gutter="20">
-              <el-col :span="8">
-                <el-form-item label="内包装数" prop="innerPackingQty">
-                  <el-input type="number" min="0" :disabled="disable" v-model="basicForm.innerPackingQty"></el-input>
-                </el-form-item>
-              </el-col>
+
               <el-col :span="8">
                 <el-form-item label="备注" prop="remark">
                   <el-input :disabled="disable" v-model="basicForm.remark"></el-input>
                 </el-form-item>
               </el-col>
+              
             </el-row>
+            
           </el-form>
         </div>
       </el-tab-pane>

+ 1 - 0
src/views/material/requisition/index.vue

@@ -333,6 +333,7 @@
                           saveAs(blob, '导入失败的物料申请单数据.xlsx');
                         }
                         this.failLoad = false;
+                        this.reset();
                       })
                     }
                   }

+ 1784 - 0
src/views/purchase/PurchaseDemandList/add_bak (2).vue

@@ -0,0 +1,1784 @@
+<template>
+  <div id="addDemandList">
+  <el-card style="position: relative;">
+    <span>基本信息</span>
+    <el-form :model="basicForm" :rules="basicRules" ref="basic" label-width="auto" :show-message="false">
+      <el-row :gutter="10">
+        <el-col :span="1.5">
+          <el-form-item label="业务类型" prop="billType" :rules="{ required: true, message: '请选择业务类型', trigger: 'blur' }">
+            <el-select clearable v-model="basicForm.billType" @change="changeBillType" :disabled="sonDisable" size="mini" 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>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="1.5">
+          <el-form-item label="需求客户">
+            <el-select clearable size="mini" v-model="basicForm.customer" :disabled="sonDisable" @clear="cleanCustomer" @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>
+        </el-col>
+
+        <el-col :span="1.5">
+          <el-form-item label="需求人员">
+              <el-select clearable size="mini" 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>
+        </el-col>
+
+        <el-col :span="1.5">
+          <el-form-item label="需求部门">
+            <el-select clearable v-model="basicForm.demandDept" size="mini" :disabled="sonDisable" @focus="chooseOrg('DEPT_PARAM', true, '需求部门')" style="width: 200px">
+              <el-option
+                v-for="item in deptOptions"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="1.5">
+          <el-form-item label="需求计划" prop="planType" :rules="{ required: true, message: '请选择需求计划', trigger: 'blur' }">
+            <el-select :disabled="sonDisable" v-model="basicForm.planType" size="mini" style="width: 200px" @change="changeplanType()">
+              <el-option v-for="dict in dict.type.sys_plan_type" :key="dict.value" :label="dict.label" :value="dict.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="1.5">
+          <el-form-item label="需求日期" prop="demandDate" :rules="{ required: true, message: '请选择需求日期', trigger: 'blur' }">
+            <el-date-picker
+              v-model="basicForm.demandDate"
+              disabled
+              clearable
+              type="date"
+              value-format="yyyy-MM-dd"
+              @change="changeDemandDate"
+              size="mini"
+              style="width: 200px"
+            >
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="1.5">
+          <el-form-item label="制单日期" prop="createTime">
+            <el-date-picker
+              v-model="basicForm.createTime"
+              disabled
+              clearable
+              type="date"
+              value-format="yyyy-MM-dd"
+              size="mini"
+              style="width: 200px"
+            >
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="1.5">
+          <el-form-item label="是否客户指定">
+            <el-select clearable @change="isCustomer" v-model="basicForm.isCustomerSpecified" :disabled="sonDisable" size="mini" style="width: 200px">
+              <el-option v-for=" item in options" :key="item.value" :label="item.label" :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="1.5">
+          <el-form-item label="备注">
+            <el-input
+              v-model.trim="basicForm.remark"
+              size="mini"
+              :disabled="sonDisable"
+              clearable
+              style="width: 200px"
+            />
+          </el-form-item>
+        </el-col>
+
+        <!-- <el-col :span="1.5">
+          <el-form-item label="需求客户名称">
+            <el-input disabled v-model="basicForm.customerName" size="mini" style="width: 200px"></el-input>
+          </el-form-item>
+        </el-col> -->
+
+        <el-col :span="1.5">
+          <el-form-item label="需求单号">
+            <el-input
+              v-model="basicForm.code"
+              size="mini"
+              disabled
+              style="width: 200px"
+            />
+          </el-form-item>
+         </el-col>
+
+        <!-- <el-col :span="1.5">
+            <el-form-item label="组织" prop="org" :rules="{ required: true, message: '请选择组织', trigger: 'blur' }">
+              <el-select clearable size="mini" 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>
+         </el-col> -->
+
+         <el-col :span="1.5">
+            <el-form-item label="单据状态">
+              <el-select disabled v-model="basicForm.status" size="mini" style="width: 200px">
+                <el-option v-for="dict in dict.type.sys_status" :key="dict.value" :label="dict.label" :value="dict.value">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+
+         <el-col :span="1.5">
+            <el-form-item label="客户负责人">
+              <el-select disabled size="mini" v-model="basicForm.customerPrincipal" style="width: 200px">
+                <el-option v-for="item in manOptions" :key="item.id" :label="item.name" :value="item.code"/>
+              </el-select>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="单据来源">
+              <el-select v-model="basicForm.source" disabled size="mini" style="width: 200px">
+                <el-option v-for="dict in dict.type.sys_bill_source" :key="dict.value" :label="dict.label" :value="dict.value">
+                </el-option>
+              </el-select>
+            </el-form-item>
+         </el-col>
+      </el-row>
+
+
+    
+      <div class="btn_grooup">
+        <span>明细信息</span>
+        <div>
+        <el-button type="primary" size="mini" @click="addLine" v-if="!sonDisable">增行</el-button>
+        <el-button type="primary" size="mini" v-if="!sonDisable" @click.stop="adjustPl">批量调整</el-button>
+        <el-button type="primary" size="mini" v-if="sonPageStu == 'check' || sonPageStu == 'edit'" @click="showReserved">货权预留单</el-button>
+        </div>
+      </div>
+
+      <ux-grid
+          v-loading="loading"
+          :data="basicForm.puDemandItemList"
+          border
+          :cell-style="{ borderColor: '#c0c0c0' }"
+          :header-cell-style="{ borderColor: '#c0c0c0' }"
+          class="exporttable"
+          height="410"
+          max-height="410"
+          style="font-size: 12px;"
+          @selection-change="handleSelectionChange"
+          :cell-class-name="cellClassName"
+          ref="table"
+          show-header-overflow="tooltip"
+          show-overflow="tooltip"
+          keep-source
+          beautifyTable
+          :checkbox-config="{highlight: true, trigger: 'row'}"
+          :edit-config="{trigger: 'click', mode: 'cell'}">
+        >
+          <ux-table-column type="checkbox" resizable fixed="left"/>
+          <ux-table-column title="序号" type="index" align="center" width="50px" fixed="left"/>
+          <ux-table-column title="行号" align="center" field="rowNo" fixed="left">
+            <template v-slot:edit="scope">
+              {{ scope.row.rowNo = scope.rowIndex + 1 + "0" }}
+            </template>
+          </ux-table-column>
+          <ux-table-column title="默认采购组织" align="center" field="purOrgName" width="200px"/>
+          <ux-table-column title="需求客户" align="center" field="demandCustomerName" width="180px"/>
+          <ux-table-column title="行状态" align="center" field="status" :formatter="hangStatus" width="100px"/>
+          <ux-table-column title="物料编码" align="center" field="materialCode" width="220px" :render-header="addRedStar" fixed="left" edit-render>
+            <template v-slot:edit="scope">
+                <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.materialCode" @paste.native="pasteMe($event, scope, scope.rowIndex)">
+                  <el-button size="mini" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMaterial(scope.rowIndex)"></el-button>
+                </el-input>
+            </template>
+          </ux-table-column>
+          <ux-table-column title="物料名称" align="center"  field="materialName" width="200px" fixed="left"/>
+          <ux-table-column title="规格" align="center"  field="specification" />
+          <ux-table-column title="型号" align="center"  field="model"/>
+          <ux-table-column title="单位" align="center"  field="unitName"/>
+          <ux-table-column title="生产厂家/代理人" align="center"  field="manufacturerName" width="230px"/>
+          <ux-table-column title="最小包装" align="center"  field="minPackage" width="100px"/>
+          <ux-table-column title="月均销量" align="center"  field="averageQtyMonth" width="100px"/>
+          <ux-table-column title="需求可用周期" align="center"  field="demandPeriod" width="120px"/>
+          <ux-table-column title="实际(业务)需求量" align="center"  field="qty" width="150px" :render-header="addRedStar" edit-render>
+            <template v-slot:edit="scope">
+                <el-input type="number" min="0" clearable :disabled="sonDisable" size="mini" v-model="scope.row.qty" @input="getYLSL(scope)" @paste.native="pasteMe($event, scope, scope.rowIndex)"/>
+            </template>
+          </ux-table-column>
+          <ux-table-column title="紧急标识" align="center" field="isUrgency" width="100px" edit-render>
+            <template v-slot:edit="scope">
+                <el-switch
+                  v-model="scope.row.isUrgency"
+                  :disabled="sonDisable"
+                  active-value="Y"
+                  inactive-value="N"
+                  active-color="#13ce66"
+                  inactive-color="#a1a3a9">
+                </el-switch>
+            </template>
+          </ux-table-column>
+          <ux-table-column title="收货仓库" align="center"  field="deliveryWarehouseName" width="200px" edit-render>
+            <template v-slot:edit="scope">
+                <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.deliveryWarehouseName" @clear="clearHang(scope.rowIndex, '选择收货仓库')">
+                  <el-button size="mini" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseCangKu(scope.rowIndex, 'WAREHOUSE_PARAM', true, '选择收货仓库', scope.row.puOrg)"></el-button>
+                </el-input>
+            </template>
+          </ux-table-column>
+          <ux-table-column title="收货货位" align="center"  field="deliveryAllocationName" width="200px" edit-render>
+            <template v-slot:edit="scope">
+                <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.deliveryAllocationName" @clear="clearHang(scope.rowIndex, '选择收货货位')">
+                  <el-button size="mini" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="choosehuoWei(scope.rowIndex, 'ALLOCATION_PARAM', true, '选择收货货位', scope.row.deliveryWarehouse)"></el-button>
+                </el-input>
+            </template>
+          </ux-table-column>
+          <ux-table-column title="业务备注" align="center"  field="remark" width="150px" edit-render>
+            <template v-slot:edit="scope">
+                <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.remark"/>
+            </template>
+          </ux-table-column>
+          <ux-table-column title="物料一级分类" align="center" field="materialClassifyOneName" width="150px"/>
+          <ux-table-column title="物料二级分类" align="center" field="materialClassifyTwoName" width="150px"/>
+          <ux-table-column title="物料三级分类" align="center" field="materialClassifyThreeName" width="150px"/>
+          <ux-table-column title="物料四级分类" align="center" field="materialClassifyFourName" width="150px"/>
+          <ux-table-column title="最小批量" align="center"  field="minBatch" width="100px"/>
+          <ux-table-column title="最小订货量" align="center"  field="minOrderQty" width="120px"/>
+          <ux-table-column title="采购员" align="center" field="buyerName" width="100px"/>
+          <!-- <ux-table-column title="采购员" align="center"  field="buyer"/> -->
+          <ux-table-column title="采购周期" align="center"  field="puPeriod" width="120px"/>
+          <ux-table-column title="交货日期" align="center"  field="deliveryDate" width="230px" edit-render>
+            <template v-slot:edit="scope">
+                <el-date-picker
+                  v-model="scope.row.deliveryDate"
+                  :disabled="sonDisable"
+                  clearable
+                  type="date"
+                  size="mini"
+                  value-format="yyyy-MM-dd"
+                  :picker-options="pickerOptionsEnd"
+                  placeholder="选择日期">
+                </el-date-picker>
+            </template>
+          </ux-table-column>
+          <ux-table-column title="有效期" align="center"  field="expiry" width="100px"/>
+          <ux-table-column title="有效期单位" align="center"  field="expiryUnit" width="100px"/>
+          <ux-table-column title="安全库存" align="center"  field="safeStock" width="100px"/>
+          <ux-table-column title="注册人" align="center"  field="registrant" width="100px"/>
+          <ux-table-column title="预留比例" align="center" field="reservedProportion" width="120px" edit-render>
+            <template v-slot:edit="scope">
+                <el-select clearable :disabled="sonDisable" size="mini" v-model="scope.row.reservedProportion" @change="getYLSL(scope)" @clear="cleanYLSL(scope)">
+                  <el-option v-for=" dict in dict.type.sys_reserve_ratio" :key="dict.value" :label="dict.label" :value="dict.value">
+                  </el-option>
+                </el-select>
+            </template>
+          </ux-table-column>
+          <ux-table-column title="预留周期" align="center" field="reservedPeriod" width="120px" edit-render>
+            <template v-slot:edit="scope">
+                <el-input type="number" min="0" clearable :disabled="sonDisable" size="mini" v-model="scope.row.reservedPeriod"></el-input>
+            </template>
+          </ux-table-column>
+          <ux-table-column title="预留数量" align="center"  field="reservedQty" width="120px"/>
+          <ux-table-column title="集团预测分类" align="center"  field="forecastClassify" width="120px"/>
+          <ux-table-column title="近一月需求" align="center"  field="onemonthAvgVolume" width="100px"/>
+          <ux-table-column title="近三月需求" align="center"  field="threemonthAvgVolume" width="100px"/>
+          <ux-table-column title="采购在途" align="center"  field="puFreight" width="100px"/>
+          <ux-table-column title="补单标识" align="center"  field="isReplenishment" width="100px" edit-render>
+            <template v-slot:edit="scope">
+                <el-switch
+                  v-model="scope.row.isReplenishment"
+                  disabled
+                  active-value="Y"
+                  inactive-value="N"
+                  active-color="#13ce66"
+                  inactive-color="#a1a3a9">
+                </el-switch>
+            </template>
+          </ux-table-column>
+          <ux-table-column title="补单供应商" align="center"  field="additionalSupplierName" width="200px" :render-header="anotherRedStar" edit-render>
+            <template v-slot:edit="scope">
+                <el-input clearable :disabled="sonDisable || BDZT" size="mini" v-model="scope.row.additionalSupplierName" @clear="clearHang(scope.rowIndex, '选择补单供应商')" @paste.native="pasteMe($event, scope, scope.rowIndex)">
+                  <el-button size="mini" :disabled="sonDisable || BDZT" slot="append" icon="el-icon-more" @click="chooseDept(scope.rowIndex, 'SUPPLIER_PARAM', true, '选择补单供应商')"></el-button>
+                </el-input>
+            </template>
+          </ux-table-column>
+          <ux-table-column title="末级供应库存组织" align="center" field="lastStockOrgName" width="180px"></ux-table-column>
+          <ux-table-column title="末级供应仓库" align="center"  field="lastWarehouseName" width="150px"/>
+          <ux-table-column title="末级供应货位" align="center"  field="lastAllocationName" width="150px"/>
+          <ux-table-column title="中心仓可用量" align="center"  field="centralWarehouseQty" width="120px"/>
+          <ux-table-column title="调拨状态" align="center"  field="statusAllot" width="100px" edit-render>
+            <template v-slot:edit="scope">
+                <el-switch
+                  v-model="scope.row.statusAllot"
+                  :disabled="sonDisable"
+                  active-value="Y"
+                  inactive-value="N"
+                  active-color="#13ce66"
+                  inactive-color="#a1a3a9">
+                </el-switch>
+            </template>
+          </ux-table-column>
+          <ux-table-column title="调拨单号" align="center"  field="allotCode"></ux-table-column>
+          <ux-table-column title="调拨占有量" align="center"  field="allotQty" width="100px"/>
+          <ux-table-column title="最终净需求量" align="center"  field="resDemandQty" width="120px"/>
+          <ux-table-column title="最终采购执行数量" align="center"  field="executeQty" width="150px">
+            <template v-slot:edit="scope">
+              {{ scope.row.executeQty ? scope.row.executeQty : 0 }}
+            </template>
+          </ux-table-column>
+          <ux-table-column title="收货地址" align="center"  field="deliveryAddressName" width="200px" edit-render>
+            <template v-slot:edit="scope">
+                <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.deliveryAddressName" @clear="clearHang(scope.rowIndex, '选择收货地址')" @paste.native="pasteMe($event, scope, scope.rowIndex)">
+                  <el-button size="mini" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.rowIndex, 'ADDRESS_PARAM', true, '选择收货地址')"></el-button>
+                </el-input>
+            </template>
+          </ux-table-column>
+          <ux-table-column title="联系人" align="center"  field="contacts"/>
+          <ux-table-column title="联系人电话" align="center"  field="contactsPhone" width="150px"/>
+          <ux-table-column title="详细地址" align="center"  field="address" width="200px"/>
+          <ux-table-column title="价格类型" align="center"  field="priceType" width="120px" edit-render>
+            <template v-slot:edit="scope">
+                <el-select clearable :disabled="sonDisable" size="mini" 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>
+                </el-select>
+            </template>
+          </ux-table-column>
+          <ux-table-column title="是否客户指定" align="center"  field="isCustomerSpecified" width="120px" edit-render>
+            <template v-slot:edit="scope">
+                <el-switch
+                  v-model="scope.row.isCustomerSpecified"
+                  disabled
+                  active-value="Y"
+                  inactive-value="N"
+                  active-color="#13ce66"
+                  inactive-color="#a1a3a9">
+                </el-switch>
+            </template>
+          </ux-table-column>
+          <!-- <ux-table-column title="批号锁定标识" align="center" field="isBatchLock" width="100px">
+            <template v-slot:edit="scope">
+              <el-form-item class="hang">
+                  <el-switch
+                    v-model="scope.row.isBatchLock"
+                    :disabled="sonDisable"
+                    active-value="Y"
+                    inactive-value="N"
+                    active-color="#13ce66"
+                    inactive-color="#a1a3a9">
+                  </el-switch>
+              </el-form-item>
+            </template>
+          </ux-table-column> -->
+          <ux-table-column title="采购备注" align="center"  field="updateCause" width="150px"/>
+          <ux-table-column title="可用量" align="center"  field="availableQty"/>
+
+          <ux-table-column
+            fixed="right"
+            title="操作"
+            width="100px"
+            align="center"
+            >
+          <template slot-scope="scope">
+            <el-button type="text" size="mini" :disabled="sonDisable" @click="delLine(scope.rowIndex, scope.row)">删除</el-button>
+          </template>
+        </ux-table-column>
+      </ux-grid>
+    </el-form>
+      <div class="btn_group">
+        <el-button type="primary" size="mini"  @click="jumpOA" v-if="sonPageStu == 'check' && (row.status == '1' || row.status == '2') && basicForm.flowId">流程跳转</el-button>
+        <el-button type="primary" size="mini"  @click="copy" v-if="sonPageStu == 'check'">复制</el-button>
+        <el-button type="primary" size="mini"  @click="editPage" v-if="sonPageStu == 'check' && row.status == '0'">编辑</el-button>
+        <el-button type="primary" size="mini"  @click="save" v-if="sonPageStu == 'add' || sonPageStu == 'edit'">保存</el-button>
+        <el-button type="primary" size="mini"  @click="submit" v-if="sonPageStu == 'check' && (row.status == '0' || row.status == '3')">提交</el-button>
+        <el-button size="mini" plain @click="back">返回</el-button>
+      </div>
+  </el-card>
+
+      <Reserved v-if="dialog.config" :isVisible="dialog.config" :info="row" @updateReserved="updateReserved"/>
+
+      <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
+
+      <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="false" />
+
+
+    <!-- 批量调整参数 -->
+    <el-dialog title="批量调整" :visible.sync="adjust.open" @close="closeEvent" width="38%">
+      <el-row style="margin-bottom: 10px;">
+        <el-col :span="6" class="pltzTxt">价格类型</el-col>
+        <el-col :span="14">
+        <el-select class="pltzIpt" clearable size="mini" v-model="adjust.priceType">
+          <el-option v-for=" dict in dict.type.sys_price_type" :key="dict.value" :label="dict.label" :value="dict.value">
+          </el-option>
+        </el-select>
+        </el-col>
+      </el-row>
+      <el-row style="margin-bottom: 10px;">
+        <el-col :span="6" class="pltzTxt">采购员</el-col>
+        <el-col :span="14">
+        <el-select class="pltzIpt" clearable size="mini" v-model="adjust.purchaseMan" @focus="chooseOrg('CONTACTS_PARAM', true, '采购员')">
+          <el-option v-for="item in purchaseManOptions" :key="item.id" :label="item.name" :value="item.code" />
+        </el-select>
+        </el-col>
+      </el-row>
+      <el-row style="margin-bottom: 10px;">
+        <el-col :span="6" class="pltzTxt">收货仓库</el-col>
+        <el-col :span="14">
+        <el-input class="pltzIpt" clearable size="mini" v-model="adjust.warehouseName" @focus="chooseOrg('WAREHOUSE_PARAM', true, '收货仓库')">
+          <el-button size="mini" slot="append" icon="el-icon-more" @click="chooseOrg('WAREHOUSE_PARAM', true, '收货仓库')"></el-button>
+        </el-input>
+        </el-col>
+      </el-row>
+      <el-row style="margin-bottom: 10px;">
+        <el-col :span="6" class="pltzTxt">收货货位</el-col>
+        <el-col :span="14">
+        <el-input class="pltzIpt" clearable size="mini" v-model="adjust.allocationName" @focus="adjustHuoWei('ALLOCATION_PARAM', true, '收货货位', adjust.warehouse)">
+          <el-button size="mini" slot="append" icon="el-icon-more" @click="adjustHuoWei('ALLOCATION_PARAM', true, '收货货位', adjust.warehouse)"></el-button>
+        </el-input>
+        </el-col>
+      </el-row>
+      <el-row style="margin-bottom: 10px;">
+        <el-col :span="6" class="pltzTxt">业务备注</el-col>
+        <el-col :span="14">
+          <el-input class="pltzIpt" clearable size="mini" v-model="adjust.remark"/>
+        </el-col>
+      </el-row>
+      <el-row style="margin-bottom: 10px;">
+        <el-col :span="6" class="pltzTxt">收货地址</el-col>
+        <el-col :span="14">
+          <el-input class="pltzIpt" clearable size="mini" v-model="adjust.deliveryAddressName">
+            <el-button size="mini" slot="append" icon="el-icon-more" @click="chooseOrg('ADDRESS_PARAM', true, '收货地址')"></el-button>
+          </el-input>
+        </el-col>
+      </el-row>
+      <el-row style="margin-bottom: 10px;">
+        <el-col :span="6" class="pltzTxt">收货地址编码</el-col>
+        <el-col :span="14">
+          <el-input class="pltzIpt" disabled clearable size="mini" v-model="adjust.deliveryAddress"/>
+        </el-col>
+      </el-row>
+      <el-row style="margin-bottom: 10px;">
+        <el-col :span="6" class="pltzTxt">联系人</el-col>
+        <el-col :span="14">
+          <el-input class="pltzIpt" disabled clearable size="mini" v-model="adjust.contacts"/>
+        </el-col>
+      </el-row>
+      <el-row style="margin-bottom: 10px;">
+        <el-col :span="6" class="pltzTxt">联系人电话</el-col>
+        <el-col :span="14">
+          <el-input class="pltzIpt" disabled clearable size="mini" v-model="adjust.contactsPhone"/>
+        </el-col>
+      </el-row>
+      <el-row style="margin-bottom: 10px;">
+        <el-col :span="6" class="pltzTxt">详细地址</el-col>
+        <el-col :span="14">
+          <el-input class="pltzIpt" disabled clearable size="mini" v-model="adjust.address"/>
+        </el-col>
+      </el-row>
+      <div slot="footer">
+      <el-button size="mini" type="primary" @click="confirmAdjust">确 认</el-button>
+      <el-button size="mini" @click="adjust.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import Reserved from './reserved.vue'
+import Refers from '@/components/Refers/refers.vue'
+import {addDemand,getDemandDetail, getDemandSonDetail, editDemand, submitDemand, queryMan, toOA } from '@/api/purchase/purchaseDemand.js'
+// 用于回显参照框数据
+import {getRefer} from '@/api/purchase/basic.js'
+// 明细行选择物料参照
+import popDialog from '@/components/PopDialog/index.vue'
+import ElTableInfiniteScroll from "el-table-infinite-scroll";
+export default {
+  directives: {
+    "el-table-infinite-scroll": ElTableInfiniteScroll,
+  },
+  name: 'addDemandList',
+  props: ['pageStu','row', 'disable'],
+  dicts: ['sys_processing_mode', 'sys_plan_type', 'sys_status', 'sys_bill_source', 'sys_business','sys_reserve_ratio', 'sys_period_unit', 'sys_price_type'],
+  components: {
+    Reserved,
+    Refers,
+    popDialog
+  },
+  model: {
+    prop: 'isList',
+    event: 'jugislist'
+  },
+  data() {
+    return {
+      loading: true,
+      // 不能直接改变props传来的值
+      sonPageStu: this.pageStu,
+      sonDisable: this.disable,
+      // BDZT是补单供应商是否可以编辑条件
+      BDZT: true,
+      dialog: {
+        config: false
+      },
+      basicForm: {
+        code: '',
+        org: '',
+        orgName: '',
+        demandBusinessType: '1',
+        status: '0',
+        customer: '',
+        customerName: '',
+        customerCode: '',
+        customerPrincipal: '',
+        demandPersonal: '',
+        demandPersonalName: '',
+        demandDept: '',
+        demandDeptName: '',
+        planType: 'ZJH',
+        demandDate: '',
+        source: '4',
+        billType: 'ZQBH',
+        isCustomerSpecified: 'N',
+        isProcess: '',
+        isMonthleyCalculate: '',
+        createTime: this.parseTime(new Date().getTime()),
+        remark: '',
+        puDemandItemList: []
+      },
+      delDemandItemList: [],
+      options: [{
+        value: 'Y', label: '是',
+      }, {
+        value: 'N', label: '否'
+      }],
+      basicRules: {},
+      tableList: [],
+      referCondition: {
+        type: '',
+        isPage: true,
+        title: '',
+      },
+      // referCondition: {
+      //   type: '',
+      //   isPage: true,
+      //   title: '',
+      // },
+      tableIndex: null,
+      ids: [],
+      orgOptions: [],
+      manOptions: [],
+      personOptions: [],
+      deptOptions: [],
+      customerOptions: [],
+      pickerOptionsEnd: {
+        disabledDate: (time) => {
+          return time.getTime() < new Date(this.basicForm.demandDate).getTime() - 8.64e7
+        }
+      },
+      isBDXQ: false,
+      isYl: false,
+      // 批量调整参数
+      adjust: {
+        open: false,
+        priceType: '',
+        purchaseMan: '',
+        purchaseManName: '',
+        warehouse: '',
+        warehouseName: '',
+        allocation: '',
+        allocationName: '',
+        remark:'',
+        deliveryAddress: '',
+        deliveryAddressName: '',
+        contacts: '',
+        contactsPhone: '',
+        address: ''
+      },
+      purchaseManOptions: [],
+      sonModel: {
+        rowNo: null,
+        contacts: null,
+        id: null,
+        demandId: null,
+        status: null,
+        materialCategory: null,
+        buyer: null,
+        buyerName: null,
+        mateiralClassifyOne: null,
+        materialClassifyOneName: null,
+        materialClassifyTwo: null,
+        materialClassifyTwoName: null,
+        materialClassifyThree: null,
+        materialClassifyThreeName: null,
+        materialClassifyFour: null,
+        materialClassifyFourName: null,
+        materialCode: null,
+        material: null,
+        materialName: null,
+        classifyId: null,
+        specification: null,
+        unit: null,
+        unitName: null,
+        manufacturerName: null,
+        registrant: null,
+        puPeriod: null,
+        expiryUnit: null,
+        expiry: null,
+        minPackage: null,
+        minOrderQty: null,
+        minBatch: null,
+        safeStock: null,
+        averageQtyMonth: null,
+        qty: null,
+        adjustmentPersonal: null,
+        adjustmentTime: null,
+        manualRegulation: null,
+        updateCause: null,
+        reservedProportion: null,
+        reservedPeriod: null,
+        reservedQty: null,
+        demandPeriod: null,
+        forecastClassify: null,
+        onemonthAvgVolume: null,
+        threemonthAvgVolume: null,
+        puFreight: null,
+        deliveryDate: null,
+        isUrgency: 'N',
+        isReplenishment: 'N',
+        isBatchLock: 'N',
+        isCustomerSpecified: '',
+        remark: null,
+        puRemark: null,
+        lastWarehouseQty: null,
+        resDemandQty: null,
+        lastWarehouse: null,
+        lastWarehouseName: null,
+        deliveryWarehouse: null,
+        deliveryWarehouseName: null,
+        lastAllocation: null,
+        lastAllocationName: null,
+        deliveryAllocation: null,
+        deliveryAllocationName: null,
+        passageOn: null,
+        puOrg: null,
+        purOrgName: null,
+        lastStockQty: null,
+        superiorCenterQty: null,
+        superiorAllotQty: null,
+        availableQty: null,
+        statusAllot: 'N',
+        additionalSupplier: null,
+        additionalSupplierName: null,
+        periodUnit: null,
+        demandCustomer: null,
+        demandCustomerName: null,
+        lastStockOrg: null,
+        lastStockOrgName: null,
+        superiorStockOrg: null,
+        superiorStockOrgName: null,
+        allotCode: null,
+        deliveryAddress: null,
+        deliveryAddressName: null,
+        contacts: null,
+        contactsPhone: null,
+        address: null,
+        source: null,
+        priceType: 'order',
+        puManagerApprover: null,
+        puManagerApproverName: null,
+        processTime: null,
+        affirmer: null,
+        tenantId: null,
+        revision: null,
+        createBy: null,
+        createByName: null,
+        createTime: null,
+        updateBy: null,
+        updateByName: null,
+        updateTime: null,
+        delFlag: 0,
+        // 新增字段
+        model: null,
+        storageCondition: null,
+        transportationCondition: null,
+      },
+      // 无限滚动配置
+      loadDisabled: true,
+      page: 0,
+      total: 5,
+    }
+  },
+  created() {
+    if(this.pageStu == 'check') {
+      console.log('数据', this.row)
+      this.getDetails(this.row)
+    } else if(this.pageStu == 'edit') {
+      this.getDetails(this.row)
+    } else if (this.pageStu == 'add') {
+      // 新增时判断需求日期
+      this.dafaultDate()
+      this.loading = false
+      this.basicForm.demandPersonal = this.$store.state.user.name
+      this.basicForm.demandPersonalName = this.$store.state.user.nickName
+      this.basicForm.demandDept = this.$store.state.user.deptId
+      this.basicForm.demandDeptName = this.$store.state.user.deptName
+      if (this.basicForm.demandPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.demandPersonal, '需求人员') }
+      if (this.basicForm.demandDept) { this.reBackRefer('DEPT_PARAM', this.basicForm.demandDept) }
+    }
+  },
+  methods: {
+    // 默认需求日期根据当天星期几判断
+    dafaultDate() {
+      // 获取当前时间
+      let date = new Date()
+      //获取当前时间的年份转为字符串
+      let year = date.getFullYear().toString()  
+      //获取月份,由于月份从0开始,此处要加1,判断是否小于10,如果是在字符串前面拼接'0'
+      let month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : (date.getMonth() + 1).toString()  //'04'
+      //获取天,判断是否小于10,如果是在字符串前面拼接'0'
+      let da = date.getDate() < 10 ? '0' + date.getDate().toString() : date.getDate().toString()  //'12'
+      let today = year + '-' + month + '-' + da
+      console.log('今天日期',today)
+      let weekDay = date.getDay()
+      console.log('今天星期几', weekDay)
+      // 改变需求计划的判断写这里面了
+      if (this.basicForm.planType == 'JJXQ') {
+        this.basicForm.demandDate = today
+      } else {
+        if (weekDay == 0) {this.basicForm.demandDate = this.getNextDate(today, 2)} 
+        else if (weekDay == 1) {this.basicForm.demandDate = this.getNextDate(today, 1)}
+        else if (weekDay == 2) {this.basicForm.demandDate = today}
+        else if (weekDay == 3) {this.basicForm.demandDate = this.getNextDate(today, 6)}
+        else if (weekDay == 4) {this.basicForm.demandDate = this.getNextDate(today, 5)}
+        else if (weekDay == 5) {this.basicForm.demandDate = this.getNextDate(today, 4)}
+        else if (weekDay == 6) {this.basicForm.demandDate = this.getNextDate(today, 3)}
+        // console.log(this.getNextDate(today, 2))
+      }
+    },
+    // 获取某天日期的下一天,默认为第二天 默认输出格式为yyyy-mm-dd
+    getNextDate(date, day = 1, format = '{y}-{m}-{d}') {
+      if (date) {
+        date = date.match(/\d+/g).join('-'); // 格式为2022年09月19日处理
+        const nDate = new Date(date);
+        nDate.setDate(nDate.getDate() + day);
+ 
+        const formatObj = {
+          y: nDate.getFullYear(),
+          m: nDate.getMonth() + 1,
+          d: nDate.getDate(),
+        };
+        return format.replace(/{([ymd])+}/g, (result, key) => {
+          const value = formatObj[key];
+          return value.toString().padStart(2, '0');
+        });
+      } else {
+        console.log('date格式不正确');
+      }
+    },
+    // 改变需求计划改变需求日期
+    changeplanType() {
+      this.dafaultDate()
+    },
+    // 无限滚动加载配置
+    load() {
+      if (this.loadDisabled) return;
+      this.page++;
+      if (this.page <= this.total) {
+        this.basicForm.puDemandItemList = this.basicForm.puDemandItemList.concat(this.basicForm.puDemandItemList);
+      }
+      if (this.page === this.total) {
+        this.loadDisabled = true;
+      }  
+    },
+    // 改变单据日期时清空子表的调拨日期
+    changeDemandDate() {
+      this.basicForm.puDemandItemList.forEach(item => {
+        item.deliveryDate = null
+      })
+    },
+    // 更改业务类型调整明细行内补单或紧急标识
+    changeBillType() {
+      if (this.basicForm.billType == 'BDXQ' && this.basicForm.puDemandItemList.length != 0) {
+        this.isBDXQ = true
+        this.BDZT = false
+        this.basicForm.puDemandItemList.forEach(item => {item.isReplenishment = 'Y'})
+      } else {
+        this.isBDXQ = false
+        this.BDZT = true
+        this.basicForm.puDemandItemList.forEach(item => {
+          item.isReplenishment = 'N'
+          item.additionalSupplier = null
+          item.additionalSupplierName = null
+        })
+      }
+      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' })
+      }
+    },
+    // 改变是否客户指定
+    isCustomer() {
+      if (this.basicForm.isCustomerSpecified == 'Y' && this.basicForm.puDemandItemList.length != 0) {
+        this.basicForm.puDemandItemList.forEach(item => {item.isCustomerSpecified = 'Y'})
+      } else {
+        this.basicForm.puDemandItemList.forEach(item => {item.isCustomerSpecified = 'N'})
+      }
+    },
+    hangStatus(row) {
+      switch (row.row.status) {
+        case '0':
+          return '需补货'
+        case '1':
+          return '待计划确认'
+        case '2':
+          return '计划已确认'
+        case '3':
+          return '计划已审核'
+        case '4':
+          return '行关闭'
+        case '5':
+          return '总供应可满足'
+      }
+    },
+    // 获取预留数量
+    getYLSL(scope) {
+      if (scope.row.reservedProportion) {
+        scope.row.reservedQty = Math.ceil(scope.row.reservedProportion.replace('%', '') / 100 * scope.row.qty)
+      }
+      // 如果选择预留比例,预留周期必填
+      // if(scope.row.reservedQty && scope.row.reservedQty !== 0) {
+      //   this.isYl = true
+      // } else {
+      //   this.isYl = false
+      // }
+    },
+    // 清空
+    cleanYLSL(scope) {
+      scope.row.reservedQty = ''
+      scope.row.reservedPeriod = ''
+    },
+    copy() {
+      this.$modal.notifySuccess("复制成功");
+      this.sonPageStu = 'add'
+      this.sonDisable = false
+      // this.getDetails(this.row)
+      this.basicForm.id = ''
+      this.basicForm.code = ''
+      this.basicForm.createBy = ''
+      this.basicForm.source = '4'
+      this.basicForm.isCustomerSpecified = 'N'
+      this.basicForm.demandPersonal = this.$store.state.user.name
+      this.basicForm.demandPersonalName = this.$store.state.user.nickName
+      this.basicForm.demandDept = this.$store.state.user.deptId
+      this.basicForm.demandDeptName = this.$store.state.user.deptName
+      // 复制时判断需求日期
+      this.dafaultDate()
+      if (this.basicForm.demandPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.demandPersonal, '需求人员') }
+      if (this.basicForm.demandDept) { this.reBackRefer('DEPT_PARAM', this.basicForm.demandDept) }
+      this.basicForm.puDemandItemList.forEach(item => {
+        item.status = ''
+        item.buyerName = ''
+        item.buyer = ''
+        item.reservedProportion = ''
+        item.reservedPeriod = ''
+        item.reservedQty = ''
+        item.averageQtyMonth = ''
+        item.demandPeriod = ''
+        item.forecastClassify = ''
+        item.onemonthAvgVolume = ''
+        item.threemonthAvgVolume = ''
+        item.puFreight = ''
+        item.superiorAllotQty = ''
+        item.resDemandQty = ''
+        item.executeQty = ''
+        item.deliveryWarehouseName = ''
+        item.deliveryWarehouse = ''
+        item.deliveryAllocationName = ''
+        item.deliveryAllocation = ''
+        item.lastWarehouseName = ''
+        item.lastAllocationName = ''
+        item.availableQty = ''
+        item.lastStockOrgName = ''
+        item.centralWarehouseQty = ''
+        item.allotCode = ''
+        item.allotQty = ''
+        item.deliveryAddress = ''
+        item.deliveryAddressName = ''
+        item.contacts = ''
+        item.contactsPhone = ''
+        item.address = ''
+        item.statusAllot = 'N'
+      })
+    },
+    editPage() {
+      this.sonPageStu = 'edit'
+      this.sonDisable = false
+    },
+    handleData() {
+      console.log('222')
+      // 复制新增把id,需求单号,创建人置为空,子表去掉id
+      this.basicForm.id = ''
+      this.basicForm.code = ''
+      this.basicForm.createBy = ''
+      this.basicForm.source = '4'
+      if (this.basicForm.puDemandItemList.length !== 0) {
+        this.basicForm.puDemandItemList.forEach(item => {
+          if (item.id) {
+            delete item.id
+          }
+          if (item.demandId) {
+            delete item.demandId
+          }
+          if (item.allotCode) {
+            delete item.allotCode
+          }
+        })
+      }
+    },
+    async save() {
+      if(this.basicForm.puDemandItemList.length !== 0) {
+        this.$refs['basic'].validate((valid, obj) => {
+          if(valid) {
+            this.$modal.loading("保存中...");
+            if(this.sonPageStu == 'add') {
+              this.handleData()
+              addDemand(this.basicForm).then(res => {
+                console.log(333)
+                if (res.code === 200) {
+                  this.$modal.notifySuccess(res.msg);
+                  this.$modal.closeLoading();
+                  this.back()
+                }
+              }).catch(err => {
+                this.$modal.closeLoading();
+              })
+            } else if (this.sonPageStu == 'edit') {
+              let list = []
+              list.push(...this.basicForm.puDemandItemList, ...this.delDemandItemList)
+              // 深拷贝一下参数对象
+              let param = JSON.parse(JSON.stringify(this.basicForm))
+              console.log('深拷贝对象',param);
+              param.puDemandItemList = list
+              // this.basicForm.puDemandItemList.push(...this.delDemandItemList)
+              editDemand(param).then(res => {
+                if (res.code === 200) {
+                  this.$modal.notifySuccess(res.msg);
+                  this.$modal.closeLoading();
+                  this.back()
+                }
+              }).catch(err => {
+                this.$modal.closeLoading();
+              })
+            }
+          } else {
+            // 校验加弹窗
+            const jiaoyan = []
+            for(let key in obj) {
+              jiaoyan.push(obj[key][0].message);
+            }
+            this.$modal.notifyWarning(jiaoyan[0]);
+            return false
+          }
+        })
+      } else {
+        this.$modal.notifyWarning("明细信息不能为空!");
+      }
+    },
+    submit() {
+      this.$modal.loading("提交中...");
+      submitDemand(this.basicForm).then(res => {
+        if (res.code === 200) {
+          this.$modal.notifySuccess("提交成功");
+          this.$modal.closeLoading();
+          this.back()
+        }
+      }).catch(err => {
+        this.$modal.closeLoading();
+      })
+    },
+    // 增行
+    addLine() {
+      const newLine = {...this.sonModel}
+      newLine.isUrgency = (this.basicForm.billType == 'JJXQ' ? 'Y' : 'N')
+      newLine.isReplenishment = (this.basicForm.billType == 'BDXQ' ? 'Y' : 'N')
+      newLine.demandCustomer = this.basicForm.customer
+      newLine.demandCustomerName = this.basicForm.customerName
+      this.basicForm.puDemandItemList.push(newLine)
+      // 补单需求状态改变
+      if (this.basicForm.billType == 'BDXQ') {
+        this.BDZT = false
+      } else {
+        this.BDZT = true
+      }
+    },
+    delLine(index, row) {
+      console.log('删除行:', index)
+      console.log('改变行:', row)
+      row.delFlag = '2'
+      let delList = []
+      delList = this.basicForm.puDemandItemList.filter(item => {
+        return item.delFlag == '2'
+      })
+      this.basicForm.puDemandItemList = this.basicForm.puDemandItemList.filter(item => {
+        return item.delFlag == '0'
+      })
+      this.delDemandItemList.push(...delList)
+      console.log('删除的数组',this.delDemandItemList)
+    },
+    back() {
+      console.log('打印人员信息看看', this.$store.state)
+      this.$emit('jugislist', true)
+      this.$emit('refresh')
+    },
+    // 如果需要回显则调用详情接口
+    getDetails(row) {
+      getDemandDetail(row.id).then(res => {
+        if (res.code === 200) {
+          // this.basicForm = res.data
+          let reciveForm = res.data
+          let params = {...{id: row.id}, ...{pageNum:1, pageSize: 10}}
+          getDemandSonDetail(params).then(res => {
+            if (res.code === 200) {
+              reciveForm.puDemandItemList = res.data
+              console.log('reciveForm',reciveForm)
+              this.basicForm = reciveForm
+              if(this.basicForm.org) { this.reBackRefer('ORG_PARAM', this.basicForm.org) }
+              if(this.basicForm.customer) { this.reBackRefer('CUSTOMER_PARAM', this.basicForm.customer) }
+              if(this.basicForm.customerPrincipal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.customerPrincipal, '客户负责人') }
+              if(this.basicForm.demandPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.demandPersonal, '需求人员') }
+              if(this.basicForm.demandDept) { this.reBackRefer('DEPT_PARAM', this.basicForm.demandDept) }
+              // 详情时将收货仓库id赋值给stordocId
+              // 如果业务类型为补单需求,则明细内补单供应商编码可以编辑
+              if(this.basicForm.billType == 'BDXQ') {
+                 this.BDZT = false
+                 this.isBDXQ = true
+              } else {
+                 this.BDZT = true
+                 this.isBDXQ = false
+              }
+            }
+          }).then(() => {
+            this.loading = false
+          }).catch(err => {
+            this.loading = false
+          })
+        }
+      })
+    },
+    // 单元格标红
+    cellClassName({row, column, rowIndex, columnIndex}) {
+      if(this.basicForm.isCustomerSpecified == 'N' && column.title == "需求可用周期" && Number(row.demandPeriod) > 1.5 && Number(row.qty) > Number(row.minOrderQty)) {
+        return 'success-row';
+      }
+    },
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item =>{
+        return item.id
+      })
+      console.log('选中数组', this.ids)
+    },
+    rowSelect(row) {
+      this.$refs.table.toggleRowSelection(row);
+    },
+    // 点击预留单展示
+    showReserved() {
+      this.dialog.config = true
+    },
+    // 修改是否让页面显示与隐藏的事件
+	  updateReserved (val) {
+      this.dialog.config = val
+    },
+    // 回显参照框
+    reBackRefer(type, id, title) {
+      getRefer({type: type, id: id}).then(res => {
+        if(type == 'ORG_PARAM') {
+          this.orgOptions = res.rows
+        }
+        if (type == 'CUSTOMER_PARAM') {
+          this.customerOptions = res.rows
+        }
+        if (type == 'CONTACTS_PARAM' && title == '需求人员') {
+          this.personOptions = res.rows
+        }
+        if (type == 'CONTACTS_PARAM' && title == '客户负责人') {
+          this.manOptions = res.rows
+        }
+        if (type == 'DEPT_PARAM') {
+          this.deptOptions = res.rows
+        }
+      })
+    },
+    chooseOrg(type, isPage, title) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.refer.init(this.referCondition)
+    },
+    selectionsToInput(selection) {
+      if(this.referCondition.type == 'ORG_PARAM' && this.referCondition.title == '选择组织') {
+        this.orgOptions = selection
+        this.basicForm.org = selection[0].id
+        this.basicForm.orgName = selection[0].name
+      }
+      if(this.referCondition.type == 'CUSTOMER_PARAM' && this.referCondition.title == '选择客户') {
+        this.customerOptions = selection
+        this.basicForm.customer = selection[0].id
+        this.basicForm.customerName = selection[0].name
+        this.basicForm.customerCode = selection[0].code
+        if(this.basicForm.puDemandItemList.length !== 0) {
+          this.basicForm.puDemandItemList.forEach(item => {
+            item.demandCustomerName = this.basicForm.customerName
+            item.demandCustomer = this.basicForm.customer
+            item.status = ''
+            item.buyerName = ''
+            item.buyer = ''
+            item.reservedProportion = ''
+            item.reservedPeriod = ''
+            item.reservedQty = ''
+            item.averageQtyMonth = ''
+            item.demandPeriod = ''
+            item.forecastClassify = ''
+            item.onemonthAvgVolume = ''
+            item.threemonthAvgVolume = ''
+            item.puFreight = ''
+            item.superiorAllotQty = ''
+            item.resDemandQty = ''
+            item.executeQty = ''
+            item.deliveryWarehouseName = ''
+            item.deliveryWarehouse = ''
+            item.deliveryAllocationName = ''
+            item.deliveryAllocation = ''
+            item.lastWarehouseName = ''
+            item.lastAllocationName = ''
+            item.availableQty = ''
+            item.lastStockOrgName = ''
+            item.centralWarehouseQty = ''
+            item.allotCode = ''
+            item.deliveryAddress = ''
+            item.deliveryAddressName = ''
+            item.contacts = ''
+            item.contactsPhone = ''
+            item.address = ''
+          })
+        }
+      }
+      if(this.referCondition.type == 'CONTACTS_PARAM' && this.referCondition.title == '需求人员') {
+        this.personOptions = selection
+        this.basicForm.demandPersonal = selection[0].code
+        this.basicForm.demandPersonalName = selection[0].name
+      }
+      if(this.referCondition.type == 'CONTACTS_PARAM' && this.referCondition.title == '采购员') {
+        this.purchaseManOptions = selection
+        this.adjust.purchaseMan = selection[0].code
+        this.adjust.purchaseManName = selection[0].name
+      }
+      if(this.referCondition.type == 'WAREHOUSE_PARAM' && this.referCondition.title == '收货仓库') {
+        this.adjust.warehouse = selection[0].id
+        this.adjust.warehouseName = selection[0].name
+        this.adjust.allocation = ''
+        this.adjust.allocationName = ''
+      }
+      if(this.referCondition.type == 'ALLOCATION_PARAM' && this.referCondition.title == '收货货位') {
+        this.adjust.allocation = selection[0].id
+        this.adjust.allocationName = selection[0].name
+      }
+      if(this.referCondition.type == 'ADDRESS_PARAM' && this.referCondition.title == '收货地址') {
+        this.adjust.deliveryAddressName = selection[0].name
+        this.adjust.deliveryAddress = selection[0].code
+        this.adjust.contacts = selection[0].contactsName
+        this.adjust.contactsPhone = selection[0].contactsPhone
+        this.adjust.address = selection[0].address
+      }
+      if(this.referCondition.type == 'DEPT_PARAM') {
+        this.deptOptions = selection
+        this.basicForm.demandDept = selection[0].id
+        this.basicForm.demandDeptName = selection[0].name
+      }
+      if(this.referCondition.title == '选择收货仓库') {
+        this.basicForm.puDemandItemList[this.tableIndex].deliveryWarehouse = selection[0].id
+        this.basicForm.puDemandItemList[this.tableIndex].deliveryWarehouseName = selection[0].name
+        this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocation = null
+        this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocationName = null
+      }
+      if(this.referCondition.title == '选择收货货位') {
+        this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocation = selection[0].id
+        this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocationName = selection[0].name
+      }
+      if(this.referCondition.title == '选择补单供应商') {
+        this.basicForm.puDemandItemList[this.tableIndex].additionalSupplier = selection[0].id
+        this.basicForm.puDemandItemList[this.tableIndex].additionalSupplierName = selection[0].name
+      }
+      if(this.referCondition.title == '选择收货地址') {
+        this.basicForm.puDemandItemList[this.tableIndex].deliveryAddressName = selection[0].name
+        this.basicForm.puDemandItemList[this.tableIndex].deliveryAddress = selection[0].code
+        this.basicForm.puDemandItemList[this.tableIndex].contacts = selection[0].contactsName
+        this.basicForm.puDemandItemList[this.tableIndex].contactsPhone = selection[0].contactsPhone
+        this.basicForm.puDemandItemList[this.tableIndex].address = selection[0].address
+      }
+    },
+    // 粘贴来的数据
+    async pasteMe(e, scope, index) {
+      this.$modal.loading("正在处理数据...");
+      e.preventDefault() //阻止默认粘贴事件
+      let source = e.clipboardData.getData("Text");
+      console.log('scope', scope.column.property)
+      // 首先对源头进行解析
+      let rows = source.split("\r\n"); // 拆成一个数组
+      // 数组去除空字符串
+      rows = rows.filter(item => {
+        return item && item.trim()
+      })
+
+      if (rows.length < 100) {
+        // 粘贴物料编码
+        if(scope.column.property == 'materialCode') {
+          await getRefer({ type: 'MATERIAL_PARAM', materialCodeList: rows }).then(res => {
+            this.$modal.closeLoading();
+            if (res.code === 200) {
+              let rowList = res.rows
+              let newLine = []
+              for (let i = 0; i<rowList.length; i++) {
+                let line = {...this.sonModel}
+                line.isUrgency = (this.basicForm.billType == 'JJXQ' ? 'Y' : 'N')
+                line.isReplenishment = (this.basicForm.billType == 'BDXQ' ? 'Y' : 'N')
+                line.demandCustomer = this.basicForm.customer
+                line.demandCustomerName = this.basicForm.customerName
+                line.materialCode = rowList[i].code
+                line.material = rowList[i].id
+                line.materialName = rowList[i].name
+                line.classifyId = rowList[i].classifyId
+                line.materialClassifyOneName = rowList[i].oneClass
+                line.materialClassifyTwoName = rowList[i].twoClass
+                line.materialClassifyThreeName = rowList[i].threeClass
+                line.materialClassifyFourName = rowList[i].fourClass
+                line.specification = rowList[i].specification
+                line.model = rowList[i].model
+                line.unit = rowList[i].unitId
+                line.unitName = rowList[i].unitIdName
+                line.registrant = rowList[i].registrant
+                line.manufacturerName = rowList[i].manufacturerIdName
+                line.puPeriod = rowList[i].deliveryPeriod
+                line.expiry = rowList[i].usefulLife
+                line.expiryUnit = rowList[i].expiryUnitIdName
+                // line.minPackage = rowList[i].usefulLife
+                line.minPackage = rowList[i].minPackQty
+                line.minOrderQty = rowList[i].minOrderQty
+                line.minBatch = rowList[i].minBatchQty
+                line.safeStock = rowList[i].safeStock
+                line.purOrgName = rowList[i].purchasingOrganizationName
+                line.puOrg = rowList[i].purchasingOrganization
+                // 物料存储条件和运输条件
+                line.transportationCondition = rowList[i].transportationCondition
+                line.storageCondition = rowList[i].storageCondition
+                newLine.push(line)
+                console.log('临时数组', newLine)
+              }
+              // 删除指定下标
+              this.basicForm.puDemandItemList.splice(index,this.basicForm.puDemandItemList.length - index,...newLine)
+              this.$modal.notifySuccess("共粘贴" + rowList.length + '条数据');
+            }
+          }).then(() => {
+            this.$refs.table.doLayout()
+          }).catch(err => {
+            this.$modal.closeLoading();
+          })
+        // 粘贴实际业务需求量
+        }else if(scope.column.property == 'qty') {
+          console.log('复制内容:', rows)
+          let newLine = []
+          if(this.basicForm.puDemandItemList.length <= 1) {
+            for (let i = 0; i<rows.length; i++) {
+              let line = {...this.sonModel}
+              line.isUrgency = (this.basicForm.billType == 'JJXQ' ? 'Y' : 'N')
+              line.isReplenishment = (this.basicForm.billType == 'BDXQ' ? 'Y' : 'N')
+              line.demandCustomer = this.basicForm.customer
+              line.demandCustomerName = this.basicForm.customerName
+              line.qty = rows[i]
+              newLine.push(line)
+            }
+            // 删除指定下标
+            this.basicForm.puDemandItemList.splice(index,this.basicForm.puDemandItemList.length - index,...newLine)
+            this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
+            this.$refs.table.doLayout()
+            this.$modal.closeLoading();
+          } else {
+            for(let i = index , j = 0; i < this.basicForm.puDemandItemList.length; i++, j++) {
+              this.basicForm.puDemandItemList[i].qty = rows[j]
+            }
+            this.$refs.table.doLayout()
+            this.$modal.closeLoading();
+          }
+        // 粘贴补单供应商
+        }else if(scope.column.property == 'additionalSupplierName') {
+          await getRefer({ type: 'SUPPLIER_PARAM', searchList: rows }).then(res => {
+            this.$modal.closeLoading();
+            if (res.code === 200) {
+              let rowList = res.rows
+              let newLine = []
+              for (let i = 0; i<rowList.length; i++) {
+                let line = {...this.sonModel}
+                line.isUrgency = (this.basicForm.billType == 'JJXQ' ? 'Y' : 'N')
+                line.isReplenishment = (this.basicForm.billType == 'BDXQ' ? 'Y' : 'N')
+                line.demandCustomer = this.basicForm.customer
+                line.demandCustomerName = this.basicForm.customerName
+                line.additionalSupplier = rowList[i].id
+                line.additionalSupplierName = rowList[i].name
+                newLine.push(line)
+                console.log('临时数组', newLine)
+              }
+              if(this.basicForm.puDemandItemList.length <= 1) {
+                // 删除指定下标
+                this.basicForm.puDemandItemList.splice(index,this.basicForm.puDemandItemList.length - index,...newLine)
+                this.$modal.notifySuccess("共粘贴" + rowList.length + '条数据');
+              } else {
+                for(let i = index , j = 0; i < this.basicForm.puDemandItemList.length; i++, j++) {
+                  this.basicForm.puDemandItemList[i].additionalSupplier = newLine[j].additionalSupplier
+                  this.basicForm.puDemandItemList[i].additionalSupplierName = newLine[j].additionalSupplierName
+                }
+                this.$refs.table.doLayout()
+                this.$modal.closeLoading();
+              }
+            }
+          }).then(() => {
+            this.$refs.table.doLayout()
+          }).catch(err => {
+            this.$modal.closeLoading();
+          })
+        }else if(scope.column.property == 'deliveryAddressName') {
+          await getRefer({ type: 'ADDRESS_PARAM', searchList: rows }).then(res => {
+           this.$modal.closeLoading();
+            if (res.code === 200) {
+              let rowList = res.rows
+              let newLine = []
+              for (let i = 0; i<rowList.length; i++) {
+                let line = {...this.sonModel}
+                line.isUrgency = (this.basicForm.billType == 'JJXQ' ? 'Y' : 'N')
+                line.isReplenishment = (this.basicForm.billType == 'BDXQ' ? 'Y' : 'N')
+                line.demandCustomer = this.basicForm.customer
+                line.demandCustomerName = this.basicForm.customerName
+                line.deliveryAddressName = rowList[i].name
+                line.deliveryAddress = rowList[i].code
+                line.contacts = rowList[i].contactsName
+                line.contactsPhone = rowList[i].contactsPhone
+                line.address = rowList[i].address
+                newLine.push(line)
+                console.log('临时数组', newLine)
+              }
+              if(this.basicForm.puDemandItemList.length <= 1) {
+                // 删除指定下标
+                this.basicForm.puDemandItemList.splice(index,this.basicForm.puDemandItemList.length - index,...newLine)
+                this.$modal.notifySuccess("共粘贴" + rowList.length + '条数据');
+              } else {
+                for(let i = index , j = 0; i < this.basicForm.puDemandItemList.length; i++, j++) {
+                  this.basicForm.puDemandItemList[i].deliveryAddressName = newLine[j].deliveryAddressName
+                  this.basicForm.puDemandItemList[i].deliveryAddress = newLine[j].deliveryAddress
+                  this.basicForm.puDemandItemList[i].contacts = newLine[j].contacts
+                  this.basicForm.puDemandItemList[i].contactsPhone = newLine[j].contactsPhone
+                  this.basicForm.puDemandItemList[i].address = newLine[j].address
+                }
+                this.$refs.table.doLayout()
+                this.$modal.closeLoading();
+              }
+            }
+          }).then(() => {
+            this.$refs.table.doLayout()
+          }).catch(err => {
+            this.$modal.closeLoading();
+          })
+        }
+
+      } else {
+        this.$modal.notifyWarning("复制长度不能超过100!");
+        this.$modal.closeLoading();
+      }
+    },
+    // 明细行选择物料编码带出数据
+    chooseMaterial(index) {
+      console.log("🚀 ~ file: add.vue:790 ~ chooseMaterial ~ index:", index)
+      this.tableIndex = index
+      // 传0只展示同步NC了的物料
+      this.$refs.materialRefer.init(0)
+    },
+    selectMaterial(selection) {
+      console.log('选中的物料', selection)
+      if (selection.length <= 1) {
+      // 选择新物料时先清空行内其他信息
+      this.basicForm.puDemandItemList[this.tableIndex].reservedProportion = null
+      this.basicForm.puDemandItemList[this.tableIndex].reservedPeriod = null
+      this.basicForm.puDemandItemList[this.tableIndex].reservedQty = null
+      this.basicForm.puDemandItemList[this.tableIndex].qty = null
+      this.basicForm.puDemandItemList[this.tableIndex].deliveryDate = null
+      this.basicForm.puDemandItemList[this.tableIndex].remark = null
+      this.basicForm.puDemandItemList[this.tableIndex].resDemandQty = null
+      this.basicForm.puDemandItemList[this.tableIndex].deliveryWarehouse = null
+      this.basicForm.puDemandItemList[this.tableIndex].deliveryWarehouseName = null
+      this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocation = null
+      this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocationName = null
+      this.basicForm.puDemandItemList[this.tableIndex].additionalSupplier = null
+      this.basicForm.puDemandItemList[this.tableIndex].additionalSupplierName = null
+      this.basicForm.puDemandItemList[this.tableIndex].periodUnit = null
+      this.basicForm.puDemandItemList[this.tableIndex].deliveryAddressName = null
+      this.basicForm.puDemandItemList[this.tableIndex].deliveryAddress = null
+      this.basicForm.puDemandItemList[this.tableIndex].contacts = null
+      this.basicForm.puDemandItemList[this.tableIndex].contactsPhone = null
+      this.basicForm.puDemandItemList[this.tableIndex].address = null
+      this.basicForm.puDemandItemList[this.tableIndex].priceType = 'order'
+      this.basicForm.puDemandItemList[this.tableIndex].lastWarehouseName = null
+      this.basicForm.puDemandItemList[this.tableIndex].lastWarehouse = null
+      this.basicForm.puDemandItemList[this.tableIndex].lastAllocation = null
+      this.basicForm.puDemandItemList[this.tableIndex].lastAllocationName = null
+      this.basicForm.puDemandItemList[this.tableIndex].materialClassifyOne = null
+      this.basicForm.puDemandItemList[this.tableIndex].materialClassifyTwo = null
+      this.basicForm.puDemandItemList[this.tableIndex].materialClassifyThree = null
+      this.basicForm.puDemandItemList[this.tableIndex].materialClassifyFour = null
+      this.basicForm.puDemandItemList[this.tableIndex].lastStockOrg = null
+      this.basicForm.puDemandItemList[this.tableIndex].lastStockOrgName = null
+      this.basicForm.puDemandItemList[this.tableIndex].buyer = null
+      this.basicForm.puDemandItemList[this.tableIndex].buyerName = null
+      // 通过选择物料查询采购员
+      queryMan(selection[0].id).then(res => {
+        if(res.code === 200 && res.rows.length !== 0) {
+          this.basicForm.puDemandItemList[this.tableIndex].buyer = res.rows[0].buyer
+          this.basicForm.puDemandItemList[this.tableIndex].buyerName = res.rows[0].buyerName
+        }
+      })
+      this.basicForm.puDemandItemList[this.tableIndex].materialCode = selection[0].code
+      this.basicForm.puDemandItemList[this.tableIndex].material = selection[0].id
+      this.basicForm.puDemandItemList[this.tableIndex].materialName = selection[0].name
+      this.basicForm.puDemandItemList[this.tableIndex].classifyId = selection[0].classifyId
+      this.basicForm.puDemandItemList[this.tableIndex].materialClassifyOneName = selection[0].oneClass
+      this.basicForm.puDemandItemList[this.tableIndex].materialClassifyTwoName = selection[0].twoClass
+      this.basicForm.puDemandItemList[this.tableIndex].materialClassifyThreeName = selection[0].threeClass
+      this.basicForm.puDemandItemList[this.tableIndex].materialClassifyFourName = selection[0].fourClass
+      this.basicForm.puDemandItemList[this.tableIndex].specification = selection[0].specification
+      this.basicForm.puDemandItemList[this.tableIndex].model = selection[0].model
+      this.basicForm.puDemandItemList[this.tableIndex].unit = selection[0].unitId
+      this.basicForm.puDemandItemList[this.tableIndex].unitName = selection[0].unitIdName
+      this.basicForm.puDemandItemList[this.tableIndex].registrant = selection[0].registrant
+      this.basicForm.puDemandItemList[this.tableIndex].manufacturerName = selection[0].manufacturerIdName
+      this.basicForm.puDemandItemList[this.tableIndex].puPeriod = selection[0].deliveryPeriod
+      this.basicForm.puDemandItemList[this.tableIndex].expiry = selection[0].usefulLife
+      this.basicForm.puDemandItemList[this.tableIndex].expiryUnit = selection[0].expiryUnitIdName
+      // this.basicForm.puDemandItemList[this.tableIndex].minPackage = selection[0].usefulLife
+      this.basicForm.puDemandItemList[this.tableIndex].minPackage = selection[0].minPackQty
+      this.basicForm.puDemandItemList[this.tableIndex].minOrderQty = selection[0].minOrderQty
+      this.basicForm.puDemandItemList[this.tableIndex].minBatch = selection[0].minBatchQty
+      this.basicForm.puDemandItemList[this.tableIndex].safeStock = selection[0].safeStock
+      this.basicForm.puDemandItemList[this.tableIndex].purOrgName = selection[0].purchasingOrganizationName
+      this.basicForm.puDemandItemList[this.tableIndex].puOrg = selection[0].purchasingOrganization
+      // 物料存储条件和运输条件
+      this.basicForm.puDemandItemList[this.tableIndex].transportationCondition = selection[0].transportationCondition
+      this.basicForm.puDemandItemList[this.tableIndex].storageCondition = selection[0].storageCondition
+      // 选中骨科耗材时候的物料,需求客户不必填
+      } else {
+        console.log('xxxxx', selection)
+        let newLine = []
+        for (let i = 0;i<selection.length;i++) {
+          let line = {...this.sonModel}
+          line.isUrgency = (this.basicForm.billType == 'JJXQ' ? 'Y' : 'N')
+          line.isReplenishment = (this.basicForm.billType == 'BDXQ' ? 'Y' : 'N')
+          line.demandCustomer = this.basicForm.customer
+          line.demandCustomerName = this.basicForm.customerName
+                // 通过选择物料查询采购员
+          queryMan(selection[i].id).then(res => {
+            if (res.code === 200 && res.rows.length !== 0) {
+              line.buyer = res.rows[0].buyer
+              line.buyerName = res.rows[0].buyerName
+            }
+          })
+          line.materialCode = selection[i].code
+          line.material = selection[i].id
+          line.materialName = selection[i].name
+          line.classifyId = selection[i].classifyId
+          line.materialClassifyOneName = selection[i].oneClass
+          line.materialClassifyTwoName = selection[i].twoClass
+          line.materialClassifyThreeName = selection[i].threeClass
+          line.materialClassifyFourName = selection[i].fourClass
+          line.specification = selection[i].specification
+          line.model = selection[i].model
+          line.unit = selection[i].unitId
+          line.unitName = selection[i].unitIdName
+          line.registrant = selection[i].registrant
+          line.manufacturerName = selection[i].manufacturerIdName
+          line.puPeriod = selection[i].deliveryPeriod
+          line.expiry = selection[i].usefulLife
+          line.expiryUnit = selection[i].expiryUnitIdName
+          // line.minPackage = selection[i].usefulLife
+          line.minPackage = selection[i].minPackQty
+          line.minOrderQty = selection[i].minOrderQty
+          line.minBatch = selection[i].minBatchQty
+          line.safeStock = selection[i].safeStock
+          line.purOrgName = selection[i].purchasingOrganizationName
+          line.puOrg = selection[i].purchasingOrganization
+          // 物料存储条件和运输条件
+          line.transportationCondition = selection[i].transportationCondition
+          line.storageCondition = selection[i].storageCondition
+          // this.basicForm.puDemandItemList.push(line)
+          newLine.push(line)
+        }
+        // 删除指定下标
+        this.basicForm.puDemandItemList.splice(this.tableIndex,1,...newLine)
+        // this.basicForm.puDemandItemList.splice(this.tableIndex,1)
+      }
+    },
+    // 明细行选择参照
+    chooseDept(index, type, isPage, title) {
+      this.tableIndex = index
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.refer.init(this.referCondition)
+    },
+    // 明细行选择仓库需要先确认采购组织
+    chooseCangKu(index, type, isPage, title, pkOrg) {
+      this.tableIndex = index
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      if(pkOrg) {
+        this.referCondition.pkOrg = pkOrg
+        this.$refs.refer.init(this.referCondition)
+      } else {
+        this.$modal.notifyWarning("请先确认默认采购组织");
+      }
+    },
+    // 明细行选择货位先确认仓库
+    choosehuoWei(index, type, isPage, title, stordocId) {
+      this.tableIndex = index
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      // 选择收货货位前先选择收货仓库
+      if(stordocId) {
+        this.referCondition.stordocId = stordocId
+        this.$refs.refer.init(this.referCondition)
+      } else {
+        this.$modal.notifyWarning("请先选择收货仓库");
+      }
+    },
+    // 明细行清空收货仓库,货位,收货地址档案等
+    clearHang(index, title) {
+      if (title == '选择收货仓库') {
+        this.basicForm.puDemandItemList[index].deliveryWarehouseName = null
+        this.basicForm.puDemandItemList[index].deliveryWarehouse = null
+        this.basicForm.puDemandItemList[index].deliveryAllocationName = null
+        this.basicForm.puDemandItemList[index].deliveryAllocation = null
+      }
+      if (title == '选择收货货位') {
+        this.basicForm.puDemandItemList[index].deliveryAllocationName = null
+        this.basicForm.puDemandItemList[index].deliveryAllocation = null
+      }
+      if (title == '选择收货地址') {
+        this.basicForm.puDemandItemList[index].deliveryAddressName = null
+        this.basicForm.puDemandItemList[index].deliveryAddress = null
+        this.basicForm.puDemandItemList[index].contacts = null
+        this.basicForm.puDemandItemList[index].contactsPhone = null
+        this.basicForm.puDemandItemList[index].address = null
+      }
+      if (title == '选择补单供应商') {
+        this.basicForm.puDemandItemList[index].additionalSupplierName = null
+        this.basicForm.puDemandItemList[index].additionalSupplier = null
+      }
+    },
+    // 清除需求客户将明细行内也清空
+    cleanCustomer() {
+      this.basicForm.customer = ''
+      this.basicForm.customerName = ''
+      this.basicForm.customerCode = ''
+      if (this.basicForm.puDemandItemList.length !== 0) {
+        this.basicForm.puDemandItemList.forEach(item => {
+          item.demandCustomerName = ''
+          item.demandCustomer = ''
+          item.status = ''
+          item.buyerName = ''
+          item.buyer = ''
+          item.reservedProportion = ''
+          item.reservedPeriod = ''
+          item.reservedQty = ''
+          item.averageQtyMonth = ''
+          item.demandPeriod = ''
+          item.forecastClassify = ''
+          item.onemonthAvgVolume = ''
+          item.threemonthAvgVolume = ''
+          item.puFreight = ''
+          item.superiorAllotQty = ''
+          item.resDemandQty = ''
+          item.executeQty = ''
+          item.deliveryWarehouseName = ''
+          item.deliveryWarehouse = ''
+          item.deliveryAllocationName = ''
+          item.deliveryAllocation = ''
+          item.lastWarehouseName = ''
+          item.lastAllocationName = ''
+          item.availableQty = ''
+          item.lastStockOrgName = ''
+          item.centralWarehouseQty = ''
+          item.allotCode = ''
+          item.deliveryAddress = ''
+          item.deliveryAddressName = ''
+          item.contacts = ''
+          item.contactsPhone = ''
+          item.address = ''
+        })
+      }
+    },
+    // 批量调整
+    adjustPl() {
+      if(this.ids.length == 0) {
+        this.$modal.notifyWarning('请至少选择一项数据进行操作!')
+      } else {
+        this.adjust.open = true
+      }
+    },
+    // 批量调整确认
+    confirmAdjust() {
+      console.log('data', this.adjust)
+      this.basicForm.puDemandItemList.forEach(item => {
+        this.ids.some(val => {
+          if(val == item.id) {
+            if(this.adjust.purchaseMan) {
+              item.buyer = this.adjust.purchaseMan
+              item.buyerName = this.adjust.purchaseManName
+            }
+            if(this.adjust.priceType) {
+              item.priceType = this.adjust.priceType
+            }
+            if(this.adjust.warehouseName) {
+              item.deliveryWarehouse = this.adjust.warehouse
+              item.deliveryWarehouseName = this.adjust.warehouseName
+              item.deliveryAllocation = this.adjust.allocation
+              item.deliveryAllocationName = this.adjust.allocationName
+            }
+            // if(this.adjust.allocationName) {
+            //   item.deliveryAllocation = this.adjust.allocation
+            //   item.deliveryAllocationName = this.adjust.allocationName
+            // }
+            if(this.adjust.remark) {
+              item.remark = this.adjust.remark
+            }
+            if(this.adjust.deliveryAddressName) {
+              item.deliveryAddressName = this.adjust.deliveryAddressName
+              item.deliveryAddress = this.adjust.deliveryAddress
+              item.contacts = this.adjust.contacts
+              item.contactsPhone = this.adjust.contactsPhone
+              item.address = this.adjust.address
+            }
+          }
+          this.adjust.open = false
+        })
+      })
+    },
+    // 批量调整选择货位
+    adjustHuoWei(type, isPage, title, stordocId) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      // 选择收货货位前先选择收货仓库
+      if (stordocId) {
+        this.referCondition.stordocId = stordocId
+        this.$refs.refer.init(this.referCondition)
+      } else {
+        this.$modal.notifyWarning("请先选择收货仓库");
+      }
+    },
+    // 关闭清空批量调整数据
+    closeEvent() {
+      this.adjust =  {
+        open: false,
+        priceType: '',
+        purchaseMan: '',
+        purchaseManName: '',
+        warehouse: '',
+        warehouseName: '',
+        allocation: '',
+        allocationName: '',
+        remark: '',
+        deliveryAddress: '',
+        deliveryAddressName: '',
+        contacts: '',
+        contactsPhone: '',
+        address: ''
+      }
+    },
+    // 必选标识
+    addRedStar(h, { column }) {
+      return [
+        h('span', { style: 'color: #F56C6C' }, '*'),
+        h('span', ' ' + column.label)
+      ];
+    },
+    // 表格表头标星
+    anotherRedStar(h, { column }) {
+      if(this.isBDXQ) {
+      return [
+        h('span', { style: 'color: #F56C6C' }, '*'),
+        h('span', ' ' + column.label)
+      ];
+      } else {
+       return [
+          h('span', ' ' + column.label)
+        ]; 
+      }
+    },
+    // 流程跳转
+    jumpOA() {
+      toOA(this.$store.state.user.name, this.basicForm.flowId).then(res => {
+        if(res.code === 200) {
+          window.open(res.oaUrl)
+        }
+      })
+    },
+    // 解决表格选中了又自动取消的问题
+    getRowKeys(row) {
+      return row.id
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.btn_group {
+  // width: 100%;
+  // margin: 20px 0;
+  display: flex;
+  justify-content: space-between;
+  position: absolute;
+  top: 10px;right: 20px;
+
+}
+.btn_grooup {
+  margin-bottom: 10px;
+  display: flex;
+  justify-content: space-between;
+}
+.hang {
+  margin: auto;
+}
+.hang ::v-deep .el-form-item__content{
+  margin-left: 0px !important;
+}
+// .el-table ::v-deep .el-form-item__error{
+//   padding-top: 0;
+//   top: 70%
+// }
+::v-deep .elx-body--row .success-row {
+  background-color: #f11616!important;
+}
+.pltzTxt{
+  text-align: right;
+  font-size: medium;
+  padding-right: 2%;
+}
+.pltzIpt{
+  width: 90%;
+}
+</style>

+ 22 - 24
src/views/purchase/apply/add/columns.js

@@ -8,7 +8,7 @@ export default function useColumns() {
       attr: { is: "el-input", disabled: true, readonly: true },
     },
     {
-      item: { key: "supplierName", title: "供应商", require: true },
+      item: { key: "supplierName", title: "供应商", required: true },
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -21,7 +21,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "puOrgName", title: "采购组织", require: true },
+      item: { key: "puOrgName", title: "采购组织", required: true },
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -30,7 +30,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "currencyName", title: "币种", require: true },
+      item: { key: "currencyName", title: "币种", required: true },
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -43,11 +43,11 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "explainStr", title: "价格合理性说明", require: true },
+      item: { key: "explainStr", title: "价格合理性说明", required: true },
       attr: { is: "el-input" },
     },
     {
-      item: { key: "buyerName", title: "采购员", require: true },
+      item: { key: "buyerName", title: "采购员", required: true },
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -56,7 +56,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "puDeptName", title: "采购部门", require: true },
+      item: { key: "puDeptName", title: "采购部门", required: true },
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -82,7 +82,7 @@ export default function useColumns() {
       attr: { is: "el-input", disabled: true, readonly: true },
     },
     {
-      item: { key: "file", title: "附件", require: true, span: 24 },
+      item: { key: "file", title: "附件", required: true, span: 24 },
       attr: { is: "el-file-upload" },
     },
     {
@@ -115,7 +115,7 @@ export default function useColumns() {
       },
       TableColumns: [
         {
-          item: { key: "materialName", title: "物料名称", require: true },
+          item: { key: "materialName", title: "物料名称", required: true },
           attr: {
             is: "el-popover-select-v2",
             checkbox: true,
@@ -136,7 +136,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "materialCode", title: "物料编码", require: true },
+          item: { key: "materialCode", title: "物料编码", required: true },
           attr: {},
         },
         { item: { key: "manufacturerName", title: "生产厂家" }, attr: {} },
@@ -165,7 +165,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "conversionRate", title: "采购换算率", require: true },
+          item: { key: "conversionRate", title: "采购换算率", required: true },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
@@ -174,7 +174,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "tax", title: "税率%", require: true },
+          item: { key: "tax", title: "税率%", required: true },
           attr: {
             is: "el-popover-select-v2",
             valueKey: "ntaxrate",
@@ -184,14 +184,14 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "taxPrice", title: "含税单价", require: true },
+          item: { key: "taxPrice", title: "含税单价", required: true },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
         },
         {
-          item: { key: "price", title: "无税单价", require: true },
+          item: { key: "price", title: "无税单价", required: true },
           attr: {
             formatter: (prop) => {
               const { tax = 0, taxPrice = 0 } = prop;
@@ -216,7 +216,7 @@ export default function useColumns() {
           item: {
             key: "periodBegin",
             title: "价格有效期(起)",
-            require: true,
+            required: true,
           },
           attr: {
             is: "el-date-picker",
@@ -225,7 +225,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "periodEnd", title: "价格有效期(止)", require: true },
+          item: { key: "periodEnd", title: "价格有效期(止)", required: true },
           attr: {
             is: "el-date-picker",
             valueFormat: "yyyy-MM-dd",
@@ -275,7 +275,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "priceType", title: "价格类型", require: true },
+          item: { key: "priceType", title: "价格类型", required: true },
           attr: {
             is: "el-select",
             dictName: "sys_price_type",
@@ -283,7 +283,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "isDistributionPrice", title: "配送价", require: true },
+          item: { key: "isDistributionPrice", title: "配送价", required: true },
           attr: {
             is: "el-select",
             dictName: "is_effective",
@@ -312,9 +312,8 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { taxPrice = 0, recentlyPrice = 0 } = prop;
-              return (prop.priceDiffer = (
-                Number(taxPrice) - Number(recentlyPrice)
-              ));
+              return (prop.priceDiffer =
+                Number(taxPrice) - Number(recentlyPrice));
             },
           },
         },
@@ -338,7 +337,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1);
+              return prop == null ? 0 : prop * 1;
             },
           },
         },
@@ -347,9 +346,8 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { priceDiffer = 0, yPurchaseQuantity = 0 } = prop;
-              return (prop.yAffectedAmount = (
-                Number(priceDiffer) * Number(yPurchaseQuantity)
-              ));
+              return (prop.yAffectedAmount =
+                Number(priceDiffer) * Number(yPurchaseQuantity));
             },
           },
         },

+ 18 - 19
src/views/purchase/apply/add/index.vue

@@ -136,24 +136,18 @@ export default {
     },
     //
     async onRowAdd(prop, pushParams = {}) {
-      const {
-        $notify,
-        TabColumns,
-        params: { puOrgName, supplierName },
-      } = this;
-      if (!supplierName) {
-        return $notify.info("请选择供应商");
-      }
-      if (!puOrgName) {
-        return $notify.info("请选择采购组织");
-      }
-      const { TableColumns } = TabColumns.find(
-        ({ item: { key } }) => key === prop
-      );
-      this.params[prop].push({
-        delFlag: "0",
-        ...this.$init.params(TableColumns),
-        ...pushParams,
+      this.$refs.superForm.validate(async (valid) => {
+        if (valid) {
+          const { TabColumns } = this;
+          const { TableColumns } = TabColumns.find(
+            ({ item: { key } }) => key === prop
+          );
+          this.params[prop].push({
+            delFlag: "0",
+            ...this.$init.params(TableColumns),
+            ...pushParams,
+          });
+        }
       });
     },
     //
@@ -257,12 +251,17 @@ export default {
               </template>
               <el-table-column fixed="right" label="操作" width="100">
                 <template slot="header" slot-scope="scope">
-                  <el-button :size="$attrs.size" @click="onRowAdd(tabName)">
+                  <el-button
+                    type="text"
+                    :size="$attrs.size"
+                    @click="onRowAdd(tabName)"
+                  >
                     新增
                   </el-button>
                 </template>
                 <template slot-scope="scope">
                   <el-button
+                    type="text"
                     :size="$attrs.size"
                     @click.native.prevent="onRowRemove(tabName, scope)"
                   >

+ 17 - 17
src/views/purchase/apply/copy/columns.js

@@ -8,7 +8,7 @@ export default function useColumns() {
       attr: { is: "el-input", disabled: true, readonly: true },
     },
     {
-      item: { key: "supplierName", title: "供应商", require: true },
+      item: { key: "supplierName", title: "供应商", required: true },
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -21,7 +21,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "puOrgName", title: "采购组织", require: true },
+      item: { key: "puOrgName", title: "采购组织", required: true },
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -30,7 +30,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "currencyName", title: "币种", require: true },
+      item: { key: "currencyName", title: "币种", required: true },
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -43,11 +43,11 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "explainStr", title: "价格合理性说明", require: true },
+      item: { key: "explainStr", title: "价格合理性说明", required: true },
       attr: { is: "el-input" },
     },
     {
-      item: { key: "buyerName", title: "采购员", require: true },
+      item: { key: "buyerName", title: "采购员", required: true },
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -56,7 +56,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "puDeptName", title: "采购部门", require: true },
+      item: { key: "puDeptName", title: "采购部门", required: true },
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -82,7 +82,7 @@ export default function useColumns() {
       attr: { is: "el-input", disabled: true, readonly: true },
     },
     {
-      item: { key: "file", title: "附件", require: true, span: 24 },
+      item: { key: "file", title: "附件", required: true, span: 24 },
       attr: { is: "el-file-upload" },
     },
     {
@@ -115,7 +115,7 @@ export default function useColumns() {
       },
       TableColumns: [
         {
-          item: { key: "materialName", title: "物料名称", require: true },
+          item: { key: "materialName", title: "物料名称", required: true },
           attr: {
             is: "el-popover-select-v2",
             checkbox: true,
@@ -136,7 +136,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "materialCode", title: "物料编码", require: true },
+          item: { key: "materialCode", title: "物料编码", required: true },
           attr: {},
         },
         { item: { key: "manufacturerName", title: "生产厂家" }, attr: {} },
@@ -165,7 +165,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "conversionRate", title: "采购换算率", require: true },
+          item: { key: "conversionRate", title: "采购换算率", required: true },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
@@ -174,7 +174,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "tax", title: "税率%", require: true },
+          item: { key: "tax", title: "税率%", required: true },
           attr: {
             is: "el-popover-select-v2",
             valueKey: "ntaxrate",
@@ -184,14 +184,14 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "taxPrice", title: "含税单价", require: true },
+          item: { key: "taxPrice", title: "含税单价", required: true },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
         },
         {
-          item: { key: "price", title: "无税单价", require: true },
+          item: { key: "price", title: "无税单价", required: true },
           attr: {
             formatter: (prop) => {
               const { tax = 0, taxPrice = 0 } = prop;
@@ -216,7 +216,7 @@ export default function useColumns() {
           item: {
             key: "periodBegin",
             title: "价格有效期(起)",
-            require: true,
+            required: true,
           },
           attr: {
             is: "el-date-picker",
@@ -225,7 +225,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "periodEnd", title: "价格有效期(止)", require: true },
+          item: { key: "periodEnd", title: "价格有效期(止)", required: true },
           attr: {
             is: "el-date-picker",
             valueFormat: "yyyy-MM-dd",
@@ -275,7 +275,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "priceType", title: "价格类型", require: true },
+          item: { key: "priceType", title: "价格类型", required: true },
           attr: {
             is: "el-select",
             dictName: "sys_price_type",
@@ -283,7 +283,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "isDistributionPrice", title: "配送价", require: true },
+          item: { key: "isDistributionPrice", title: "配送价", required: true },
           attr: {
             is: "el-select",
             dictName: "is_effective",

+ 14 - 18
src/views/purchase/apply/copy/index.vue

@@ -141,7 +141,9 @@ export default {
           this.params.priceApplyItems = data.priceApplyItems.map((item) => ({
             ...this.$init.params(TableColumns),
             ...item,
+            id: null,
           }));
+          this.params.id = null;
         } else {
           this.visible = false;
         }
@@ -184,24 +186,18 @@ export default {
     },
     //
     async onRowAdd(prop, pushParams = {}) {
-      const {
-        $notify,
-        TabColumns,
-        params: { puOrgName, supplierName },
-      } = this;
-      if (!supplierName) {
-        return $notify.info("请选择供应商");
-      }
-      if (!puOrgName) {
-        return $notify.info("请选择采购组织");
-      }
-      const { TableColumns } = TabColumns.find(
-        ({ item: { key } }) => key === prop
-      );
-      this.params[prop].push({
-        delFlag: "0",
-        ...this.$init.params(TableColumns),
-        ...pushParams,
+      this.$refs.superForm.validate(async (valid) => {
+        if (valid) {
+          const { TabColumns } = this;
+          const { TableColumns } = TabColumns.find(
+            ({ item: { key } }) => key === prop
+          );
+          this.params[prop].push({
+            delFlag: "0",
+            ...this.$init.params(TableColumns),
+            ...pushParams,
+          });
+        }
       });
     },
     //

+ 17 - 17
src/views/purchase/apply/edit/columns.js

@@ -8,7 +8,7 @@ export default function useColumns() {
       attr: { is: "el-input", disabled: true, readonly: true },
     },
     {
-      item: { key: "supplierName", title: "供应商", require: true },
+      item: { key: "supplierName", title: "供应商", required: true },
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -21,7 +21,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "puOrgName", title: "采购组织", require: true },
+      item: { key: "puOrgName", title: "采购组织", required: true },
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -30,7 +30,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "currencyName", title: "币种", require: true },
+      item: { key: "currencyName", title: "币种", required: true },
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -43,11 +43,11 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "explainStr", title: "价格合理性说明", require: true },
+      item: { key: "explainStr", title: "价格合理性说明", required: true },
       attr: { is: "el-input" },
     },
     {
-      item: { key: "buyerName", title: "采购员", require: true },
+      item: { key: "buyerName", title: "采购员", required: true },
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -56,7 +56,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "puDeptName", title: "采购部门", require: true },
+      item: { key: "puDeptName", title: "采购部门", required: true },
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -82,7 +82,7 @@ export default function useColumns() {
       attr: { is: "el-input", disabled: true, readonly: true },
     },
     {
-      item: { key: "file", title: "附件", require: true, span: 24 },
+      item: { key: "file", title: "附件", required: true, span: 24 },
       attr: { is: "el-file-upload" },
     },
     {
@@ -115,7 +115,7 @@ export default function useColumns() {
       },
       TableColumns: [
         {
-          item: { key: "materialName", title: "物料名称", require: true },
+          item: { key: "materialName", title: "物料名称", required: true },
           attr: {
             is: "el-popover-select-v2",
             checkbox: true,
@@ -136,7 +136,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "materialCode", title: "物料编码", require: true },
+          item: { key: "materialCode", title: "物料编码", required: true },
           attr: {},
         },
         { item: { key: "manufacturerName", title: "生产厂家" }, attr: {} },
@@ -165,7 +165,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "conversionRate", title: "采购换算率", require: true },
+          item: { key: "conversionRate", title: "采购换算率", required: true },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
@@ -174,7 +174,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "tax", title: "税率%", require: true },
+          item: { key: "tax", title: "税率%", required: true },
           attr: {
             is: "el-popover-select-v2",
             valueKey: "ntaxrate",
@@ -184,14 +184,14 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "taxPrice", title: "含税单价", require: true },
+          item: { key: "taxPrice", title: "含税单价", required: true },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
         },
         {
-          item: { key: "price", title: "无税单价", require: true },
+          item: { key: "price", title: "无税单价", required: true },
           attr: {
             formatter: (prop) => {
               const { tax = 0, taxPrice = 0 } = prop;
@@ -216,7 +216,7 @@ export default function useColumns() {
           item: {
             key: "periodBegin",
             title: "价格有效期(起)",
-            require: true,
+            required: true,
           },
           attr: {
             is: "el-date-picker",
@@ -225,7 +225,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "periodEnd", title: "价格有效期(止)", require: true },
+          item: { key: "periodEnd", title: "价格有效期(止)", required: true },
           attr: {
             is: "el-date-picker",
             valueFormat: "yyyy-MM-dd",
@@ -275,7 +275,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "priceType", title: "价格类型", require: true },
+          item: { key: "priceType", title: "价格类型", required: true },
           attr: {
             is: "el-select",
             dictName: "sys_price_type",
@@ -283,7 +283,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "isDistributionPrice", title: "配送价", require: true },
+          item: { key: "isDistributionPrice", title: "配送价", required: true },
           attr: {
             is: "el-select",
             dictName: "is_effective",

+ 12 - 18
src/views/purchase/apply/edit/index.vue

@@ -192,24 +192,18 @@ export default {
     },
     //
     async onRowAdd(prop, pushParams = {}) {
-      const {
-        $notify,
-        TabColumns,
-        params: { puOrgName, supplierName },
-      } = this;
-      if (!supplierName) {
-        return $notify.info("请选择供应商");
-      }
-      if (!puOrgName) {
-        return $notify.info("请选择采购组织");
-      }
-      const { TableColumns } = TabColumns.find(
-        ({ item: { key } }) => key === prop
-      );
-      this.params[prop].push({
-        delFlag: "0",
-        ...this.$init.params(TableColumns),
-        ...pushParams,
+      this.$refs.superForm.validate(async (valid) => {
+        if (valid) {
+          const { TabColumns } = this;
+          const { TableColumns } = TabColumns.find(
+            ({ item: { key } }) => key === prop
+          );
+          this.params[prop].push({
+            delFlag: "0",
+            ...this.$init.params(TableColumns),
+            ...pushParams,
+          });
+        }
       });
     },
     //

+ 31 - 13
src/views/purchase/catalogue/columns.js

@@ -42,12 +42,7 @@ export default function useColumns() {
     { item: { width: 100, key: "applyCode", title: "来源单据" }, attr: {} },
     {
       item: { width: 100, key: "convertRate", title: "换算率" },
-      attr: {
-        formatter: (prop) => {
-          const { convertRate = 0 } = prop;
-          return convertRate * 1;
-        },
-      },
+      attr: {},
     },
     {
       item: { width: 100, key: "status", title: "有效状态" },
@@ -72,10 +67,15 @@ export default function useColumns() {
     { item: { width: 100, key: "expiryEarly", title: "效期预警" }, attr: {} },
     { item: { width: 100, key: "priority", title: "含税/无税优先" }, attr: {} },
     { item: { width: 100, key: "createByName", title: "创建人" }, attr: {} },
+    { item: { width: 100, key: "createTime", title: "创建时间" }, attr: {} },
     {
       item: { width: 100, key: "updateByName", title: "更新人名称" },
       attr: {},
     },
+    {
+      item: { width: 100, key: "updateTime", title: "更新时间" },
+      attr: {},
+    },
   ].map(({ item, attr }) => ({
     attr,
     item: {
@@ -129,15 +129,11 @@ export default function useColumns() {
       attr: { is: "el-input" },
     },
     {
-      item: { width: 100, key: "materialCode", title: "物料编码" },
+      item: { width: 100, key: "materialCodeList", title: "物料编码" },
       attr: {
-        is: "el-popover-select-v2",
+        is: "el-popover-multiple-select-v2",
         referName: "MATERIAL_PARAM",
         valueKey: "code",
-        dataMapping: {
-          material: "id",
-          materialCode: "code",
-        },
       },
     },
     {
@@ -145,9 +141,31 @@ export default function useColumns() {
       attr: { is: "el-select", dictName: "is_effective" },
     },
     {
-      item: { width: 100, key: "enableStatus", title: "启用状态" },
+      item: { width: 100, key: "enableStatus", title: "启用状态", span: 4 },
       attr: { is: "el-select", dictName: "is_effective" },
     },
+    {
+      item: { width: 100, key: "createTime", title: "价格日期", span: 8 },
+      attr: {
+        is: "el-date-picker",
+        type: "datetimerange",
+        rangeSeparator: "至",
+        startPlaceholder: "开始日期",
+        endPlaceholder: "结束日期",
+        valueFormat: "yyyy-MM-dd hh:mm:ss",
+      },
+    },
+    {
+      item: { width: 100, key: "invalid", title: "价格失效日期", span: 8 },
+      attr: {
+        is: "el-date-picker",
+        type: "datetimerange",
+        rangeSeparator: "至",
+        startPlaceholder: "开始日期",
+        endPlaceholder: "结束日期",
+        valueFormat: "yyyy-MM-dd hh:mm:ss",
+      },
+    },
   ];
   return { TableColumns, SearchColumns };
 }

+ 20 - 3
src/views/purchase/catalogue/export/index.vue

@@ -10,12 +10,22 @@ export default {
   data() {
     return {};
   },
-  computed: {},
+  computed: {
+    disabled: {
+      get() {
+        const { selectData } = this.$props;
+        if (selectData.length < 1) {
+          return true;
+        }
+      },
+      set() {},
+    },
+  },
   watch: {},
   methods: {
     //
     open() {
-      this.$confirm("是否确认导出所有数据项?", "提示", {
+      this.$confirm("是否确认导出选中数据项?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "info",
@@ -56,5 +66,12 @@ export default {
 };
 </script>
 <template>
-  <el-button v-bind="$attrs" v-on="$listeners" @click="open"> 导 出 </el-button>
+  <el-button
+    v-bind="$attrs"
+    v-on="$listeners"
+    :disabled="disabled"
+    @click="open"
+  >
+    导 出
+  </el-button>
 </template>

+ 15 - 1
src/views/purchase/catalogue/index.vue

@@ -58,7 +58,21 @@ export default {
     },
     // 查 询
     useQuery(prop, page) {
-      this.fetchList(prop, page);
+      const { invalid, createTime } = prop;
+      const [invalidStart, invalidEnd] = invalid || [];
+      const [createTimeStart, createTimeEnd] = createTime || [];
+      this.fetchList(
+        {
+          ...prop,
+          invalidStart,
+          invalidEnd,
+          createTimeStart,
+          createTimeEnd,
+          invalid: null,
+          createTime: null,
+        },
+        page
+      );
     },
     // 重 置
     useReset() {

+ 0 - 7
src/views/purchase/contract/add/columns.js

@@ -203,13 +203,6 @@ export default function useColumns() {
         is: "el-date-picker",
         valueFormat: "yyyy-MM-dd",
         disabled: (prop) => !prop.effectiveDate,
-        pickerOptions: (prop) => {
-          return {
-            disabledDate(time) {
-              return time.getTime() < Date.now(prop.effectiveDate);
-            },
-          };
-        },
       },
     },
     {

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

@@ -71,6 +71,33 @@ export default {
       },
       immediate: true,
     },
+    "params.effectiveDate": {
+      handler: function (newValue) {
+        if (!newValue) {
+          this.params.endDate = null;
+        }
+        this.rules.endDate = [
+          {
+            validator: (rule, value, callback) => {
+              if (!newValue) {
+                callback(new Error("合同生效日期不能为空"));
+              } else if (!value) {
+                callback(new Error("合同失效日期不能为空"));
+              } else if (
+                new Date(value).getTime() <
+                new Date(newValue).getTime() + 24 * 1000 * 3600
+              ) {
+                callback(new Error("合同失效日期必须大于合同生效日期!"));
+              } else {
+                callback();
+              }
+            },
+            trigger: "change",
+          },
+        ];
+      },
+      immediate: true,
+    },
   },
   methods: {
     //

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

@@ -54,8 +54,8 @@ export default {
               const { msg, code } = await REMOVE(id);
               if (code === 200) {
                 done();
-                this.$emit("success");
                 this.$notify.success(msg);
+                this.$emit("submit-success");
               }
             } catch (err) {
               // catch

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

@@ -218,7 +218,7 @@ export default {
               params,
               params: { status },
             } = this;
-            const TASK = status === "2" ? EDIT : ALTERATION;
+            const TASK = status === "3" ? ALTERATION : EDIT;
             const { msg, code } = await TASK(params);
             if (code === 200) {
               this.hide();

+ 17 - 15
src/views/purchase/contract/index.vue

@@ -6,11 +6,10 @@ export default {
   name: "PuchaseContract",
   dicts: dicts,
   components: {
-    AddFormModel: () => import("./add/index.vue"),
-    EditFormModel: () => import("./edit/index.vue"),
-    SeeFormModel: () => import("./see/index.vue"),
-    SeeButton: () => import("./see/index.vue"),
-    DeleButton: () => import("./delete/index.vue"),
+    ElAddForm: () => import("./add/index.vue"),
+    ElEditForm: () => import("./edit/index.vue"),
+    ElSeeForm: () => import("./see/index.vue"),
+    ElDeleteButton: () => import("./delete/index.vue"),
     SubmButton: () => import("./submit/index.vue"),
     TermButton: () => import("./termination/index.vue"),
     PigeButton: () => import("./pigeonhole/index.vue"),
@@ -56,9 +55,6 @@ export default {
         if (selectData.length === 1 && status === "1") {
           return true;
         }
-        if (selectData.length === 1 && status === "3") {
-          return true;
-        }
       },
       set() {},
     },
@@ -116,25 +112,30 @@ export default {
       const { id } = prop;
       this.drawerVisible = true;
       this.components.title = id ? `明细-${id}` : "明细";
-      this.components.is = "SeeFormModel";
+      this.components.is = "ElSeeForm";
     },
     // 新 增
     useAdd() {
       this.drawerVisible = true;
       this.components.title = "新增";
-      this.components.is = "AddFormModel";
+      this.components.is = "ElAddForm";
     },
     // 期 初 补 录
     useReord() {
       this.drawerVisible = true;
       this.components.title = "期初补录";
-      this.components.is = "AddFormModel";
+      this.components.is = "ElAddForm";
     },
     // 编 辑
     useEdit() {
       this.drawerVisible = true;
       this.components.title = "编 辑";
-      this.components.is = "EditFormModel";
+      this.components.is = "ElEditForm";
+    },
+    // 删 除
+    useDelete() {
+      this.useQuery(this.params, this.page);
+      this.$refs.superTable.clearSelection();
     },
   },
 };
@@ -191,11 +192,11 @@ export default {
         <el-button :size="size" :disabled="EditDisabled" @click="useEdit">
           编辑
         </el-button>
-        <dele-button
+        <el-delete-button
           :size="size"
           :select-data="selectData"
-          @success="useQuery(params, page)"
-        ></dele-button>
+          @submit-success="useDelete"
+        ></el-delete-button>
       </el-button-group>
       <el-button-group>
         <subm-button
@@ -225,6 +226,7 @@ export default {
     </div>
     <el-super-table
       v-model="tableData"
+      ref="superTable"
       :size="size"
       :dict="dict"
       :page="page"

+ 80 - 80
src/views/purchase/purchase-order/column.js

@@ -137,13 +137,13 @@ export const TableColumns = [
       key: "money", 
       title: "价税合计",
       width:80,
-      // precision:2,
+      // 
     },
     attr:{
-      is: "el-computed-input-v2",
-      formatter: (prop) => {
-        return prop ? (prop * 1).toFixed(2) : prop;
-      },
+      // is: "el-computed-input-v2",
+      // formatter: (prop) => {
+      //   return prop ? (prop * 1).toFixed(2) : prop;
+      // },
       isHidden:true,
     },
  },
@@ -182,23 +182,23 @@ export const TableColumns = [
       key: "rebateMoney", 
       title: "订单使用返利金额" ,
       width:100,
-      // precision:2,
+      // 
     },
     attr:{
-      is: "el-computed-input-v2",
-          formatter: (prop) => {
-            return prop ? (prop * 1).toFixed(2) : prop;
-          },
+      // is: "el-computed-input-v2",
+          // formatter: (prop) => {
+          //   return prop ? (prop * 1).toFixed(2) : prop;
+          // },
       isHidden:true,
     },
   },
   { 
-    item:{key: "deductionMoney", title: "订单抵扣余款金额" ,precision:2,},
+    item:{key: "deductionMoney", title: "订单抵扣余款金额" ,},
     attr:{
-      is: "el-computed-input-v2",
-          formatter: (prop) => {
-            return prop ? (prop * 1).toFixed(2) : prop;
-          },
+      // is: "el-computed-input-v2",
+          // formatter: (prop) => {
+          //   return prop ? (prop * 1).toFixed(2) : prop;
+          // },
       isHidden:true,
      
     },
@@ -269,34 +269,34 @@ export const TableColumns = [
     },
   },
   { 
-    item:{ key: "applyPaymentMoney", title: "累计付款申请金额", precision:2,},
+    item:{ key: "applyPaymentMoney", title: "累计付款申请金额", },
     attr:{
-      is: "el-computed-input-v2",
-          formatter: (prop) => {
-            return prop ? (prop * 1).toFixed(2) : prop;
-          },
+      // is: "el-computed-input-v2",
+          // formatter: (prop) => {
+          //   return prop ? (prop * 1).toFixed(2) : prop;
+          // },
       isHidden:true,
     },
     width:100,
   },
   { 
-    item:{ key: "paymentMoney", title: "累计付款金额" ,precision:2,},
+    item:{ key: "paymentMoney", title: "累计付款金额" ,},
     attr:{
-      is: "el-computed-input-v2",
-          formatter: (prop) => {
-            return prop ? (prop * 1).toFixed(2) : prop;
-          },
+      // is: "el-computed-input-v2",
+      //     formatter: (prop) => {
+      //       return prop ? (prop * 1).toFixed(2) : prop;
+      //     },
       isHidden:true,
     },
     width:100,
   },
   { 
-    item:{ key: "invoiceMoney", title: "发票金额" ,precision:2,},
+    item:{ key: "invoiceMoney", title: "发票金额" ,},
     attr:{
-      is: "el-computed-input-v2",
-          formatter: (prop) => {
-            return prop ? (prop * 1).toFixed(2) : prop;
-          },
+      // is: "el-computed-input-v2",
+          // formatter: (prop) => {
+          //   return prop ? (prop * 1).toFixed(2) : prop;
+          // },
       isHidden:true,
     },
     width:100,
@@ -585,7 +585,7 @@ export const TabColumns = [
         },
       },
       { 
-        item:{key: "qty", title: "数量",width:80, },
+        item:{key: "qty", title: "数量",width:120, },
         attr:{
           isHidden:true,
         },
@@ -598,84 +598,84 @@ export const TabColumns = [
        
       },
       { 
-        item:{key: "taxPrice", title: "含税单价" ,width:80,precision:2,},
+        item:{key: "taxPrice", title: "含税单价" ,width:120,},
         attr:{
-          is: "el-computed-input-v2",
-          formatter: (prop) => {
-            return prop ? (prop * 1).toFixed(2) : prop;
-          },
+          // is: "el-computed-input-v2",
+          // formatter: (prop) => {
+          //   return prop ? (prop * 1).toFixed(2) : prop;
+          // },
         },
       },
       { 
-        item:{key: "money", title: "价税合计" ,width:80, precision:2,},
+        item:{key: "money", title: "价税合计" ,width:120, },
         attr:{
-          is: "el-computed-input-v2",
-          formatter: (prop) => {
-            return prop ? (prop * 1).toFixed(2) : prop;
-          },
+          // is: "el-computed-input-v2",
+          // formatter: (prop) => {
+          //   return prop ? (prop * 1).toFixed(2) : prop;
+          // },
         },
       },
       { 
-        item:{key: "tax", title: "税率" ,width:80, precision:2,},
+        item:{key: "tax", title: "税率" ,width:120, },
         attr:{
-          is: "el-computed-input-v2",
-          formatter: (prop) => {
-            return prop ? (prop * 1).toFixed(2) : prop;
-          },
+          // is: "el-computed-input-v2",
+          // formatter: (prop) => {
+          //   return prop ? (prop * 1).toFixed(2) : prop;
+          // },
         },
       },
       { 
-        item:{key: "taxDeductMoneya", title: "折扣金额", width:80, precision:2, },
+        item:{key: "taxDeductMoneya", title: "折扣金额", width:80,  },
         attr:{
-          is: "el-computed-input-v2",
-          formatter: (prop) => {
-            return prop ? (prop * 1).toFixed(2) : prop;
-          },
+          // is: "el-computed-input-v2",
+          // formatter: (prop) => {
+          //   return prop ? (prop * 1).toFixed(2) : prop;
+          // },
         },
       },
       { 
         item:{key: "arrivalQty", title: "已到货数量" , width:80,},
         attr:{
-          is: "el-computed-input-v2",
-          formatter: (prop) => {
-            return prop ? (prop * 1).toFixed(2) : prop;
-          },
+          // is: "el-computed-input-v2",
+          // formatter: (prop) => {
+          //   return prop ? (prop * 1).toFixed(2) : prop;
+          // },
         },
       },
       { 
         item:{key: "unarrivedQty", title: "未到货数量" , width:80,},
         attr:{
-          is: "el-computed-input-v2",
-          formatter: (prop) => {
-            return prop ? (prop * 1).toFixed(2) : prop;
-          },
+          // is: "el-computed-input-v2",
+          // formatter: (prop) => {
+          //   return prop ? (prop * 1).toFixed(2) : prop;
+          // },
         },
       },
       { 
-        item:{key: "price", title: "无税单价" , idth:80, precision:2,},
+        item:{key: "price", title: "无税单价" , width:120, },
         attr:{
-          is: "el-computed-input-v2",
-          formatter: (prop) => {
-            return prop ? (prop * 1).toFixed(2) : prop;
-          },
+          // is: "el-computed-input-v2",
+          // formatter: (prop) => {
+          //   return prop ? (prop * 1).toFixed(2) : prop;
+          // },
         },
       },
       { 
-        item:{key: "notaxMoney", title: "无税金额" , width:80, precision:2,},
+        item:{key: "notaxMoney", title: "无税金额" , width:120, },
         attr:{
-          is: "el-computed-input-v2",
-          formatter: (prop) => {
-            return prop ? (prop * 1).toFixed(2) : prop;
-          },
+          // is: "el-computed-input-v2",
+          // formatter: (prop) => {
+          //   return prop ? (prop * 1).toFixed(2) : prop;
+          // },
         },
       },
-      { 
-        item:{key: "priceSource", title: "价格目录ID", width:10, },
-        attr:{
-          isHidden:true,
-        },
+      // { 
+      //   item:{key: "priceSource", title: "价格目录ID", width:10, },
+      //   attr:{
+      //     isHidden:true,
+      //   },
        
-      },
+      // },
       {
         item:{
           key: "isStorage",
@@ -889,10 +889,10 @@ export const TabColumns = [
           width:80,
         },
         attr:{
-          is: "el-computed-input-v2",
-          formatter: (prop) => {
-            return prop ? (prop * 1).toFixed(2) : prop;
-          },
+          // is: "el-computed-input-v2",
+          // formatter: (prop) => {
+          //   return prop ? (prop * 1).toFixed(2) : prop;
+          // },
         },
       },
       { 
@@ -1268,7 +1268,7 @@ export const SearchColumns = [
   { 
     item:{
       key: "erpOrderCode",
-      title: "NC订单号", 
+      title: "erp订单号", 
     },
     attr: {
       clearable:true,

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

@@ -96,6 +96,23 @@ export default {
         }
       }
     },
+    async jumpFlow(row){
+      const {name} = this.$store.state.user;
+
+      try {
+
+        let {code,msg,oaUrl} = await orderApi.toOA(name,row.flowId);
+
+        if(code == 200){
+          window.open(oaUrl)
+        }
+        
+      } catch (error) {
+        
+      }finally{
+
+      }
+    },
     setSelectable(){
       return true
     },
@@ -115,8 +132,6 @@ export default {
       this.page.pageNum = 1;
 
       this.page.pageSize = 10;
-      console.log(this,'this-------------------');
-
       this.$refs.purchaseTable.$refs.superTable.clearSelection();
 
       for (const key in this.tabTableDatas) {
@@ -687,6 +702,12 @@ export default {
                 v-hasPermi="['material:order:toOa']" 
                 @click.stop="handleSubmit(scope.row)"
               >提交</el-button>
+              <el-button 
+                v-if="scope.row.flowId && scope.row.flowId !== ''" 
+                type="text" 
+                size="mini"
+                @click.stop="jumpFlow(scope.row)"
+              >流程跳转</el-button>
             </template>
         </el-table-column>
       

+ 20 - 0
src/views/purchase/task/xie-yi-zhi-cai/column.js

@@ -99,3 +99,23 @@ export const TableColumns = [
     },
   },
 ];
+
+export const BasicColumns = [
+  {
+    item: { key: "materialCode", title: "物料编码" },
+    attr: {},
+  },
+  {
+    item: { key: "materialName", title: "物料名称" },
+    attr: {},
+  },
+  {
+    item: { key: "manufacturerName", title: "生产厂商" },
+    attr: {},
+  },
+  {
+    item: { key: "customerName", title: "需求客户" },
+    attr: {},
+  },
+ 
+]

+ 28 - 9
src/views/purchase/task/xie-yi-zhi-cai/index.vue

@@ -1,5 +1,5 @@
 <script>
-import { TableColumns } from "./column";
+import { TableColumns ,BasicColumns} from "./column";
 import { initDicts } from "@/utils/init.js";
 import { FIRSTDIRECT, ADD } from "@/api/business/purchase/task";
 export default {
@@ -24,6 +24,7 @@ export default {
       visible: false,
       loading: false,
       tableColumns: TableColumns,
+      basicColumns:BasicColumns,
       data: [],
     };
   },
@@ -137,14 +138,32 @@ export default {
         
       </template>
       <div v-for="(item, index) in data" :key="index" class="m-4">
-        <h3 class="mb-4">
-          <span style="margin-right: 10px">{{ item.materialName }}</span>
-          <span style="color: tomato">{{ item.puQty }}</span>
-          (<span style="color: tomato">{{
-            item.puQty - (item.executeQty || 0)
-          }}</span
-          >) <span> {{ item.puUnitName }}</span>
-        </h3>
+        
+        <el-descriptions>
+          <template slot="title" >
+            <template>
+              <span style="margin-right: 10px">{{ item.materialName }}</span>
+              <span style="color: tomato">{{ item.puQty }}</span>
+              (<span style="color: tomato">{{
+                item.puQty - (item.executeQty || 0)
+              }}</span
+              >) <span> {{ item.puUnitName }}</span>
+            </template>
+          </template>
+
+          <el-descriptions-item 
+            v-for="(basic,bIndex) in basicColumns"
+            :key="bIndex"
+            :label="basic.item.title"
+          >{{ item[basic.item.key] }}
+          </el-descriptions-item>
+          <el-descriptions-item 
+            label="需求数量"
+          >{{ item.puQty - (item.executeQty || 0) }}
+          </el-descriptions-item>
+          
+        </el-descriptions>
+
         <el-super-table
           v-model="item.orderPriceVos"
           :columns="tableColumns"