ソースを参照

Merge branch 'purchaseDev' into 'dev'

Purchase dev

See merge request new-business/drp-web!345
黄梓星 1 年間 前
コミット
149c7b9fe3

+ 7 - 0
src/api/requisition/basic.js

@@ -152,3 +152,10 @@ export function fileImport(data) {
     responseType: 'blob',
   })
 }
+
+export function toOA(userName, fdId) {
+  return request({
+    url: `/oaflow/redirectToOa/${userName}/${fdId}`,
+    method: 'get',
+  })
+}

+ 0 - 1
src/components/PopDialog/fourClass.vue

@@ -33,7 +33,6 @@
                   :highlight-current="true"
                   :current-node-key="checkId"
                   @node-click="clickTree"
-                  default-expand-all
                   :filter-node-method="filterNode"
                   ref="tree"
                 >

+ 1 - 1
src/views/material/basicFile/columns.js

@@ -148,7 +148,7 @@ export const OtherDictColumns = [
   {
     item:{
       key:"expiryUnitId",
-      title:'效期管理',
+      title:'效期单位',
     },
     attr:{
       is: "el-select",

+ 80 - 44
src/views/material/requisition/index.vue

@@ -83,16 +83,32 @@
             fixed="right"
             label="操作"
             align="center"
-            width="120"
+            width="180"
           >
             <template slot-scope="scope">
-              <el-button type="text" :size="size" @click="check(scope.row)">查看</el-button>
-              <el-button @click="edit(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3" type="text"
-                        :size="size">编辑
-              </el-button>
-              <el-button type="text" :size="size" @click="deleteRow(scope.row)"
-                        v-if="scope.row.status == 0 || scope.row.status == 3">删除
-              </el-button>
+              <el-button 
+                type="text" 
+                :size="size" 
+                @click="check(scope.row)"
+              >查看</el-button>
+              <el-button 
+                @click="edit(scope.row)" 
+                v-if="scope.row.status == 0 || scope.row.status == 3" 
+                type="text"
+                :size="size"
+              >编辑</el-button>
+              <el-button 
+                @click="jumpFlow(scope.row)" 
+                v-if="scope.row.oaId && scope.row.oaId !=''" 
+                type="text"
+                :size="size"
+              >流程跳转</el-button>
+              <el-button 
+                type="text" 
+                :size="size"
+                @click="deleteRow(scope.row)"
+                v-if="scope.row.status == 0 || scope.row.status == 3"
+              >删除</el-button>
             </template>
           </el-table-column>
         </el-super-table>
@@ -116,7 +132,7 @@
 
 <script>
   import addReq from './add.vue';
-  import {getReqList, delReq, importData, fileImport,betchSubmit} from '@/api/requisition/basic';
+  import {getReqList, delReq, importData, fileImport,betchSubmit,toOA} from '@/api/requisition/basic';
   import {saveAs} from "file-saver";
   import { blobValidate } from "@/utils/ruoyi";
   import { SearchColumns, TableColumns } from './columns';
@@ -180,53 +196,73 @@
     },
     methods: {
       // 批量提交
-     async handleBatchSubmit(){
-        let filterList = this.checkedList.filter(item => !(item.status == '0' || item.status == '3') )
-        
-        if(!filterList.length &&  this.checkedList.length){  
+      async handleBatchSubmit(){
+          let filterList = this.checkedList.filter(item => !(item.status == '0' || item.status == '3') )
+          
+          if(!filterList.length &&  this.checkedList.length){  
+
+            try {
+
+              this.failLoad = true;
+              
+              let ids = this.checkedList.map( item => Number(item.id));
+              
+              let {code,msg} = await betchSubmit(ids);
 
-          try {
+              if(code == 200){
+                this.reset();
+              }
 
-            this.failLoad = true;
-            
-            let ids = this.checkedList.map( item => Number(item.id));
-            
-            let {code,msg} = await betchSubmit(ids);
+              this.$notify({
+                title: code == 200 ? msg : 'error',
+                type: code == 200 ? 'success' :'error',
+                message: code == 200 ?'' :msg,
+              });
+
+              // if(code == 200){
+              //   this.$notify.success({
+              //     title: msg,
+              //   });
+              // }else{
+              //   this.$notify.error({
+              //     title: '错误',
+              //     message: msg,
+              //   });
+              // }
 
-            if(code == 200){
-              this.reset();
+            } catch (error) {
+              
+            }finally{
+              this.failLoad = false;
             }
 
-            this.$notify({
-              title: code == 200 ? msg : 'error',
-              type: code == 200 ? 'success' :'error',
-              message: code == 200 ?'' :msg,
+          }else{
+            this.$notify.warning({
+              title: '警告',
+              message: '存在不符合提交条件数据或未选择数据!',
             });
+          }
+      },
+
+      async jumpFlow (row){
+
+        const {name} = this.$store.state.user;
 
-            // if(code == 200){
-            //   this.$notify.success({
-            //     title: msg,
-            //   });
-            // }else{
-            //   this.$notify.error({
-            //     title: '错误',
-            //     message: msg,
-            //   });
-            // }
+        try {
 
-          } catch (error) {
-            
-          }finally{
-            this.failLoad = false;
+          let {code,msg,oaUrl} = await toOA(name,row.id);
+
+          if(code == 200){
+            window.open(oaUrl)
           }
+          
+        } catch (error) {
+          
+        }finally{
 
-        }else{
-          this.$notify.warning({
-            title: '警告',
-            message: '存在不符合提交条件数据或未选择数据!',
-          });
         }
       },
+
       reset() {
         // this.queryParams.billCode = ''
         // this.queryParams.name = ''

+ 67 - 20
src/views/purchase/DemandSummary/index.vue

@@ -28,7 +28,7 @@
                 @focus="chooseTreeRefer('MATERIALCLASSIFY_PARAM', false, '选择品类')"
                 style="width: 200px"
                 >
-                <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.name" />
+                <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
               </el-form-item>
             </el-col>
@@ -123,27 +123,14 @@
                   </el-select>
                 </el-form-item>
               </el-col>
-              <!-- <el-col :span="1.5">
-                <el-form-item label="转请购时间">
-                  <el-select v-model="queryParams.ywlx" size="mini" style="width: 200px" clearable>
-                    <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-row>
 
             <el-row :gutter="10">
               <el-col :span="1.5">
                 <el-form-item label="物料编码">
-                  <el-input clearable size="mini" v-model="queryParams.names" @clear="queryParams.materialCode = ''" @focus="chooseMaterial" style="width: 200px">
+                  <el-input clearable size="mini" v-model="queryParams.names" @clear="clearMaterial" style="width: 200px" @paste.native="pasteMe($event)">
                     <el-button size="mini" slot="append" icon="el-icon-more" @click="chooseMaterial"></el-button>
                   </el-input>
-                  <el-input v-show="false" v-model="queryParams.materialCode"></el-input>
                 </el-form-item>
               </el-col>
               <el-col :span="1.5">
@@ -191,6 +178,31 @@
                   </el-date-picker>
                 </el-form-item>
               </el-col>
+              <el-col :span="1.5">
+                <el-form-item label="是否客户指定">
+                  <el-select clearable v-model="queryParams.isCustomerSpecified" 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-select clearable v-model="queryParams.isUrgency" 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-row>
           </div>
           </CollapseTransition>
@@ -354,6 +366,8 @@ import Refers from '@/components/Refers/refers.vue'
 import TreeRefers from '@/components/Refers/treeRefer.vue'
 import popDialog from '@/components/PopDialog/index.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
+// 用于物料参照框数据
+import {getRefer} from '@/api/purchase/basic.js'
 import {getSummaryList, auditSummary, confirmSummary , cancelSummary , shutDownSummary, editSummaryList, exportList, exportItems } from '@/api/purchase/DemandSummary.js'
 export default {
   name: 'demandSummary',
@@ -444,11 +458,13 @@ export default {
         customer: '',
         lastWarehouse: '',
         lastAllocation: '',
-        materialCode: '',
+        materialCodeList: [],
         names: '',
         purchaseOrg: '',
         demandDate: '',
         approverFinishTime: '',
+        isCustomerSpecified: '',
+        isUrgency: '',
         pageNum: 1,
         pageSize: 10
       },
@@ -542,11 +558,13 @@ export default {
         customer: '',
         lastWarehouse: '',
         lastAllocation: '',
-        materialCode: '',
+        materialCodeList: [],
         names: '',
         purchaseOrg: '',
         demandDate: '',
         approverFinishTime: '',
+        isCustomerSpecified: '',
+        isUrgency: '',
         pageNum: 1,
         pageSize: 10
       }
@@ -774,7 +792,7 @@ export default {
     },
     selectionsToInput2(selection) {
       this.classOptions.push(selection)
-      this.queryParams.materialClassifyFour = selection.name
+      this.queryParams.materialClassifyFour = selection.id
     },
     // 搜索区物料编码
     chooseMaterial() {
@@ -782,8 +800,37 @@ export default {
     },
     selectMaterial(selection) {
       console.log('选择的物料', selection)
-      this.queryParams.materialCode = selection[0].code
-      this.queryParams.names = selection[0].name
+      this.queryParams.materialCodeList = selection.map(item => {return item.code})
+      console.log(this.queryParams.materialCodeList)
+      this.queryParams.names = (selection.map(item => {return item.name})).join(',')
+    },
+    // 清空物料搜索框
+    clearMaterial() {
+      this.queryParams.names = ''
+      this.queryParams.materialCodeList = []
+    },
+    // 粘贴来的数据
+    async pasteMe(e) {
+      this.$modal.loading("正在粘贴数据...");
+      e.preventDefault() //阻止默认粘贴事件
+      let source = e.clipboardData.getData("Text");
+      // 首先对源头进行解析
+      let rows = source.split("\r\n"); // 拆成一个数组
+      // 数组去除空字符串
+      rows = rows.filter(item => {
+        return item && item.trim()
+      })
+      await getRefer({ type: 'MATERIAL_PARAM', materialCodeList: rows }).then(res => {
+        this.$modal.closeLoading();
+        if (res.code === 200) {
+          let rowList = res.rows
+          console.log('粘贴的', rowList)
+          this.queryParams.materialCodeList = rowList.map(item => {return item.code})
+          this.queryParams.names = (rowList.map(item => {return item.name})).join(',')
+        }
+      }).catch(err => {
+        this.$modal.closeLoading();
+      })
     },
         // 明细行选择业务部门参照带出业务部门数据
     chooseSon(index, type, isPage, title) {

+ 2 - 2
src/views/purchase/PurchaseDemandList/add.vue

@@ -424,7 +424,7 @@
       </el-table>
     </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="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>
@@ -1758,7 +1758,7 @@ export default {
         ]; 
       }
     },
-    // 审批
+    // 流程跳转
     jumpOA() {
       toOA(this.$store.state.user.name, this.basicForm.flowId).then(res => {
         if(res.code === 200) {

+ 21 - 0
src/views/purchase/PurchaseDemandList/index.vue

@@ -115,6 +115,14 @@
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
+              <el-form-item label="需求计划">
+                <el-select clearable v-model="queryParams.planType" size="mini" style="width: 200px">
+                  <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="备注">
                 <el-input
                   v-model.trim="queryParams.remark"
@@ -179,6 +187,7 @@
           <el-table-column show-overflow-tooltip label="序号" type="index" align="center" width="50px" fixed="left"/>
           <el-table-column show-overflow-tooltip label="需求单号" align="center" width="170" prop="code"/>
           <el-table-column show-overflow-tooltip label="需求日期" align="center" width="120" prop="demandDate"/>
+          <el-table-column show-overflow-tooltip label="需求计划" align="center" width="120" prop="planType" :formatter="formatterPlanType"/>
           <el-table-column show-overflow-tooltip label="审批结束日期" align="center" width="120" prop="approverFinishTime"/>
           <el-table-column show-overflow-tooltip label="单据状态" align="center" prop="satus" :formatter="formatterStatus"/>
           <el-table-column show-overflow-tooltip label="业务类型" align="center" width="120" prop="billType" :formatter="formatterBillType"/>
@@ -362,6 +371,7 @@ export default {
         isProcess: '',
         demandPersonal: '',
         source: '',
+        planType: '',
         billType: '',
         demandDept: '',
         demandDate: '',
@@ -396,6 +406,16 @@ export default {
   },
   methods: {
     // 格式化表格内容
+    formatterPlanType(row) {
+      switch(row.planType){
+        case 'ZJH':
+          return '周计划'
+        case 'YJH':
+          return '月计划'
+        case 'JJXQ':
+          return '紧急计划'
+      }
+    },
     formatterStatus(row) {
       switch(row.status){
         case '0':
@@ -452,6 +472,7 @@ export default {
         isProcess: '',
         demandPersonal: '',
         source: '',
+        planType: '',
         billType: '',
         demandDept: '',
         demandDate: '',

+ 1 - 1
src/views/purchase/catalogue/columns.js

@@ -101,7 +101,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { width: 100, key: "manufacturerName", title: "生厂家" },
+      item: { width: 100, key: "manufacturerName", title: "生厂家" },
       attr: {
         is: "el-popover-select-v2",
         referName: "MANUFACTURER_PARAM",

+ 8 - 6
src/views/purchase/purchase-order/index.vue

@@ -304,9 +304,10 @@ export default {
     },
     fetchSubmit(puOrderIds){
 
-      try {
+      this.handleConfirmTips(async()=>{
+      
+        try {
 
-        this.handleConfirmTips(async()=>{
 
           this.loading = true;
 
@@ -318,11 +319,12 @@ export default {
 
           }
 
+        }  catch (error) {} 
+        finally{
+          this.loading = false;
+        }
         })
-      } catch (error) {} 
-      finally{
-        this.loading = false;
-      }
+     
     },
 
     // 判断“整单退回”按钮

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

@@ -1338,7 +1338,7 @@
             (row.status == '1' || row.status == '2') &&
             row.oaId
           "
-          >审批</el-button
+          >流程跳转</el-button
         >
         <el-button
           type="primary"