Browse Source

Merge branch 'dev' into 'historical_route'

Dev

See merge request new-business/drp-web!452
黄梓星 1 năm trước cách đây
mục cha
commit
d645598f70

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

@@ -180,6 +180,8 @@ const downloadFailData = (data) =>{
   });
 }
 
+
+
 export default {
   list,
   details,

+ 6 - 4
src/components/Refers/treeRefer.vue

@@ -10,8 +10,8 @@
                 <el-input placeholder="输入关键字进行过滤" size="small" v-model="filterText" style="margin-bottom: 16px">
                 </el-input>
 
-                <el-tree class="filter-tree" :data="threedata" :props="defaultProps" accordion node-key="id"
-                  highlight-current @node-click="clickTree" :filter-node-method="filterNode" ref="tree">
+                <el-tree class="filter-tree" :data="threedata" :props="defaultProps" show-checkbox check-strictly accordion node-key="id"
+                  highlight-current @check="clickTree" :filter-node-method="filterNode" ref="tree">
                   <span slot-scope="{ node, data }">
                     {{ data.code }}{{ data.name }}
                   </span>
@@ -78,8 +78,10 @@ export default {
       });
     },
     clickTree(data) {
-      console.log("树形节点信息:", data);
-      this.choosePoint = data;
+      // console.log("树形节点信息:", data);
+      // this.choosePoint = data;
+      // console.log('查看打勾的',this.$refs.tree.getCheckedNodes())
+      this.choosePoint = this.$refs.tree.getCheckedNodes()
     },
     filterNode(value, data) {
       if (!value) return true;

+ 10 - 0
src/components/Retrieve/api/index.js

@@ -0,0 +1,10 @@
+import request from "@/utils/request";
+
+// 模OA流程收回
+export const rollback = (data) =>{
+  return request({
+    url: "/oaflow/rollback",
+    method: "POST",
+    data: data,
+  });
+}

+ 93 - 0
src/components/Retrieve/index.vue

@@ -0,0 +1,93 @@
+<template>
+  <el-button 
+    v-if="isShow"
+    :type="type" 
+    :size="size"
+    @click.native="retrieve"
+  >
+    {{ title }}
+  </el-button>
+</template>
+
+<script>
+// import {rollback} from "@/api/business/purchase/purchase-order.js"
+import {rollback} from "./api/index";
+export default {
+  name:'Retrieve',
+  props:{
+    data:{
+      type:[Object],
+      require:true,
+    },
+    type:{
+      type:String,
+      default:'text',
+    },
+    size:{
+      type:String,
+      default:'mini',
+    },
+
+  },
+  computed:{
+    isShow:{
+      get(){
+        if(this.data.status === '1'){
+
+          return true;
+        }
+        return false;
+      },
+      set(){
+
+      }
+    }
+  },
+  data(){
+    return {
+      title:'收 回',
+    }
+  },
+  methods:{
+    retrieve(){
+
+      // if(this.data.status === '1'){
+
+        this.$confirm('是否继续此操作?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(async() => {
+  
+            try {
+              this.$modal.loading("请稍候...");
+              console.log(this.data,'this.data');
+              let {code,msg} = await rollback({...this.data});
+              if(code == 200){
+                this.$emit('success');
+              }
+              
+            } catch (error) {
+              
+            }finally{
+              this.$modal.closeLoading();
+            }
+  
+          }).catch(() => {        
+          });
+      
+      // }else{
+      //   this.$notify.warning({
+      //     title: '警告',
+      //     message: '!',
+      //   });
+      // }
+
+    },
+
+  },
+  created(){},
+  mounted(){},
+
+}
+</script>

+ 1 - 1
src/components/super-search/index.vue

@@ -116,7 +116,7 @@ export default {
               v-if="attr.is === 'el-select'"
               v-bind="attr"
               v-model="innerValue[item.key]"
-              @change="$emit('submit')"
+              @change="attr.multiple ? '': $emit('submit')"
               style="width: 100%"
             >
               <template>

+ 1 - 1
src/views/material/changeApply/add/index.vue

@@ -279,7 +279,7 @@ export default {
 
     async handleTemDownload(){
 
-      this.download('/material/change/downloadInner',{}, `物料信息模板${new Date().getTime()}.xlsx`);
+      this.download('/material/change/downloadInner',{}, `变更单物料信息模板${new Date().getTime()}.xlsx`);
     },
 
   },

+ 8 - 8
src/views/purchase/DemandSummary/add.vue

@@ -26,22 +26,22 @@
           ref="table"
         >
         <el-table-column show-overflow-tooltip type="selection" fixed="left"/>
-        <el-table-column show-overflow-tooltip label="序号" align="center" type="index" width="55" fixed="left"/>
+        <el-table-column show-overflow-tooltip label="需求单号" align="center" prop="code" width="100"/>
+        <!-- <el-table-column show-overflow-tooltip label="序号" align="center" type="index" width="55" fixed="left"/> -->
         <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowNo">
           <template slot-scope="scope">
             {{ scope.$index + 1 + '0' }}
           </template>
         </el-table-column>
-        <el-table-column show-overflow-tooltip label="行状态" align="center" prop="status" width="100px" :formatter="hangStatus"/>
-        <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="materialCode" width="120px"/>
-        <el-table-column show-overflow-tooltip label="品名" align="center" prop="materialName" width="180"/>
+        <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="materialCode" width="120"/>
+        <el-table-column show-overflow-tooltip label="品名" align="center" prop="materialName" width="120"/>
         <el-table-column show-overflow-tooltip label="规格" align="center" prop="specification"/>
         <el-table-column show-overflow-tooltip label="单位" align="center" prop="unit"/>
-        <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturerName" width="230"/>
+        <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturerName" width="120"/>
         <!-- <el-table-column show-overflow-tooltip label="末级供应仓库存量" align="center" prop="lastWarehouseQty" width="150"/> -->
         <el-table-column show-overflow-tooltip label="月销量" align="center" prop="totalMonthlySales"/>
         <el-table-column show-overflow-tooltip label="采购周期" align="center" prop="puPeriod"/>
-        <el-table-column show-overflow-tooltip label="最终净需求量" align="center" prop="resDemandQty" width="120">
+        <el-table-column show-overflow-tooltip label="最终净需求量" align="center" prop="resDemandQty" width="100">
           <template slot-scope="scope">
             {{scope.row.resDemandQty ? parseFloat(scope.row.resDemandQty).toFixed(0) : '0'}}
           </template>
@@ -51,7 +51,7 @@
             <el-input clearable type="number" min="0" size="mini" :disabled="scope.row.status !== '1' || lineDisable" v-model="scope.row.puQtyRes"/>
           </template>
         </el-table-column>
-        <el-table-column show-overflow-tooltip label="需求客户" align="center" prop="customerName" width="150"/>
+        <el-table-column show-overflow-tooltip label="需求客户" align="center" prop="customerName" width="100"/>
         <el-table-column show-overflow-tooltip label="最小订货量" align="center" prop="minOrderQty" width="100">
           <template slot-scope="scope">
             {{scope.row.minOrderQty ? parseFloat(scope.row.minOrderQty).toFixed(0) : '0'}}
@@ -104,7 +104,6 @@
               </el-input>
           </template>
         </el-table-column>
-        <el-table-column show-overflow-tooltip label="需求单单号" align="center" prop="code" width="150"/>
         <el-table-column show-overflow-tooltip label="供应仓库" align="center" prop="lastWarehouseName" width="100"/>
         <el-table-column show-overflow-tooltip label="供应货位" align="center" prop="lastAllocationName" width="120"/>
         <el-table-column show-overflow-tooltip label="默认采购组织" align="center" prop="orgName" width="250px">
@@ -115,6 +114,7 @@
           </template>
         </el-table-column>
         <el-table-column show-overflow-tooltip label="业务类型" align="center" prop="billType" width="120" :formatter="formatterBillType"/>
+        <el-table-column show-overflow-tooltip label="行状态" align="center" prop="status" width="100px" :formatter="hangStatus"/>
         <el-table-column show-overflow-tooltip label="收货仓库" align="center" prop="deliveryWarehouseName" width="200">
             <template slot-scope="scope">
               <el-input clearable :disabled="scope.row.status !== '1' || lineDisable" size="mini" v-model="scope.row.deliveryWarehouseName" @clear="clean(scope.row, '收货仓库')" @focus="chooseMxCK(scope.$index, 'WAREHOUSE_PARAM', true, '收货仓库', scope.row.org)">

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

@@ -24,6 +24,7 @@
                 <el-select
                 v-model="queryParams.materialClassifyFour"
                 size="mini"
+                multiple
                 clearable
                 @focus="chooseTreeRefer('MATERIALCLASSIFY_PARAM', false, '选择品类')"
                 style="width: 200px"
@@ -242,8 +243,7 @@
           show-summary
           :summary-method="getSummaries"
           highlight-current-row
-          height="355"
-          max-height="355"
+          max-height="620"
           style="font-size: 12px;"
           :cell-class-name="cellClassName"
           @selection-change="handleSelectionChange"
@@ -254,50 +254,60 @@
           <el-table-column type="selection" width="60" fixed="left"/>
           <el-table-column show-overflow-tooltip  label="序号" type="index" align="center" width="50px" fixed="left"/>
           <!-- <el-table-column show-overflow-tooltip v-if="showColumn.status" label="行号" align="center" prop="rowNo"/> -->
-          <el-table-column show-overflow-tooltip v-if="showColumn.status" label="行状态" align="center" prop="status" width="100px" :formatter="hangStatus"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.materialClassifyOneName" label="一级品类" align="center" prop="materialClassifyOneName" width="80"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.materialCode" label="物料编码" align="center" prop="materialCode" width="150px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.materialName" label="品名" align="center" prop="materialName" width="150px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.specification" label="规格" align="center" prop="specification" width="100px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.unit" label="单位" align="center" prop="unit"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.manufacturer" label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.demandNum" label="需求单位数" align="center" prop="demandNum" width="80px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.evensalesforyear" label="近1月月均需求" align="center" prop="evensalesforyear" width="80px">
+          <el-table-column show-overflow-tooltip v-if="showColumn.status" label="行状态" align="center" prop="status" width="50px" :formatter="hangStatus"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.finalBuyQty" label="最终采购量" align="center" prop="finalBuyQty" width="80px">
             <template slot-scope="scope">
-              {{scope.row.evensalesforyear ? parseFloat(scope.row.evensalesforyear).toFixed(2) : '0.00'}}
+                <el-input size="mini" :disabled="scope.row.status !== '1' || lineDisable" v-model="scope.row.finalBuyQty" @change="jilu(scope.$index)"/>
             </template>
           </el-table-column>
-          <el-table-column show-overflow-tooltip v-if="showColumn.evensalesforthrmonth" label="近3月月均需求" align="center" prop="evensalesforthrmonth" width="80px">
+          <el-table-column show-overflow-tooltip v-if="showColumn.artificialAdjust" label="人工调整数" align="center" prop="artificialAdjust" width="50px">
             <template slot-scope="scope">
-              {{scope.row.evensalesforthrmonth ? parseFloat(scope.row.evensalesforthrmonth).toFixed(2) : '0.00'}}
+              {{scope.row.artificialAdjust = scope.row.finalBuyQty - scope.row.suggestionPurchase}}
             </template>
           </el-table-column>
+          <el-table-column show-overflow-tooltip v-if="showColumn.materialClassifyOneName" label="一级品类" align="center" prop="materialClassifyOneName" width="50"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.materialCode" label="物料编码" align="center" prop="materialCode" width="50px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.materialName" label="品名" align="center" prop="materialName" width="50px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.specification" label="规格" align="center" prop="specification" width="50px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.unit" label="单位" align="center" prop="unit" width="50"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.manufacturer" label="生产厂家/代理人" align="center" prop="manufacturer" width="80px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.demandNum" label="需求单位数" align="center" prop="demandNum" width="50px"/>
           <el-table-column show-overflow-tooltip v-if="showColumn.netDemandNum" label="总最终净需求量" align="center" prop="netDemandNum" width="80px">
             <template slot-scope="scope">
               {{scope.row.netDemandNum ? parseFloat(scope.row.netDemandNum).toFixed(2) : '0.00'}}
             </template>
           </el-table-column>
-          <el-table-column show-overflow-tooltip v-if="showColumn.totalMonthlySales" label="总月销量" align="center" prop="totalMonthlySales" width="80px">
+          <el-table-column show-overflow-tooltip v-if="showColumn.evensalesforyear" label="近1月月均需求" align="center" prop="evensalesforyear" width="50">
+            <template slot-scope="scope">
+              {{scope.row.evensalesforyear ? parseFloat(scope.row.evensalesforyear).toFixed(2) : '0.00'}}
+            </template>
+          </el-table-column>
+          <el-table-column show-overflow-tooltip v-if="showColumn.evensalesforthrmonth" label="近3月月均需求" align="center" prop="evensalesforthrmonth" width="50">
+            <template slot-scope="scope">
+              {{scope.row.evensalesforthrmonth ? parseFloat(scope.row.evensalesforthrmonth).toFixed(2) : '0.00'}}
+            </template>
+          </el-table-column>
+          <el-table-column show-overflow-tooltip v-if="showColumn.totalMonthlySales" label="总月销量" align="center" prop="totalMonthlySales" width="50">
             <template slot-scope="scope">
               {{scope.row.totalMonthlySales ? parseFloat(scope.row.totalMonthlySales).toFixed(2) : '0.00'}}
             </template>
           </el-table-column>
-          <el-table-column show-overflow-tooltip v-if="showColumn.demandCycle" label="需求可用周期" align="center" prop="demandCycle" width="80px">
+          <el-table-column show-overflow-tooltip v-if="showColumn.demandCycle" label="需求可用周期" align="center" prop="demandCycle" width="50px">
             <template slot-scope="scope">
               {{scope.row.demandCycle ? parseFloat(scope.row.demandCycle).toFixed(1) : '0.0'}}
             </template>
           </el-table-column>
-          <el-table-column show-overflow-tooltip v-if="showColumn.dullQut" label="呆滞量" align="center" prop="dullQut" width="80px">
+          <el-table-column show-overflow-tooltip v-if="showColumn.dullQut" label="呆滞量" align="center" prop="dullQut" width="50px">
             <template slot-scope="scope">
               {{parseFloat(scope.row.dullQut).toFixed(2)}}
             </template>
           </el-table-column>
-          <el-table-column show-overflow-tooltip v-if="showColumn.buyPeriod" label="采购周期" align="center" prop="buyPeriod" width="80px" />
-          <el-table-column show-overflow-tooltip v-if="showColumn.centralPublicStock" label="中心公共库存" align="center" prop="centralPublicStock" width="80px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.centralWarehouse" label="中心仓专属货位" align="center" prop="centralWarehouse" width="80px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.regionPublicStock" label="区域分仓公共库存" align="center" prop="regionPublicStock" width="80px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.eachWarehouseStock" label="各项目仓库存" align="center" prop="eachWarehouseStock" width="80px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.commerceWarehouse" label="电商仓库" align="center" prop="commerceWarehouse"  width="80px" />
+          <el-table-column show-overflow-tooltip v-if="showColumn.buyPeriod" label="采购周期" align="center" prop="buyPeriod" width="50px" />
+          <el-table-column show-overflow-tooltip v-if="showColumn.centralPublicStock" label="中心公共库存" align="center" prop="centralPublicStock" width="50"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.centralWarehouse" label="中心仓专属货位" align="center" prop="centralWarehouse" width="50"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.eachWarehouseStock" label="各项目仓库存" align="center" prop="eachWarehouseStock" width="50"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.commerceWarehouse" label="电商仓库" align="center" prop="commerceWarehouse"  width="50" />
+          <el-table-column show-overflow-tooltip v-if="showColumn.regionPublicStock" label="区域分仓公共库存" align="center" prop="regionPublicStock" width="50"/>
           <el-table-column show-overflow-tooltip v-if="showColumn.buyTransit" label="采购在途" align="center" prop="buyTransit"  width="80px" />
           <el-table-column show-overflow-tooltip v-if="showColumn.lendTransit" label="借出在途" align="center" prop="lendTransit"  width="80px" />
           <el-table-column show-overflow-tooltip v-if="showColumn.transferTransit" label="调拨在途" align="center" prop="transferTransit"  width="80px"/>
@@ -305,11 +315,6 @@
           <el-table-column show-overflow-tooltip v-if="showColumn.minPackage" label="最小包装量" align="center" prop="minPackage"  width="80px"/>
           <el-table-column show-overflow-tooltip v-if="showColumn.minOrder" label="最小订货量" align="center" prop="minOrder"  width="80px"/>
           <el-table-column show-overflow-tooltip v-if="showColumn.minBatch" label="最小批量" align="center" prop="minBatch"  width="80px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.artificialAdjust" label="人工调整数" align="center" prop="artificialAdjust" width="80px">
-            <template slot-scope="scope">
-              {{scope.row.artificialAdjust = scope.row.finalBuyQty - scope.row.suggestionPurchase}}
-            </template>
-          </el-table-column>
           <el-table-column show-overflow-tooltip v-if="showColumn.modifyReason" label="修改原因" align="center" prop="modifyReason" width="150px">
             <template slot-scope="scope">
                 <el-input size="mini" :disabled="scope.row.status !== '1'|| lineDisable || scope.row.artificialAdjust == '0'" v-model="scope.row.modifyReason" @change="jilu(scope.$index)"/>
@@ -317,11 +322,6 @@
           </el-table-column>
           <el-table-column show-overflow-tooltip v-if="showColumn.suggestionPurchase" label="建议采购量" align="center" prop="suggestionPurchase"  width="80px"/>
           <!-- <el-table-column show-overflow-tooltip v-if="showColumn.status" label="建议净采购量" align="center" prop="suggestBuyQty" width="100px"/> -->
-          <el-table-column show-overflow-tooltip v-if="showColumn.finalBuyQty" label="最终采购量" align="center" prop="finalBuyQty" width="80px">
-            <template slot-scope="scope">
-                <el-input size="mini" :disabled="scope.row.status !== '1' || lineDisable" v-model="scope.row.finalBuyQty" @change="jilu(scope.$index)"/>
-            </template>
-          </el-table-column>
           <el-table-column show-overflow-tooltip v-if="showColumn.materialClassifyTwoName" label="二级品类" align="center" prop="materialClassifyTwoName" width="120px"/>
           <el-table-column show-overflow-tooltip v-if="showColumn.materialClassifyThreeName" label="三级品类" align="center" prop="materialClassifyThreeName" width="120px"/>
           <el-table-column show-overflow-tooltip v-if="showColumn.materialClassifyFourName" label="四级品类" align="center" prop="materialClassifyFourName" width="120px"/>
@@ -481,7 +481,7 @@ export default {
         rowStatus: ['1'],
         buyer: '',
         buyerName: '',
-        materialClassifyFour: '',
+        materialClassifyFour: [],
         manufacturer: '',
         forecastClassification: '',
         periodUnit: '',
@@ -588,7 +588,7 @@ export default {
         rowStatus: ['1'],
         buyer: '',
         buyerName: '',
-        materialClassifyFour: '',
+        materialClassifyFour: [],
         manufacturer: '',
         forecastClassification: '',
         periodUnit: '',
@@ -860,8 +860,8 @@ export default {
       this.$refs.tree.init(this.referCondition)
     },
     selectionsToInput2(selection) {
-      this.classOptions.push(selection)
-      this.queryParams.materialClassifyFour = selection.id
+      this.classOptions = selection
+      this.queryParams.materialClassifyFour = selection.map(item => {return item.id})
     },
     // 搜索区物料编码
     chooseMaterial() {

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

@@ -207,10 +207,10 @@
           >
           <template slot-scope="scope">
             <el-button type="text" size="mini" @click="check(scope.row)">查看</el-button>
-            <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3'" @click="edit(scope.row)">编辑</el-button>
-            <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3'" @click="commit(scope.row)">提交</el-button>
-            <el-button type="text" size="mini" v-if="scope.row.status == '1' && scope.row.flowId" @click="reback(scope.row)">收回</el-button>
-            <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3'" @click="deleteids(scope.row)">删除</el-button>
+            <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3' || scope.row.status == '9'" @click="edit(scope.row)">编辑</el-button>
+            <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3' || scope.row.status == '9'" @click="commit(scope.row)">提交</el-button>
+            <!-- <el-button type="text" size="mini" v-if="scope.row.status == '1' && scope.row.flowId" @click="reback(scope.row)">收回</el-button> -->
+            <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3' || scope.row.status == '9'" @click="deleteids(scope.row)">删除</el-button>
           </template>
         </el-table-column>
         </el-table>

+ 27 - 9
src/views/purchase/apply/add/index.vue

@@ -86,8 +86,16 @@
           const {
             recentlyPrice = "0",
             isApprovalFirst = "N",
-            purchasequantity
-          } = await fetchExist({puOrg, customer, supplier, materialCode, customerName: "", priceType: prop.row.priceType});
+            purchasequantity,
+            recentlyPriceDate
+          } = await fetchExist({
+            puOrg,
+            customer,
+            supplier,
+            materialCode,
+            customerName: "",
+            priceType: prop.row.priceType
+          });
           this.loading = false;
           await this.onRowAdd(this.tabName, {
             ...item,
@@ -102,6 +110,7 @@
             puUnitName: puUnitName,
             recentlyPrice,
             isApprovalFirst,
+            recentlyPriceDate: recentlyPriceDate,
             yPurchaseQuantity: purchasequantity,
             tax: Number(ntaxrate === "0E-8" ? 0 : ntaxrate),
             createByName: createByName,
@@ -110,7 +119,7 @@
           });
         }
       },
-      // 
+      //
       async changeCustomerName(prop) {
         console.log("prop", prop)
         const {
@@ -123,11 +132,20 @@
         const {
           recentlyPrice,
           isApprovalFirst,
-          purchasequantity
-          } = await fetchExist({puOrg, supplier, materialCode: prop.row.materialCode, customer:prop.row.customer,customerName: prop.row.customerName, priceType: prop.row.priceType});
-          prop.row.yPurchaseQuantity = purchasequantity
-          prop.row.recentlyPrice = recentlyPrice
-          prop.row.isApprovalFirst = isApprovalFirst
+          purchasequantity,
+          recentlyPriceDate
+        } = await fetchExist({
+          puOrg,
+          supplier,
+          materialCode: prop.row.materialCode,
+          customer: prop.row.customerName ? prop.row.customer : '',
+          customerName: prop.row.customerName,
+          priceType: prop.row.priceType
+        });
+        prop.row.yPurchaseQuantity = purchasequantity
+        prop.row.recentlyPrice = recentlyPrice
+        prop.row.isApprovalFirst = isApprovalFirst
+        prop.row.recentlyPriceDate = recentlyPriceDate
       },
       //
       async onOpen() {
@@ -278,7 +296,7 @@
                   v-model="scope.row[scope.item.key]"
                   :size="$attrs.size"
                   :source.sync="scope.row"
-                  @change="changeCustomerName({ ...scope, selectData: $event })"
+                  @input="changeCustomerName({ ...scope, selectData: $event })"
                 >
                 </component>
               </template>

+ 2 - 2
src/views/purchase/apply/columns.js

@@ -22,7 +22,7 @@ export default function useColumns() {
     { item: { key: "createByName", title: "创建人", width: 100 }, attr: {} },
     {
       item: { key: "isEffective", title: "是否已推价格", width: 100 },
-      attr: { is: "el-dict-tag", dictName: "is_effective", width: 100 },
+      attr: { is: "el-dict-tag", dictName: "is_effective"},
     },
     {
       item: { key: "approveTime", title: "单据申请日期", width: 100 },
@@ -30,7 +30,7 @@ export default function useColumns() {
     },
     {
       item: { key: "sourceType", title: "来源单据类型", width: 100 },
-      attr: { is: "el-dict-tag", dictName: "price_source", width: 100 },
+      attr: { is: "el-dict-tag", dictName: "price_source" },
     },
   ].map(({ item, attr }) => ({
     attr,

+ 246 - 231
src/views/purchase/apply/copy/index.vue

@@ -1,132 +1,135 @@
 <script>
-import useColumns from "./columns";
-import { EXIST } from "@/api/business/purchase/catalogue";
-import { ITEM, SAVE } from "@/api/business/purchase/apply";
-import { tax, unit, currency } from "@/components/popover-select-v2/fetch";
+  import useColumns from "./columns";
+  import {EXIST} from "@/api/business/purchase/catalogue";
+  import {ITEM, SAVE} from "@/api/business/purchase/apply";
+  import {tax, unit, currency} from "@/components/popover-select-v2/fetch";
 
-const fetchExist = async (prop) => {
-  try {
-    // try
-    const { code, data } = await EXIST(prop);
-    if (code === 200) return data;
-  } catch (err) {
-    // catch
-    console.error(err);
-  } finally {
-    // finally
-  }
-};
+  const fetchExist = async (prop) => {
+    try {
+      // try
+      const {code, data} = await EXIST(prop);
+      if (code === 200) return data;
+    } catch (err) {
+      // catch
+      console.error(err);
+    } finally {
+      // finally
+    }
+  };
 
-export default {
-  name: "CopyDrawer",
-  props: {
-    dict: {
-      type: Object,
+  export default {
+    name: "CopyDrawer",
+    props: {
+      dict: {
+        type: Object,
+      },
+      selectData: {
+        type: [Array],
+        require: true,
+      },
     },
-    selectData: {
-      type: [Array],
-      require: true,
+    components: {
+      ElSuperForm: () => import("@/components/super-form/index.vue"),
+      ElSuperTable: () => import("@/components/super-table/index.vue"),
+      ElPopoverSelectV2: () => import("@/components/popover-select-v2/index.vue"),
+    },
+    data() {
+      const {
+        TabColumns,
+        TableColumns,
+        TabColumns: [
+          {
+            item: {key: tabName},
+          },
+        ],
+      } = useColumns();
+      const rules = this.$init.rules([...TabColumns, ...TableColumns]);
+      const params = this.$init.params([...TabColumns, ...TableColumns]);
+      return {
+        title: "复 制",
+        width: "100%",
+        visible: false,
+        loading: false,
+        rules: rules,
+        params: params,
+        tabName: tabName,
+        TabColumns: TabColumns,
+        TableColumns: TableColumns,
+      };
     },
-  },
-  components: {
-    ElSuperForm: () => import("@/components/super-form/index.vue"),
-    ElSuperTable: () => import("@/components/super-table/index.vue"),
-    ElPopoverSelectV2: () => import("@/components/popover-select-v2/index.vue"),
-  },
-  data() {
-    const {
-      TabColumns,
-      TableColumns,
-      TabColumns: [
-        {
-          item: { key: tabName },
+    computed: {
+      disabled: {
+        get() {
+          const {
+            selectData: {length},
+          } = this.$props;
+          if (length !== 1) {
+            return true;
+          }
+        },
+        set() {
         },
-      ],
-    } = useColumns();
-    const rules = this.$init.rules([...TabColumns, ...TableColumns]);
-    const params = this.$init.params([...TabColumns, ...TableColumns]);
-    return {
-      title: "复 制",
-      width: "100%",
-      visible: false,
-      loading: false,
-      rules: rules,
-      params: params,
-      tabName: tabName,
-      TabColumns: TabColumns,
-      TableColumns: TableColumns,
-    };
-  },
-  computed: {
-    disabled: {
-      get() {
-        const {
-          selectData: { length },
-        } = this.$props;
-        if (length !== 1) {
-          return true;
-        }
       },
-      set() {},
     },
-  },
-  watch: {},
-  methods: {
-    //
-    async changeMaterialName(prop) {
-      const { selectData } = prop;
-      const {
-        puOrg,
-        customer,
-        supplier,
-        currency,
-        currencyCode,
-        currencyName,
-      } = this.params;
-      const { nickName: createByName } = this.$store.state.user;
-      if (selectData.length) {
-        this.params[this.tabName].splice(-1);
-      }
-      for (const item of selectData) {
-        this.loading = true;
-        const { tax: taxName, unitName, code: materialCode } = item;
-        // task 1
-        const { ntaxrate } = await tax(taxName);
-        // task 2
+    watch: {},
+    methods: {
+      //
+      async changeMaterialName(prop) {
+        const {selectData} = prop;
         const {
-          id: puUnit,
-          code: puUnitCode,
-          name: puUnitName,
-        } = await unit(unitName);
-        // task 3
-        const {
-          recentlyPrice = "0",
-          isApprovalFirst = "N",
-          purchasequantity
-        } = await fetchExist({ puOrg, customer, supplier, materialCode, priceType: prop.row.priceType });
-        this.loading = false;
-        await this.onRowAdd(this.tabName, {
-          ...item,
-          currency: currency,
-          currencyCode: currencyCode,
-          currencyName: currencyName,
-          unit: puUnit,
-          unitCode: puUnitCode,
-          unitName: puUnitName,
-          puUnit: puUnit,
-          puUnitCode: puUnitCode,
-          puUnitName: puUnitName,
-          recentlyPrice,
-          isApprovalFirst,
-          yPurchaseQuantity: purchasequantity,
-          tax: Number(ntaxrate === "0E-8" ? 0 : ntaxrate),
-          createByName: createByName,
-          updateByName: createByName,
-          id: null,
-        });
-      }
-    },
-      // 
+          puOrg,
+          customer,
+          supplier,
+          currency,
+          currencyCode,
+          currencyName,
+        } = this.params;
+        const {nickName: createByName} = this.$store.state.user;
+        if (selectData.length) {
+          this.params[this.tabName].splice(-1);
+        }
+        for (const item of selectData) {
+          this.loading = true;
+          const {tax: taxName, unitName, code: materialCode} = item;
+          // task 1
+          const {ntaxrate} = await tax(taxName);
+          // task 2
+          const {
+            id: puUnit,
+            code: puUnitCode,
+            name: puUnitName,
+          } = await unit(unitName);
+          // task 3
+          const {
+            recentlyPrice = "0",
+            isApprovalFirst = "N",
+            purchasequantity,
+            recentlyPriceDate
+          } = await fetchExist({puOrg, customer, supplier, materialCode, priceType: prop.row.priceType});
+          this.loading = false;
+          await this.onRowAdd(this.tabName, {
+            ...item,
+            currency: currency,
+            currencyCode: currencyCode,
+            currencyName: currencyName,
+            unit: puUnit,
+            unitCode: puUnitCode,
+            unitName: puUnitName,
+            puUnit: puUnit,
+            puUnitCode: puUnitCode,
+            puUnitName: puUnitName,
+            recentlyPrice,
+            recentlyPriceDate: recentlyPriceDate,
+            isApprovalFirst,
+            yPurchaseQuantity: purchasequantity,
+            tax: Number(ntaxrate === "0E-8" ? 0 : ntaxrate),
+            createByName: createByName,
+            updateByName: createByName,
+            id: null,
+          });
+        }
+      },
+      //
       async changeCustomerName(prop) {
         console.log("prop", prop)
         const {
@@ -139,124 +142,136 @@ export default {
         const {
           recentlyPrice,
           isApprovalFirst,
-          purchasequantity
-          } = await fetchExist({puOrg, supplier, materialCode: prop.row.materialCode, customer:prop.row.customer,customerName: prop.row.customerName, priceType: prop.row.priceType});
-          prop.row.yPurchaseQuantity = purchasequantity
-          prop.row.recentlyPrice = recentlyPrice
-          prop.row.isApprovalFirst = isApprovalFirst
+          purchasequantity,
+          recentlyPriceDate
+        } = await fetchExist({
+          puOrg,
+          supplier,
+          materialCode: prop.row.materialCode,
+          customer: prop.row.customerName ? prop.row.customer : '',
+          customerName: prop.row.customerName,
+          priceType: prop.row.priceType
+        });
+        prop.row.yPurchaseQuantity = purchasequantity
+        prop.row.recentlyPrice = recentlyPrice
+        prop.row.isApprovalFirst = isApprovalFirst
+        prop.row.recentlyPriceDate = recentlyPriceDate
       },
-    //
-    async fetchItem(prop) {
-      try {
-        // try
-        this.loading = true;
-        const { tabName, TabColumns } = this;
-        const { TableColumns } = TabColumns.find(
-          ({ item: { key } }) => key === tabName
-        );
-        console.log('看看prop', prop)
-        const { code, data } = await ITEM(prop, true);
-        if (code === 200) {
-          this.params = data;
-          this.params.priceApplyItems = data.priceApplyItems.map((item) => ({
-            ...this.$init.params(TableColumns),
-            ...item,
-            id: null,
-          }));
-          this.params.id = null;
-        } else {
+      //
+      async fetchItem(prop) {
+        try {
+          // try
+          this.loading = true;
+          const {tabName, TabColumns} = this;
+          const {TableColumns} = TabColumns.find(
+            ({item: {key}}) => key === tabName
+          );
+          console.log('看看prop', prop)
+          const {code, data} = await ITEM(prop, true);
+          if (code === 200) {
+            this.params = data;
+            this.params.priceApplyItems = data.priceApplyItems.map((item) => ({
+              ...this.$init.params(TableColumns),
+              ...item,
+              id: null,
+            }));
+            this.params.id = null;
+          } else {
+            this.visible = false;
+          }
+        } catch (err) {
+          // catch
+          console.error(err);
           this.visible = false;
+        } finally {
+          // finally
+          this.loading = false;
         }
-      } catch (err) {
-        // catch
-        console.error(err);
+      },
+      //
+      async onOpen() {
+        this.visible = true;
+        const {
+          selectData: [{id}],
+        } = this.$props;
+        this.params.id = null;
+        this.params.createBy = null;
+        this.params.priceCode = null;
+        this.params.createByName = null;
+        this.params.effectiveDate = null;
+        this.params.priceApplyOrgs = [];
+        this.params.priceApplyItems = this.params.priceApplyItems.map((item) => ({
+          ...item,
+          id: null,
+          applyId: null,
+          createByName: null,
+          updateByName: null,
+          delFlag: 0,
+        }));
+        await this.fetchItem(id);
+      },
+      //
+      async onHide() {
+        const {TabColumns, TableColumns} = useColumns();
         this.visible = false;
-      } finally {
-        // finally
-        this.loading = false;
-      }
-    },
-    //
-    async onOpen() {
-      this.visible = true;
-      const {
-        selectData: [{ id }],
-      } = this.$props;
-      this.params.id = null;
-      this.params.createBy = null;
-      this.params.priceCode = null;
-      this.params.createByName = null;
-      this.params.effectiveDate = null;
-      this.params.priceApplyOrgs = [];
-      this.params.priceApplyItems = this.params.priceApplyItems.map((item) => ({
-        ...item,
-        id: null,
-        applyId: null,
-        createByName: null,
-        updateByName: null,
-        delFlag: 0,
-      }));
-      await this.fetchItem(id);
-    },
-    //
-    async onHide() {
-      const { TabColumns, TableColumns } = useColumns();
-      this.visible = false;
-      this.params = this.$init.params([...TabColumns, ...TableColumns]);
-      this.$emit("success");
+        this.params = this.$init.params([...TabColumns, ...TableColumns]);
+        this.$emit("success");
+      },
+      //
+      async onRowAdd(prop, 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,
+            });
+          }
+        });
+      },
+      //
+      async onRowRemove(prop, scope) {
+        const {$index} = scope;
+        this.params[prop].splice($index, 1);
+      },
+      //
+      async useSubmit(prop) {
+        this.$refs[prop].validate(async (valid) => {
+          console.log(this.params);
+          if (valid) {
+            try {
+              this.loading = true;
+              this.params.priceApplyOrgs = [];
+              const {msg, code} = await SAVE(this.params);
+              if (code === 200) {
+                this.onHide();
+                this.$emit("success");
+                this.$notify.success(msg);
+              }
+            } catch (err) {
+              // catch
+              console.error(err);
+            } finally {
+              // finally
+              this.loading = false;
+            }
+          } else {
+            return false;
+          }
+        });
+      },
     },
-    //
-    async onRowAdd(prop, 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,
-          });
-        }
-      });
+    created() {
     },
-    //
-    async onRowRemove(prop, scope) {
-      const { $index } = scope;
-      this.params[prop].splice($index, 1);
+    mounted() {
     },
-    //
-    async useSubmit(prop) {
-      this.$refs[prop].validate(async (valid) => {
-        console.log(this.params);
-        if (valid) {
-          try {
-            this.loading = true;
-            this.params.priceApplyOrgs = [];
-            const { msg, code } = await SAVE(this.params);
-            if (code === 200) {
-              this.onHide();
-              this.$emit("success");
-              this.$notify.success(msg);
-            }
-          } catch (err) {
-            // catch
-            console.error(err);
-          } finally {
-            // finally
-            this.loading = false;
-          }
-        } else {
-          return false;
-        }
-      });
+    destroyed() {
     },
-  },
-  created() {},
-  mounted() {},
-  destroyed() {},
-};
+  };
 </script>
 <template>
   <el-button
@@ -333,7 +348,7 @@ export default {
                   v-model="scope.row[scope.item.key]"
                   :size="$attrs.size"
                   :source.sync="scope.row"
-                  @change="changeCustomerName({ ...scope, selectData: $event })"
+                  @input="changeCustomerName({ ...scope, selectData: $event })"
                 >
                 </component>
               </template>

+ 16 - 5
src/views/purchase/apply/edit/index.vue

@@ -131,7 +131,8 @@
           const {
             recentlyPrice = "0",
             isApprovalFirst = "N",
-            purchasequantity
+            purchasequantity,
+            recentlyPriceDate
           } = await fetchExist({puOrg, customer, supplier, materialCode, customerName: "",priceType: prop.row.priceType});
           this.loading = false;
           await this.onRowAdd(this.tabName, {
@@ -147,6 +148,7 @@
             puUnitName: puUnitName,
             recentlyPrice,
             isApprovalFirst,
+            recentlyPriceDate: recentlyPriceDate,
             yPurchaseQuantity: purchasequantity,
             tax: Number(ntaxrate === "0E-8" ? 0 : ntaxrate),
             createByName: createByName,
@@ -155,7 +157,7 @@
           });
         }
       },
-      // 
+      //
       async changeCustomerName(prop) {
         console.log("prop", prop)
         const {
@@ -168,11 +170,20 @@
         const {
           recentlyPrice,
           isApprovalFirst,
-          purchasequantity
-          } = await fetchExist({puOrg, supplier, materialCode: prop.row.materialCode, customer:prop.row.customer,customerName: prop.row.customerName, priceType: prop.row.priceType});
+          purchasequantity,
+          recentlyPriceDate
+          } = await fetchExist({
+            puOrg,
+            supplier,
+            materialCode: prop.row.materialCode,
+            customer: prop.row.customerName ? prop.row.customer : '',
+            customerName: prop.row.customerName,
+            priceType: prop.row.priceType
+          });
           prop.row.yPurchaseQuantity = purchasequantity
           prop.row.recentlyPrice = recentlyPrice
           prop.row.isApprovalFirst = isApprovalFirst
+          prop.row.recentlyPriceDate = recentlyPriceDate
       },
       //
       async fetchItem(prop) {
@@ -354,7 +365,7 @@
                   v-model="scope.row[scope.item.key]"
                   :size="$attrs.size"
                   :source.sync="scope.row"
-                  @change="changeCustomerName({ ...scope, selectData: $event })"
+                  @input="changeCustomerName({ ...scope, selectData: $event })"
                 >
                 </component>
               </template>

+ 14 - 0
src/views/purchase/apply/index.vue

@@ -171,6 +171,10 @@
         this.upload.title = "文件导入"
         this.upload.open = true
       },
+      // 收回
+      reback(row) {
+        console.log(row)
+      },
     },
   };
 </script>
@@ -257,6 +261,16 @@
       @row-select="useSelect"
       @pagination="useQuery(params, page)"
     >
+      <el-table-column
+        fixed="right"
+        label="操作"
+        align="center"
+        width="100"
+        >
+        <template slot-scope="scope">
+          <!-- <el-button type="text" size="mini" v-if="scope.row.status == '1' && scope.row.flowId" @click="reback(scope.row)">收回</el-button> -->
+        </template>
+      </el-table-column>
     </el-super-table>
     <!-- 文件导入对话框 -->
     <el-dialog title="文件导入" :visible.sync="upload.open" width="400px">

+ 16 - 0
src/views/purchase/purchase-order/column.js

@@ -642,6 +642,22 @@ export const TabColumns = [
         },
       },
       { 
+        item:{
+          key: "nitemdiscountrate", 
+          title: "折扣(%)", 
+          width:80, 
+        },
+        attr:{},
+       },
+      { 
+        item:{
+          key: "ntaxnetprice", 
+          title: "含税净价", 
+          width:80, 
+        },
+        attr:{},
+       },
+      { 
         item:{key: "arrivalQty", title: "已到货数量" , width:80,},
         attr:{
           // is: "el-computed-input-v2",

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

@@ -29,6 +29,7 @@ export default {
     PurchaseReturnDrawer: () => import('./purchaseReturn/index.vue'),
     ElSuperTable: () => import("@/components/super-table/index.vue"),
     ElSuperSearch: () => import("@/components/super-search/index.vue"),
+    Retrieve: () => import("@/components/Retrieve/index.vue"),
     },
   data() {
     const initTabColumns = () => TabColumns;
@@ -61,6 +62,15 @@ export default {
         return this.dict.type;
       },
     },
+    tabHeight:{
+      get(){
+        return `${this.tabTableDatas['puOrderItemList'].length ? 
+                  (this.tabTableDatas['puOrderItemList'].length > 8 ? 500 :
+                   (this.tabTableDatas['puOrderItemList'].length *50) +100)
+                : 120}px`
+      },
+      set(){}
+    }
   },
   created() {
     if(this.$route.query.billCode) this.params.orderCode = this.$route.query.billCode 
@@ -318,7 +328,7 @@ export default {
     // 批量提交
     handleBatchSubmit(){
 
-      let inconformity = this.checkedList.filter(row => !((row.status == '0' || row.status == '3') && row.isEnd === 'N'));
+      let inconformity = this.checkedList.filter(row => !((row.status == '0' || row.status == '3' || row.status == '9') && row.isEnd === 'N'));
 
       if(!inconformity.length && this.checkedList.length){
 
@@ -601,27 +611,38 @@ export default {
       }
     },
     judgeIsOption(type,source){
-      // status: 0=自由态,1=审批中,2=已审核,3=已驳回 4=提交中
+      // status: 0=自由态,1=审批中,2=已审核,3=已驳回 4=提交中 9=已回退
       // source: 1=自动协议直采,2=协议直采,3=手工
       // isEnd:整单关闭标识
       switch(type){
         case 'edit':
-          return (source.status == '0' || source.status == '3') && source.isEnd === 'N';
+          return (source.status == '0' || source.status == '3' || source.status == '9') && source.isEnd === 'N';
         case 'revise':
             return source.status == '2' && source.isEnd === 'N';
         case 'del':
-          return (source.status == '0' || source.status == '3') && source.source == '3' && source.isEnd === 'N';
+          return (source.status == '0' || source.status == '3' || source.status == '9') && source.source == '3' && source.isEnd === 'N';
         case 'submit':
-          return (source.status == '0' || source.status == '3') && source.isEnd === 'N';
+          return (source.status == '0' || source.status == '3' || source.status == '9') && source.isEnd === 'N';
         case 'allClose':
           return source.status == 0 && source.isEnd === 'N';
         case 'return':
           return source.source != 3 && source.isEnd === 'N' &&
-                (source.status == 0 || source.status == 3);
+                (source.status == 0 || source.status == 3 || source.status == '9');
         default:
          return false;
       }
-    }
+    },
+    handelRetrieve(row){
+
+      let { status, flowId, code,createBy } = row;
+      return {
+        status,
+        fdId:flowId,
+        fdTemplateId:'1880447a834addc648b3763477a9b09f',
+        billCode:code,
+        billMaker:createBy,
+      }
+    },
   }
 };
 </script>
@@ -674,6 +695,7 @@ export default {
             size="mini" 
             @click="handleDownload" 
           >批量导出</el-button>
+          
         </el-button-group>
         
 
@@ -735,11 +757,12 @@ export default {
                 @click.stop="handleSubmit(scope.row)"
               >提交</el-button>
               <el-button 
-                v-if="scope.row.flowId && scope.row.flowId !== ''" 
+                v-if="scope.row.flowId && scope.row.flowId !== '' && scope.row.status !== '9'" 
                 type="text" 
                 size="mini"
                 @click.stop="jumpFlow(scope.row)"
               >流程跳转</el-button>
+              <!-- <Retrieve :data="handelRetrieve(scope.row)" @success="handleQueryList"></Retrieve> -->
             </template>
         </el-table-column>
       
@@ -764,7 +787,12 @@ export default {
           :label="column.title" 
           :name="column.key"
         >
-          <div style="height:580px;display:flex">
+          <div 
+            :style="{
+              height:tabHeight,
+              display:'flex'
+            }"
+          >
             <el-super-table
               v-model="tabTableDatas[column.key]"
               :ref="column.key"

+ 7 - 2
src/views/purchase/task/columns.js

@@ -6,6 +6,7 @@ export default function useColumns() {
       attr: {
         is: "el-dict-tag",
         dictName: "purchase_task_status",
+
       },
     },
 
@@ -119,7 +120,8 @@ export default function useColumns() {
       },
       attr: { 
         is: "el-select", 
-        dictName: "sys_true_false" 
+        dictName: "sys_true_false" ,
+        clearable: true,
       },
     },
     // {
@@ -153,11 +155,14 @@ export default function useColumns() {
     },
     {
       item: {
-        key: "status",
+        // key: "status",
+        key: "statusList",
         title: "状态",
       },
       attr: {
         is: "el-select",
+        multiple:true,
+        collapseTags:true,
         dictName: "purchase_task_status",
         clearable: true,
       },

+ 4 - 0
src/views/purchase/task/index.vue

@@ -33,6 +33,10 @@ export default {
   computed: {},
   watch: {},
   created() {
+    this.params = {
+      ...this.params,
+      statusList:['0','2','3']
+    }
     this.useQuery(this.params, this.page);
   },
   methods: {