Explorar o código

Merge branch 'purchaseDev' into 'dev'

Purchase dev

See merge request new-business/drp-web!277
黄梓星 hai 1 ano
pai
achega
a73b34ac30

+ 3 - 1
src/views/purchase/PurchaseDemandList/add.vue

@@ -1735,7 +1735,9 @@ export default {
     },
     jumpOA() {
       toOA(this.$store.state.user.name, this.basicForm.flowId).then(res => {
-
+        if(res.code === 200) {
+          window.open(res.oaUrl)
+        }
       })
     }
   }

+ 12 - 9
src/views/purchase/purchase-order/index.vue

@@ -598,16 +598,17 @@ export default {
     </el-row>
 
     <el-super-table
+      class="purchaseTable"
       v-model="tableData"
       ref="purchaseTable"
-      max-height="480"
       :dict="dict"
       :columns="tableColumns"
       :selectable="setSelectable"
+      index
       checkbox
       pagination
       :page="page"
-      :iconOperation="false"
+      convenitentOperation
       @pagination="fetchList(params, page)"
       @row-dblclick="handleOpenSeeDrawer" 
       @row-click="handleDetailsData" 
@@ -677,17 +678,11 @@ export default {
             :columns="column.tableColumns"
             :selectable="setTabSelectable"
             :checkbox="setTabSelectable()"
-            :iconOperation="false"
+            convenitentOperation
             @select="handleTabSelect"
             @selection-change="handleTabSelectionChange"
 
           >
-            <!-- <el-table-column
-              v-if=" tabName === 'puOrderItemList'" 
-              type="selection" 
-              width="45"
-            ></el-table-column> -->
-            <!-- <el-table-column type="index" width="50" label="序号"></el-table-column> -->
           </el-super-table>
          
         </el-tab-pane>
@@ -697,3 +692,11 @@ export default {
     </div>
   </el-card>
 </template>
+
+<style lang="scss">
+.purchaseTable{
+  .el-table__body-wrapper{
+    height: 480px;
+  }
+}
+</style>

+ 140 - 274
src/views/purchase/transferOrder/add.vue

@@ -1,73 +1,40 @@
 <template>
   <div id="addOder">
-    <el-card style="position: relative;">
+    <el-card style="position: relative">
       <span>基本信息</span>
-      <el-form
-        :model="basicForm"
-        :rules="basicRules"
-        ref="basic"
-        label-width="auto"
-      >
+      <el-form :model="basicForm" :rules="basicRules" ref="basic" label-width="auto">
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="调出库存组织">
-              <el-select
-                clearable
-                size="mini"
-                v-model="basicForm.deliveryInventoryOrg"
-                :disabled="sonDisable"
+              <el-select clearable :disabled="sonDisable" size="mini" v-model="basicForm.deliveryInventoryOrg" 
                 @clear="clean('调出库存组织')"
                 @change="controlCk('调出库存组织')"
                 @focus="chooseRefer('ORG_PARAM', true, '调出库存组织')"
                 style="width: 200px"
               >
-                <el-option
-                  v-for="item in chuOrgOptions"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                />
+                <el-option v-for="item in chuOrgOptions" :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
-                v-model="basicForm.billType"
-                :disabled="sonDisable"
-                size="mini"
-                style="width: 200px"
-                clearable
-              >
-                <el-option
-                  v-for="dict in dict.type.sys_allot_billtype"
-                  :key="dict.value"
-                  :label="dict.label"
-                  :value="dict.value"
-                >
+              <el-select clearable v-model="basicForm.billType" :disabled="sonDisable" size="mini" style="width: 200px">
+                <el-option v-for="dict in dict.type.sys_allot_billtype" :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-input
-                v-model="basicForm.code"
-                size="mini"
-                :disabled="sonDisable"
-                clearable
-                style="width: 200px"
-              />
+              <el-input clearable :disabled="sonDisable" v-model="basicForm.code" size="mini" style="width: 200px"/>
             </el-form-item>
           </el-col>
+
           <el-col :span="1.5">
             <el-form-item label="单据日期">
-              <el-date-picker
-                v-model="basicForm.billDate"
-                size="mini"
-                :disabled="sonDisable"
-                type="date"
-                clearable
+              <el-date-picker clearable :disabled="sonDisable" v-model="basicForm.billDate" size="mini" type="date"
                 @change="changeBillDate"
                 value-format="yyyy-MM-dd"
                 style="width: 200px"
@@ -75,25 +42,16 @@
               </el-date-picker>
             </el-form-item>
           </el-col>
+
           <el-col :span="1.5">
             <el-form-item label="调拨方式">
-              <el-select
-                v-model="basicForm.allotType"
-                disabled
-                size="mini"
-                style="width: 200px"
-                clearable
-              >
-                <el-option
-                  v-for="dict in dict.type.sys_to_type"
-                  :key="dict.value"
-                  :label="dict.label"
-                  :value="dict.value"
-                >
+              <el-select clearable disabled v-model="basicForm.allotType" size="mini" style="width: 200px">
+                <el-option v-for="dict in dict.type.sys_to_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="调拨出库单号">
               <el-input
@@ -105,6 +63,7 @@
               />
             </el-form-item>
           </el-col>
+
           <el-col :span="1.5">
             <el-form-item label="调拨入库单号">
               <el-input
@@ -116,228 +75,130 @@
               />
             </el-form-item>
           </el-col>
+
           <el-col :span="1.5">
             <el-form-item label="调入库存组织">
-              <el-select
-                clearable
-                size="mini"
-                v-model="basicForm.storageInventoryOrg"
-                :disabled="sonDisable"
+              <el-select clearable :disabled="sonDisable" size="mini" v-model="basicForm.storageInventoryOrg"
                 @clear="clean('调入库存组织')"
                 @change="controlCk('调入库存组织')"
                 @focus="chooseRefer('ORG_PARAM', true, '调入库存组织')"
                 style="width: 200px"
               >
-                <el-option
-                  v-for="item in ruOrgOptions"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                />
+                <el-option v-for="item in ruOrgOptions" :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
+              <el-select clearable :disabled="sonDisable"
                 size="mini"
                 v-model="basicForm.businessPersonal"
-                :disabled="sonDisable"
                 @clear="clean('调出业务员')"
                 @focus="chooseRefer('CONTACTS_PARAM', true, '调出业务员')"
                 style="width: 200px"
               >
-                <el-option
-                  v-for="item in manOptions"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.code"
-                />
+                <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
-                clearable
+              <el-select clearable :disabled="sonDisable || isOrg"
                 size="mini"
                 v-model="basicForm.deliveryDept"
-                :disabled="sonDisable || isOrg"
-                @focus="
-                  chooseRefer(
-                    'DEPT_PARAM',
-                    true,
-                    '调出部门',
-                    basicForm.deliveryInventoryOrg
-                  )
-                "
+                @focus="chooseRefer('DEPT_PARAM', true, '调出部门', basicForm.deliveryInventoryOrg)"
                 style="width: 200px"
               >
-                <el-option
-                  v-for="item in deptOptions"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                />
+                <el-option v-for="item in deptOptions" :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
+              <el-select clearable :disabled="sonDisable"
                 size="mini"
                 v-model="basicForm.currency"
-                :disabled="sonDisable"
                 @focus="chooseRefer('CURRENCY_PARAM', true, '币种')"
                 style="width: 200px"
               >
-                <el-option
-                  v-for="item in currencyOptions"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                />
+                <el-option v-for="item in currencyOptions" :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-input-number
-                v-model="basicForm.rate"
-                size="mini"
-                disabled
-                :precision="2"
-                :step="0.1"
-                :max="10"
-                style="width: 200px"
-              ></el-input-number>
+                v-model="basicForm.rate" size="mini" disabled :precision="2" :step="0.1" :max="10" style="width: 200px"></el-input-number>
             </el-form-item>
           </el-col>
+
           <el-col :span="1.5">
             <el-form-item label="在途归属">
-              <el-input
-                v-model="basicForm.onRouteAffilliation"
-                size="mini"
-                disabled
-                clearable
-                style="width: 200px"
-              />
+              <el-input clearable disabled v-model="basicForm.onRouteAffilliation" size="mini" style="width: 200px"/>
             </el-form-item>
           </el-col>
+
           <el-col :span="1.5">
             <el-form-item label="总数量">
-              <el-input
-                v-model="basicForm.qty"
-                type="number"
-                min="0"
-                size="mini"
-                :disabled="sonDisable"
-                clearable
-                style="width: 200px"
-              />
+              <el-input clearable :disabled="sonDisable" v-model="basicForm.qty" type="number" min="0" size="mini" style="width: 200px"/>
             </el-form-item>
           </el-col>
+
           <el-col :span="1.5">
             <el-form-item label="结算路径">
-              <el-input
-                v-model="basicForm.accountPath"
-                size="mini"
-                :disabled="sonDisable"
-                clearable
-                style="width: 200px"
-              />
+              <el-input clearable :disabled="sonDisable" v-model="basicForm.accountPath" size="mini" style="width: 200px"/>
             </el-form-item>
           </el-col>
+
           <el-col :span="1.5">
             <el-form-item label="客户">
-              <el-select
-                clearable
+              <el-select clearable :disabled="sonDisable"
                 size="mini"
-                :disabled="sonDisable"
                 v-model="basicForm.customer"
                 @clear="clean('客户')"
                 @focus="chooseRefer('CUSTOMER_PARAM', true, '客户')"
                 style="width: 200px"
               >
                 <!-- @change="controlDRHW"  -->
-                <el-option
-                  v-for="item in customerOptions"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                />
+                <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id"/>
               </el-select>
-              <!-- <el-input
-                  v-model="basicForm.customer"
-                  size="mini"
-                  :disabled="sonDisable"
-                  clearable
-                  style="width: 200px"
-                /> -->
             </el-form-item>
           </el-col>
+
           <el-col :span="1.5">
             <el-form-item label="调入仓库">
-              <el-select
-                clearable
+              <el-select clearable :disabled="sonDisable || isOrg"
                 size="mini"
                 v-model="basicForm.storageWarehouse"
-                :disabled="sonDisable || isOrg"
                 @clear="clean('调入仓库')"
                 @change="controlDRHW"
-                @focus="
-                  chooseRefer(
-                    'WAREHOUSE_PARAM',
-                    true,
-                    '调入仓库',
-                    basicForm.storageInventoryOrg,
-                    'N',
-                    'N'
-                  )
-                "
+                @focus="chooseRefer('WAREHOUSE_PARAM', true, '调入仓库', basicForm.storageInventoryOrg, 'N', 'N')"
                 style="width: 200px"
               >
-                <el-option
-                  v-for="item in ruHouseOptions"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                />
+                <el-option v-for="item in ruHouseOptions" :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
+              <el-select clearable :disabled="sonDisable || isOrg"
                 size="mini"
                 v-model="basicForm.deliveryWarehouse"
-                :disabled="sonDisable || isOrg"
                 @clear="clean('调出仓库')"
                 @change="controlDCHW"
-                @focus="
-                  chooseRefer(
-                    'WAREHOUSE_PARAM',
-                    true,
-                    '调出仓库',
-                    basicForm.deliveryInventoryOrg,
-                    'N',
-                    'N'
-                  )
-                "
+                @focus="chooseRefer('WAREHOUSE_PARAM', true, '调出仓库', basicForm.deliveryInventoryOrg, 'N', 'N')"
                 style="width: 200px"
               >
-                <el-option
-                  v-for="item in chuHouseOptions"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                />
+                <el-option v-for="item in chuHouseOptions" :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
@@ -1491,55 +1352,53 @@
       </el-form>
 
       <div class="btn_group">
-        <el-col :span="1.5">
-          <el-button
-            style="margin-right: 10px"
-            type="primary"
-            size="mini"
-            plain
-            @click="copy"
-            v-if="sonPageStu == 'check'"
-            >复制</el-button
-          >
-        </el-col>
-        <el-col :span="1.5">
-          <el-button
-            style="margin-right: 10px"
-            type="danger"
-            size="mini"
-            plain
-            @click="toNC"
-            v-if="sonPageStu == 'check' && row.status == '2'"
-            >重传NC</el-button
-          >
-        </el-col>
-        <el-col :span="1.5">
-          <el-button
-            style="margin-right: 10px"
-            type="primary"
-            size="mini"
-            plain
-            @click="save"
-            v-if="sonPageStu == 'add' || sonPageStu == 'edit'"
-            >保存</el-button
-          >
-        </el-col>
-        <el-col :span="1.5">
-          <el-button
-            style="margin-right: 10px"
-            type="primary"
-            size="mini"
-            plain
-            @click="submit"
-            v-if="
-              sonPageStu == 'check' && (row.status == '0' || row.status == '3')
-            "
-            >提交</el-button
-          >
-        </el-col>
-        <el-col :span="1.5">
-          <el-button size="mini" plain @click="back">返回</el-button>
-        </el-col>
+        <el-button
+          type="primary"
+          size="mini"
+          plain
+          @click="jumpOA"
+          v-if="
+            sonPageStu == 'check' &&
+            (row.status == '1' || row.status == '2') &&
+            row.oaId
+          "
+          >跳转OA</el-button
+        >
+        <el-button
+          type="primary"
+          size="mini"
+          plain
+          @click="copy"
+          v-if="sonPageStu == 'check'"
+          >复制</el-button
+        >
+        <el-button
+          type="danger"
+          size="mini"
+          plain
+          @click="toNC"
+          v-if="sonPageStu == 'check' && row.status == '2'"
+          >重传NC</el-button
+        >
+        <el-button
+          type="primary"
+          size="mini"
+          plain
+          @click="save"
+          v-if="sonPageStu == 'add' || sonPageStu == 'edit'"
+          >保存</el-button
+        >
+        <el-button
+          type="primary"
+          size="mini"
+          plain
+          @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>
 
@@ -1551,6 +1410,7 @@
 </template>
 
 <script>
+import { toOA } from "@/api/purchase/purchaseDemand.js";
 import {
   addOrder,
   getOrderDetail,
@@ -1692,8 +1552,8 @@ export default {
       this.getDetails(this.row);
     } else if (this.pageStu == "edit") {
       this.getDetails(this.row);
-      this.isDRCk = false
-      this.isDCCk = false
+      this.isDRCk = false;
+      this.isDCCk = false;
     }
   },
   methods: {
@@ -1705,8 +1565,11 @@ export default {
     },
     // 控制先选调出库存组织和调入库存组织再选调出部门和调入调出仓库
     controlCk(val) {
-      console.log("进了吗");
-      if (this.basicForm.deliveryInventoryOrg && this.basicForm.storageInventoryOrg){
+      if (val = '调出库存组织') {console.log("进了吗");}
+      if (
+        this.basicForm.deliveryInventoryOrg &&
+        this.basicForm.storageInventoryOrg
+      ) {
         this.isOrg = false;
       } else {
         this.basicForm.deliveryDept = "";
@@ -1757,25 +1620,20 @@ export default {
       this.basicForm.updateBy = "";
       this.basicForm.updateByName = "";
       this.basicForm.updateTime = "";
-      this.isDRCk = false
-      this.isDCCk = false
-    },
-    handleData() {
-      console.log("222");
+      this.basicForm.storageCode = "";
+      this.basicForm.deliveryCode = "";
       // 复制新增把id,编码,创建人置为空,子表去掉id
-      this.basicForm.id = "";
-      this.basicForm.code = "";
-      this.basicForm.createBy = "";
-      this.basicForm.createByName = "";
-      this.basicForm.createTime = "";
-      this.basicForm.isSendWms = "";
-      this.basicForm.ncCode = "";
-      this.basicForm.oaId = "";
-      this.basicForm.updateBy = "";
-      this.basicForm.updateByName = "";
-      this.basicForm.updateTime = "";
       if (this.materialInfo.length !== 0) {
         this.materialInfo.forEach((item) => {
+          if (item.deliveryCode) {
+            item.deliveryCode = "";
+          }
+          if (item.storageCode) {
+            item.storageCode = "";
+          }
+          if (item.demandCode) {
+            item.demandCode = "";
+          }
           if (item.allotId) {
             delete item.allotId;
           }
@@ -1794,6 +1652,8 @@ export default {
           }
         });
       }
+      this.isDRCk = false;
+      this.isDCCk = false;
     },
     toNC() {
       againToNC(this.row)
@@ -1825,7 +1685,6 @@ export default {
     save() {
       if (this.materialInfo.length !== 0) {
         if (this.sonPageStu == "add") {
-          this.handleData();
           this.basicForm.stAllotMaterialList = this.materialInfo;
           this.basicForm.stAllotReceiveDeliverList = this.receiveInfo;
           this.basicForm.stAllotReceiveExecuteList = this.priceList;
@@ -1901,7 +1760,7 @@ export default {
           if (this.basicForm.deliveryDept) {
             this.reBackRefer("DEPT_PARAM", this.basicForm.deliveryDept);
           }
-          
+
           if (this.basicForm.currency) {
             this.reBackRefer("CURRENCY_PARAM", this.basicForm.currency);
           }
@@ -1934,7 +1793,6 @@ export default {
     },
     // 回显参照框
     reBackRefer(type, id, title) {
-      console.log(type, id, title,'回显参照框');
       getRefer({ type: type, id: id, title: title }).then((res) => {
         if (type == "ORG_PARAM" && title == "调出库存组织") {
           this.chuOrgOptions = res.rows;
@@ -2016,7 +1874,7 @@ export default {
         classify: null,
         customerLogistic: null,
         customerLogisticName: null,
-        delFlag: 0
+        delFlag: 0,
       };
       this.materialInfo.push(newLine);
     },
@@ -2026,7 +1884,7 @@ export default {
         ...item,
         delFlag: index === $index ? "2" : item.delFlag,
       }));
-      console.log('看看列表',this.materialInfo)
+      console.log("看看列表", this.materialInfo);
     },
     //
     rowClassName(prop) {
@@ -2179,25 +2037,23 @@ export default {
     },
     selectMaterial(selection) {
       console.log("选中的物料", selection);
+      // 先清空通用名,调入调出结算规则明细
+      this.materialInfo[this.tableIndex].ruleDetail = ''
+      this.materialInfo[this.tableIndex].commonCode = ''
       this.materialInfo[this.tableIndex].material = selection[0].id;
       this.materialInfo[this.tableIndex].materialCode = selection[0].code;
       this.materialInfo[this.tableIndex].materialName = selection[0].name;
-      this.materialInfo[this.tableIndex].specification =
-        selection[0].specification;
+      this.materialInfo[this.tableIndex].specification = selection[0].specification;
       this.materialInfo[this.tableIndex].model = selection[0].model;
       this.materialInfo[this.tableIndex].originPlace = selection[0].originPlace;
-      this.materialInfo[this.tableIndex].originPlaceName =
-        selection[0].originPlaceName;
+      this.materialInfo[this.tableIndex].originPlaceName = selection[0].originPlaceName;
       this.materialInfo[this.tableIndex].unit = selection[0].unitId;
       this.materialInfo[this.tableIndex].mainUnit = selection[0].unitId;
       this.materialInfo[this.tableIndex].unitName = selection[0].unitIdName;
       this.materialInfo[this.tableIndex].mainUnitName = selection[0].unitIdName;
-      this.materialInfo[this.tableIndex].manufacturer =
-        selection[0].manufacturerIdName;
-      this.materialInfo[this.tableIndex].marketingApprovalPersonal =
-        selection[0].registrant;
-      this.materialInfo[this.tableIndex].production =
-        selection[0].productionPermit;
+      this.materialInfo[this.tableIndex].manufacturer = selection[0].manufacturerIdName;
+      this.materialInfo[this.tableIndex].marketingApprovalPersonal = selection[0].registrant;
+      this.materialInfo[this.tableIndex].production = selection[0].productionPermit;
       // 根据物料单位id查询单位code
       this.reBackRefer("UNIT_PARAM", selection[0].unitId);
     },
@@ -2206,7 +2062,7 @@ export default {
       this.tableIndex = index;
       this.referConditionMx.orgId = this.basicForm.deliveryInventoryOrg;
       this.referConditionMx.materialCode =
-        this.materialInfo[this.tableIndex].materialCode;
+      this.materialInfo[this.tableIndex].materialCode;
       this.referConditionMx.unitId = this.materialInfo[this.tableIndex].unit;
       this.referConditionMx.warehouseId = this.basicForm.deliveryWarehouse;
       this.$refs.batchRefer.init(this.referConditionMx);
@@ -2279,6 +2135,8 @@ export default {
         this.materialInfo[index].unitName = "";
         this.materialInfo[index].mainUnitName = "";
         this.materialInfo[index].manufacturer = "";
+        this.materialInfo[index].ruleDetail = ''
+        this.materialInfo[index].commonCode = ''
         this.materialInfo[index].marketingApprovalPersonal = "";
         this.materialInfo[index].production = "";
         this.materialInfo[index].unitCode = "";
@@ -2296,6 +2154,13 @@ export default {
         this.materialInfo[index].storageAllocation = "";
       }
     },
+    jumpOA() {
+      toOA(this.$store.state.user.name, this.basicForm.oaId).then((res) => {
+        if (res.code === 200) {
+          window.open(res.oaUrl);
+        }
+      });
+    },
   },
 };
 </script>
@@ -2311,7 +2176,8 @@ export default {
   display: flex;
   // justify-content: center;
   position: absolute;
-  top: 10px;right: 20px;
+  top: 10px;
+  right: 20px;
 }
 .btn_grooup {
   margin-bottom: 10px;