gjy 3 years ago
parent
commit
3eff3274ed
29 changed files with 1888 additions and 762 deletions
  1. 6 0
      src/api/V2/profitable/index.js
  2. 1 0
      src/lang/zh.js
  3. 10 1
      src/model/profitable/index.js
  4. 39 42
      src/views/profitable/cashout.vue
  5. 44 104
      src/views/profitable/cashoutaduit.vue
  6. 551 0
      src/views/profitable/cashoutedit.vue
  7. 16 0
      src/views/profitable/component/routers/route.js
  8. 57 19
      src/views/profitable/contractcost.vue
  9. 44 6
      src/views/profitable/contractinventory.vue
  10. 100 31
      src/views/profitable/contractprofits.vue
  11. 42 33
      src/views/profitable/contractprofitsdetails.vue
  12. 107 19
      src/views/profitable/expenseallot.vue
  13. 18 27
      src/views/profitable/expenseallotaduit.vue
  14. 33 13
      src/views/profitable/expensemanagement.vue
  15. 33 19
      src/views/profitable/expensemanagementdetails.vue
  16. 127 103
      src/views/profitable/expensemanagentedit.vue
  17. 27 3
      src/views/profitable/payment.vue
  18. 13 12
      src/views/profitable/receipt.vue
  19. 24 8
      src/views/profitable/receiptaduit.vue
  20. 16 10
      src/views/profitable/warehousecost.vue
  21. 101 73
      src/views/profitable/warehouseprofits.vue
  22. 8 6
      src/views/profitable/warehouseprofitsdetails.vue
  23. 2 2
      src/views/taskManagement/tranManagementWarehouseInOutTask.vue
  24. 5 1
      src/views/taskManagement/tranManagementWarehouseInOutTaskAdd.vue
  25. 7 5
      src/views/taskManagement/tranManagementWarehouseInOutTaskAudit.vue
  26. 294 146
      src/views/taskManagement/tranManagementWarehouseInOutTaskEdit.vue
  27. 1 4
      src/views/warehouse/warehouseManagementRecord.vue
  28. 84 45
      src/views/warehousenew/inventoryCheck.vue
  29. 78 30
      src/views/warehousenew/warehousingOrder.vue

+ 6 - 0
src/api/V2/profitable/index.js

@@ -42,6 +42,8 @@ export const API_LOOK_EXPENSEINFO ='/expenseInfo/ExpenseInfo'
 export const API_DEL_EXPENSEINFO ='/expenseInfo/deleteInfo'
 // 费用管理分配删除
 export const API_DEL_ALLOCATIONINFO ='/expenseInfo/deleteAllocationInfo'
+// 费用管理分配编辑单条删除
+export const API_DEL_ONE_ALLOCATIONINFO ='/expenseAllocationInfo/deleteInfo'
 // 费用管理付款
 export const API_PAYMNET ='/expenseInfo/payment'
 // 合同费用,库点费用
@@ -50,8 +52,12 @@ export const API_GET_CONTRACTEXPENSEINFO ='/contractExpensesInfo/selectContractE
 export const API_GET_INVENTORYINFO ='/contractInventoryDistribution/selectContractInventoryInfo'
 // 合同利润详情
 export const API_GET_CONTRACTDETAILS ='/contractManagementInfo/selectContractInfo'
+// 合同利润图表
+export const API_GET_CONTRACTCHART  ='/contractManagementInfo/selectContractChart'
 // 库点利润详情
 export const API_GET_WAREHOUSETAILS ='/warehouseBaseInfo/selectBaseInfo'
+// 库点利润图表
+export const API_GET_WAREHOUSECHART  ='/warehouseBaseInfo/selectWarehouseChart'
 // 费用管理图表
 export const API_EXPENSECHAT ='/expenseInfo/expenseChart'
 // 费用管理收支表

+ 1 - 0
src/lang/zh.js

@@ -1072,6 +1072,7 @@ export default {
     warehousecost:'库点利润  /  利润详情  /  费用',
     contractcost:'合同利润  /  利润详情  /  费用',
     cashout:'费用管理  /  费用详情  /  请款',
+    cashoutedit:'费用管理  /  费用详情  /  请款编辑',
     cashoutaduit:'费用管理  /  费用详情  /  审核',
     payment:'费用管理  /  费用详情  /  付款',
     receiptaduit:'费用管理  /  费用详情  /  确认',

+ 10 - 1
src/model/profitable/index.js

@@ -29,7 +29,10 @@ import {
   API_GET_INVENTORYINFO,
   API_GET_WAREHOUSETAILS,
   API_EXPENSECHAT,
-  API_EXPENSECHATLIST
+  API_EXPENSECHATLIST,
+  API_GET_CONTRACTCHART,
+  API_GET_WAREHOUSECHART,
+  API_DEL_ONE_ALLOCATIONINFO
 } from '@/api/V2/profitable'
 //收支明细列表
 export const getInOutDetailed = appRx.get(API_GET_INOUTDETAILED, errorCatcher, errorHandle, filter)
@@ -75,6 +78,8 @@ export const lookexenseinfo= appRx.get(API_LOOK_EXPENSEINFO, errorCatcher, error
 export const delexenseinfo= appRx.post(API_DEL_EXPENSEINFO, errorCatcher, errorHandle, filter)
 // 费用管理分配删除
 export const delallocationinfo= appRx.post(API_DEL_ALLOCATIONINFO, errorCatcher, errorHandle, filter)
+// 费用管理分配编辑单条删除
+export const deloneallocationinfo= appRx.post(API_DEL_ONE_ALLOCATIONINFO, errorCatcher, errorHandle, filter)
 // 费用管理付款
 export const expensepayment= appRx.post(API_PAYMNET, errorCatcher, errorHandle, filter)
 // 合同费用,库点费用
@@ -83,8 +88,12 @@ export const getcontractexpenseinfo= appRx.get(API_GET_CONTRACTEXPENSEINFO, erro
 export const getcontractdetails= appRx.get(API_GET_CONTRACTDETAILS, errorCatcher, errorHandle, filter)
 // 合同库存、收购库存
 export const getinventoryinfo= appRx.get(API_GET_INVENTORYINFO, errorCatcher, errorHandle, filter)
+// 合同利润图表
+export const getcontractchart= appRx.get(API_GET_CONTRACTCHART, errorCatcher, errorHandle, filter)
 // 库点利润详情
 export const getwarehousedetails= appRx.get(API_GET_WAREHOUSETAILS, errorCatcher, errorHandle, filter)
+// 库点利润图表
+export const getwarehousechart= appRx.get(API_GET_WAREHOUSECHART, errorCatcher, errorHandle, filter)
 // 费用管理图表
 export const getexpensechat= appRx.get(API_EXPENSECHAT, errorCatcher, errorHandle, filter)
 // 费用管理收支表

+ 39 - 42
src/views/profitable/cashout.vue

@@ -90,35 +90,36 @@
         </ws-select>
         <span v-if='mode!="暂不分配"'>合计分配:{{amount}}元</span>  
         </div>
-        <el-table v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"&&mode!="暂不分配"||deptBudgetList.purpose=="库点费用"&&mode!="暂不分配"' :data="feeDetailsDistributions" style="width: 90%;margin:0 auto;">
+        <el-table ref="tableref" v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"&&mode!="暂不分配"||deptBudgetList.purpose=="库点费用"&&mode!="暂不分配"' :data="feeDetailsDistributions" style="width: 90%;margin:0 auto;">
           <el-table-column v-if='deptBudgetList.purpose=="合同费用"' prop="date" label="仓库名称" min-width="110">
             <template slot-scope="scope">
-              <ws-select v-model="scope.row.warehouseName" placeholder="选择仓库" @change="((value)=>{selectware(value, scope.row)})">
-                <ws-option v-for="item in warehouseList" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName"
+              <el-select v-model="scope.row.warehouseName" placeholder="选择仓库" @change="((value)=>{selectware(value, scope.$index)})">
+                <el-option v-for="item in warehouseList" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName"
                   style="color: #8890b1" />
-              </ws-select>
+              </el-select>
             </template>
           </el-table-column>
           <el-table-column v-if='deptBudgetList.purpose=="合同费用"' prop="date" label="日期">
             <template slot-scope="scope">
-               <ws-select v-model="scope.row.receiptDocDate" placeholder="选择日期" @change="((value)=>{selecttime(value, scope.row)})">
-                <ws-option v-for="item in datelist" :key="item.time" :label="item.time" :value="item.time"
+               <ws-select v-model="scope.row.receiptDocDate" placeholder="选择日期" @change="((value)=>{selecttime(value, scope.row,scope.$index)})">
+                <ws-option v-for="item in datelist[scope.$index]" :key="item.time" :label="item.time" :value="item.time"
                   style="color: #8890b1" />
               </ws-select>
             </template>
           </el-table-column>
           <el-table-column v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="日期">
             <template slot-scope="scope">
-                <el-date-picker @change="receiptDocDatechange" v-model="scope.row.receiptDocDate" type="date" placeholder="请选择日期"
+                <el-date-picker @change="((value)=>{receiptDocDatechange(value, scope.$index)})" v-model="scope.row.receiptDocDate" type="date" placeholder="请选择日期"
               value-format="yyyy-MM-dd"   ></el-date-picker>
             </template>
           </el-table-column>
           <el-table-column v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="货源">
               <template slot-scope="scope">
-                <ws-select v-model="scope.row.orderId" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row)})">
-                    <ws-option v-for="item in goodsourcelist" :key="item.id" :label="item.goodsSource" :value="item.id"
+                <!-- {{scope.row.goodsourcelist}} -->
+                <el-select v-model="scope.row.orderId" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row,scope.$index)})">
+                    <el-option v-for="item in goodsourcelist[scope.$index]" :key="item.id" :label="item.goodsSource" :value="item.id"
                         style="color: #8890b1" />
-                </ws-select>
+                </el-select>
             </template>
           </el-table-column>
           <el-table-column v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="货名">
@@ -246,16 +247,18 @@
         var date = "0" + unixtimestamp.getDate();
         return year + "-" + month.substring(month.length - 2, month.length) + "-" +     date.substring(date.length - 2,date.length)      
       },
-      selectware(e,item){
+      selectware(e,index){
+        var arr=[]
         this.datelist=[]
         getwarehousingorder({contractNo:this.deptBudgetList.contractNo,warehouseName:e}).toPromise()
           .then(response => {
             for (let i = 0; i < response.length; i++) {
-              this.datelist.push({time:response[i].issuingTime,id:response[i].id,weight:response[i].inWarehouseWeight})
+              arr.push({time:response[i].issuingTime,id:response[i].id,weight:response[i].inWarehouseWeight})
             }
+            this.$set(this.datelist,index,JSON.parse(JSON.stringify(arr)))
           })
       },
-      selectgoodsSource(e,item){
+      selectgoodsSource(e,item,index){
         var weight=0
         console.log(e)
         var money=0
@@ -271,32 +274,25 @@
               })
           return
         }
-        for (let i = 0; i < this.goodsourcelist.length; i++) {
-          if(this.goodsourcelist[i].id==e){
-            item.goodsSource=this.goodsourcelist[i].goodsSource
-            item.inWarehouseWeight=this.goodsourcelist[i].weight
-            item.goodsName=this.goodsourcelist[i].goodsName
-            item.goodsNameKey=this.goodsourcelist[i].goodsNameKey
+        for (let i = 0; i < this.goodsourcelist[index].length; i++) {
+          if(this.goodsourcelist[index][i].id==e){
+            this.feeDetailsDistributions[index].goodsSource=this.goodsourcelist[index][i].goodsSource
+            this.feeDetailsDistributions[index].inWarehouseWeight=this.goodsourcelist[index][i].weight
+            this.feeDetailsDistributions[index].goodsName=this.goodsourcelist[index][i].goodsName
+            this.feeDetailsDistributions[index].goodsNameKey=this.goodsourcelist[index][i].goodsNameKey
             }
         }
         if(this.moneys=='按重量自动分配'){
+          weight = this.feeDetailsDistributions.reduce(function (total, currentValue, currentIndex, arr) {
+              return total + currentValue.inWarehouseWeight;
+          }, 0)
           for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
-          weight+=this.feeDetailsDistributions[i].inWarehouseWeight
-          }
-          for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
-            // console.log(weight,this.feeDetailsDistributions[i].inWarehouseWeight)
-            if(i=this.feeDetailsDistributions.length-1&&i!=0){
-              console.log(i)
-              this.feeDetailsDistributions[i].distributionMoney=this.deptBudgetList.amountMoney-money
-            }else{
               this.feeDetailsDistributions[i].distributionMoney=Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.amountMoney)
               money+=this.feeDetailsDistributions[i].distributionMoney
-            }
-            
           }
         }
       },
-      selecttime(e,item){
+      selecttime(e,item,index){
         var weight=0
         var money=0
         if(!this.deptBudgetList.amountMoney&&this.moneys=='按重量自动分配'){
@@ -311,10 +307,11 @@
               })
           return
         }
-        for (let i = 0; i < this.datelist.length; i++) {
-          if(this.datelist[i].time==e){
-            item.orderId=this.datelist[i].id
-            item.inWarehouseWeight=this.datelist[i].weight
+        for (let i = 0; i < this.datelist[index].length; i++) {
+          // console.log()
+          if(this.datelist[index][i].time==e){
+            item.orderId=this.datelist[index][i].id
+            item.inWarehouseWeight=this.datelist[index][i].weight
           }
         }
         if(this.moneys=='按重量自动分配'){
@@ -323,23 +320,22 @@
           }
           for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
             // console.log(weight,this.feeDetailsDistributions[i].inWarehouseWeight)
-            if(i=this.feeDetailsDistributions.length-1&&i!=0){
-              this.feeDetailsDistributions[i].distributionMoney=this.deptBudgetList.amountMoney-money
-            }else{
               this.feeDetailsDistributions[i].distributionMoney=Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.amountMoney)
               money+=this.feeDetailsDistributions[i].distributionMoney
-            }
+
           }
         }
         // console.log(this.feeDetailsDistributions)
       },
-      receiptDocDatechange(e){
-        this.goodsourcelist=[]
+      receiptDocDatechange(e,index){
+        var arr=[]
+        this.goodsourcelist[index]=[]
         getwarehousingorder({warehouseName:this.deptBudgetList.warehouseName,receiptDocDate:e}).toPromise()
           .then(response => {
             for (let i = 0; i < response.length; i++) {
-              this.goodsourcelist.push({goodsSource:response[i].goodsSource,id:response[i].id,weight:response[i].inWarehouseWeight,goodsName:response[i].goodsName,goodsNameKey:response[i].goodsNameKey})
+              arr.push({goodsSource:response[i].goodsSource,id:response[i].id,weight:response[i].inWarehouseWeight,goodsName:response[i].goodsName,goodsNameKey:response[i].goodsNameKey})
             }
+             this.$set(this.goodsourcelist,index,JSON.parse(JSON.stringify(arr)))
           })
       },
       selectcontent(e){
@@ -595,6 +591,7 @@
               message: '提交成功!',
               type: 'success',
             })
+            this.deptBudgetList={}
             this.$router.go(-1)
           })
           })
@@ -612,7 +609,7 @@
           console.log(e)
       },
       addlist(){
-        this.feeDetailsDistributions.push({proDate:'',weight:'',money:'',warehouse:'',belonging:'',index:this.feeDetailsDistributions.length})
+        this.feeDetailsDistributions.push({receiptDocDate:'',inWarehouseWeight:0,distributionMoney:0,warehouseName:'',time:0,id:0,weight:0,goodsName:'',goodsSource:'',index:0,   goodsNameKey: null,index:this.feeDetailsDistributions.length})
       },
       dellist(row){
         if(this.feeDetailsDistributions.length>1){

+ 44 - 104
src/views/profitable/cashoutaduit.vue

@@ -30,7 +30,7 @@
             </ws-select>
           </el-form-item>
           <el-form-item v-if='deptBudgetList.expensesPurpose==3' label-width='100px' label="仓库名称" span="1" prop="warehouse" class="readonly">
-          {{deptBudgetList.warehouse}}
+          {{deptBudgetList.warehouseName}}
           </el-form-item>
           <el-form-item v-if='deptBudgetList.expensesPurpose==1' label-width='100px' label="合同编号" span="1" prop="contractNo" class="readonly">
           {{deptBudgetList.contractNo}}
@@ -60,10 +60,9 @@
           </div>
         </el-form-item>
         </el-form>
-        <div v-if='deptBudgetList.expensesPurpose==1&&deptBudgetList.costType==3||deptBudgetList.expensesPurpose==2' style='width:90%;margin:10px auto;'>
+        <!-- <div v-if='deptBudgetList.expensesPurpose==1&&deptBudgetList.costType==3||deptBudgetList.expensesPurpose==2' style='width:90%;margin:10px auto;'>
           <div style='margin-bottom:20px;display:flex;justify-content: space-between;'>
             <div>费用分配</div><span>合计分配:{{amount}}元</span>  </div>
-          <!-- <div> -->
           <el-table :data="deptBudgetList.expenseAllocationInfoList">
             <el-table-column v-if='deptBudgetList.purpose=="合同费用"' prop="date" label="仓库名称" min-width="110">
               <template slot-scope="scope">
@@ -112,7 +111,7 @@
             </el-table-column>
           </el-table>
 
-      </div>
+      </div> -->
       <div>
         <div style='width:90%;margin:10px auto;text-align:right;'>
           <el-button class="bg-bottom" type="primary" size="small" @click="reject()">驳回
@@ -145,7 +144,10 @@
   </div>
 </template>
 <script>
-  import {setexpense,getcontract,getwarehouse,addexenseinfo,getwarehousingorder,lookexenseinfo} from '@/model/profitable/index'
+  import {
+    woekflowhandle
+  } from '@/model/tasksport/index'
+  import {getcontract,getwarehouse,lookexenseinfo,editexenseinfo} from '@/model/profitable/index'
   export default {
     components: {},
     data() {
@@ -162,16 +164,18 @@
         goods:'全部货品',
         goodsList:[],
         warecontractList:[],
+        textarea:'',
         feeDetailsDistributions:[{proDate:'',weight:'',money:'',warehouse:'',belonging:'',index:0}],
         deptBudgetList:{},
         makeWordData: {},
         warehouseList:[],
         rejectshow:false,
-        modeList:[{key:1,value:'全部分配'},{key:2,value:'部分分配'},{key:3,value:'暂不分配'}],
-        wareList:[{key:1,value:'指定仓库'},{key:2,value:'全部仓库'}],
-        datesList:[{key:1,value:'固定日期'},{key:2,value:'指定日期'}],
-        moneysList:[{key:1,value:'按重量自动分配'},{key:2,value:'指定分配金额'}],
-        goodsList:[{key:1,value:'全部货品'},{key:2,value:'指定货品'}],
+        srcList:[],
+        // modeList:[{key:1,value:'全部分配'},{key:2,value:'部分分配'},{key:3,value:'暂不分配'}],
+        // wareList:[{key:1,value:'指定仓库'},{key:2,value:'全部仓库'}],
+        // datesList:[{key:1,value:'固定日期'},{key:2,value:'指定日期'}],
+        // moneysList:[{key:1,value:'按重量自动分配'},{key:2,value:'指定分配金额'}],
+        // goodsList:[{key:1,value:'全部货品'},{key:2,value:'指定货品'}],
         valueData: [{
             date: 10
           },
@@ -185,20 +189,10 @@
     activated() {
       this.getList()
     },
-    computed: {
-    // 计算属性的 getter
-      amount: function () {
-        // `this` 指向 vm 实例
-        var num=0
-        for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
-          if(this.feeDetailsDistributions[i].distributionMoney){
-            num+=Number(this.feeDetailsDistributions[i].distributionMoney)
-          }
-        }
-        return num
-      }
-    },
     methods: {
+      handleClose(){
+        this.rejectshow=false
+      },
       pass(){
          this.$confirm('确认通过请款信息?', '提示', {
             confirmButtonText: '确定',
@@ -207,24 +201,23 @@
           })
           .then(() => {
             woekflowhandle({
-                taskId: this.deptBudgetList.taskId,
-                approved: true,
-                auditMind: '34',
-                needReapply: false,
+              taskId: this.deptBudgetList.taskId,
+              approved:true,
+              auditMind: '34',
+              needReapply: true,
+            }).toPromise()
+            .then((response) => {
+              this.$message({
+                message: '通过成功!',
+                type: 'success',
               })
-              .toPromise()
-              .then((response) => {
-                this.$message({
-                  message: '通过成功!',
-                  type: 'success',
-                })
-                this.$router.go(-1)
-              }).catch((response) => {
-                this.$message({
-                  message: '通过失败!',
-                  type: 'success',
-                })
+              this.$router.go(-1)
+            }).catch((response) => {
+              this.$message({
+                message: '通过失败!',
+                type: 'error',
               })
+            })
           })
       },
       returnsales(){
@@ -236,57 +229,41 @@
       rejectclick(){
         woekflowhandle({
           taskId: this.deptBudgetList.taskId,
-          approved: true,
-          auditMind: '34',
-          needReapply: false,
+          approved:false,
+          auditMind: this.textarea,
+          needReapply: true,
         }).toPromise()
         .then((response) => {
           this.$message({
             message: '驳回成功!',
             type: 'success',
           })
+          this.rejectshow=false
           this.$router.go(-1)
         }).catch((response) => {
           this.$message({
             message: '驳回失败!',
-            type: 'success',
+            type: 'error',
           })
         })
       },
-      modeselect(e){
-          console.log(e)
-      },selectware(e){
-          console.log(e)
-      },
-      goodsNameselect(e){
-          console.log(e)
-      },
-      addlist(){
-        this.feeDetailsDistributions.push({proDate:'',weight:'',money:'',warehouse:'',belonging:'',index:this.feeDetailsDistributions.length})
-      },
-      dellist(row){
-          this.feeDetailsDistributions.splice(row.index,1)
-      },
       getList() {
        getcontract({
         compId:localStorage.getItem('ws-pf_compId'),
-        })
-        .toPromise()
+        }).toPromise()
         .then((response) => {
           this.contractList=response
         })
         getwarehouse({
-        compId:localStorage.getItem('ws-pf_compId'),
-        warehouseType:1
-        })
-        .toPromise()
+          compId:localStorage.getItem('ws-pf_compId'),
+          warehouseType:1
+        }).toPromise()
         .then((response) => {
           this.warehouseList=response
         })
         lookexenseinfo({
          id:this.$route.query.id
-        })
-        .toPromise()
+        }).toPromise()
         .then((response) => {
           if(response.costType==1){
             response.type='粮款'
@@ -295,52 +272,15 @@
           }else if(response.costType==5){
             response.type='保证金'
           }
-          this.deptBudgetList=response 
+          this.deptBudgetList=response
+          this.deptBudgetList.taskId=this.$route.query.taskId 
           if(response.addressUrl){
             var arr=[]
             var srcs=response.addressUrl.split(',')
             this.srcList=srcs
           }
-          if(response.expenseAllocationInfoList){
-            this.feeDetailsDistributions=response.expenseAllocationInfoList
-          }
-          
-          
         })
 
-      },
-      detail(){
-        this.$router.push({name:'contractprofitsdetails'})
-      },
-      getPassYearFormatDate() {
-        var nowDate = new Date()
-        var _date = new Date()
-        nowDate.setTime(nowDate.getTime() - 24 * 60 * 60 * 1000 * 30)
-        var year = nowDate.getFullYear()
-        var year1 = _date.getFullYear()
-        var month = nowDate.getMonth() + 1
-        var month1 = _date.getMonth() + 1
-        var strDate = nowDate.getDate()
-        var strDate1 = _date.getDate()
-        if (month >= 1 && month <= 9) {
-          month = '0' + month
-        }
-        if (month1 >= 1 && month1 <= 9) {
-          month1 = '0' + month1
-        }
-
-        if (strDate >= 0 && strDate <= 9) {
-          strDate = '0' + strDate
-        }
-        if (strDate1 >= 0 && strDate1 <= 9) {
-          strDate1 = '0' + strDate1
-        }
-        this.startDate = year + '-' + month + '-' + strDate
-        this.endDate = year1 + '-' + month1 + '-' + strDate1
-        this.value = [this.startDate, this.endDate]
-      },
-      pickerOptions() {
-
       },
     },
   }

+ 551 - 0
src/views/profitable/cashoutedit.vue

@@ -0,0 +1,551 @@
+//请款
+<template>
+  <div class="container">
+    <el-row class="row_top">
+      <el-col :span="12">
+        <h2 class="bg-left title">请款</h2>
+      </el-col>
+      <el-col :span="12" class="bg-right"><el-button class="bg-bottom" type="primary" size="small" @click="returnsales()"><img width="6" height="10"
+            style="vertion-align: bottom; margin-right: 3px" src="../../../public/img/lujing.png" alt="" />返回
+        </el-button></el-col>
+    </el-row>
+    <div class="center">
+     
+      <div>
+        <el-form label-position="left"><div style='margin:30px 0 30px;'>基本信息</div>
+          <el-form-item  label-width='100px' label="用途" span="1" prop="purpose" class="readonly">
+            <ws-select v-model="deptBudgetList.purpose" placeholder="" class="typeselect" >
+              <ws-option label="合同费用" value="合同费用"
+                style="color: #8890b1" />
+                <ws-option label="库点费用" value="库点费用"
+                style="color: #8890b1" />
+                <ws-option label="经营性费用" value="经营性费用"
+                style="color: #8890b1" />
+            </ws-select>
+          </el-form-item>
+          <el-form-item label-width='100px' v-if='deptBudgetList.purpose=="合同费用"' label="类型" span="1" prop="contractNo" class="readonly">
+            <ws-select v-model="deptBudgetList.type" placeholder="" class="typeselect" >
+                <ws-option label="粮款" value="粮款" style="color: #8890b1" />
+                <ws-option label="非粮款" value="非粮款" style="color: #8890b1" />
+                <ws-option label="保证金" value="保证金" style="color: #8890b1" />
+            </ws-select>
+          </el-form-item>
+          <el-form-item label-width='100px' v-if='deptBudgetList.purpose=="合同费用"' label="合同编号" span="1" prop="contractNo" class="readonly">
+            <el-select v-model="deptBudgetList.contractNo" placeholder="选择合同" class="typeselect" @change="selectcontract">
+              <el-option v-for="item in contractList" :key="item.contractNo" :label="item.contractNo" :value="item.contractNo"
+                style="color: #8890b1" />
+            </el-select>
+          </el-form-item>
+           <el-form-item label-width='100px' v-if='deptBudgetList.purpose=="库点费用"' label="仓库名称" span="1" prop="contractNo" class="readonly">
+            <el-select v-model="deptBudgetList.warehouseName" placeholder="选择仓库" class="typeselect" @change="selectwarehouse">
+              <el-option v-for="item in warehouseList" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName"
+                style="color: #8890b1" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label-width='100px' label="费用名称" span="1" prop="settlementMethod">
+            <el-input class='input50 input_css' placeholder="输入费用名称,1-15个字" v-model="deptBudgetList.expenseName"></el-input>
+          </el-form-item>
+          <el-form-item label-width='100px' label="金额" span="1" prop="contractNo" class="readonly">
+            <el-input class='input50 input_css' placeholder="输入请款金额" v-model="deptBudgetList.amountMoney"></el-input>
+          </el-form-item>
+          <el-form-item label-width='100px' label="备注" span="1" prop="settlementMethod">
+            <el-input
+            type="textarea"
+            :rows="5"
+            placeholder="选填,不超过50个字"
+            v-model="deptBudgetList.remark">
+            </el-input>
+          </el-form-item>
+          <el-form-item label-width='100px' label="附件">
+          <el-upload ref='uploadfiles' :file-list='dataList' action="https://www.zthymaoyi.com/upload/admin" list-type="picture-card"
+            :on-success="handlefujian" :on-remove="handleRemove" class="photo2">
+            <i class="el-icon-plus"></i>
+          </el-upload>
+        </el-form-item>
+        </el-form>
+       <div style='text-align:right;margin-right:30px;'>
+        <el-button class="bg-bottom" type="primary" size="small" @click="submit()">提交
+        </el-button>
+    </div>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+  import {setexpense,getcontract,getwarehouse,editexenseinfo,getwarehousingorder,lookexenseinfo,} from '@/model/profitable/index'
+  export default {
+    components: {},
+    data() {
+      return {
+        value: [],
+        profitList: [{
+          name: "玉米",
+          count: 2000,
+        }],
+        mode:'全部分配',
+        moneys:'按重量自动分配',
+        dataList:[],
+        goodsList:[],
+        disabled:false,
+        warecontractList:[],
+        dateRange: this.disabledDate(),
+        feeDetailsDistributions:[{receiptDocDate:'',inWarehouseWeight:0,distributionMoney:0,warehouseName:'',goodsName:'',goodsSource:'',index:0}],
+        deptBudgetList:{purpose:"合同费用",type:'粮款'},
+        makeWordData: {},
+        warehouseList:[],
+        contractList:[],
+        choosablewareList:[],
+        paymentScreenshot:[],
+        goodsourcelist:[],
+        signingDate:'',
+        datelist:[],
+        modeList:[{key:1,value:'全部分配'},{key:2,value:'部分分配'},{key:3,value:'暂不分配'}],
+        wareList:[{key:1,value:'指定仓库'},{key:2,value:'全部仓库'}],
+        datesList:[{key:1,value:'固定日期'},{key:2,value:'指定日期'}],
+        moneysList:[{key:1,value:'按重量自动分配'},{key:2,value:'指定分配金额'}],
+        goodsList:[{key:1,value:'全部货品'},{key:2,value:'指定货品'}],
+        
+        valueData: [{
+            date: 10
+          },
+          {
+            date: 20
+          }
+        ], //货值
+
+      }
+
+    },
+    activated() {
+      // this.makeWordData = this.getData(2)
+      // this.initCharts()
+      // this.getPassYearFormatDate()
+      this.getList()
+    },
+     computed: {
+    // 计算属性的 getter
+      amount: function () {
+        // `this` 指向 vm 实例
+        var num=0
+        for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+          if(this.feeDetailsDistributions[i].distributionMoney){
+            num+=Number(this.feeDetailsDistributions[i].distributionMoney)
+          }
+        }
+        return num
+      }
+    },
+    methods: {
+      selectwarehouse(e){
+        for (let i = 0; i < this.warehouseList.length; i++) {
+          if(this.warehouseList[i].warehouseName==e){
+            this.deptBudgetList.warehouseId=this.warehouseList[i].id
+          }
+          
+        }
+      },
+      disabledDate() {
+        let that = this
+        return {
+          disabledDate(time) {
+            var firstDay = new Date(new Date(that.signingDate).getTime());
+            var lastDay = new Date(new Date().getTime());
+            lastDay.setFullYear(lastDay.getFullYear() + 1);
+            firstDay = that.timeFun(firstDay) //转格式 yyyy-MM-dd
+            lastDay = that.timeFun(lastDay) //转格式 yyyy-MM-dd
+            return time.getTime() < new Date(firstDay).getTime()
+                   ||
+                   time.getTime() > new Date(lastDay).getTime()
+          }
+        }
+      },
+      timeFun(unixtimestamp) {
+        var unixtimestamp = new Date(unixtimestamp);
+        var year = 1900 + unixtimestamp.getYear();
+        var month = "0" + (unixtimestamp.getMonth() + 1);
+        var date = "0" + unixtimestamp.getDate();
+        return year + "-" + month.substring(month.length - 2, month.length) + "-" +     date.substring(date.length - 2,date.length)      
+      },
+      selectware(e,item){
+        this.datelist=[]
+        getwarehousingorder({contractNo:this.deptBudgetList.contractNo,warehouseName:e}).toPromise()
+          .then(response => {
+            for (let i = 0; i < response.length; i++) {
+              this.datelist.push({time:response[i].issuingTime,id:response[i].id,weight:response[i].inWarehouseWeight})
+            }
+          })
+      },
+      selectcontent(e){
+
+      },
+      selectcontract(e){
+        console.log(e)
+        for (let i = 0; i < this.contractList.length; i++) {
+          console.log(this.contractList[i])
+          if(this.contractList[i].contractNo==e){
+            this.deptBudgetList.contractId=this.contractList[i].id
+            this.signingDate=this.contractList[i].signingDate
+            // this.disabledDate()
+          }
+        }
+      },
+      returnsales(){
+        this.$router.go(-1)
+      },
+      handlefujian(file) {
+        // console.log(file)
+        this.paymentScreenshot.push(file.url)
+        // this.dialogVisible = true
+      },
+      handleRemove(file) {
+        // console.log(file)
+        for (let i = 0; i < this.paymentScreenshot.length; i++) {
+          if(this.paymentScreenshot[i]==response.url){
+            this.paymentScreenshot.splice(i, 1)
+          }
+          
+        }
+      },
+      // 获取当前年月日
+			getdate() {
+				var date = new Date()
+				var year = date.getFullYear() //获取完整的年份(4位)
+				var mouth = date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
+				var datetime = date.getDate() //获取当前日(1-31)
+				var hour = date.getHours()
+				var minutes = date.getMinutes()
+				var seconds = date.getSeconds()
+				if (mouth < 10) {
+					mouth = '0' + mouth
+				}
+				if (datetime < 10) {
+					datetime = '0' + datetime
+				}
+				if (hour < 10) {
+					hour = '0' + hour
+				}
+				if (minutes < 10) {
+					minutes = '0' + minutes
+				}
+				if (seconds < 10) {
+					seconds = '0' + seconds
+				}
+				return year + '' + mouth + datetime + hour + minutes + seconds
+			},
+      MathRand() {
+				var Num = ''
+				for (var i = 0; i < 4; i++) {
+					Num += Math.floor(Math.random() * 10)
+				}
+				return Num
+			},
+      submit(){
+        this.deptBudgetList.compId=localStorage.getItem('ws-pf_compId')
+        this.deptBudgetList.agent=localStorage.getItem('ws-pf_staffName')
+        if(this.deptBudgetList.purpose=='合同费用'&&this.deptBudgetList.type=='非粮款'||this.deptBudgetList.purpose=='库点费用'){
+          for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+            if(!this.feeDetailsDistributions[i].distributionMoney){
+              this.$message({
+                message: '分配金额不能为空!',
+                type: 'warning',
+              })
+              return
+            }
+            if(this.feeDetailsDistributions[i].distributionMoney<0){
+              this.$message({
+                message: '分配金额应大于0!',
+                type: 'warning',
+              })
+              return
+            }
+            if((String(this.feeDetailsDistributions[i].distributionMoney).indexOf('.') != -1 &&
+              String(this.feeDetailsDistributions[i].distributionMoney).length -
+              (String(this.feeDetailsDistributions[i].distributionMoney).indexOf('.') + 1) >
+              2)){
+              this.$message({
+                message: '分配金额最多保留两位小数!',
+                type: 'warning',
+              })
+              return
+            }
+          }
+        }
+        this.deptBudgetList.totalDistribution=this.amount
+        if(this.deptBudgetList.purpose=='合同费用'){
+          this.deptBudgetList.expensesPurpose=1
+          this.deptBudgetList.costNo='HTF'+this.getdate()+this.MathRand()
+        }else if(this.deptBudgetList.purpose=='库点费用'){
+          this.deptBudgetList.expensesPurpose=3
+           this.deptBudgetList.costNo='KDF'+this.getdate()+this.MathRand()
+        }else if(this.deptBudgetList.purpose=='经营性费用'){
+          this.deptBudgetList.expensesPurpose=5
+           this.deptBudgetList.costNo='JYF'+this.getdate()+this.MathRand()
+        }
+        if(this.deptBudgetList.expensesPurpose==1){
+          if(this.deptBudgetList.type=='粮款'){
+            this.deptBudgetList.costType=1
+          }else if(this.deptBudgetList.type=='非粮款'){
+            this.deptBudgetList.costType=3
+          }else if(this.deptBudgetList.type=='保证金'){
+            this.deptBudgetList.expensesPurpose=5
+          }
+        }
+        this.deptBudgetList.expensesType=2
+        if(!this.deptBudgetList.contractNo&&this.deptBudgetList.expensesPurpose==1){
+          this.$message({
+                message: '合同编号不能为空!',
+                type: 'warning',
+              })
+              return
+        }
+        if(!this.deptBudgetList.warehouseName&&this.deptBudgetList.expensesPurpose==3){
+          this.$message({
+                message: '仓库名称不能为空!',
+                type: 'warning',
+              })
+              return
+        }
+       
+        if(this.deptBudgetList.expensesPurpose==1&&this.deptBudgetList.costType==3&&this.mode=='全部分配'||this.deptBudgetList.expensesPurpose==3&&this.mode=='全部分配'){
+          if(this.amount!=this.deptBudgetList.amountMoney){
+            this.$message({
+                message: '请款金额与分配金额不相等!',
+                type: 'warning',
+          })
+          return
+          }
+        }
+        if(this.deptBudgetList.expensesPurpose==1&&this.deptBudgetList.costType==3&&this.mode=='部分分配'||this.deptBudgetList.expensesPurpose==3&&this.mode=='部分分配'){
+          if(this.amount>this.deptBudgetList.amountMoney){
+            this.$message({
+                message: '分配金额不可超过请款金额!',
+                type: 'warning',
+          })
+          return
+          }
+        }
+        if(!this.deptBudgetList.expenseName){
+          this.$message({
+                message: '费用名称不能为空!',
+                type: 'warning',
+          })
+          return
+        }
+        if(this.deptBudgetList.expenseName.length<1||this.deptBudgetList.expenseName.length>15){
+          this.$message({
+                message: '费用名称输入错误!',
+                type: 'warning',
+          })
+        }
+        if(!this.deptBudgetList.amountMoney){
+          this.$message({
+                message: '金额不能为空!',
+                type: 'warning',
+          })
+          return
+        }
+        if(this.deptBudgetList.amountMoney<0.01||this.deptBudgetList.amountMoney>100000000){
+          this.$message({
+                message: '金额输入错误!',
+                type: 'warning',
+          })
+          return
+        }
+        this.deptBudgetList.addressUrl=this.paymentScreenshot.toString()
+        this.$confirm('确定提交请款信息', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          })
+          .then(() => {
+        this.deptBudgetList.flag=4
+        editexenseinfo(this.deptBudgetList).toPromise()
+          .then(response => {
+            this.$message({
+              message: '提交成功!',
+              type: 'success',
+            })
+            this.dataList=[]
+            this.paymentScreenshot=[]
+            this.$router.go(-1)
+          })
+          })
+      },
+      modeselect(e){
+        if(e=='全部分配'){
+          this.moneys='按重量自动分配'
+          this.disabled=false
+        }else if(e=='部分分配'){
+          this.moneys='指定分配金额'
+          this.disabled=true
+        }
+      },
+      goodsNameselect(e){
+          console.log(e)
+      },
+      addlist(){
+        this.feeDetailsDistributions.push({proDate:'',weight:'',money:'',warehouse:'',belonging:'',index:this.feeDetailsDistributions.length})
+      },
+      dellist(row){
+        if(this.feeDetailsDistributions.length>1){
+          this.feeDetailsDistributions.splice(row.index,1)
+        }else{
+          this.$message({
+            message: '至少保留一条!',
+            type: 'warning',
+          })
+        }
+      },
+      getList() {
+        getcontract({
+        compId:localStorage.getItem('ws-pf_compId'),
+        })
+        .toPromise()
+        .then((response) => {
+          this.contractList=response
+        })
+        getwarehouse({
+        compId:localStorage.getItem('ws-pf_compId'),
+        warehouseType:1
+        })
+        .toPromise()
+        .then((response) => {
+          this.warehouseList=response
+        })
+        lookexenseinfo({
+         id:this.$route.query.id
+        })
+        .toPromise()
+        .then((response) => {
+          if(response.costType==1){
+            response.type='粮款'
+          }else if(response.costType==3){
+            response.type='非粮款'
+          }else if(response.costType==5){
+            response.type='保证金'
+          }
+          this.deptBudgetList=response
+          this.dataList=[]
+          if(response.addressUrl){
+            var arr=[]
+            var srcs=response.addressUrl.split(',')
+            for (let i = 0; i < srcs.length; i++) {
+              this.dataList.push({url:srcs[i]})
+              
+            }
+            this.paymentScreenshot=srcs
+          }
+          if(response.expenseAllocationInfoList){
+            this.feeDetailsDistributions=response.expenseAllocationInfoList
+          }
+          
+          
+        })
+
+      },
+      detail(){
+        this.$router.push({name:'contractprofitsdetails'})
+      },
+      pickerOptions() {
+
+      },
+    },
+  }
+</script>
+<style lang="scss" scoped>
+  .container {
+    background: #E8ECF6;
+  }
+
+  .center {
+    margin: 0 auto;
+    background: #ffffff;
+    height: calc(100vh - 13vh);
+    border-radius: 4px;
+    margin-top: 10px;
+    overflow:scroll;
+  }
+  .expensetitle{
+    margin:0  auto 10px;width:90%;border-top:1px solid #D8DCE6;padding-top:30px;
+  }
+  /deep/.input50>.el-input__inner{
+    width:50%;
+  }
+  /deep/.typeselect.el-select{
+    width:50%;
+  }
+  .row_top {
+    // background: #F6F7FC;
+    border-radius: 4px;
+
+    .bg-left {
+      padding-left: 30px;
+    }
+
+  .bg-right {
+      padding-right: 10px;
+      text-align: right;
+      height:60px;
+      padding-top:15px;
+    }
+
+    .title {
+      position: relative;
+    }
+
+    .title::before {
+      content: '';
+      display: inline-block;
+      width: 5px;
+      height: 30px;
+      background: #5473e8;
+      position: absolute;
+      left: 0;
+    }
+  }
+
+  .datascreen {
+    // margin-top: 10px;
+    width: 500px;
+    height: 60px;
+    line-height: 60px;
+    margin-left: 30px;
+
+  }
+
+  .chart_css {
+    display: flex;
+    height: 410px;
+
+    .table {
+      width: 70%;
+      height: 410px;
+    }
+
+    .makeWord_css {
+      width: 30%;
+      height: 410px;
+      margin-left: 30px;
+    }
+  }
+
+  .table_css {
+
+    text-align:center;
+
+  }
+  /deep/.el-form{
+    width:90%;
+    margin:0 auto;
+    .el-form-item__label{
+      color:#8890B1;
+    }
+  }
+
+  /deep/.el-form-item {
+    width: 50%;
+}
+.add,.del{
+  width:25px;height:25px;
+}
+</style>

+ 16 - 0
src/views/profitable/component/routers/route.js

@@ -200,6 +200,22 @@ const profitableRouter = {
       },
       hidden:true,
     },
+    // 费用管理请款编辑
+    {
+      path: 'cashoutedit',
+      component: () =>
+        import(/* webpackChunkName: "applDetail" */ '@/views/profitable/cashoutedit'),
+      name: 'cashoutedit',
+      meta: {
+        title: 'cashoutedit',
+        shortcutEntrance: 'profitable',
+        module: 'contractManagement.exContract.exContractInfo.view',
+        permissicon: [],
+        keepAlive: true
+        // module: 'procurement.sparepart.applDetail'
+      },
+      hidden:true,
+    },
     // 费用管理请款审核
     {
       path: 'cashoutaduit',

+ 57 - 19
src/views/profitable/contractcost.vue

@@ -24,12 +24,11 @@
           </div>
         </el-col>
       </el-row>
-      <el-row style='margin-bottom:10px;'>
+      <el-row style='margin:10px;'>
         <el-col :span="18">
         支出粮款:{{foodExpenditure}}元   收入粮款:{{grainIncome}}元    费用收入:{{expenseIncome}}元    费用支出:{{expensesPay}}元    当期利润: {{currentProfit}}元 
         </el-col>
         <el-col :span="6">
-
         </el-col>
       </el-row>
       <div class="fromdata">
@@ -75,6 +74,7 @@
         deptBudgetTotal: 0,
         currentPage: 1,
         pageSize: 10,
+        name:'',
         deptCircularPage: {},
         contractList:[],
         taskTypeList:[],
@@ -93,7 +93,23 @@
       }
     },
     activated() {
-      this.contractNo=this.$route.query.contractNo
+      var type=''
+      if(this.$route.query.contractType==2){
+        type='(采购)'
+        this.name=this.$route.query.seller
+      }else if(this.$route.query.contractType==1){
+        type='(销售)'
+        this.name=this.$route.query.buyer
+      }else if(this.$route.query.contractType==3){
+         type='(代收)'
+         this.name=this.$route.query.buyer
+      }else{
+        type='(代储)'
+        this.name=this.$route.query.buyer
+      }
+      
+      this.contractNo1=this.$route.query.contractNo
+      this.contractNo=this.$route.query.contractNo+type
         //  this.getPassYearFormatDate()
       this.getList()
     },
@@ -102,6 +118,9 @@
         this.searchType = num
         this.getList()
       },
+      returnsales(){
+        this.$router.go(-1)
+      },
       changecontract(e){
           for (let i = 0; i < this.contractList.length; i++) {
             if(this.contractList[i].contractNo==e){
@@ -146,14 +165,26 @@
         })
         .toPromise()
         .then((response) => {
+          for (let i = 0; i < response.length; i++) {
+            if(response[i].contractType==2){
+              response[i].contractType1='(采购)'
+            }else if(response[i].contractType==1){
+              response[i].contractType1='(销售)'
+            }else if(response[i].contractType==3){
+              response[i].contractType1='(代收)'
+            }else{
+              response[i].contractType1='(代储)'
+            }
+            
+          }
           this.contractList=response
         })
          getcontractexpenseinfo({
             // warehouseType: 1,
             compId: localStorage.getItem('ws-pf_compId'),
-            contractNo:this.contractNo,
+            contractNo:this.contractNo1,
             currentPage: this.currentPage,
-            pageSize:this.pageSize ,
+            pageSize:this.pageSize,
             costType:1
           })
           .toPromise()
@@ -165,22 +196,26 @@
               this.expenseIncome=0
               this.expensesPay=0
               this.currentProfit=0
+              var income=0,expend=0
               for (let i = 0; i < this.tableData.length; i++) {
-                if(this.tableData[i].foodExpenditure){
-                  this.foodExpenditure+=Number(this.tableData[i].foodExpenditure)
-                }
-                if(this.tableData[i].grainIncome){
-                  this.grainIncome+=Number(this.tableData[i].grainIncome)
-                }
-                if(this.tableData[i].expenseIncome){
-                  this.expenseIncome+=Number(this.tableData[i].expenseIncome)
-                }
-                if(this.tableData[i].expensesPay){
-                  this.expensesPay+=Number(this.tableData[i].expensesPay)
-                }
-                if(this.tableData[i].currentProfit){
-                  this.currentProfit+=Number(this.tableData[i].currentProfit)
+                if(this.tableData[i].expensesPrice){
+                  if(this.tableData[i].expensesType==2){
+                    expend+=Number(this.tableData[i].expensesPrice)
+                    if(this.tableData[i].expensesName=='非粮款'){
+                      this.expensesPay+=Number(this.tableData[i].expensesPrice)
+                    }else{
+                      this.foodExpenditure+=Number(this.tableData[i].expensesPrice)
+                    }
+                  }else{
+                    income+=Number(this.tableData[i].expensesPrice)
+                    if(this.tableData[i].expensesName=='非粮款'){
+                      this.grainIncome+=Number(this.tableData[i].expensesPrice)
+                    }else{
+                      this.expenseIncome+=Number(this.tableData[i].expensesPrice)
+                    }
+                  }
                 }
+                  this.currentProfit=income-expend
               }
             }
             
@@ -291,4 +326,7 @@
   .bg-right{
     padding-top:15px;
   }
+  .typeselect{
+    margin:0 10px;
+  }
 </style>

+ 44 - 6
src/views/profitable/contractinventory.vue

@@ -13,7 +13,7 @@
       <el-row style='margin-bottom:10px;'>
         <el-col :span="12">
         <ws-select v-model="contractNo" placeholder="" class="typeselect" @change='changecontract'>
-          <ws-option v-for="item in contractList"  :key="item.id" :label="item.contractNo+item.contractType==2?'(采购)':item.contractType==1?'(销售)':item.contractType==3?'(代收)':'(代储)'" :value="item.contractNo"
+          <ws-option v-for="item in contractList"  :key="item.id" :value='item.contractNo' :label="item.contractNo+item.contractType1"
             style="color: #8890b1" />
         </ws-select>
          <span>{{name}}</span>
@@ -74,7 +74,24 @@
       }
     },
     activated() {
-         this.getPassYearFormatDate()
+      var type=''
+      if(this.$route.query.contractType==2){
+        type='(采购)'
+        this.name=this.$route.query.seller
+      }else if(this.$route.query.contractType==1){
+        type='(销售)'
+        this.name=this.$route.query.buyer
+      }else if(this.$route.query.contractType==3){
+         type='(代收)'
+         this.name=this.$route.query.buyer
+      }else{
+        type='(代储)'
+        this.name=this.$route.query.buyer
+      }
+      
+      this.contractNo1=this.$route.query.contractNo
+      this.contractNo=this.$route.query.contractNo+type
+        //  this.getPassYearFormatDate()
       this.getList()
     },
     methods: {
@@ -82,6 +99,9 @@
         this.searchType = num
         this.getList()
       },
+      returnsales(){
+        this.$router.go(-1)
+      },
       getPassYearFormatDate () {
           var nowDate = new Date()
           var _date = new Date()
@@ -110,6 +130,7 @@
           this.value=[this.startDate,this.endDate]
         },
         changecontract(e){
+          this.contractNo1=e
           for (let i = 0; i < this.contractList.length; i++) {
             if(this.contractList[i].contractNo==e){
               if(this.contractList[i].contractType==2){
@@ -119,6 +140,7 @@
               }
             }
           }
+          this.getList()
         },
       getList() {
         getcontract({
@@ -126,16 +148,29 @@
         })
         .toPromise()
         .then((response) => {
+          for (let i = 0; i < response.length; i++) {
+            if(response[i].contractType==2){
+              response[i].contractType1='(采购)'
+            }else if(response[i].contractType==1){
+              response[i].contractType1='(销售)'
+            }else if(response[i].contractType==3){
+              response[i].contractType1='(代收)'
+            }else{
+              response[i].contractType1='(代储)'
+            }
+            
+          }
           this.contractList=response
         })
          getinventoryinfo({
             // warehouseType: 1,
             compId: localStorage.getItem('ws-pf_compId'),
-            startDate:this.startDate,
-            endDate:this.endDate,
-            searchKeyWord:this.searchKeyWord,
+            // startDate:this.startDate,
+            // endDate:this.endDate,
+            // searchKeyWord:this.searchKeyWord,
             currentPage: this.currentPage,
-            pageSize:this.pageSize ,
+            pageSize:this.pageSize,
+            contractNo:this.contractNo1,
             inventoryType:1,
             searchType:this.searchType
           })
@@ -250,4 +285,7 @@
   .bg-right{
     padding-top:15px;
   }
+  .typeselect{
+    margin:0 10px;
+  }
 </style>

+ 100 - 31
src/views/profitable/contractprofits.vue

@@ -12,7 +12,7 @@
       <el-col :span="12">
         <div class="datascreen">
         <el-date-picker v-model="value" type="daterange" align="right" unlink-panels range-separator="至"
-          start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions">
+          start-placeholder="开始日期" value-format='yyyy-MM-dd' @change='datechange' end-placeholder="结束日期" :picker-options="pickerOptions">
         </el-date-picker>
         
 
@@ -26,9 +26,6 @@
         <div class="table">
           <div ref="myEchart7" style="height: 410px;"></div>
         </div>
-        <div class="makeWord_css">
-          <!-- <div ref="myEchart6" style="height: 410px"></div> -->
-        </div>
       </div>
       <div class="table_css">
         <div style='margin:0 auto;' ><div class='title' style='margin-bottom:10px;'>合同利润汇总表</div>
@@ -36,28 +33,28 @@
         <ws-form>
           <ws-info-table>
           <ws-form-item label="采购重量(吨)" span="1" prop="contractNo" class="readonly">
-            
+            {{deptBudgetList.cgweight}}
           </ws-form-item>
           <ws-form-item label="销售重量(吨)" span="1" prop="settlementMethod">
-            
+            {{deptBudgetList.xsweight}}
           </ws-form-item>
           <ws-form-item label="支付粮款(万元)" span="1" prop="contractNo" class="readonly">
-            
+            {{deptBudgetList.zfweight}}
           </ws-form-item>
           <ws-form-item label="收入粮款(万元)" span="1" prop="settlementMethod">
-            
+            {{deptBudgetList.srweight}}
           </ws-form-item>
-          <ws-form-item label="其他支(万元)" span="1" prop="contractNo" class="readonly">
-            
+          <ws-form-item label="其他支(万元)" span="1" prop="contractNo" class="readonly">
+            {{deptBudgetList.qtzfweight}}
           </ws-form-item>
           <ws-form-item label="其他收入(万元)" span="1" prop="settlementMethod">
-            
+            {{deptBudgetList.qtsrweight}}
           </ws-form-item>
           <ws-form-item label="运费(万元)" span="1" prop="contractNo" class="readonly">
-            
+            {{deptBudgetList.yfweight}}
           </ws-form-item>
           <ws-form-item label="总利润(万元)" span="1" prop="settlementMethod">
-            
+            {{deptBudgetList.lrweight}}
           </ws-form-item>
         </ws-info-table>
         </ws-form>
@@ -93,7 +90,7 @@
   </div>
 </template>
 <script>
-  import {} from '@/model/profitable/index'
+  import {getcontractchart} from '@/model/profitable/index'
   export default {
     components: {},
     data() {
@@ -104,7 +101,7 @@
           count: 2000,
         }],
         contracttypelist:[],
-        deptBudgetList:{},
+        deptBudgetList:{cgweight:0},
         datalist1:[],
         datalist2:[6.0, 60.9, 90.0, 23.2, 25.6, 76.7, 135.6, 162.2, -32.6, 20.0],
         makeWordData: {},
@@ -119,16 +116,53 @@
       }
     },
     activated() {
-      this.makeWordData = this.getData(2)
+      // this.makeWordData = this.getData(2)
      
       this.getPassYearFormatDate()
       this.getList()
     },
     methods: {
       getList() {
-        for (let i = 0; i < this.datalist2.length; i++) {
+        this.startDate=this.value[0]
+        this.endDate=this.value[1]
+        this.contracttypelist=[]
+        this.datalist2=[]
+        this.datalist1=[]
+        getcontractchart({
+          startDate:this.startDate,
+          endDate:this.endDate
+        })
+        .toPromise()
+        .then((response) => {
+          for (let i = 0; i < response.chartList.length; i++) {
+            this.contracttypelist.push(response.chartList[i].type+'合同')
+            this.datalist2.push(response.chartList[i].contractProfit/10000)
+          }
+          for (let i = 0; i < response.formList.length; i++) {
+            // response.formList[i]
+            if( response.formList[i].type=='采购重量'){
+            this.deptBudgetList.cgweight=response.formList[i].profit
+          }else if(response.formList[i].type=='销售重量'){
+            this.deptBudgetList.xsweight=response.formList[i].profit
+          }else if(response.formList[i].type=='支付粮款'){
+            this.deptBudgetList.zfweight=(response.formList[i].profit/10000).toFixed(4)
+          }else if(response.formList[i].type=='收入粮款'){
+            this.deptBudgetList.srweight=(response.formList[i].profit/10000).toFixed(4)
+          }else if(response.formList[i].type=='其他支出'){
+            this.deptBudgetList.qtzfweight=(response.formList[i].profit/10000).toFixed(4)
+          }else if(response.formList[i].type=='其他收入'){
+            this.deptBudgetList.qtsrweight=(response.formList[i].profit/10000).toFixed(4)
+          }else if(response.formList[i].type=='运费'){
+            this.deptBudgetList.yfweight=(response.formList[i].profit/10000).toFixed(4)
+          }else if(response.formList[i].type=='总利润'){
+            this.deptBudgetList.lrweight=(response.formList[i].profit/10000).toFixed(4)
+          }
+          }
+          console.log(this.deptBudgetList)
+          
+          for (let i = 0; i < this.datalist2.length; i++) {
           if(this.datalist2[i]<0){
-            this.datalist1.push({value:Math.abs(this.datalist2[i]),
+            this.datalist1.push({value: Math.abs(this.datalist2[i]),
           itemStyle: {
             color: '#FF9F24'
           }})
@@ -137,19 +171,19 @@
           }
         }
          this.initCharts()
-        // getceshi({
-        //  driverId:'8f1f3c624d7946d79a9d44a4057d969b'
-        // })
-        // .toPromise()
-        // .then((response) => {
-        // debugger
-        // console.log(response)
-        // })
+        })
+        
+        
 
       },
       detail(){
         this.$router.push({name:'contractprofitsdetails'})
       },
+      datechange(e){
+        this.value=e
+        this.getList()
+        console.log(e)
+      },
       getPassYearFormatDate() {
         var nowDate = new Date()
         var _date = new Date()
@@ -184,6 +218,14 @@
         let myChart7 = app.$echarts.init(this.$refs.myEchart7);
         var option;
         option = {
+           grid: {
+          // 四周留白区域设置
+          top: 40,
+          right: 40,
+          left: 40,
+          bottom: 40,
+          containLabel: true,
+        },
             // title: {
             //   text: 'Rainfall vs Evaporation',
             //   subtext: 'Fake Data'
@@ -215,15 +257,41 @@
 
               type: 'category',
               // prettier-ignore
-              data: this.contracttypelist
+              data: this.contracttypelist,
+              axisLine: {
+                show: false //y轴线消失
+              },
+              axisLabel: {   // X轴线 标签修改 
+                textStyle: {
+                  color: '#929AB8', //坐标值得具体的颜色
+                }
+              },
             }],
             yAxis: [{
               name: '利润(万元)',
-              type: 'value'
+              type: 'value',
+              axisLine: {
+                show: false //y轴线消失
+              },
+              nameTextStyle:{
+                color:'#929AB8'
+              },
+              splitLine: {
+                show: true, // 网格线是否显示
+                lineStyle:{
+                  type:'dashed'    //设置网格线类型 dotted:虚线   solid:实线
+                },
+              },
+              axisLabel: {   // X轴线 标签修改 
+                textStyle: {
+                  color: '#929AB8', //坐标值得具体的颜色
+                }
+              },
             }],
             series: [{
                 type: 'bar',
                 right: 0,
+                barWidth:25,
                 // label: {
                 //   show: true,
                 //   position: 'inside'
@@ -339,10 +407,11 @@
   .chart_css {
     display: flex;
     height: 410px;
-
     .table {
-      width: 70%;
+      width: 90%;
       height: 410px;
+      border: 1px solid #D8DCE6;
+      margin:0 auto 30px;
     }
 
     .makeWord_css {
@@ -355,7 +424,7 @@
   .table_css {
 
     text-align:center;
-    margin-bottom:30px;
+    margin:30px 0;
   }
   .flex-between{
     justify-content: space-between;

+ 42 - 33
src/views/profitable/contractprofitsdetails.vue

@@ -27,7 +27,7 @@
       </el-row>
       <el-row style='margin-bottom:10px;'>
         <el-col :span="18">
-          <el-button style="margin-left:10px" @click="typeChange('')" :type="searchType == ''?'primary':''">全部合同</el-button>
+          <el-button style="margin-left:10px" @click="typeChange('')" :type="searchContractType == ''?'primary':''">全部合同</el-button>
           <el-button @click="typeChange(2)" :type="searchContractType == 2?'primary':''">采购合同</el-button>
           <el-button @click="typeChange(1)" :type="searchContractType == 1?'primary':''">销售合同</el-button>
           <el-button @click="typeChange(3)" :type="searchContractType == 3?'primary':''">代收合同</el-button>
@@ -65,8 +65,10 @@
           <el-table-column prop="contractNo" label="合同编号"></el-table-column>
           <el-table-column prop="contractType" label="合同类型">
             <template slot-scope="scope">
-              <span v-if='scope.row.contractType==1'>销售</span>
-              <span v-if='scope.row.contractType==2'>采购</span>
+              <span v-if='scope.row.agreementType=="销售合同"'>销售</span>
+              <span v-if='scope.row.agreementType=="采购合同"'>采购</span>
+              <span v-if='scope.row.agreementType=="代收合同"'>代收</span>
+              <span v-if='scope.row.agreementType=="代储合同"'>代储</span>
             </template>
           </el-table-column>
           <el-table-column prop="buyer" label="买方"></el-table-column>
@@ -116,8 +118,7 @@
       }
     },
     activated() {
-         this.getPassYearFormatDate()
-      this.getList()
+      this.getPassYearFormatDate()
     },
     methods: {
       typeChange(num){
@@ -129,40 +130,47 @@
         this.getList()
       },
       inventory(row){
-        this.$router.push({name:'contractinventory',query:{warehouseName:row.warehouseName}})
+        this.$router.push({name:'contractinventory',query:{contractNo:row.contractNo,contractType:row.contractType,buyer:row.buyer,seller:row.seller}})
       },
       returnsales(){
         this.$router.go(-1)
       },
-      cost(){
-        this.$router.push({name:'contractcost',query:{contractNo:row.contractNo}})
+      handleSelectionChange(val) {
+        this.multipleSelection = val;
+      },
+      cost(row){
+        this.$router.push({name:'contractcost',query:{contractNo:row.contractNo,contractType:row.contractType,buyer:row.buyer,seller:row.seller}})
       },
       getPassYearFormatDate () {
-          var nowDate = new Date()
-          var _date = new Date()
-          nowDate.setTime(nowDate.getTime()-24*60*60*1000*30)
-          var year = nowDate.getFullYear()
-          var year1 = _date.getFullYear()
-          var month = nowDate.getMonth() + 1
-          var month1 = _date.getMonth() + 1
-          var strDate = nowDate.getDate()
-          var strDate1 = _date.getDate()
-          if (month >= 1 && month <= 9) {
-            month = '0' + month
-          }
-           if (month1 >= 1 && month1 <= 9) {
-            month1 = '0' + month1
-          }
-        
-          if (strDate >= 0 && strDate <= 9) {
-            strDate = '0' + strDate
-          }
-           if (strDate1 >= 0 && strDate1 <= 9) {
-            strDate1 = '0' + strDate1
-          }
-          this.startDate = year + '-' + month +'-' + strDate
-          this.endDate = year1 + '-' + month1 +'-' + strDate1
-          this.value=[this.startDate,this.endDate]
+        getcontractdetails({
+            // warehouseType: 1,
+            agreementType: this.agreementType,
+            startDate:this.startDate,
+            endDate:this.endDate,
+            currentPage: this.currentPage,
+            pageSize:9999 ,
+            searchType:this.searchType,
+            searchContractType:this.searchContractType,
+            searchTypeCon:this.searchTypeCon
+          })
+          .toPromise()
+          .then(response => {
+            this.tableData = response.records
+             var _date = new Date()
+            var year1 = _date.getFullYear()
+            var month1 = _date.getMonth() + 1
+            var strDate1 = _date.getDate()
+            if (month1 >= 1 && month1 <= 9) {
+              month1 = '0' + month1
+            }
+            if (strDate1 >= 0 && strDate1 <= 9) {
+              strDate1 = '0' + strDate1
+            }
+            this.startDate = response.records[response.records.length-1].signingDate
+            this.endDate = year1 + '-' + month1 +'-' + strDate1
+            this.value=[this.startDate,this.endDate]
+            this.getList()
+          })
         },
       getList() {
          getcontractdetails({
@@ -188,6 +196,7 @@
            this.deptBudgetTotal = response.total
           })
       },
+
       changeDate(){
         if(this.value){
           this.startDate = this.value[0]

+ 107 - 19
src/views/profitable/expenseallot.vue

@@ -32,7 +32,7 @@
             </ws-select>
           </el-form-item>
           <el-form-item v-if='deptBudgetList.expensesPurpose==3' label-width='100px' label="仓库名称" span="1" prop="warehouse" class="readonly">
-          {{deptBudgetList.warehouse}}
+          {{deptBudgetList.warehouseName}}
           </el-form-item>
           <el-form-item v-if='deptBudgetList.expensesPurpose==1' label-width='100px' label="合同编号" span="1" prop="contractNo" class="readonly">
           {{deptBudgetList.contractNo}}
@@ -74,35 +74,36 @@
         </ws-select>
         合计分配:{{amount}}元
         </div>
-        <el-table v-if='mode!="暂不分配"' :data="feeDetailsDistributions" style="width: 90%;margin:0 auto;">
+        <el-table ref="tableref" v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"&&mode!="暂不分配"||deptBudgetList.purpose=="库点费用"&&mode!="暂不分配"' :data="feeDetailsDistributions" style="width: 90%;margin:0 auto;">
           <el-table-column v-if='deptBudgetList.purpose=="合同费用"' prop="date" label="仓库名称" min-width="110">
             <template slot-scope="scope">
-              <ws-select v-model="scope.row.warehouseName" placeholder="选择仓库" @change="((value)=>{selectware(value, scope.row)})">
-                <ws-option v-for="item in warehouseList" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName"
+              <el-select v-model="scope.row.warehouseName" placeholder="选择仓库" @change="((value)=>{selectware(value, scope.$index)})">
+                <el-option v-for="item in warehouseList" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName"
                   style="color: #8890b1" />
-              </ws-select>
+              </el-select>
             </template>
           </el-table-column>
           <el-table-column v-if='deptBudgetList.purpose=="合同费用"' prop="date" label="日期">
             <template slot-scope="scope">
-               <ws-select v-model="scope.row.receiptDocDate" placeholder="选择日期" @change="((value)=>{selecttime(value, scope.row)})">
-                <ws-option v-for="item in datelist" :key="item.time" :label="item.time" :value="item.time"
+               <ws-select v-model="scope.row.receiptDocDate" placeholder="选择日期" @change="((value)=>{selecttime(value, scope.row,scope.$index)})">
+                <ws-option v-for="item in datelist[scope.$index]" :key="item.time" :label="item.time" :value="item.time"
                   style="color: #8890b1" />
               </ws-select>
             </template>
           </el-table-column>
           <el-table-column v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="日期">
             <template slot-scope="scope">
-                <el-date-picker @change="receiptDocDatechange" v-model="scope.row.receiptDocDate" type="date" placeholder="请选择日期"
+                <el-date-picker @change="((value)=>{receiptDocDatechange(value, scope.$index)})" v-model="scope.row.receiptDocDate" type="date" placeholder="请选择日期"
               value-format="yyyy-MM-dd"   ></el-date-picker>
             </template>
           </el-table-column>
           <el-table-column v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="货源">
               <template slot-scope="scope">
-                <ws-select v-model="scope.row.orderId" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row)})">
-                    <ws-option v-for="item in goodsourcelist" :key="item.id" :label="item.goodsSource" :value="item.id"
+                <!-- {{scope.row.goodsourcelist}} -->
+                <el-select v-model="scope.row.orderId" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row,scope.$index)})">
+                    <el-option v-for="item in goodsourcelist[scope.$index]" :key="item.id" :label="item.goodsSource" :value="item.id"
                         style="color: #8890b1" />
-                </ws-select>
+                </el-select>
             </template>
           </el-table-column>
           <el-table-column v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="货名">
@@ -130,9 +131,7 @@
       </div>
       <div>
         <div style='margin-top:10px;text-align:right;width:90%;'>
-          <el-button class="bg-bottom" type="primary" size="small" @click="returnsales()">驳回
-        </el-button>
-        <el-button class="bg-bottom" type="primary" size="small" @click="returnsales()">通过
+          <el-button class="bg-bottom" type="primary" size="small" @click="submit()">提交
         </el-button>
         </div>
       
@@ -207,8 +206,97 @@
           this.moneys='指定分配金额'
           this.disabled=true
         }
-      },selectware(e){
-          console.log(e)
+      },
+      selectware(e,index){
+        var arr=[]
+        this.datelist=[]
+        getwarehousingorder({contractNo:this.deptBudgetList.contractNo,warehouseName:e}).toPromise()
+          .then(response => {
+            for (let i = 0; i < response.length; i++) {
+              arr.push({time:response[i].issuingTime,id:response[i].id,weight:response[i].inWarehouseWeight})
+            }
+            this.$set(this.datelist,index,JSON.parse(JSON.stringify(arr)))
+          })
+      },
+      selectgoodsSource(e,item,index){
+        var weight=0
+        console.log(e)
+        var money=0
+        if(!this.deptBudgetList.amountMoney&&this.moneys=='按重量自动分配'){
+          for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+            if(this.feeDetailsDistributions[i].orderId==e){
+              this.feeDetailsDistributions[i].orderId=''
+            }
+          }
+          this.$message({
+                message: '请输入金额之后进行操作',
+                type: 'warning',
+              })
+          return
+        }
+        for (let i = 0; i < this.goodsourcelist[index].length; i++) {
+          if(this.goodsourcelist[index][i].id==e){
+            this.feeDetailsDistributions[index].goodsSource=this.goodsourcelist[index][i].goodsSource
+            this.feeDetailsDistributions[index].inWarehouseWeight=this.goodsourcelist[index][i].weight
+            this.feeDetailsDistributions[index].goodsName=this.goodsourcelist[index][i].goodsName
+            this.feeDetailsDistributions[index].goodsNameKey=this.goodsourcelist[index][i].goodsNameKey
+            }
+        }
+        if(this.moneys=='按重量自动分配'){
+          weight = this.feeDetailsDistributions.reduce(function (total, currentValue, currentIndex, arr) {
+              return total + currentValue.inWarehouseWeight;
+          }, 0)
+          for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+              this.feeDetailsDistributions[i].distributionMoney=Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.amountMoney)
+              money+=this.feeDetailsDistributions[i].distributionMoney
+          }
+        }
+      },
+      selecttime(e,item,index){
+        var weight=0
+        var money=0
+        if(!this.deptBudgetList.amountMoney&&this.moneys=='按重量自动分配'){
+          for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+            if(this.feeDetailsDistributions[i].receiptDocDate==e){
+              this.feeDetailsDistributions[i].receiptDocDate=''
+            }
+          }
+          this.$message({
+                message: '请输入金额之后进行操作',
+                type: 'warning',
+              })
+          return
+        }
+        for (let i = 0; i < this.datelist[index].length; i++) {
+          // console.log()
+          if(this.datelist[index][i].time==e){
+            item.orderId=this.datelist[index][i].id
+            item.inWarehouseWeight=this.datelist[index][i].weight
+          }
+        }
+        if(this.moneys=='按重量自动分配'){
+          for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+          weight+=this.feeDetailsDistributions[i].inWarehouseWeight
+          }
+          for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+            // console.log(weight,this.feeDetailsDistributions[i].inWarehouseWeight)
+              this.feeDetailsDistributions[i].distributionMoney=Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.amountMoney)
+              money+=this.feeDetailsDistributions[i].distributionMoney
+
+          }
+        }
+        // console.log(this.feeDetailsDistributions)
+      },
+      receiptDocDatechange(e,index){
+        var arr=[]
+        this.goodsourcelist[index]=[]
+        getwarehousingorder({warehouseName:this.deptBudgetList.warehouseName,receiptDocDate:e}).toPromise()
+          .then(response => {
+            for (let i = 0; i < response.length; i++) {
+              arr.push({goodsSource:response[i].goodsSource,id:response[i].id,weight:response[i].inWarehouseWeight,goodsName:response[i].goodsName,goodsNameKey:response[i].goodsNameKey})
+            }
+             this.$set(this.goodsourcelist,index,JSON.parse(JSON.stringify(arr)))
+          })
       },
       returnsales(){
         this.$router.go(-1)
@@ -375,9 +463,9 @@
             this.paymentScreenshot=srcs
             this.srcList=srcs
           }
-          if(response.expenseAllocationInfoList){
-            this.feeDetailsDistributions=response.expenseAllocationInfoList
-          }
+          // if(response.expenseAllocationInfoList){
+          //   this.feeDetailsDistributions=response.expenseAllocationInfoList
+          // }
           
           
         })

+ 18 - 27
src/views/profitable/expenseallotaduit.vue

@@ -30,7 +30,7 @@
             </ws-select>
           </el-form-item>
           <el-form-item v-if='deptBudgetList.expensesPurpose==3' label-width='100px' label="仓库名称" span="1" prop="warehouse" class="readonly">
-          {{deptBudgetList.warehouse}}
+          {{deptBudgetList.warehouseName}}
           </el-form-item>
           <el-form-item v-if='deptBudgetList.expensesPurpose==1' label-width='100px' label="合同编号" span="1" prop="contractNo" class="readonly">
           {{deptBudgetList.contractNo}}
@@ -60,14 +60,14 @@
           </div>
         </el-form-item>
         </el-form>
-        <div v-if='deptBudgetList.expensesPurpose==1&&deptBudgetList.costType==3||deptBudgetList.expensesPurpose==2' style='width:90%;margin:10px auto;'>
+        <div v-if='deptBudgetList.expensesPurpose==1&&deptBudgetList.costType==3||deptBudgetList.expensesPurpose==3' style='width:90%;margin:10px auto;'>
           <div style='margin-bottom:20px;display:flex;justify-content: space-between;'>
             <div>费用分配</div><span>合计分配:{{amount}}元</span>  </div>
           <!-- <div> -->
-          <el-table :data="deptBudgetList.expenseAllocationInfoList">
+          <el-table :data="feeDetailsDistributions">
             <el-table-column v-if='deptBudgetList.purpose=="合同费用"' prop="date" label="仓库名称" min-width="110">
               <template slot-scope="scope">
-                <ws-select disabled v-model="scope.row.warehouseName" placeholder="选择仓库" @change="((value)=>{selectware(value, scope.row)})">
+                <ws-select disabled v-model="scope.row.warehouseName" placeholder="选择仓库" >
                   <ws-option v-for="item in warehouseList" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName"
                     style="color: #8890b1" />
                 </ws-select>
@@ -75,7 +75,7 @@
             </el-table-column>
             <el-table-column v-if='deptBudgetList.expensesPurpose==1' prop="date" label="日期">
               <template slot-scope="scope">
-                <ws-select disabled v-model="scope.row.receiptDocDate" placeholder="选择日期" @change="((value)=>{selecttime(value, scope.row)})">
+                <ws-select disabled v-model="scope.row.receiptDocDate" placeholder="选择日期" >
                   <ws-option v-for="item in datelist" :key="item.time" :label="item.time" :value="item.time"
                     style="color: #8890b1" />
                 </ws-select>
@@ -83,13 +83,13 @@
             </el-table-column>
             <el-table-column v-if='deptBudgetList.expensesPurpose==3' prop="date" label="日期">
               <template slot-scope="scope">
-                  <el-date-picker disabled @change="receiptDocDatechange" v-model="scope.row.receiptDocDate" type="date" placeholder="请选择日期"
+                  <el-date-picker disabled v-model="scope.row.receiptDocDate" type="date" placeholder="请选择日期"
                 value-format="yyyy-MM-dd"   ></el-date-picker>
               </template>
             </el-table-column>
             <el-table-column v-if='deptBudgetList.expensesPurpose==3' prop="date" label="货源">
                 <template slot-scope="scope">
-                  <ws-select disabled v-model="scope.row.orderId" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row)})">
+                  <ws-select disabled v-model="scope.row.goodsSource" placeholder="选择货源">
                       <ws-option v-for="item in goodsourcelist" :key="item.id" :label="item.goodsSource" :value="item.id"
                           style="color: #8890b1" />
                   </ws-select>
@@ -145,7 +145,7 @@
   </div>
 </template>
 <script>
-  import {setexpense,getcontract,getwarehouse,addexenseinfo,getwarehousingorder,lookexenseinfo} from '@/model/profitable/index'
+  import {setexpense,getcontract,getwarehouse,addexenseinfo,getwarehousingorder,lookexenseinfo,editexenseinfo} from '@/model/profitable/index'
   export default {
     components: {},
     data() {
@@ -162,11 +162,14 @@
         goods:'全部货品',
         goodsList:[],
         warecontractList:[],
+        textarea:'',
+        datelist:[],
         feeDetailsDistributions:[{proDate:'',weight:'',money:'',warehouse:'',belonging:'',index:0}],
         deptBudgetList:{},
         makeWordData: {},
         warehouseList:[],
         rejectshow:false,
+        goodsourcelist:[],
         modeList:[{key:1,value:'全部分配'},{key:2,value:'部分分配'},{key:3,value:'暂不分配'}],
         wareList:[{key:1,value:'指定仓库'},{key:2,value:'全部仓库'}],
         datesList:[{key:1,value:'固定日期'},{key:2,value:'指定日期'}],
@@ -199,6 +202,9 @@
       }
     },
     methods: {
+      handleClose(){
+        this.rejectshow=false
+      },
       pass(){
         this.$confirm('确认通过分配信息?', '提示', {
           confirmButtonText: '确定',
@@ -208,13 +214,6 @@
           this.deptBudgetList.flag=2
           editexenseinfo(this.deptBudgetList).toPromise()
           .then((response) => {
-            woekflowhandle({
-              taskId: this.deptBudgetList.taskId,
-              approved: true,
-              auditMind: '34',
-              needReapply: false,
-            }).toPromise()
-            .then((response) => {
               this.$message({
                 message: '通过成功!',
                 type: 'success',
@@ -225,7 +224,6 @@
                 message: '通过失败!',
                 type: 'success',
               })
-            })
           })
         })
       },
@@ -240,17 +238,11 @@
         this.deptBudgetList.rejectionReason=this.textarea
           editexenseinfo(this.deptBudgetList).toPromise()
           .then((response) => {
-        woekflowhandle({
-          taskId: this.deptBudgetList.taskId,
-          approved: true,
-          auditMind: '34',
-          needReapply: false,
-        }).toPromise()
-        .then((response) => {
           this.$message({
             message: '驳回成功!',
             type: 'success',
           })
+          this.rejectshow=false
           this.$router.go(-1)
         }).catch((response) => {
           this.$message({
@@ -258,7 +250,6 @@
             type: 'success',
           })
         })
-        })
       },
       modeselect(e){
           console.log(e)
@@ -308,10 +299,10 @@
             var srcs=response.addressUrl.split(',')
             this.srcList=srcs
           }
-          if(response.expenseAllocationInfoList){
-            this.feeDetailsDistributions=response.expenseAllocationInfoList
+          if( localStorage.getItem('expenseqr')){
+            this.feeDetailsDistributions=JSON.parse(localStorage.getItem('expenseqr'))
           }
-          
+          console.log(this.feeDetailsDistributions)
           
         })
 

+ 33 - 13
src/views/profitable/expensemanagement.vue

@@ -36,7 +36,8 @@
       <div class="table_css">
         <div style='width:90%;margin:10px auto;'>
           <div style='width:15%;'><el-date-picker v-model="value" type="daterange" align="right" unlink-panels range-separator="至"
-          start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions"></el-date-picker></div>
+          start-placeholder="开始日期" value-format='yyyy-MM-dd' @change='datechange' end-placeholder="结束日期" :picker-options="pickerOptions">
+        </el-date-picker></div>
         </div>
         <ws-form>
           <ws-info-table>
@@ -111,6 +112,8 @@
         deptBudgetList:{},
         start: 2021,
         yearList:[],
+        startDate:'',
+        endDate:'',
         tablelist:{},
         monthlist:[],
         incomelist:[],
@@ -150,7 +153,14 @@
       yearChange(){
         this.getList()
       },
+      datechange(e){
+        this.value=e
+        this.getList()
+        console.log(e)
+      },
       getList() {
+        this.startDate=this.value[0]
+        this.endDate=this.value[1]
         this.monthlist=[]
         this.incomelist=[]
         this.expenditurelist=[]
@@ -277,25 +287,34 @@
               
             }],
             tooltip: {
-    trigger: 'axis',
-    formatter: function (data) {
-      if(!data[0].data){
-        data[0].data=0
-      }
-      if(!data[1].data){
-        data[1].data=0
-      }
-      return '收入:'+data[0].data+ '<br/>' +'支出:'+data[1].data+ '<br/>' +'利润:'+(data[0].data-data[1].data)
-    },
-  },
+              trigger: 'axis',
+              backgroundColor: 'rgba(255,255,255,1)', 
+              textStyle: {
+                  color: '#000',     // 文字的颜色
+                  fontStyle: 'normal',    // 文字字体的风格('normal',无样式;'italic',斜体;'oblique',倾斜字体) 
+                  fontWeight: 'normal',    // 文字字体的粗细('normal',无样式;'bold',加粗;'bolder',加粗的基础上再加粗;'lighter',变细;数字定义粗细也可以,取值范围100至700)
+                  fontSize: '14',    // 文字字体大小
+                  lineHeight: '50',    // 行高 
+              },
+              formatter: function (data) {
+                if(!data[0].data){
+                  data[0].data=0
+                }
+                if(!data[1].data){
+                  data[1].data=0
+                }
+                return '<div style="padding:10px;box-shadow:1px 1px 10px #ccc;">收入:<span style="color:#5878E8;">'+data[0].data+ '</span><br/>' +'支出:<span style="color:#FF9F24;">'+data[1].data+ '</span><br/>' +'利润:'+(data[0].data-data[1].data)+'</div>'
+              },
+            },
 
             series: [
               {
                 name: '收入',
                 type: 'bar',
                 right: 20,
+                barWidth:25,
                 label: {
-                  show: true,
+                  show: false,
                   precision: 1,
                   position: 'top',
                   valueAnimation: true,
@@ -311,6 +330,7 @@
               },{
                 name: '支出',
                 type: 'bar',
+                barWidth:25,
                 right: 0,
                 // label: {
                 //   show: true,

+ 33 - 19
src/views/profitable/expensemanagementdetails.vue

@@ -89,25 +89,26 @@
           </el-table-column>
           <el-table-column prop="agent" label="经办人"></el-table-column>
           <el-table-column prop="expenseDate" label="发起日期"></el-table-column>
-          <el-table-column prop="status" label="费用状态">
+          <el-table-column prop="status" label="费用状态" width="120">
             <template slot-scope="scope">
               <span v-if='scope.row.approveStatus'>{{scope.row.approveStatus}}</span><span v-else>{{scope.row.status}}</span>
-              <i v-if='scope.row.approveStatus' @click="handlerecord(scope.row)" class="el-icon-s-claim"></i>
+              <i @click="handlerecord(scope.row)" class="el-icon-s-claim"></i>
             </template>
           </el-table-column>
           <el-table-column prop="address" label="操作" width="500">
             <template slot-scope="scope">
               <el-button @click="look(scope.row)" type="primary">查看</el-button>
-              <el-button v-if='scope.row.approveStatus=="待确认"&&scope.row.expensesType==1' @click="shoukuanqueren(scope.row)" type="primary">确认</el-button>
+              <el-button v-if='scope.row.status=="待确认"&&scope.row.expensesType==1' @click="shoukuanqueren(scope.row)" type="primary">确认</el-button>
               <!-- <el-button v-if='scope.row.approveStatus=="待确认"' @click="accomplish(scope.row)" type="primary">完成</el-button> -->
-              <el-button v-if='scope.row.expensesPurpose==1&&scope.row.approveStatus=="已收款"||scope.row.expensesPurpose==1&&scope.row.approveStatus=="已付款"' @click="accomplish(scope.row)" type="primary">完成</el-button>
-              <el-button  v-if='scope.row.approveStatus=="已驳回"' @click="expenseedit(scope.row)" type="primary">编辑</el-button>
+              <el-button v-if='scope.row.expensesPurpose==1&&scope.row.status=="已收款"&&!scope.row.approveStatus||scope.row.expensesPurpose==1&&scope.row.status=="已付款"&&!scope.row.approveStatus' @click="accomplish(scope.row)" type="primary">完成</el-button>
+              <el-button  v-if='scope.row.status=="已驳回"' @click="edit(scope.row)" type="primary">编辑</el-button>
               <!-- <el-button v-if='scope.row.status=="已驳回"' @click="expenseedit(scope.row)" type="primary">编辑</el-button> -->
-              <el-button v-if='scope.row.distributionStatus=="未完成"&&scope.row.allocatedAmount>0' @click="allot(scope.row)" type="primary">分配</el-button>
+              <el-button v-if='!scope.row.distributionStatus&&scope.row.expensesPurpose==1&&scope.row.costType==3&&!scope.row.approveStatus&&scope.row.status=="已付款"
+              ||!scope.row.distributionStatus&&scope.row.expensesPurpose==3&&!scope.row.approveStatus&&scope.row.status=="已付款"' @click="allot(scope.row)" type="primary">分配</el-button>
               <!-- <el-button v-if='scope.row.approveStatus=="已驳回"' @click="del(0,scope.row)" type="primary">删除</el-button> -->
-              <el-button v-if='scope.row.approveStatus=="已驳回"' @click="del(0,scope.row)" type="primary">删除</el-button>
-              <el-button v-if='scope.row.taskId' @click="aduit(scope.row)" type="primary">审核</el-button>
-              <el-button v-if='scope.row.expensesType==2&&scope.row.approveStatus=="已付款"' @click="payment(scope.row)" type="primary">付款</el-button>
+              <el-button v-if='scope.row.status=="已驳回"' @click="del(0,scope.row)" type="danger">删除</el-button>
+              <el-button v-if='scope.row.approveStatus=="待财务审核"||scope.row.approveStatus=="待决策人审核"' @click="aduit(scope.row)" type="primary">审核</el-button>
+              <el-button v-if='!scope.row.approveStatus&&scope.row.expensesType==2&&scope.row.status=="待付款"' @click="payment(scope.row)" type="primary">付款</el-button>
             </template>
           </el-table-column>
           <el-table-column prop="expenseRemarks" label="分配状态">
@@ -116,14 +117,13 @@
               <el-tooltip v-if='scope.row.rejectionReason' class="item" effect="dark" :content="scope.row.rejectionReason" placement="top-start">
                 <i class="el-icon-question"></i>
               </el-tooltip>
-              
             </template>
           </el-table-column>
           <el-table-column prop="address" label="分配相关" width="300">
             <template slot-scope="scope">
-              <el-button @click="allotaduit(scope.row)" type="primary">确认</el-button>
-              <el-button @click="allot(scope.row)" type="primary">编辑</el-button>
-              <el-button @click="del(1,scope.row)" type="primary">删除</el-button>
+              <el-button v-if='scope.row.expensesType==2&&scope.row.distributionStatus=="待确认"&&!scope.row.approveStatus' @click="allotaduit(scope.row)" type="primary">确认</el-button>
+              <el-button v-if='scope.row.expensesType==2&&scope.row.distributionStatus=="已驳回"&&!scope.row.approveStatus' @click="expenseedit(scope.row)" type="primary">编辑</el-button>
+              <el-button v-if='scope.row.expensesType==2&&scope.row.distributionStatus=="已驳回"&&!scope.row.approveStatus' @click="del(1,scope.row)" type="danger">删除</el-button>
             </template>
           </el-table-column>
         </el-table>
@@ -133,14 +133,16 @@
         layout="total, sizes, prev, pager, next, jumper" :total="deptBudgetTotal">
       </el-pagination>
     </div>
-    <el-dialog width='50%' :visible.sync="dialogVisible1" title="审核记录">
-      <div v-for="item in recordList">
+    <el-dialog width='50%' :visible.sync="dialogVisible1" :title="title1">
+      <div  style='padding:20px;' v-for="(item,index) in recordList" :style="{'border-bottom':(index!=recordList.length-1?'1px solid #ccc':'none')}"
+>
         <div style='width:100%;justify-content: space-between;' class='flex'>
           <div style='width:33.333%;text-align:center;'>{{item.operateUser}}</div>
           <div style='width:33.333%;text-align:center;'>{{item.dealMsg}}</div>
           <div style='width:33.333%;text-align:center;'>{{item.createDate}}</div>
         </div>
-        <div style='width:100%;text-align:center;'>{{item.verifyRemark}}</div>
+        <div v-if='index<recordList.length-1' style='width:100%;text-align:center;'>{{item.verifyRemark}}</div>
+        <div v-else style='width:100%;text-align:center;'>{{item.verifyRemark}}</div>
       </div>
     </el-dialog>
     <WinseaContentModal v-model="fujianshow" :title="title"
@@ -157,7 +159,7 @@
     getInOutDetailed,
     getexenseinfo,
     delexenseinfo,
-    delallocationinfo,editexenseinfo
+    delallocationinfo,editexenseinfo,getAuditRecord
   } from '@/model/profitable/index'
   export default {
     components: {},
@@ -176,6 +178,7 @@
         startDate:"",
         endDate:"",
         title:'附件',
+        title1:'',
         outtotal:0,
         intotal:0,
         fujianshow:false,
@@ -188,7 +191,13 @@
     },
     methods: {
       handlerecord(row){
-        billoperatehis({id: row.id}).toPromise()
+        if(row.expensesType==1){
+          this.title1='收款审核记录'
+        }else{
+          this.title1='请款审核记录'
+        }
+        getAuditRecord({ id: row.id,
+            workflowId: row.workflowId}).toPromise()
                 .then((response) => {
                   this.recordList=response
                   this.dialogVisible1=true
@@ -288,16 +297,21 @@
         this.searchType = num
         this.getList()
       },
+      edit(row){
+        this.$router.push({name:'cashoutedit',query:{id:row.id}})
+      },
       expenseedit(row){
+        localStorage.setItem('expensebh',JSON.stringify(row.expenseAllocationInfoListBH))
         this.$router.push({name:'expensemanagentedit',query:{id:row.id}})
       },
       shoukuanqueren(row){
         this.$router.push({name:'receiptaduit',query:{id:row.id}})
       },
       aduit(row){
-        this.$router.push({name:'cashoutaduit',query:{id:row.id}})
+        this.$router.push({name:'cashoutaduit',query:{id:row.id,taskId:row.taskId}})
       },
       allotaduit(row){
+        localStorage.setItem('expenseqr',JSON.stringify(row.expenseAllocationInfoList))
         this.$router.push({name:'expenseallotaduit',query:{id:row.id}})
       },
       payment(row){

+ 127 - 103
src/views/profitable/expensemanagentedit.vue

@@ -14,44 +14,39 @@
      <div class="center">
      
       <div>
-        <el-form label-position="left"><div style='margin:30px 0 30px;'>基本信息</div>
-          <el-form-item  label-width='100px' label="用途" span="1" prop="purpose" class="readonly">
-            <ws-select v-model="deptBudgetList.purpose" placeholder="" class="typeselect" >
-              <ws-option label="合同费用" value="合同费用"
+        <el-form label-position="left">
+         <el-form-item  label-width='100px' label="用途" span="1" prop="purpose" class="readonly">
+            <ws-select disabled v-model="deptBudgetList.expensesPurpose" placeholder="" class="typeselect" >
+              <ws-option label="合同费用" value="1"
                 style="color: #8890b1" />
-                <ws-option label="库点费用" value="库点费用"
+                <ws-option label="库点费用" value="3"
                 style="color: #8890b1" />
-                <ws-option label="经营性费用" value="经营性费用"
+                <ws-option label="经营性费用" value="5"
                 style="color: #8890b1" />
             </ws-select>
           </el-form-item>
-          <el-form-item label-width='100px' v-if='deptBudgetList.purpose=="合同费用"' label="类型" span="1" prop="contractNo" class="readonly">
-            <ws-select v-model="deptBudgetList.type" placeholder="" class="typeselect" >
-                <ws-option label="粮款" value="粮款" style="color: #8890b1" />
-                <ws-option label="非粮款" value="非粮款" style="color: #8890b1" />
-                <ws-option label="保证金" value="保证金" style="color: #8890b1" />
+          <el-form-item label-width='100px' v-if='deptBudgetList.expensesPurpose==1' label="类型" span="1" prop="contractNo" class="readonly">
+            <ws-select disabled v-model="deptBudgetList.costType" placeholder="" class="typeselect" >
+                <ws-option label="粮款" value="1" style="color: #8890b1" />
+                <ws-option label="非粮款" value="3" style="color: #8890b1" />
+                <ws-option label="保证金" value="5" style="color: #8890b1" />
             </ws-select>
           </el-form-item>
-          <el-form-item label-width='100px' v-if='deptBudgetList.purpose=="合同费用"' label="合同编号" span="1" prop="contractNo" class="readonly">
-            <el-select v-model="deptBudgetList.contractNo" placeholder="选择合同" class="typeselect" @change="selectcontract">
-              <el-option v-for="item in contractList" :key="item.contractNo" :label="item.contractNo" :value="item.contractNo"
-                style="color: #8890b1" />
-            </el-select>
+          <el-form-item v-if='deptBudgetList.expensesPurpose==3' label-width='100px' label="仓库名称" span="1" prop="warehouse" class="readonly">
+          {{deptBudgetList.warehouseName}}
           </el-form-item>
-           <el-form-item label-width='100px' v-if='deptBudgetList.purpose=="库点费用"' label="仓库名称" span="1" prop="contractNo" class="readonly">
-            <el-select v-model="deptBudgetList.warehouseName" placeholder="选择仓库" class="typeselect" @change="selectwarehouse">
-              <el-option v-for="item in warehouseList" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName"
-                style="color: #8890b1" />
-            </el-select>
+          <el-form-item v-if='deptBudgetList.expensesPurpose==1' label-width='100px' label="合同编号" span="1" prop="contractNo" class="readonly">
+          {{deptBudgetList.contractNo}}
           </el-form-item>
           <el-form-item label-width='100px' label="费用名称" span="1" prop="settlementMethod">
-            <el-input class='input50 input_css' placeholder="输入费用名称,1-15个字" v-model="deptBudgetList.expenseName"></el-input>
+            {{deptBudgetList.expenseName}}
           </el-form-item>
           <el-form-item label-width='100px' label="金额" span="1" prop="contractNo" class="readonly">
-            <el-input class='input50 input_css' placeholder="输入请款金额" v-model="deptBudgetList.amountMoney"></el-input>
+            {{deptBudgetList.amountMoney}}
           </el-form-item>
           <el-form-item label-width='100px' label="备注" span="1" prop="settlementMethod">
             <el-input
+            disabled
             type="textarea"
             :rows="5"
             placeholder="选填,不超过50个字"
@@ -59,10 +54,13 @@
             </el-input>
           </el-form-item>
           <el-form-item label-width='100px' label="附件">
-          <el-upload ref='uploadfiles' :file-list='srcList' action="https://www.zthymaoyi.com/upload/admin" list-type="picture-card"
-            :on-success="handlefujian" :on-remove="handleRemove" class="photo2">
-            <i class="el-icon-plus"></i>
-          </el-upload>
+          <!-- <div>
+            <span v-for='item in dataList'><el-image
+              style="width: 100px; height: 100px;border:1px solid #000;display:inline-block;margin:10px;"
+              :src="item"
+               :preview-src-list="dataList"></el-image></span>
+             
+          </div> -->
         </el-form-item>
         </el-form>
         <div v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"||deptBudgetList.purpose=="库点费用"' class='expensetitle'>费用分配</div>
@@ -92,35 +90,36 @@
         </ws-select>
         <span v-if='mode!="暂不分配"'>合计分配:{{amount}}元</span>  
         </div>
-        <el-table v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"&&mode!="暂不分配"||deptBudgetList.purpose=="库点费用"&&mode!="暂不分配"' :data="feeDetailsDistributions" style="width: 90%;margin:0 auto;">
+        <el-table ref="tableref" v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"&&mode!="暂不分配"||deptBudgetList.purpose=="库点费用"&&mode!="暂不分配"' :data="feeDetailsDistributions" style="width: 90%;margin:0 auto;">
           <el-table-column v-if='deptBudgetList.purpose=="合同费用"' prop="date" label="仓库名称" min-width="110">
             <template slot-scope="scope">
-              <ws-select v-model="scope.row.warehouseName" placeholder="选择仓库" @change="((value)=>{selectware(value, scope.row)})">
-                <ws-option v-for="item in warehouseList" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName"
+              <el-select v-model="scope.row.warehouseName" placeholder="选择仓库" @change="((value)=>{selectware(value, scope.$index)})">
+                <el-option v-for="item in warehouseList" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName"
                   style="color: #8890b1" />
-              </ws-select>
+              </el-select>
             </template>
           </el-table-column>
           <el-table-column v-if='deptBudgetList.purpose=="合同费用"' prop="date" label="日期">
             <template slot-scope="scope">
-               <ws-select v-model="scope.row.receiptDocDate" placeholder="选择日期" @change="((value)=>{selecttime(value, scope.row)})">
-                <ws-option v-for="item in datelist" :key="item.time" :label="item.time" :value="item.time"
+               <ws-select v-model="scope.row.receiptDocDate" placeholder="选择日期" @change="((value)=>{selecttime(value, scope.row,scope.$index)})">
+                <ws-option v-for="item in datelist[scope.$index]" :key="item.time" :label="item.time" :value="item.time"
                   style="color: #8890b1" />
               </ws-select>
             </template>
           </el-table-column>
           <el-table-column v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="日期">
             <template slot-scope="scope">
-                <el-date-picker @change="receiptDocDatechange" v-model="scope.row.receiptDocDate" type="date" placeholder="请选择日期"
+                <el-date-picker @change="((value)=>{receiptDocDatechange(value, scope.$index)})" v-model="scope.row.receiptDocDate" type="date" placeholder="请选择日期"
               value-format="yyyy-MM-dd"   ></el-date-picker>
             </template>
           </el-table-column>
           <el-table-column v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="货源">
               <template slot-scope="scope">
-                <ws-select v-model="scope.row.orderId" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row)})">
-                    <ws-option v-for="item in goodsourcelist" :key="item.id" :label="item.goodsSource" :value="item.id"
+                <!-- {{scope.row.goodsourcelist}} -->
+                <el-select v-model="scope.row.orderId" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row,scope.$index)})">
+                    <el-option v-for="item in goodsourcelist[scope.$index]" :key="item.id" :label="item.goodsSource" :value="item.id"
                         style="color: #8890b1" />
-                </ws-select>
+                </el-select>
             </template>
           </el-table-column>
           <el-table-column v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="货名">
@@ -155,7 +154,7 @@
   </div>
 </template>
 <script>
-  import {lookexenseinfo,getcontract,getwarehouse,addexenseinfo,getwarehousingorder,editexenseinfo} from '@/model/profitable/index'
+  import {lookexenseinfo,getcontract,getwarehouse,getwarehousingorder,editexenseinfo,deloneallocationinfo} from '@/model/profitable/index'
   export default {
     components: {},
     data() {
@@ -172,14 +171,18 @@
         disabled:false,
         warecontractList:[],
         // dateRange: this.disabledDate(),
-        feeDetailsDistributions:[{receiptDocDate:'',inWarehouseWeight:0,distributionMoney:0,warehouseName:'',goodsName:'',goodsSource:'',index:0}],
+        feeDetailsDistributions:[{receiptDocDate:'',inWarehouseWeight:0,distributionMoney:0,warehouseName:'',goodsName:'',goodsSource:'',index:0,}],
         deptBudgetList:{purpose:"合同费用",type:'粮款'},
         makeWordData: {},
         warehouseList:[],
         contractList:[],
         choosablewareList:[],
         paymentScreenshot:[],
-        goodsourcelist:[],
+        goodsourcelist:[[{goodsName: "玉米",
+goodsNameKey: null,
+goodsSource: "张跃文",
+id: "34e710ed3883484798ab37ec4ee9b9cd",
+weight: 4000}]],
         signingDate:'',
         datelist:[],
         modeList:[{key:1,value:'全部分配'},{key:2,value:'部分分配'},{key:3,value:'暂不分配'}],
@@ -224,16 +227,18 @@
         var date = "0" + unixtimestamp.getDate();
         return year + "-" + month.substring(month.length - 2, month.length) + "-" +     date.substring(date.length - 2,date.length)      
       },
-      selectware(e,item){
+      selectware(e,index){
+        var arr=[]
         this.datelist=[]
         getwarehousingorder({contractNo:this.deptBudgetList.contractNo,warehouseName:e}).toPromise()
           .then(response => {
             for (let i = 0; i < response.length; i++) {
-              this.datelist.push({time:response[i].issuingTime,id:response[i].id,weight:response[i].inWarehouseWeight})
+              arr.push({time:response[i].issuingTime,id:response[i].id,weight:response[i].inWarehouseWeight})
             }
+            this.$set(this.datelist,index,JSON.parse(JSON.stringify(arr)))
           })
       },
-      selectgoodsSource(e,item){
+      selectgoodsSource(e,item,index){
         var weight=0
         console.log(e)
         var money=0
@@ -249,32 +254,25 @@
               })
           return
         }
-        for (let i = 0; i < this.goodsourcelist.length; i++) {
-          if(this.goodsourcelist[i].id==e){
-            item.goodsSource=this.goodsourcelist[i].goodsSource
-            item.inWarehouseWeight=this.goodsourcelist[i].weight
-            item.goodsName=this.goodsourcelist[i].goodsName
-            item.goodsNameKey=this.goodsourcelist[i].goodsNameKey
+        for (let i = 0; i < this.goodsourcelist[index].length; i++) {
+          if(this.goodsourcelist[index][i].id==e){
+            this.feeDetailsDistributions[index].goodsSource=this.goodsourcelist[index][i].goodsSource
+            this.feeDetailsDistributions[index].inWarehouseWeight=this.goodsourcelist[index][i].weight
+            this.feeDetailsDistributions[index].goodsName=this.goodsourcelist[index][i].goodsName
+            this.feeDetailsDistributions[index].goodsNameKey=this.goodsourcelist[index][i].goodsNameKey
             }
         }
         if(this.moneys=='按重量自动分配'){
+          weight = this.feeDetailsDistributions.reduce(function (total, currentValue, currentIndex, arr) {
+              return total + currentValue.inWarehouseWeight;
+          }, 0)
           for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
-          weight+=this.feeDetailsDistributions[i].inWarehouseWeight
-          }
-          for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
-            // console.log(weight,this.feeDetailsDistributions[i].inWarehouseWeight)
-            if(i=this.feeDetailsDistributions.length-1&&i!=0){
-              console.log(i)
-              this.feeDetailsDistributions[i].distributionMoney=this.deptBudgetList.amountMoney-money
-            }else{
               this.feeDetailsDistributions[i].distributionMoney=Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.amountMoney)
               money+=this.feeDetailsDistributions[i].distributionMoney
-            }
-            
           }
         }
       },
-      selecttime(e,item){
+      selecttime(e,item,index){
         var weight=0
         var money=0
         if(!this.deptBudgetList.amountMoney&&this.moneys=='按重量自动分配'){
@@ -289,10 +287,11 @@
               })
           return
         }
-        for (let i = 0; i < this.datelist.length; i++) {
-          if(this.datelist[i].time==e){
-            item.orderId=this.datelist[i].id
-            item.inWarehouseWeight=this.datelist[i].weight
+        for (let i = 0; i < this.datelist[index].length; i++) {
+          // console.log()
+          if(this.datelist[index][i].time==e){
+            item.orderId=this.datelist[index][i].id
+            item.inWarehouseWeight=this.datelist[index][i].weight
           }
         }
         if(this.moneys=='按重量自动分配'){
@@ -301,23 +300,22 @@
           }
           for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
             // console.log(weight,this.feeDetailsDistributions[i].inWarehouseWeight)
-            if(i=this.feeDetailsDistributions.length-1&&i!=0){
-              this.feeDetailsDistributions[i].distributionMoney=this.deptBudgetList.amountMoney-money
-            }else{
               this.feeDetailsDistributions[i].distributionMoney=Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.amountMoney)
               money+=this.feeDetailsDistributions[i].distributionMoney
-            }
+
           }
         }
         // console.log(this.feeDetailsDistributions)
       },
-      receiptDocDatechange(e){
-        this.goodsourcelist=[]
+      receiptDocDatechange(e,index){
+        var arr=[]
+        this.goodsourcelist[index]=[]
         getwarehousingorder({warehouseName:this.deptBudgetList.warehouseName,receiptDocDate:e}).toPromise()
           .then(response => {
             for (let i = 0; i < response.length; i++) {
-              this.goodsourcelist.push({goodsSource:response[i].goodsSource,id:response[i].id,weight:response[i].inWarehouseWeight,goodsName:response[i].goodsName,goodsNameKey:response[i].goodsNameKey})
+              arr.push({goodsSource:response[i].goodsSource,id:response[i].id,weight:response[i].inWarehouseWeight,goodsName:response[i].goodsName,goodsNameKey:response[i].goodsNameKey})
             }
+             this.$set(this.goodsourcelist,index,JSON.parse(JSON.stringify(arr)))
           })
       },
       selectcontent(e){
@@ -334,9 +332,7 @@
         }
       },
       handlefujian(file) {
-        // console.log(file)
         this.paymentScreenshot.push(file.url)
-        // this.dialogVisible = true
       },
       submit(){
         this.deptBudgetList.totalDistribution=this.amount
@@ -405,14 +401,6 @@
                   })
                   return
               }
-              // for (let q = 0; q < data.length; q++) {
-              //   if(data[q].warehouseName==this.feeDetailsDistributions[i].warehouseName&&this.feeDetailsDistributions[i].receiptDocDate==data[q].receiptDocDate){
-              //     this.$message({
-              //       message: '请不要选择一样的入库单!',
-              //       type: 'warning',
-              //     })
-              //   }
-              // }
             }
             
           }
@@ -435,14 +423,6 @@
                   })
                   return
               }
-              // for (let q = 0; q < data.length; q++) {
-              //   if(data[q].warehouseName==this.feeDetailsDistributions[i].warehouseName&&this.feeDetailsDistributions[i].receiptDocDate==data[q].receiptDocDate){
-              //     this.$message({
-              //       message: '请不要选择一样的入库单!',
-              //       type: 'warning',
-              //     })
-              //   }
-              // }
             }
             
           }
@@ -455,7 +435,7 @@
               })
               return
         }
-        if(!this.deptBudgetList.warehouse&&this.deptBudgetList.expensesPurpose==3){
+        if(!this.deptBudgetList.warehouseName&&this.deptBudgetList.expensesPurpose==3){
           this.$message({
                 message: '仓库名称不能为空!',
                 type: 'warning',
@@ -509,7 +489,7 @@
           return
         }
         this.deptBudgetList.addressUrl=this.paymentScreenshot.toString()
-        this.deptBudgetList.flag=4
+        this.deptBudgetList.flag=3
         editexenseinfo(this.deptBudgetList).toPromise()
           .then(response => {
             this.$message({
@@ -521,18 +501,32 @@
       },
       modeselect(e){
           console.log(e)
-      },selectware(e){
-          console.log(e)
       },
       goodsNameselect(e){
           console.log(e)
       },
       addlist(){
-        this.feeDetailsDistributions.push({proDate:'',weight:'',money:'',warehouse:'',belonging:'',index:this.feeDetailsDistributions.length})
+        this.feeDetailsDistributions.push({receiptDocDate:'',inWarehouseWeight:0,distributionMoney:0,warehouseName:'',time:0,id:0,weight:0,goodsName:'',goodsSource:'',index:0,   goodsNameKey: null,index:this.feeDetailsDistributions.length})
       },
       dellist(row){
         if(this.feeDetailsDistributions.length>1){
-          this.feeDetailsDistributions.splice(row.index,1)
+          if(row.id==0){
+            this.feeDetailsDistributions.splice(row.index,1)
+          }else{
+            deloneallocationinfo({id:row.id}).toPromise().then((response) => {
+            })
+          }
+        }
+        var weight=0
+        var money=0
+        if(this.moneys=='按重量自动分配'){
+          for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+          weight+=this.feeDetailsDistributions[i].inWarehouseWeight
+          }
+          for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+              this.feeDetailsDistributions[i].distributionMoney=Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.amountMoney)
+              money+=this.feeDetailsDistributions[i].distributionMoney
+          }
         }
       },
       getList() {
@@ -563,24 +557,51 @@
           }else if(response.costType==5){
             response.type='保证金'
           }
-          this.deptBudgetList=response 
+          this.deptBudgetList=response
+          this.dataList=[]
           if(response.addressUrl){
             var arr=[]
             var srcs=response.addressUrl.split(',')
-            this.paymentScreenshot=srcs
             for (let i = 0; i < srcs.length; i++) {
-              arr.push({url:srcs[i]})
+              this.dataList.push({url:srcs[i]})
               
             }
-            this.srcList=arr
+            this.paymentScreenshot=srcs
           }
-          if(response.expenseAllocationInfoList){
-            this.feeDetailsDistributions=response.expenseAllocationInfoList
+          if(localStorage.getItem('expensebh')){
+            if(this.deptBudgetList.expensesPurpose==3||this.deptBudgetList.expensesPurpose==1){
+              this.getgoodsourcelist()
+            }
+          //   console.log(this.feeDetailsDistributions)
           }
-          
-          
         })
       },
+     async getgoodsourcelist(){
+         if(localStorage.getItem('expensebh')){
+            this.feeDetailsDistributions=JSON.parse(localStorage.getItem('expensebh'))
+            for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+              var arr=[]
+              if(this.deptBudgetList.expensesPurpose==3){
+                const data  = await getwarehousingorder({warehouseName:this.deptBudgetList.warehouseName,receiptDocDate:this.feeDetailsDistributions[i].receiptDocDate}).toPromise()
+                this.goodsourcelist[i]=[]
+                for (let q = 0; q < data.length; q++) {
+                  arr.push({
+                    goodsSource:data[q].goodsSource,
+                    id:data[q].id,weight:data[q].inWarehouseWeight,goodsName:data[q].goodsName,goodsNameKey:data[q].goodsNameKey})
+                }
+                this.$set(this.goodsourcelist,i,JSON.parse(JSON.stringify(arr)))
+              }else if(this.deptBudgetList.expensesPurpose==1){
+                const data  = await getwarehousingorder({contractNo:this.deptBudgetList.contractNo,warehouseName:this.feeDetailsDistributions[i].warehouseName}).toPromise()
+                this.datelist[i]=[]
+                for (let q = 0; q < data.length; q++) {
+                  arr.push({time:data[i].issuingTime,id:data[i].id,weight:data[i].inWarehouseWeight})
+                }
+                this.$set(this.datelist,i,JSON.parse(JSON.stringify(arr)))
+              }
+            }
+            console.log(this.goodsourcelist,this.datelist)
+          }
+     },
       returnsales(){
         this.$router.go(-1)
       },
@@ -714,4 +735,7 @@
   /deep/.el-form-item {
     width: 50%;
 }
+.add,.del{
+  width:25px;height:25px;
+}
 </style>

+ 27 - 3
src/views/profitable/payment.vue

@@ -53,11 +53,15 @@
           </el-form-item>
           <el-form-item label-width='100px' label="附件">
           <div>
-            <span v-for='item in srcList'><el-image
+            <!-- <span v-for='item in srcList'><el-image
               style="width: 100px; height: 100px;border:1px solid #000;display:inline-block;margin:10px;"
               :src="item"
                :preview-src-list="srcList"></el-image></span>
-             
+              -->
+              <el-upload ref='uploadfiles' :file-list='srcList' action="https://www.zthymaoyi.com/upload/admin" list-type="picture-card"
+            :on-success="handlefujian" :on-remove="handleRemove" class="photo2">
+            <i class="el-icon-plus"></i>
+          </el-upload>
           </div>
         </el-form-item>
         </el-form>
@@ -106,14 +110,34 @@
         .toPromise()
         .then((response) => {
           this.deptBudgetList=response
-          this.srcList=response.addressUrl.split(',')
+          var arr=response.addressUrl.split(',')
+          for (let i = 0; i < arr.length; i++) {
+          this.srcList.push({url:arr[i]})
+            
+          }
+          this.paymentScreenshot=response.addressUrl.split(',')
         })
 
       },
+      handlefujian(file) {
+        // console.log(file)
+        this.paymentScreenshot.push(file.url)
+        // this.dialogVisible = true
+      },
+      handleRemove(file) {
+        // console.log(file)
+        for (let i = 0; i < this.paymentScreenshot.length; i++) {
+          if(this.paymentScreenshot[i]==response.url){
+            this.paymentScreenshot.splice(i, 1)
+          }
+          
+        }
+      },
       returnsales(){
         this.$router.go(-1)
       },
       submit(){
+        this.deptBudgetList.addressUrl=this.paymentScreenshot.toString()
         this.$confirm('确定提交付款信息?', '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',

+ 13 - 12
src/views/profitable/receipt.vue

@@ -30,7 +30,7 @@
             </ws-select>
           </el-form-item>
            <el-form-item label-width='100px' v-if='deptBudgetList.purpose=="合同费用"' label="合同编号" span="1" prop="contractNo" class="readonly">
-            <el-select v-model="deptBudgetList.contractNo" placeholder="选择合同" class="typeselect">
+            <el-select v-model="deptBudgetList.contractNo" placeholder="选择合同" class="typeselect" @change="selectcontract">
               <el-option v-for="item in contractList" :key="item.contractNo" :label="item.contractNo" :value="item.contractNo"
                 style="color: #8890b1" />
             </el-select>
@@ -45,7 +45,7 @@
             <el-input placeholder="输入费用名称,1-15个字" class="input_css input50" v-model="deptBudgetList.expenseName"></el-input>
           </el-form-item>
           <el-form-item label-width='100px' label="金额" span="1" prop="contractNo" class="readonly">
-            <el-input placeholder="输入款金额" class="input_css input50" v-model="deptBudgetList.amountMoney"></el-input>
+            <el-input placeholder="输入款金额" class="input_css input50" v-model="deptBudgetList.amountMoney"></el-input>
           </el-form-item>
           <el-form-item label-width='100px' label="备注" span="1" prop="settlementMethod">
             <el-input
@@ -151,16 +151,16 @@
 				}
 				return Num
 			},
-      // selectcontract(e){
-      //   console.log(e)
-      //   for (let i = 0; i < this.contractList.length; i++) {
-      //     console.log(this.contractList[i])
-      //     if(this.contractList[i].contractNo==e){
-      //       this.signingDate=this.contractList[i].signingDate
-      //       // this.disabledDate()
-      //     }
-      //   }
-      // },
+      selectcontract(e){
+        console.log(e)
+        for (let i = 0; i < this.contractList.length; i++) {
+          console.log(this.contractList[i])
+          if(this.contractList[i].contractNo==e){
+            this.deptBudgetList.contractId=this.contractList[i].id
+            // this.disabledDate()
+          }
+        }
+      },
       handlefujian(file) {
         // console.log(file)
         this.paymentScreenshot.push(file.url)
@@ -246,6 +246,7 @@
               message: '提交成功!',
               type: 'success',
             })
+            this.$refs.uploadfiles.clearFiles()
             this.$router.go(-1)
             })
       },

+ 24 - 8
src/views/profitable/receiptaduit.vue

@@ -52,13 +52,10 @@
             </el-input>
           </el-form-item>
           <el-form-item label-width='100px' label="附件">
-          <div>
-            <span v-for='item in srcList'><el-image
-              style="width: 100px; height: 100px;border:1px solid #000;display:inline-block;margin:10px;"
-              :src="item"
-               :preview-src-list="srcList"></el-image></span>
-             
-          </div>
+          <el-upload ref='uploadfiles' :file-list='srcList' action="https://www.zthymaoyi.com/upload/admin" list-type="picture-card"
+            :on-success="handlefujian" :on-remove="handleRemove" class="photo2">
+            <i class="el-icon-plus"></i>
+          </el-upload>
         </el-form-item>
         </el-form>
         <div style='width:90%;margin:10px auto;text-align:right;'><el-button class="bg-bottom" type="primary" size="small" @click="reject()">驳回
@@ -118,6 +115,20 @@
       this.getList()
     },
     methods: {
+      handlefujian(file) {
+        // console.log(file)
+        this.paymentScreenshot.push(file.url)
+        // this.dialogVisible = true
+      },
+      handleRemove(file) {
+        // console.log(file)
+        for (let i = 0; i < this.paymentScreenshot.length; i++) {
+          if(this.paymentScreenshot[i]==response.url){
+            this.paymentScreenshot.splice(i, 1)
+          }
+          
+        }
+      },
       getList() {
         lookexenseinfo({
          id:this.$route.query.id
@@ -125,7 +136,12 @@
         .toPromise()
         .then((response) => {
           this.deptBudgetList=response
-          this.srcList=response.addressUrl.split(',')
+          var arr=response.addressUrl.split(',')
+          for (let i = 0; i < arr.length; i++) {
+          this.srcList.push({url:arr[i]})
+            
+          }
+          this.paymentScreenshot=response.addressUrl.split(',')
         })
 
       },

+ 16 - 10
src/views/profitable/warehousecost.vue

@@ -12,21 +12,25 @@
     <div class="center">
       <el-row style='margin-bottom:10px;'>
         <el-col :span="12">
-          <el-date-picker v-model="value" type="daterange" align="right" unlink-panels range-separator="至"
-          start-placeholder="开始日期" end-placeholder="结束日期">
-        </el-date-picker>
-        <ws-select v-model="warehouseName" placeholder="" class="typeselect" @change="selectwarehouse">
-          <ws-option v-for="item in warehouse" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName"
-            style="color: #8890b1" />
-        </ws-select>
-
+          <el-row :gutter="20" style='margin:0 0 10px 10px;'>
+            <el-col :span="12">
+              <el-date-picker value-format='yyyy-MM-dd' v-model="value" type="daterange" align="right" unlink-panels range-separator="至"
+                    start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" class="data_css" @change="changeDate" >
+              </el-date-picker>
+            </el-col>
+            <el-col :span="12">
+              <ws-select v-model="warehouseName" placeholder="" class="typeselect" @change="selectwarehouse">
+                <ws-option v-for="item in warehouse" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName" style="color: #8890b1" />
+              </ws-select>
+            </el-col>
+          </el-row>
         </el-col>
         <el-col :span="12">
           <div class="datascreen">
           </div>
         </el-col>
       </el-row>
-      <el-row style='margin-bottom:10px;'>
+      <el-row style='margin:0 0 10px 10px;'>
         <el-col :span="18">
           支出粮款:{{foodExpenditure}}元   收入粮款:{{grainIncome}}元    费用收入:{{expenseIncome}}元    费用支出:{{expensesPay}}元    当期利润: {{currentProfit}}元 
         </el-col>
@@ -64,7 +68,8 @@
 <script>
   import {
     getInOutDetailed,
-    getwarehouse
+    getwarehouse,
+    getcontractexpenseinfo
   } from '@/model/profitable/index'
   export default {
     components: {},
@@ -299,4 +304,5 @@
   .bg-right{
     padding-top:15px;
   }
+
 </style>

+ 101 - 73
src/views/profitable/warehouseprofits.vue

@@ -12,7 +12,7 @@
       <el-col :span="12">
         <div class="datascreen">
         <el-date-picker v-model="value" type="daterange" align="right" unlink-panels range-separator="至"
-          start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions">
+          start-placeholder="开始日期" value-format='yyyy-MM-dd' @change='datechange' end-placeholder="结束日期" :picker-options="pickerOptions">
         </el-date-picker>
         
       </div>
@@ -35,28 +35,28 @@
         <ws-form>
           <ws-info-table>
           <ws-form-item label="收购重量(吨)" span="1" prop="contractNo" class="readonly">
-            
+            {{deptBudgetList.sgweight}}
           </ws-form-item>
           <ws-form-item label="销售重量(吨)" span="1" prop="settlementMethod">
-            
+            {{deptBudgetList.xsweight}}
           </ws-form-item>
           <ws-form-item label="支付粮款(万元)" span="1" prop="contractNo" class="readonly">
-            
+            {{deptBudgetList.zfweight}}
           </ws-form-item>
           <ws-form-item label="收入粮款(万元)" span="1" prop="settlementMethod">
-            
+            {{deptBudgetList.srweight}}
           </ws-form-item>
-          <ws-form-item label="其他支(万元)" span="1" prop="contractNo" class="readonly">
-            
+          <ws-form-item label="其他支(万元)" span="1" prop="contractNo" class="readonly">
+            {{deptBudgetList.qtzfweight}}
           </ws-form-item>
           <ws-form-item label="其他收入(万元)" span="1" prop="settlementMethod">
-            
+            {{deptBudgetList.qtsrweight}}
           </ws-form-item>
-          <ws-form-item label="运费(万元)" span="1" prop="contractNo" class="readonly">
-            
+          <ws-form-item label="成本(万元)" span="1" prop="contractNo" class="readonly">
+            {{deptBudgetList.zfweight}}
           </ws-form-item>
           <ws-form-item label="总利润(万元)" span="1" prop="settlementMethod">
-            
+            {{deptBudgetList.srweight-deptBudgetList.zfweight}}
           </ws-form-item>
         </ws-info-table>
         </ws-form>
@@ -92,7 +92,7 @@
   </div>
 </template>
 <script>
-  import {} from '@/model/profitable/index'
+  import {getwarehousechart} from '@/model/profitable/index'
   export default {
     components: {},
     data() {
@@ -118,34 +118,67 @@
       }
     },
     activated() {
+      this.getPassYearFormatDate()
       this.getList()
-      this.makeWordData = this.getData(2)
+      // this.makeWordData = this.getData(2)
+      
       
-      this.getPassYearFormatDate()
       
     },
     methods: {
+      datechange(e){
+        this.value=e
+        this.getList()
+        console.log(e)
+      },
       getList() {
-        
-        for (let i = 0; i < this.datalist2.length; i++) {
+        this.startDate=this.value[0]
+        this.endDate=this.value[1]
+        this.goodstypelist=[]
+        this.datalist2=[]
+        this.datalist1=[]
+        getwarehousechart({
+          startDate:this.startDate,
+          endDate:this.endDate
+        })
+        .toPromise()
+        .then((response) => {
+          for (let i = 0; i < response.chartList.length; i++) {
+            this.goodstypelist.push(response.chartList[i].goodsName)
+            this.datalist2.push(response.chartList[i].profit/10000)
+          }
+          
+          for (let i = 0; i < this.datalist2.length; i++) {
           if(this.datalist2[i]<0){
-            this.datalist1.push({value:Math.abs(this.datalist2[i]),
+            this.datalist1.push({value: Math.abs(this.datalist2[i]),
           itemStyle: {
-            color: '#a90000'
+            color: '#FF9F24'
           }})
           }else{
             this.datalist1.push({value:Math.abs(this.datalist2[i])})
           }
         }
-        // getceshi({
-        //  driverId:'8f1f3c624d7946d79a9d44a4057d969b'
-        // })
-        // .toPromise()
-        // .then((response) => {
-        // debugger
-        // console.log(response)
-        // })
-        this.initCharts()
+         this.initCharts()
+         for (let i = 0; i < response.formList.length; i++) {
+           console.log(response.formList[i].num)
+            // response.formList[i]
+            if( response.formList[i].type=='收购重量'){
+              this.$set(this.deptBudgetList,'sgweight',response.formList[i].num)
+          }else if(response.formList[i].type=='销售重量'){
+            this.deptBudgetList.xsweight=response.formList[i].num
+          }else if(response.formList[i].type=='支付粮款'){
+            this.deptBudgetList.zfweight=(response.formList[i].num/10000).toFixed(4)
+          }else if(response.formList[i].type=='收入粮款'){
+            this.deptBudgetList.srweight=(response.formList[i].num/10000).toFixed(4)
+          }else if(response.formList[i].type=='其他支出'){
+            this.deptBudgetList.qtzfweight=(response.formList[i].num/10000).toFixed(4)
+          }else if(response.formList[i].type=='其他收入'){
+            this.deptBudgetList.qtsrweight=(response.formList[i].num/10000).toFixed(4)
+          }
+          }
+          console.log(this.deptBudgetList)
+          
+        })
       },
       detail(){
         this.$router.push({name:'warehouseprofitsdetails'})
@@ -184,6 +217,14 @@
         let myChart7 = app.$echarts.init(this.$refs.myEchart7);
         var option;
         option = {
+           grid: {
+          // 四周留白区域设置
+          top: 40,
+          right: 40,
+          left: 40,
+          bottom: 40,
+          containLabel: true,
+        },
             // title: {
             //   text: 'Rainfall vs Evaporation',
             //   subtext: 'Fake Data'
@@ -215,15 +256,41 @@
 
               type: 'category',
               // prettier-ignore
-              data: this.goodstypelist
+              data: this.goodstypelist,
+              axisLine: {
+                show: false //y轴线消失
+              },
+              axisLabel: {   // X轴线 标签修改 
+                textStyle: {
+                  color: '#929AB8', //坐标值得具体的颜色
+                }
+              },
             }],
             yAxis: [{
               name: '利润(万元)',
-              type: 'value'
+              type: 'value',
+              axisLine: {
+                show: false //y轴线消失
+              },
+              nameTextStyle:{
+                color:'#929AB8'
+              },
+              splitLine: {
+                show: true, // 网格线是否显示
+                lineStyle:{
+                  type:'dashed'    //设置网格线类型 dotted:虚线   solid:实线
+                },
+              },
+              axisLabel: {   // X轴线 标签修改 
+                textStyle: {
+                  color: '#929AB8', //坐标值得具体的颜色
+                }
+              },
             }],
             series: [{
                 type: 'bar',
                 right: 0,
+                barWidth:25,
                 // label: {
                 //   show: true,
                 //   position: 'inside'
@@ -245,45 +312,12 @@
                 data: this.datalist1,
                 color: ['#5878E8 '],
                 formatter: '{value} 元',
-
               }
             ]
           },
           myChart7.setOption(option)
       },
-      getData(count) {
-        // prettier-ignore
-        const nameList = [
-          '支出', '收入'
-        ];
-        const legendData = [];
-        const seriesData = [];
-        for (var i = 0; i < count; i++) {
-          var name = nameList[i]
-          // Math.random() > 0.65 ?  makeWord(4, 1) + '·' + makeWord(3, 0) :  makeWord(2, 1);
-          legendData.push(name);
-          seriesData.push({
-            name: name,
-            value: Math.round(Math.random() * 100000)
-          });
-        }
-
-        return {
-          legendData: legendData,
-          seriesData: seriesData
-        };
-
-        // function makeWord(max, min) {
-        //   debugger
-        //   const nameLen = Math.ceil(Math.random() * max + min);
-        //   const name = [];
-        //   for (var i = 0; i < nameLen; i++) {
-        //     name.push(nameList[Math.round(Math.random() * nameList.length - 1)]);
-        //   }
-        //   return name.join('');
-        // }
-
-      }
+     
     },
   }
 </script>
@@ -343,23 +377,17 @@
   .chart_css {
     display: flex;
     height: 410px;
-
     .table {
-      width: 70%;
+      width: 90%;
       height: 410px;
-    }
-
-    .makeWord_css {
-      width: 30%;
-      height: 410px;
-      margin-left: 30px;
+      border: 1px solid #D8DCE6;
+      margin:0 auto 30px;
     }
   }
-
   .table_css {
 
     text-align:center;
-    margin-bottom:10px;
+    margin:30px 0;
   }
   /deep/.el-form{
     width:90%;

+ 8 - 6
src/views/profitable/warehouseprofitsdetails.vue

@@ -45,8 +45,8 @@
           <el-table-column prop="profit" label="利润(万元)"></el-table-column>
           <el-table-column prop="address" label="操作" width="200">
             <template slot-scope="scope">
-              <el-button @click="inventory(1)" type="primary">库存</el-button>
-              <el-button @click="typeChange(1)" type="primary">费用</el-button>
+              <el-button @click="inventory(scope.row)" type="primary">库存</el-button>
+              <el-button @click="cost(scope.row)" type="primary">费用</el-button>
             </template>
           </el-table-column>
         </el-table>
@@ -94,17 +94,20 @@
       inventory(row){
         this.$router.push({name:'warehouseinventory',query:{warehouseName:row.warehouseName}})
       },
-      cost(){
+      cost(row){
         this.$router.push({name:'warehousecost',query:{warehouseName:row.warehouseName}})
       },
       returnsales(){
         this.$router.go(-1)
       },
+      handleSelectionChange(val) {
+        this.multipleSelection = val;
+      },
       getPassYearFormatDate () {
           var nowDate = new Date()
           var _date = new Date()
           nowDate.setTime(nowDate.getTime()-24*60*60*1000*30)
-          var year = nowDate.getFullYear()
+          var year = nowDate.getFullYear()-1
           var year1 = _date.getFullYear()
           var month = nowDate.getMonth() + 1
           var month1 = _date.getMonth() + 1
@@ -128,10 +131,9 @@
           this.value=[this.startDate,this.endDate]
         },
       getList() {
-        
          getwarehousedetails({
             // warehouseType: 1,
-            compId: localStorage.getItem('ws-pf_compId'),
+            // compId: localStorage.getItem('ws-pf_compId'),
             startDate:this.startDate,
             endDate:this.endDate,
             searchKeyWord:this.searchKeyWord,

+ 2 - 2
src/views/taskManagement/tranManagementWarehouseInOutTask.vue

@@ -105,12 +105,12 @@
             <span class="corles" v-hasPermission="
                 `warehouseManagement.warehouse.warehouseInfoTask.edit`
               " v-if="
-                scope.row.taskStatus == '待审核' ||
                 scope.row.taskStatus == '执行中' ||
                 scope.row.taskStatus == '已驳回'
               " @click="delivery(scope.row)">编辑</span>
               <span v-hasPermission="`warehouseManagement.warehouse.warehouseInfoTask.delete`">
-              <el-divider direction="vertical" v-if="scope.row.taskId == null"></el-divider>
+              <el-divider direction="vertical" v-if=" scope.row.taskStatus == '执行中' ||
+                scope.row.taskStatus == '已驳回'"></el-divider>
             </span>
 
             <span class="corles" v-hasPermission="

+ 5 - 1
src/views/taskManagement/tranManagementWarehouseInOutTaskAdd.vue

@@ -543,7 +543,7 @@
 							type: 'warning'
 						});
 					}
-				}else if(this.dataList1.taskTypeKey==2&&this.dataList1.inOutType=="退库"||this.dataList1.taskTypeKey==3){
+				}else if(this.dataList1.taskTypeKey==2&&this.dataList1.inOutType=="退库"||this.dataList1.taskTypeKey==4){
 					if(this.dataList1.moveTaskNo||this.dataList1.contractNo){
 						this.$router.push({name:'outsupplyofgoods',query:{contractNo:this.dataList1.contractNo}})
 					}else{
@@ -1410,8 +1410,12 @@
 					for (let i = 0; i < data.length; i++) {
 						data[i].sourceId=data[i].id
 					}
+				}else{
+					
 				}
 				var supplygoods=data
+				this.dataList.sourceId=this.goods
+				this.dataList1.sourceId=this.goods
 				if (this.dataList.taskTypeKey == 1) {
 					this.dataList.inOutTaskNo = this.inOutTaskNo
 					this.dataList.sourceRelationInfoList=supplygoods

+ 7 - 5
src/views/taskManagement/tranManagementWarehouseInOutTaskAudit.vue

@@ -523,6 +523,7 @@
         warehouseInOutDetail: {},
         onChange: {},
         deptBudgetList1: [],
+        goods:'',
         gradeList: [],
         Pricetype: true,
         rules: {
@@ -1011,6 +1012,7 @@
             })
             .toPromise()
             .then((response) => {
+              console.log(response,22222)
               if (response.length > 1) {
                 if (response[0].taskTypeKey == 3) {
                   if (response[0].inOutType == '移库出库') {
@@ -1020,6 +1022,9 @@
                     this.dataList = response[1]
                     this.dataList1 = response[0]
                   }
+                }else if (response[0].taskTypeKey == 4) {
+                    this.dataList = response[0]
+                    this.dataList1 = response[1]
                 }
               } else {
                 if (response[0].taskTypeKey == 3) {
@@ -1038,12 +1043,9 @@
               this.goods=''
             if(this.dataList.sourceRelationInfoList){
               for (let i = 0; i < this.dataList.sourceRelationInfoList.length; i++) {
+                var supplygoods=this.dataList.sourceRelationInfoList
                 if(this.dataList.taskTypeKey==2&&this.dataList.inOutType=="退库"||this.dataList.taskTypeKey==4){
-                  for (let q = 0; q < supplygoods[i].sourceRelationInfoList.length; q++) {
-                    if(this.goods.indexOf(supplygoods[i].sourceRelationInfoList[q].goodsName)==-1){
-                      this.goods=this.goods!=''?this.goods+',':''+supplygoods[i].sourceRelationInfoList[q].goodsName
-                    }
-                  }
+                  this.goods=this.dataList1.sourceId
                 }else if(this.dataList.taskTypeKey==1||this.dataList.taskTypeKey==3){
                   this.goods=this.goods!=''?this.goods+',':''+this.dataList.sourceRelationInfoList[i].goodsName
                 }

File diff suppressed because it is too large
+ 294 - 146
src/views/taskManagement/tranManagementWarehouseInOutTaskEdit.vue


+ 1 - 4
src/views/warehouse/warehouseManagementRecord.vue

@@ -302,11 +302,8 @@
             </el-option>
           </el-select>
         </div>
-<<<<<<< HEAD
-        <div v-if="deptBudgetList.warehouseName=='鲅鱼圈金信库'||deptBudgetList.warehouseName=='白城内陆港'||deptBudgetList.warehouseName=='哈尔滨依兰库'||this.warehouseName=='山东园丰库'">
-=======
+        <!-- <div v-if="deptBudgetList.warehouseName=='鲅鱼圈金信库'||deptBudgetList.warehouseName=='白城内陆港'||deptBudgetList.warehouseName=='哈尔滨依兰库'||this.warehouseName=='山东园丰库'"> -->
         <div v-if="deptBudgetList.warehouseName=='鲅鱼圈金信库'||deptBudgetList.warehouseName=='白城内陆港'">
->>>>>>> 32173094c0b5517c2d64af85d92ed9b3864725d5
           <div class="print-type-ew">
             <el-checkbox v-model="checked" @change="changeEw">打印额外票据</el-checkbox>
             <el-checkbox v-model="ddchecked" @change="changeEwDD">单独打印额外票据</el-checkbox>

+ 84 - 45
src/views/warehousenew/inventoryCheck.vue

@@ -87,12 +87,9 @@
         <el-table-column prop="approveStatus" label="状态" width="90">
           <template slot-scope="scope">
             <template>
-              <span slot="reference">
-                <span v-if="scope.row.inventoryStatus == '待审核'" class="executory"></span>
-                <span v-if="scope.row.inventoryStatus == '执行中'" class="inExecution"></span>
-                <span v-if="scope.row.inventoryStatus == '已完成'" class="done"></span>
-                {{ scope.row.inventoryStatus }}
-              </span>
+              <!-- <span v-if='scope.row.approveStatus'>{{ scope.row.approveStatus }}</span> -->
+              <!-- <span v-else>{{ scope.row.inventoryStatus }}</span> -->
+              <span>{{ scope.row.inventoryStatus }}</span>
             </template>
             <img v-if="scope.row.taskStatus == '执行中'" width="17" height="18"
               style="vertical-align: text-top; position: relative; top: -1px" src="../../../public/img/edit.png"
@@ -101,10 +98,8 @@
         </el-table-column>
         <el-table-column prop="seller" label="操作" width="230">
           <template slot-scope="scope">
-             <ws-button type="primary" v-if="scope.row.taskStatus == '待审核'" @click="aduit(scope.row)" v-hasPermission="
-            `warehouseManagement.warehousingOrder.adiut`
-          ">审核
-        </ws-button>
+             <ws-button type="primary" v-if="scope.row.inventoryStatus == '待审核'" @click="aduit(scope.row)" v-hasPermission="`warehouseManagement.warehousingOrder.adiut`">
+              审核</ws-button>
           </template>
         </el-table-column>
       </el-table>
@@ -162,6 +157,9 @@
     woekflowhandle
   } from '@/model/tasksport/index'
     import {
+    getAuditRecord
+  } from '@/model/profitable/index'
+    import {
   getwarehousingorder,
   editwarehousingorder
 } from '@/model/warehouse/index'
@@ -264,10 +262,11 @@
         // 提交类型
         submitType: true,
         size: 10,
-        form:{},
+        form:{num:0},
         spanArr: [],
         aduitList:[],
         flag:'',
+        currectflag:'',
         warehouseName: '',
         deptBudgetTotal: 0,
         compId: localStorage.getItem('ws-pf_compId'),
@@ -287,7 +286,7 @@
     //   this.getList()
     //   this.showType = this.isShow
     // },
-    mounted() {
+    activated() {
       
       this.getList()
       this.value2=this.getNowTime()
@@ -298,7 +297,7 @@
         return index * 2;
       },
       handlerecord(row){
-        gettaskhistories({ businessKey: row.id,
+        getAuditRecord({ id: row.id,
             workflowId: row.workflowId}).toPromise()
                 .then((response) => {
                   this.recordList=response
@@ -343,16 +342,29 @@
         this.aduitList=row
         this.form.id=row.id
         this.form.surplusWeight=row.surplusWeight
+        this.form.profitAndLoss=row.profitAndLoss
+        this.form.num=row.surplusWeight+row.plValue
+        this.form.plValue=row.plValue
         this.title='审核'
+        this.currectflag=row.operationFlag
         this.aduitshow=true
         this.disabled=true
       },
       lose(ware){
         if(this.multipleSelection[ware]){
           this.form.id=this.multipleSelection[ware].id
+          this.form.workflowId=this.multipleSelection[ware].workflowId
           this.form.surplusWeight=this.multipleSelection[ware].surplusWeight
+          this.form.profitAndLoss=this.multipleSelection[ware].profitAndLoss
           this.title='盘亏'
           this.slecetwarehouseName=''
+          if(this.multipleSelection[ware].approveStatus){
+           this.$notify.warning({
+            title: '警告',
+            message: '未选择要盘点的入库记录',
+          })
+          return
+        }
           this.aduitshow=true
           this.disabled=false
         }else{
@@ -366,8 +378,17 @@
       profit(ware){
         if(this.multipleSelection[ware]){
         this.form.id=this.multipleSelection[ware].id
+        this.form.workflowId=this.multipleSelection[ware].workflowId
         this.form.surplusWeight=this.multipleSelection[ware].surplusWeight
+        this.form.profitAndLoss=this.multipleSelection[ware].profitAndLoss
         this.title='盘盈'
+        if(this.multipleSelection[ware].approveStatus){
+           this.$notify.warning({
+            title: '警告',
+            message: '未选择要盘点的入库记录',
+          })
+          return
+        }
         this.aduitshow=true
         this.disabled=false
         }else{
@@ -387,7 +408,7 @@
             return
           }
         if(this.title=='盘盈'){
-          this.form.profitAndLoss=this.form.surplusWeight-this.form.num
+          this.form.plValue=this.form.num-this.form.surplusWeight
           this.form.flag=0
           if(this.form.num<this.form.surplusWeight){
             this.$notify.warning({
@@ -399,7 +420,7 @@
           title='确定提交盘盈数据?'
         }
         if(this.title=='盘亏'){
-          this.form.profitAndLoss=-this.form.surplusWeight-this.form.num
+          this.form.plValue=this.form.num-this.form.surplusWeight
           this.form.flag=1
           if(this.form.num>this.form.surplusWeight){
             this.$notify.warning({
@@ -410,6 +431,7 @@
           }
           title='确定提交盘亏数据?'
         }
+        this.form.compId=localStorage.getItem('ws-pf_compId')
          this.$confirm(title, {
             confirmButtonText: '确定',
             cancelButtonText: '取消',
@@ -419,9 +441,10 @@
           editwarehousingorder(this.form).toPromise()
               .then((response) => {
                 this.aduitshow=false
+                this.form.num=''
                 this.$message({
                   message: '提交成功',
-                  type: 'error'
+                  type: 'success'
                 });
                 this.getList()
               }).catch(() => {
@@ -439,25 +462,33 @@
             type: 'warning',
           })
           .then(() => {
-            woekflowhandle({
-                taskId: this.aduitList.taskId,
-                approved: true,
-                auditMind: '34',
-                needReapply: false,
-              }).toPromise()
-              .then((response) => {
+            if(this.currectflag==0){
+              this.form.flag=2
+            }else{
+              this.form.flag=3
+            }
+            editwarehousingorder(this.form).toPromise().then((response) => {
+              // woekflowhandle({
+              //   taskId: this.aduitList.taskId,
+              //   approved: true,
+              //   auditMind: '34',
+              //   needReapply: false,
+              // }).toPromise()
+              // .then((response) => {
+                this.form.num=0
                 this.aduitshow=false
                 this.$message({
                   message: '通过成功',
-                  type: 'error'
+                  type: 'success'
                 });
                 this.getList()
-              }).catch(() => {
-                  this.$message({
-                    message: '通过失败',
-                    type: 'error'
-                  });
-              })  
+              // }).catch(() => {
+              //     this.$message({
+              //       message: '通过失败',
+              //       type: 'error'
+              //     });
+              // }) 
+            }) 
           }).catch(() => {
             return false
           })
@@ -470,25 +501,33 @@
             type: 'warning',
           })
           .then(() => {
-            woekflowhandle({
-                taskId: this.aduitList.taskId,
-                approved: false,
-                auditMind: '驳回',
-                needReapply: false,
-              }).toPromise()
-              .then((response) => {
+            if(this.currectflag==1){
+              this.form.flag=4
+            }else{
+              this.form.flag=5
+            }
+            editwarehousingorder(this.form).toPromise().then((response) => {
+            // woekflowhandle({
+            //     taskId: this.aduitList.taskId,
+            //     approved: false,
+            //     auditMind: '驳回',
+            //     needReapply: true,
+            //   }).toPromise()
+            //   .then((response) => {
+                this.form.num=0
                 this.aduitshow=false
                 this.$message({
                   message: '驳回成功',
-                  type: 'error'
+                  type: 'success'
                 });
                 this.getList()
-              }).catch(() => {
-                  this.$message({
-                    message: '驳回失败',
-                    type: 'error'
-                  });
-              })  
+              // }).catch(() => {
+              //     this.$message({
+              //       message: '驳回失败',
+              //       type: 'error'
+              //     });
+              // })
+            }) 
               }).catch(() => {
             return false
           })
@@ -640,7 +679,7 @@
         return fmt
       },
       handleClose() {
-        this.accessoryTFs = false
+        this.aduitshow = false
       },
       handleSizeChange(val) {
         console.log(`每页 ${val} 条`)

+ 78 - 30
src/views/warehousenew/warehousingOrder.vue

@@ -5,7 +5,7 @@
       <template slot="left">
           <div style='width:50%;margin-right:10px;'>
             <el-date-picker v-model="value2" type="daterange" align="right" unlink-panels range-separator="至"
-          start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions">
+          start-placeholder="开始日期" value-format='yyyy-MM-dd' end-placeholder="结束日期" @change='datechange' :picker-options="pickerOptions">
         </el-date-picker>
   
           </div>
@@ -25,11 +25,11 @@
     <el-row style='margin:10px;'>
         <el-col :span="12">
              <ws-button :type="searchType===''?'primary':''" @click="handleAdd()" v-hasPermission="
-            `warehouseManagement.warehouse.warehouseInfoTask.add`
+            `warehouseManagement.warehousingOrder.View`
           ">全部
         </ws-button>
          <ws-button :type="searchType==='1'?'primary':''" @click="handleAdd()" v-hasPermission="
-            `warehouseManagement.warehouse.warehouseInfoTask.add`
+            `warehouseManagement.warehousingOrder.View`
           ">未付款
         </ws-button>
         </el-col>
@@ -42,7 +42,7 @@
     </el-row>
     <div v-for="item in gainList" style='margin:10px;border:1px solid #ccc;padding:10px;'>
       <div style='width:100%;justify-content:space-between;align-items:center;margin-bottom:10px;' class="flex">
-        <div>2022-10-22</div>
+        <div>{{item.issuingTime}}</div>
         <div>{{item.warehouseName}}入库单</div>
         <div>
           <ws-button v-if='item.payshow' type="primary" @click="payout(item)" v-hasPermission="
@@ -58,7 +58,7 @@
           ">提交
         </ws-button>
         <ws-button type="primary" @click="aduit(item)" v-hasPermission="
-            `warehouseManagement.warehousingOrder.View`
+            `warehouseManagement.warehousingOrder.adiut`
           ">审核
         </ws-button>
          <ws-button type="primary" @click="payment(item)" v-hasPermission="
@@ -119,17 +119,8 @@
         </el-table-column>
         <el-table-column prop="approveStatus" label="请款状态" width="90">
           <template slot-scope="scope">
-            <template>
-              <span slot="reference">
-                <span v-if="scope.row.approveStatus == '待审核'" class="executory"></span>
-                <span v-if="scope.row.approveStatus == '执行中'" class="inExecution"></span>
-                <span v-if="scope.row.approveStatus == '已完成'" class="done"></span>
-                {{ scope.row.approveStatus }}
-              </span>
-            </template>
-            <img v-if="scope.row.approveStatus == '执行中'" width="17" height="18"
-              style="vertical-align: text-top; position: relative; top: -1px" src="../../../public/img/edit.png"
-              @click="editClick(scope.row)" alt />
+            <span v-if='scope.row.approveStatus'>{{ scope.row.approveStatus }}</span>
+            <span v-else>{{ scope.row.status }}</span>
           </template>
         </el-table-column>
       </el-table>
@@ -328,6 +319,8 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
         id:'',
         appendixIdss:[],
         paymentScreenshot:[],
+        endDate:'',
+        startDate:'',
         warehouseName: '',
         deptBudgetTotal: 0,
         compId: localStorage.getItem('ws-pf_compId'),
@@ -347,9 +340,9 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
     //   this.getList()
     //   this.showType = this.isShow
     // },
-    mounted() {
-      this.getList()
+    activated() {
       this.value2=this.getNowTime()
+      this.getList()
       this.showType = this.isShow
     },
     methods: {
@@ -363,7 +356,14 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
         this.getList()
       },
        handleSelectionChange(val) {
-        this.multipleSelection = val;
+         this.multipleSelection=this.noRepeat(this.multipleSelection.concat(val))
+      },
+      noRepeat(arr){
+ 
+        var newArr = [...new Set(arr)]; //利用了Set结构不能接收重复数据的特点
+    
+        return newArr
+    
       },
       editWeight(row){
         row.weightedit=true
@@ -415,8 +415,8 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
         .toISOString()
         .replace('T', ' ')
         .split('.')[0]//默认结束时间今天
-      console.log([start, end])
-      return [start, end]
+      // console.log([start.split(' '), end])
+      return [start.split(' ')[0], end.split(' ')[0]]
     },
       cancel(item){
         item.payshow=true
@@ -526,9 +526,9 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
       },
       paymentsubmit(){
         var that=this
-         var arr2=this.multipleSelection.filter(function(items,index){
-                  return that.currectdata.warehouseName==items.warehouseName
-                })
+        var arr2=this.multipleSelection.filter(function(items,index){
+          return that.currectdata.warehouseName==items.warehouseName
+        })
           if(this.paymentScreenshot.length==0){
             this.$message({
               message: '请上传付款截图',
@@ -537,7 +537,7 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
             return
           }
           for (let i = 0; i < arr2.length; i++) {
-            arr2[i].addressUrl=this.paymentScreenshot.toString()
+            arr2[i].addressUrl=arr2[i].addressUrl+this.paymentScreenshot.toString()
             
           }
             paymoney({flag:0,warehousingOrderList:arr2}).toPromise()
@@ -547,6 +547,8 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
               type: 'success'
             });
             this.aduitshow=false
+            this.paymentScreenshot=[]
+            this.$refs.upload.clearFiles()
             this.getList()
           }).catch(() => {
            this.$message({
@@ -558,20 +560,40 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
       },
       payment(item){
         this.money=0
+        var moneyarr=this.multipleSelection.filter(function(items,index){
+          return item.warehouseName==items.warehouseName
+        })
+        console.log(moneyarr)
         for (let i = 0; i < this.multipleSelection.length; i++) {
          if(this.multipleSelection[i].warehouseName==item.warehouseName){
            this.money=Number(this.money)+Number(this.multipleSelection[i].requestFunds)
+           if(this.multipleSelection[i].approveStatus!==null){
+             this.$message({
+              message: '请勾选一条待付款的条目',
+              type: 'warning'
+            })
+            return
+           }
          }
         }
         this.form.name=this.money
         this.currectdata=item
-        this.aduitshow=true
+        if(moneyarr&&moneyarr.length>0){
+          this.aduitshow=true
+        }else{
+          this.$message({
+              message: '至少勾选一条待付款的条目',
+              type: 'warning'
+            })
+        }
+        
         
       },
       aduit(row){
         var arr2=this.multipleSelection.filter(function(items,index){
           return row.warehouseName==items.warehouseName
         })
+        // console.log(arr2)
         if(arr2.length==0){
           if(localStorage.getItem('ws-pf_roleName')=='采购副总'){
             this.$message({
@@ -598,15 +620,17 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
           }
           
         }
+        var arr3=this.filtertask(arr2)
           this.$confirm('审核请款信息', {
             confirmButtonText: '通过',
             cancelButtonText: '驳回',
             type: 'warning',
           })
           .then(() => {
-            this.aduithandle(arr2,0,true)
+            
+            this.aduithandle(arr3,0,true)
           }).catch(() => {
-            this.aduithandle(arr2,0,false)
+            this.aduithandle(arr3,0,false)
           })       
       },
       aduithandle(item,index,status){
@@ -615,7 +639,7 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
                 taskId: item[index].taskId,
                 approved:status,
                 auditMind: '34',
-                needReapply: false,
+                needReapply: true,
               }).toPromise()
               .then((response) => {
                this.aduithandle(item,index+1,status)
@@ -657,9 +681,18 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
       warehousingorder(){
         this.dialogVisible=true
       },
+      datechange(e){
+        this.value2=e
+        this.getList()
+        console.log(e)
+      },
       getList() {
+        this.startDate=this.value2[0]
+        this.endDate=this.value2[1]
         getwarehousingorder({
             compId: localStorage.getItem('ws-pf_compId'),
+            startDate:this.startDate,
+            endDate:this.endDate,
             currentPage: this.currentPage,
             pageSize: this.pageSize,
             searchType: this.searchType,
@@ -717,6 +750,21 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
         // 记录结果就是过滤后的结果
         return newArr;
       },
+      filtertask(arr){
+        const newArr = [];
+        for (const t of arr) {
+          if (
+            newArr.find(
+              (c) =>
+                c.taskId === t.taskId
+            )
+          ) {
+            continue;
+          }
+          newArr.push(t);
+        }
+        return newArr;
+      },
       getSpanArr(data) {
         let that = this
 
@@ -782,7 +830,7 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
         return fmt
       },
       handleClose() {
-        this.accessoryTFs = false
+        this.aduitshow = false
       },
       handleSizeChange(val) {
         console.log(`每页 ${val} 条`)

Some files were not shown because too many files changed in this diff