gjy 3 лет назад
Родитель
Сommit
bde268f315
37 измененных файлов с 4758 добавлено и 3253 удалено
  1. 29 1
      src/api/V2/profitable/index.js
  2. 4 0
      src/api/V2/taskspost/index.js
  3. 8 1
      src/api/V2/warehouse/index.js
  4. 5 7
      src/lang/zh.js
  5. 44 2
      src/model/profitable/index.js
  6. 11 2
      src/model/tasksport/index.js
  7. 13 3
      src/model/warehouse/index.js
  8. 1 1
      src/views/houseSelfCollect/customerManagementAdd.vue
  9. 471 246
      src/views/profitable/cashout.vue
  10. 199 238
      src/views/profitable/cashoutaduit.vue
  11. 0 33
      src/views/profitable/component/routers/route.js
  12. 63 20
      src/views/profitable/contractcost.vue
  13. 25 17
      src/views/profitable/contractinventory.vue
  14. 46 29
      src/views/profitable/contractprofitsdetails.vue
  15. 274 215
      src/views/profitable/expenseallot.vue
  16. 234 237
      src/views/profitable/expenseallotaduit.vue
  17. 107 71
      src/views/profitable/expensemanagement.vue
  18. 147 48
      src/views/profitable/expensemanagementdetails.vue
  19. 438 221
      src/views/profitable/expensemanagentedit.vue
  20. 109 145
      src/views/profitable/expensemanagentlook.vue
  21. 91 222
      src/views/profitable/payment.vue
  22. 210 243
      src/views/profitable/receipt.vue
  23. 146 304
      src/views/profitable/receiptaduit.vue
  24. 68 18
      src/views/profitable/warehousecost.vue
  25. 41 7
      src/views/profitable/warehouseinventory.vue
  26. 14 17
      src/views/profitable/warehouseprofitsdetails.vue
  27. 72 154
      src/views/taskManagement/outsupplyofgoods.vue
  28. 48 154
      src/views/taskManagement/outsupplyofgoodsedit.vue
  29. 4 4
      src/views/taskManagement/outsupplyofgoodslook.vue
  30. 78 188
      src/views/taskManagement/supplyofgoods.vue
  31. 103 188
      src/views/taskManagement/supplyofgoodsedit.vue
  32. 15 148
      src/views/taskManagement/supplyofgoodslook.vue
  33. 40 3
      src/views/taskManagement/tranManagementWarehouseInOutTask.vue
  34. 40 11
      src/views/taskManagement/tranManagementWarehouseInOutTaskAdd.vue
  35. 28 28
      src/views/warehousenew/component/router/index.js
  36. 671 14
      src/views/warehousenew/inventoryCheck.vue
  37. 861 13
      src/views/warehousenew/warehousingOrder.vue

+ 29 - 1
src/api/V2/profitable/index.js

@@ -27,4 +27,32 @@ export const API_POST_SUBMITPAY = '/feeDetailsInfo/submitPay'
 // 费用管理编辑 、 收款、付款
 export const API_POST_SHOUGUAN = '/feeDetailsInfo/payShou'
 //合同编号下拉
-export const API_GET_WAREHOUSE_NO = '/warehouseBaseInfo/selectContractNoList'
+export const API_GET_WAREHOUSE_NO = '/warehouseBaseInfo/selectContractNoList'
+// 费用管理详情列表
+export const API_GET_EXPENSEINFO = '/expenseInfo/selectInfo'
+// 费用管理请款收款
+export const API_SET_EXPENSEINFO = '/expenseInfo/api/addInfo'
+// 获取仓库的入库单
+export const API_GET_SELECTWAREHOUSINGORDER ='/expenseInfo/selectWarehousingOrder'
+// 费用管理编辑、分配、完成、确认收款、确认分配
+export const API_EDIT_EXPENSEINFO ='/expenseInfo/editInfo'
+// 费用管理查看
+export const API_LOOK_EXPENSEINFO ='/expenseInfo/ExpenseInfo'
+// 费用管理删除
+export const API_DEL_EXPENSEINFO ='/expenseInfo/deleteInfo'
+// 费用管理分配删除
+export const API_DEL_ALLOCATIONINFO ='/expenseInfo/deleteAllocationInfo'
+// 费用管理付款
+export const API_PAYMNET ='/expenseInfo/payment'
+// 合同费用,库点费用
+export const API_GET_CONTRACTEXPENSEINFO ='/contractExpensesInfo/selectContractExpensesInfo'
+// 合同库存、收购库存
+export const API_GET_INVENTORYINFO ='/contractInventoryDistribution/selectContractInventoryInfo'
+// 合同利润详情
+export const API_GET_CONTRACTDETAILS ='/contractManagementInfo/selectContractInfo'
+// 库点利润详情
+export const API_GET_WAREHOUSETAILS ='/warehouseBaseInfo/selectBaseInfo'
+// 费用管理图表
+export const API_EXPENSECHAT ='/expenseInfo/expenseChart'
+// 费用管理收支表
+export const API_EXPENSECHATLIST ='/expenseInfo/expenseList'

+ 4 - 0
src/api/V2/taskspost/index.js

@@ -49,3 +49,7 @@ export const API_POST_DEL_HAULAGE_STAGE= '/tranProcessInfo/api/deleteTranProcess
 export const API_GET_TASKHISTORIES= '/workflowHistory/query/taskHistories'
 // 获取发货人
 export const API_GET_STAFF = '/staff/query/getStaffListByCompId'
+// 货源提交
+export const API_EDIT_SOURCEOFGOODS = '/warehousingOrder/editSourceOfGoods'
+// 货源查看
+export const API_GET_SOURCEGOOD = 'warehousingOrder/getSourceOfGoodsList'

+ 8 - 1
src/api/V2/warehouse/index.js

@@ -110,4 +110,11 @@ export const API_SEND_BACK ='/warehouseInOutInfo/returnWarehouse'
 export const API_DELETE_WAREHOUSE ='/warehouseInOutInfo/api/deleteWarehouse'
 //查看自己负责的仓库
 export const API_GET_WAREHOUSENAME='/warehouseBaseInfo/selectWarehouseSelf'
-
+// 入库单列表
+export const API_GET_WAREHOUSINGORDER = '/warehousingOrder/selectInfo'
+// 盘盈、盘亏
+export const API_EDIT_WAREHOUSINGORDER = '/warehousingOrder/editInfo'
+//请款、收款
+export const API_SET_PAYMONEY = 'warehousingOrder/api/payMoney'
+//费用详情
+export const API_GET_EXPENSEINFO = '/expenseInfo/selectInfo'

+ 5 - 7
src/lang/zh.js

@@ -517,8 +517,6 @@ export default {
 
     //仓库管理
     warehouseManagementList: '仓库管理',
-    warehousingOrder: '入库单',
-    inventoryCheck:'库存盘点',
     warehouselocation: '成本管理  /  库点费用',
     weightedsubsidiary: '加权明细',
     costmanagement: '成本管理',
@@ -611,6 +609,8 @@ export default {
     outsupplyofgoods:'出入库任务  /  添加  /  选择货源',
     supplyofgoodslook:'出入库任务  /  审核  /  查看货源',
     outsupplyofgoodslook:'出入库任务  /  审核  /  查看货源',
+    supplyofgoodsedit:'出入库任务  /  编辑  /  选择货源',
+    outsupplyofgoodsedit:'出入库任务  /  编辑  /  选择货源',
     tranManagementWarehouseInOutTaskAdd: '出入库任务添加',
     tranManagementWarehouseInOutTaskEdit: '编辑',
     tranManagementWarehouseInOutTaskaudit: '审核',
@@ -660,7 +660,8 @@ export default {
     quotesDetail: '报价单详情',
     purchasDetail: '采购详情',
     billDetail: '备件结算详情',
-
+    warehousingOrder: '入库单',
+    inventoryCheck:'库存盘点',
     sparepartMa: '物料采购',
     applDetailMa: '物料申请详情',
     enquiryDetailMa: '物料询价详情',
@@ -4900,10 +4901,7 @@ export default {
     warehouseManagementPutOut: '任务',
     warehouseManagementPutOutLook: '查看',
     transformation: '折转',
-    warehouseManagement:'全部仓库',
-    warehousingOrder: '入库单',
-    inventoryCheck:'库存盘点',
-
+    warehouseManagement:'全部仓库'
   },
   //贸易服务
   tradeServicesManagement: {

+ 44 - 2
src/model/profitable/index.js

@@ -15,7 +15,21 @@ import {
   API_POST_SUBMIT,
   API_POST_SHOUGUAN,
   API_POST_SUBMITPAY,
-  API_GET_WAREHOUSE_NO
+  API_GET_WAREHOUSE_NO,
+  API_GET_EXPENSEINFO,
+  API_SET_EXPENSEINFO,
+  API_GET_SELECTWAREHOUSINGORDER,
+  API_EDIT_EXPENSEINFO,
+  API_LOOK_EXPENSEINFO,
+  API_DEL_EXPENSEINFO,
+  API_DEL_ALLOCATIONINFO,
+  API_PAYMNET,
+  API_GET_CONTRACTEXPENSEINFO,
+  API_GET_CONTRACTDETAILS,
+  API_GET_INVENTORYINFO,
+  API_GET_WAREHOUSETAILS,
+  API_EXPENSECHAT,
+  API_EXPENSECHATLIST
 } from '@/api/V2/profitable'
 //收支明细列表
 export const getInOutDetailed = appRx.get(API_GET_INOUTDETAILED, errorCatcher, errorHandle, filter)
@@ -35,7 +49,7 @@ export const getLookInfo = appRx.get(API_GET_LOOKINFO, errorCatcher, errorHandle
 export const woekflowhandle = appRx.post(API_POST_WORKFLOW_API_HANDLE, errorCatcher, errorHandle, filter)
 // 审核记录
 export const getAuditRecord = appRx.get(API_POST_AUDITRECORD, errorCatcher, errorHandle, filter)
-// 审核记录
+// 仓库
 export const getwarehouse= appRx.get(API_GET_WAREHOUSE, errorCatcher, errorHandle, filter)
 // 费用管理提交
 export const setexpense = appRx.post(API_POST_SUBMIT, errorCatcher, errorHandle, filter)
@@ -47,3 +61,31 @@ export const expenseLook = appRx.post(API_GET_LOOK, errorCatcher, errorHandle, f
 export const expensepay= appRx.post(API_POST_SUBMITPAY, errorCatcher, errorHandle, filter)
 // 费用管理编辑 、 收款、付款
 export const expenseshougou= appRx.post(API_POST_SHOUGUAN, errorCatcher, errorHandle, filter)
+// 费用详情列表
+export const getexenseinfo= appRx.get(API_GET_EXPENSEINFO, errorCatcher, errorHandle, filter)
+// 费用管理请款收款
+export const addexenseinfo= appRx.post(API_SET_EXPENSEINFO, errorCatcher, errorHandle, filter)
+// 获取仓库的入库单
+export const getwarehousingorder= appRx.get(API_GET_SELECTWAREHOUSINGORDER, errorCatcher, errorHandle, filter)
+// 费用管理编辑、分配、完成、确认收款、确认分配
+export const editexenseinfo= appRx.post(API_EDIT_EXPENSEINFO, errorCatcher, errorHandle, filter)
+// 查看
+export const lookexenseinfo= appRx.get(API_LOOK_EXPENSEINFO, errorCatcher, errorHandle, filter)
+// 费用管理删除
+export const delexenseinfo= appRx.post(API_DEL_EXPENSEINFO, errorCatcher, errorHandle, filter)
+// 费用管理分配删除
+export const delallocationinfo= appRx.post(API_DEL_ALLOCATIONINFO, errorCatcher, errorHandle, filter)
+// 费用管理付款
+export const expensepayment= appRx.post(API_PAYMNET, errorCatcher, errorHandle, filter)
+// 合同费用,库点费用
+export const getcontractexpenseinfo= appRx.get(API_GET_CONTRACTEXPENSEINFO, errorCatcher, errorHandle, filter)
+// 合同利润详情
+export const getcontractdetails= appRx.get(API_GET_CONTRACTDETAILS, errorCatcher, errorHandle, filter)
+// 合同库存、收购库存
+export const getinventoryinfo= appRx.get(API_GET_INVENTORYINFO, errorCatcher, errorHandle, filter)
+// 库点利润详情
+export const getwarehousedetails= appRx.get(API_GET_WAREHOUSETAILS, errorCatcher, errorHandle, filter)
+// 费用管理图表
+export const getexpensechat= appRx.get(API_EXPENSECHAT, errorCatcher, errorHandle, filter)
+// 费用管理收支表
+export const getexpensechatlist= appRx.get(API_EXPENSECHATLIST, errorCatcher, errorHandle, filter)

+ 11 - 2
src/model/tasksport/index.js

@@ -25,7 +25,10 @@ import {
     API_POST_DEL_HAULAGE_STAGE,
     API_GET_STAFF,
     API_GET_TASKHISTORIES,
-    API_POST_WORKFLOW_TASK
+    API_POST_WORKFLOW_TASK,
+    API_EDIT_SOURCEOFGOODS,
+    API_GET_SOURCEGOOD,
+    API_SET_CORRECT
 } from '@/api/V2/taskspost'
 //运输任务列表
 export const gain = appRx.get(API_GET_TRAN_LIST, errorCatcher, errorHandle, filter)
@@ -74,4 +77,10 @@ export const delhaulagestage = appRx.post(API_POST_DEL_HAULAGE_STAGE, errorCatch
 //查询审核记录
 export const gettaskhistories = appRx.get(API_GET_TASKHISTORIES, errorCatcher, errorHandle, filter)
 //获取发货人
-export const getstaff = appRx.get(API_GET_STAFF, errorCatcher, errorHandle, filter)
+export const getstaff = appRx.get(API_GET_STAFF, errorCatcher, errorHandle, filter)
+//货源提交编辑
+export const editSourceOfGoods = appRx.post(API_EDIT_SOURCEOFGOODS, errorCatcher, errorHandle, filter)
+//货源查看
+export const getSourceOfGoods = appRx.get(API_GET_SOURCEGOOD, errorCatcher, errorHandle, filter)
+//矫正
+export const setcorrect = appRx.get(API_SET_CORRECT, errorCatcher, errorHandle, filter)

+ 13 - 3
src/model/warehouse/index.js

@@ -54,7 +54,11 @@ import {
     API_GET_WAREHOUSE_ALL,
     API_SEND_BACK,
     API_DELETE_WAREHOUSE,
-    API_GET_WAREHOUSENAME
+    API_GET_WAREHOUSENAME,
+    API_GET_WAREHOUSINGORDER,
+    API_EDIT_WAREHOUSINGORDER,
+    API_SET_PAYMONEY,
+    // API_GET_EXPENSEINFO
 } from '@/api/V2/warehouse'
 // import { app } from 'electron'
 // 列表
@@ -164,5 +168,11 @@ export const sendback = appRx.post(API_SEND_BACK,errorCatcher, errorHandle, filt
 export const postdeletewarehouse = appRx.post(API_DELETE_WAREHOUSE,errorCatcher, errorHandle, filter)
 //查看自己负责的仓库
 export const getwarehousName = appRx.get(API_GET_WAREHOUSENAME,errorCatcher, errorHandle, filter)
-
-
+//入库单列表
+export const getwarehousingorder = appRx.get(API_GET_WAREHOUSINGORDER,errorCatcher, errorHandle, filter)
+//盘盈、盘亏/入库重量
+export const editwarehousingorder = appRx.post(API_EDIT_WAREHOUSINGORDER,errorCatcher, errorHandle, filter)
+//请款,收款
+export const paymoney = appRx.post(API_SET_PAYMONEY,errorCatcher, errorHandle, filter)
+// //费用详情
+// export const getexenseinfo = appRx.get(API_GET_EXPENSEINFO,errorCatcher, errorHandle, filter)

+ 1 - 1
src/views/houseSelfCollect/customerManagementAdd.vue

@@ -487,7 +487,7 @@
           })
           .toPromise()
           .then((response) => {
-            if (response.bankNameZhihang.length > 0) {
+            if (response.bankNameZhihang) {
               this.bankList = response.bankNameZhihang
             }
             if (response.bankNo) {

+ 471 - 246
src/views/profitable/cashout.vue

@@ -12,64 +12,64 @@
     <div class="center">
      
       <div>
-        <ws-form label-position="left"  label-width="140px"><div style='margin:30px 0 30px;'>基本信息</div>
-          <ws-form-item label="用途" span="1" prop="contractNo" class="readonly">
-             <el-radio-group v-model="deptBudgetList.purpose">
-                <el-radio :label="1">合同费用</el-radio>
-                <el-radio :label="2">库点费用</el-radio>
-                <el-radio :label="3">经营性费用</el-radio>
-            </el-radio-group>
-          </ws-form-item>
-          <ws-form-item v-if='deptBudgetList.purpose==1||deptBudgetList.purpose==2' label="类型" span="1" prop="contractNo" class="readonly">
-             <el-radio-group v-model="deptBudgetList.type">
-                <el-radio :label="1">粮款</el-radio>
-                <el-radio :label="2">非粮款</el-radio>
-                <el-radio v-if='deptBudgetList.purpose==1' :label="3">保证金</el-radio>
-            </el-radio-group>
-          </ws-form-item>
-          <ws-form-item v-if='deptBudgetList.purpose==1' label="合同编号" span="1" prop="contractNo" class="readonly">
-            <ws-select v-model="deptBudgetList.contractNo" placeholder="" class="typeselect" @change="selectcontent"
-          :value="searchType">
-          <ws-option v-for="item in contractList" :key="item.contractNo" :label="item.contractNo" :value="item.contractNo"
-            style="color: #8890b1" />
-        </ws-select>
-          </ws-form-item>
-           <ws-form-item v-if='deptBudgetList.purpose==2' label="仓库名称" span="1" prop="contractNo" class="readonly">
-            <ws-select v-model="deptBudgetList.warehouse" placeholder="" class="typeselect" @change="selectwarehouse"
-          :value="searchType">
-          <ws-option v-for="item in contractList" :key="item.contractNo" :label="item.contractNo" :value="item.contractNo"
-            style="color: #8890b1" />
-        </ws-select>
-          </ws-form-item>
-          <ws-form-item label="费用名称" span="1" prop="settlementMethod">
-            <el-input placeholder="输入费用名称,1-15个字" class="input_css" v-model="deptBudgetList.expenseName"></el-input>
-          </ws-form-item>
-          <ws-form-item label="金额(元)" span="1" prop="contractNo" class="readonly">
-            <el-input placeholder="输入请款金额" class="input_css" v-model="deptBudgetList.money"></el-input>
-          </ws-form-item>
-          <ws-form-item label="备注" span="1" prop="settlementMethod">
+        <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="2"
+            :rows="5"
             placeholder="选填,不超过50个字"
             v-model="deptBudgetList.remark">
             </el-input>
-          </ws-form-item>
-          <ws-form-item label="附件">
+          </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>
-        </ws-form-item>
-        </ws-form>
-        <div v-if='deptBudgetList.type==2'>费用分配</div>
-        <div v-if='deptBudgetList.type==2' style='margin-bottom:10px;'>
-            <ws-select v-model="mode" placeholder="费用分配方式" class="typeselect" @change="modeselect"
-          :value="searchType">
+        </el-form-item>
+        </el-form>
+        <div v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"||deptBudgetList.purpose=="库点费用"' class='expensetitle'>费用分配</div>
+        <div v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"||deptBudgetList.purpose=="库点费用"' style='margin:0  auto 10px;width:90%;'>
+            <ws-select v-model="mode" placeholder="费用分配方式" @change="modeselect">
           <ws-option v-for="item in modeList" :key="item.value" :label="item.value" :value="item.value"
             style="color: #8890b1" />
         </ws-select>
-         <ws-select v-if='deptBudgetList.purpose==1' v-model="ware" placeholder="费用分配仓库" class="typeselect" @change="selectwareType"
+         <!-- <ws-select v-if='deptBudgetList.purpose==1' v-model="ware" placeholder="费用分配仓库" class="typeselect" @change="selectwareType"
           :value="searchType">
           <ws-option v-for="item in wareList" :key="item.value" :label="item.value" :value="item.value"
             style="color: #8890b1" />
@@ -83,48 +83,57 @@
           :value="searchType">
           <ws-option v-for="item in datesList" :key="item.value" :label="item.value" :value="item.value"
             style="color: #8890b1" />
-        </ws-select>
-         <ws-select v-model="moneys" placeholder="费用分配金额" class="typeselect" @change="selecttaskType"
-          :value="searchType">
+        </ws-select> -->
+         <ws-select :disabled='disabled' v-model="moneys" placeholder="费用分配金额">
           <ws-option v-for="item in moneysList" :key="item.value" :label="item.value" :value="item.value"
             style="color: #8890b1" />
         </ws-select>
-        合计分配:{{amount}}元
+        <span v-if='mode!="暂不分配"'>合计分配:{{amount}}元</span>  
         </div>
-        <el-table v-if='deptBudgetList.type==2' :data="feeDetailsDistributions" style="width: 80%;margin:0 auto;">
-          <el-table-column prop="date" label="所属" min-width="110">
+        <el-table 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-if='deptBudgetList.purpose==2' v-model="scope.row.belonging" placeholder="选择仓库或合同" class="typeselect" @change="selectware"
-          :value="searchType">
-          <ws-option v-for="item in warecontractList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-        <ws-select v-if='deptBudgetList.purpose==1' v-model="scope.row.belonging" placeholder="选择仓库" class="typeselect" @change="selectware"
-          :value="searchType">
-          <ws-option v-for="item in warehouseList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
+              <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"
+                  style="color: #8890b1" />
+              </ws-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"
+                  style="color: #8890b1" />
+              </ws-select>
             </template>
           </el-table-column>
-          <el-table-column prop="date" label="日期">
+          <el-table-column v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="日期">
             <template slot-scope="scope">
-                <ws-date-picker v-model="scope.row.proDate" type="date" placeholder="请选择日期"
-              value-format="yyyy-MM-dd" />
+                <el-date-picker @change="receiptDocDatechange" v-model="scope.row.receiptDocDate" type="date" placeholder="请选择日期"
+              value-format="yyyy-MM-dd"   ></el-date-picker>
             </template>
           </el-table-column>
-          <el-table-column prop="date" label="货名">
+          <el-table-column v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="货源">
               <template slot-scope="scope">
-                <ws-select v-model="scope.row.goodsName" placeholder="选择货名" class="typeselect" @change="goodsNameselect"
-                    :value="searchType">
-                    <ws-option v-for="item in goodsList" :key="item.value" :label="item.value" :value="item.value"
+                <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"
                         style="color: #8890b1" />
                 </ws-select>
             </template>
           </el-table-column>
-          <el-table-column prop="date" label="库存(吨)"></el-table-column>
+          <el-table-column v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="货名">
+            <template slot-scope="scope">
+               <span>{{scope.row.goodsName?scope.row.goodsName:'自动获取'}}</span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="inWarehouseWeight" label="入库量(吨)">
+            <template slot-scope="scope">
+               <span>{{scope.row.inWarehouseWeight?scope.row.inWarehouseWeight:'自动获取'}}</span>
+            </template>
+          </el-table-column>
           <el-table-column prop="date" label="分配金额(元)">
             <template slot-scope="scope">
-                <el-input placeholder="输入费用名称,1-15个字" class="input_css" v-model="scope.row.money"></el-input>
+                <el-input placeholder="输入费用名称,1-15个字" class="input_css" v-model="scope.row.distributionMoney"></el-input>
             </template>
           </el-table-column>
           <el-table-column prop="address" label="操作" width="200">
@@ -143,7 +152,7 @@
   </div>
 </template>
 <script>
-  import {setexpense,getcontract} from '@/model/profitable/index'
+  import {setexpense,getcontract,getwarehouse,addexenseinfo,getwarehousingorder} from '@/model/profitable/index'
   export default {
     components: {},
     data() {
@@ -154,25 +163,28 @@
           count: 2000,
         }],
         mode:'全部分配',
-        ware:'指定仓库',
-        dates:'固定日期',
         moneys:'按重量自动分配',
-        goods:'全部货品',
-        amount:0,
+        dataList:[],
         goodsList:[],
+        disabled:false,
         warecontractList:[],
-        feeDetailsDistributions:[{proDate:'',weight:'',money:'',warehouse:'',belonging:'',index:0}],
-        deptBudgetList:{purpose:1,type:1},
+        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
           },
@@ -189,50 +201,359 @@
       // 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(){
-
+      selectwarehouse(e){
+      },
+      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)      
       },
-      selectwareType(e){
-        if(e=='全部仓库'){
-          for (let i = 0; i < this.choosablewareList.length; i++) {
-            this.feeDetailsDistributions.push(this.choosablewareList[i])
+      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})
+            }
+          })
+      },
+      selectgoodsSource(e,item){
+        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.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
+            }
+        }
+        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)
+            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
+            }
             
           }
         }
       },
-      selectproductType(){
-        if(e=='全部产品'){
-
+      selecttime(e,item){
+        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.length; i++) {
+          if(this.datelist[i].time==e){
+            item.orderId=this.datelist[i].id
+            item.inWarehouseWeight=this.datelist[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)
+            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=[]
+        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})
+            }
+          })
       },
       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.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(){
-        if(!this.deptBudgetList.contractNo&&this.deptBudgetList.purpose==1){
+        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.expenseAllocationInfoList=this.feeDetailsDistributions
+           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
+            this.deptBudgetList.expenseAllocationInfoList=[]
+          }else if(this.deptBudgetList.type=='非粮款'){
+            this.deptBudgetList.costType=3
+            this.deptBudgetList.expenseAllocationInfoList=this.feeDetailsDistributions
+          }else if(this.deptBudgetList.type=='保证金'){
+            this.deptBudgetList.expensesPurpose=5
+            this.deptBudgetList.expenseAllocationInfoList=[]
+          }
+        }
+         if(this.deptBudgetList.expensesPurpose==1){
+        var data=[]
+          for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+            if(data.length==0){
+              data.push(this.feeDetailsDistributions[i])
+            }else{
+              var repetition=data.filter((item,index)=>{
+                return this.feeDetailsDistributions[i].orderId==item.orderId&&this.feeDetailsDistributions[i].receiptDocDate==item.receiptDocDate
+              })
+              if(repetition.length==0){
+                data.push(this.feeDetailsDistributions[i])
+              }else{
+                this.$message({
+                    message: '货源重复!',
+                    type: 'warning',
+                  })
+                  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',
+              //     })
+              //   }
+              // }
+            }
+            
+          }
+        }
+        if(this.deptBudgetList.expensesPurpose==3){
+        var data=[]
+          for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+            if(data.length==0){
+              data.push(this.feeDetailsDistributions[i])
+            }else{
+              var repetition=data.filter((item,index)=>{
+                return this.feeDetailsDistributions[i].warehouseName==item.warehouseName&&this.feeDetailsDistributions[i].receiptDocDate==item.receiptDocDate
+              })
+              if(repetition.length==0){
+                data.push(this.feeDetailsDistributions[i])
+              }else{
+                this.$message({
+                    message: '货源重复!',
+                    type: 'warning',
+                  })
+                  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',
+              //     })
+              //   }
+              // }
+            }
+            
+          }
+        }
+        this.deptBudgetList.expensesType=2
+        if(!this.deptBudgetList.contractNo&&this.deptBudgetList.expensesPurpose==1){
           this.$message({
                 message: '合同编号不能为空!',
                 type: 'warning',
               })
+              return
         }
-        if(!this.deptBudgetList.warehouse&&this.deptBudgetList.purpose==2){
+        if(!this.deptBudgetList.warehouse&&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({
@@ -240,20 +561,45 @@
                 type: 'warning',
           })
         }
-        if(!this.deptBudgetList.money){
+        if(!this.deptBudgetList.amountMoney){
           this.$message({
                 message: '金额不能为空!',
                 type: 'warning',
           })
+          return
         }
-        this.deptBudgetList.applUrl=this.paymentScreenshot.toString()
-        setexpense(this.deptBudgetList).toPromise()
-          .then(response => {})
+        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(() => {
+        addexenseinfo(this.deptBudgetList).toPromise()
+          .then(response => {
+            this.$message({
+              message: '提交成功!',
+              type: 'success',
+            })
+            this.$router.go(-1)
+          })
+          })
       },
       modeselect(e){
-          console.log(e)
-      },selectware(e){
-          console.log(e)
+        if(e=='全部分配'){
+          this.moneys='按重量自动分配'
+          this.disabled=false
+        }else if(e=='部分分配'){
+          this.moneys='指定分配金额'
+          this.disabled=true
+        }
       },
       goodsNameselect(e){
           console.log(e)
@@ -264,10 +610,14 @@
       dellist(row){
         if(this.feeDetailsDistributions.length>1){
           this.feeDetailsDistributions.splice(row.index,1)
+        }else{
+          this.$message({
+            message: '至少保留一条!',
+            type: 'warning',
+          })
         }
       },
       getList() {
-        console.log(1222)
         getcontract({
         compId:localStorage.getItem('ws-pf_compId'),
         })
@@ -275,162 +625,22 @@
         .then((response) => {
           this.contractList=response
         })
+        getwarehouse({
+        compId:localStorage.getItem('ws-pf_compId'),
+        warehouseType:1
+        })
+        .toPromise()
+        .then((response) => {
+          this.warehouseList=response
+        })
 
       },
       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() {
 
       },
-      initCharts() {
-        let app = this;
-        let myChart7 = app.$echarts.init(this.$refs.myEchart7);
-        var option;
-        option = {
-            // title: {
-            //   text: 'Rainfall vs Evaporation',
-            //   subtext: 'Fake Data'
-            // },
-            tooltip: {
-              trigger: 'axis'
-            },
-            legend: {
-              data: ['支出', '收入']
-            },
-            toolbox: {
-              show: true,
-              feature: {
-                dataView: {
-                  show: false,
-                  readOnly: false
-                },
-                magicType: {
-                  show: false,
-                  type: ['line', 'bar']
-                },
-                restore: {
-                  show: false
-                },
-                saveAsImage: {
-                  show: false
-                }
-              }
-            },
-            calculable: true,
-            xAxis: [{
-              name: '种类',
-              type: 'category',
-              // prettier-ignore
-              data: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct']
-            }],
-            yAxis: [{
-              name: '储量(吨)',
-              type: 'value'
-            }],
-            series: [{
-                name: '支出',
-                type: 'bar',
-                right: 0,
-                // label: {
-                //   show: true,
-                //   position: 'inside'
-                // },
-                 label: {
-                  show: true,
-                  precision: 1,
-                  position: 'top',
-                  valueAnimation: true,
-                  fontFamily: 'monospace'
-                },
-                data: [
-                  6.0, 60.9, 90.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0
-                ],
-                color: ['#5878E8 '],
-                formatter: '{value} 元',
-
-              },
-              {
-                name: '收入',
-                type: 'bar',
-                right: 20,
-                label: {
-                  show: true,
-                  precision: 1,
-                  position: 'top',
-                  valueAnimation: true,
-                  fontFamily: 'monospace'
-                },
-                data: [
-                  102.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8
-                ],
-                color: ['#FF9F24'],
-                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>
@@ -447,7 +657,15 @@
     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;
@@ -511,8 +729,15 @@
   /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>

+ 199 - 238
src/views/profitable/cashoutaduit.vue

@@ -1,131 +1,126 @@
-//请款
+//审核请款
 <template>
   <div class="container">
     <el-row class="row_top">
       <el-col :span="12">
-        <h2 class="bg-left title">请款</h2>
+        <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 class="table_css">
-        <ws-form><div>基本信息</div>
-          <ws-form-item label="用途" span="1" prop="contractNo" class="readonly">
-              <div v-if="deptBudgetList.purpose==1">合同费用</div>
-              <div v-if="deptBudgetList.purpose==2">库点费用</div>
-              <div v-if="deptBudgetList.purpose==3">经营性费用</div>
-          </ws-form-item>
-          <ws-form-item v-if='deptBudgetList.purpose==1||deptBudgetList.purpose==2' label="类型" span="1" prop="contractNo" class="readonly">
-            <div v-if='deptBudgetList.type==1'>粮款</div>
-            <div v-if='deptBudgetList.type==2'>非粮款</div>
-            <div v-if='deptBudgetList.type==3&&deptBudgetList.purpose==1'>保证金</div>
-          </ws-form-item>
-          <ws-form-item label="合同编号" span="1" prop="contractNo" class="readonly">
+      <div >
+        <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="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.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 v-if='deptBudgetList.expensesPurpose==3' label-width='100px' label="仓库名称" span="1" prop="warehouse" class="readonly">
+          {{deptBudgetList.warehouse}}
+          </el-form-item>
+          <el-form-item v-if='deptBudgetList.expensesPurpose==1' label-width='100px' label="合同编号" span="1" prop="contractNo" class="readonly">
           {{deptBudgetList.contractNo}}
-          </ws-form-item>
-          <ws-form-item label="费用名称" span="1" prop="settlementMethod">
+          </el-form-item>
+          <el-form-item label-width='100px' label="费用名称" span="1" prop="settlementMethod">
             {{deptBudgetList.expenseName}}
-          </ws-form-item>
-          <ws-form-item label="金额" span="1" prop="contractNo" class="readonly">
-            {{deptBudgetList.money}}
-          </ws-form-item>
-          <ws-form-item label="备注" span="1" prop="settlementMethod">
+          </el-form-item>
+          <el-form-item label-width='100px' label="金额" span="1" prop="contractNo" class="readonly">
+            {{deptBudgetList.amountMoney}}
+          </el-form-item>
+          <el-form-item label-width='100px' label="备注" span="1" prop="settlementMethod">
             <el-input
             disabled
             type="textarea"
-            :rows="2"
+            :rows="5"
             placeholder="选填,不超过50个字"
             v-model="deptBudgetList.remark">
             </el-input>
-          </ws-form-item>
-          <ws-form-item 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>
-        </ws-form-item>
-        </ws-form>
-        <div v-if='deptBudgetList.type==2'>费用分配</div>
-        <div v-if='deptBudgetList.type==2' style='margin-bottom:10px;'>
-            <ws-select v-model="mode" placeholder="费用分配方式" class="typeselect" @change="modeselect"
-          :value="searchType">
-          <ws-option v-for="item in modeList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-         <ws-select v-if='deptBudgetList.purpose==1' v-model="ware" placeholder="费用分配仓库" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in wareList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-        <ws-select v-if='deptBudgetList.purpose==2' v-model="goods" placeholder="费用分配产品" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in goodsList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-         <ws-select v-model="dates" placeholder="费用分配日期" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in datesList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-         <ws-select v-model="moneys" placeholder="费用分配金额" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in moneysList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-        合计分配:{{amount}}元
-        </div>
-        <el-table :data="feeDetailsDistributions" style="width: 80%;margin:0 auto;">
-          <el-table-column prop="date" label="所属" min-width="110">
-            <template slot-scope="scope">
-                <ws-select v-if='deptBudgetList.purpose==2' v-model="scope.row.belonging" placeholder="选择仓库或合同" class="typeselect" @change="selectware"
-          :value="searchType">
-          <ws-option v-for="item in warecontractList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-        <ws-select v-if='deptBudgetList.purpose==1' v-model="scope.row.belonging" placeholder="选择仓库" class="typeselect" @change="selectware"
-          :value="searchType">
-          <ws-option v-for="item in warehouseList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-            </template>
-          </el-table-column>
-          <el-table-column prop="date" label="日期">
-            <template slot-scope="scope">
-                <ws-date-picker v-model="scope.row.proDate" type="date" placeholder="请选择日期"
-              value-format="yyyy-MM-dd" />
-            </template>
-          </el-table-column>
-          <el-table-column prop="date" label="货名">
+          </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-form-item>
+        </el-form>
+        <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">
+                <ws-select disabled 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"
+                    style="color: #8890b1" />
+                </ws-select>
+              </template>
+            </el-table-column>
+            <el-table-column v-if='deptBudgetList.expensesPurpose==1' prop="date" label="日期">
               <template slot-scope="scope">
-                <ws-select v-model="scope.row.goodsName" placeholder="选择货名" class="typeselect" @change="goodsNameselect"
-                    :value="searchType">
-                    <ws-option v-for="item in goodsList" :key="item.value" :label="item.value" :value="item.value"
-                        style="color: #8890b1" />
+                <ws-select disabled 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"
+                    style="color: #8890b1" />
                 </ws-select>
-            </template>
-          </el-table-column>
-          <el-table-column prop="date" label="库存(吨)"></el-table-column>
-          <el-table-column prop="date" label="分配金额(元)">
-            <template slot-scope="scope">
-                <el-input placeholder="输入费用名称,1-15个字" class="input_css" v-model="scope.row.money"></el-input>
-            </template>
-          </el-table-column>
-          <el-table-column prop="address" label="操作" width="200">
-            <template slot-scope="scope">
-                <img class='add' @click='addlist()' src="../../../public/img/add.png" alt="">
-                <img class='del' @click='dellist(scope.row)' src="../../../public/img/del.png" alt="">
-            </template>
-          </el-table-column>
-        </el-table>
+              </template>
+            </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="请选择日期"
+                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-option v-for="item in goodsourcelist" :key="item.id" :label="item.goodsSource" :value="item.id"
+                          style="color: #8890b1" />
+                  </ws-select>
+              </template>
+            </el-table-column>
+            <el-table-column v-if='deptBudgetList.expensesPurpose==3' prop="date" label="货名">
+              <template slot-scope="scope">
+                <span>{{scope.row.goodsName?scope.row.goodsName:'自动获取'}}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="inWarehouseWeight" label="入库量(吨)">
+              <template slot-scope="scope">
+                <span>{{scope.row.inWarehouseWeight?scope.row.inWarehouseWeight:'自动获取'}}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="date" label="分配金额(元)">
+              <template slot-scope="scope">
+                  <el-input disabled placeholder="输入费用名称,1-15个字" class="input_css" v-model="scope.row.distributionMoney"></el-input>
+              </template>
+            </el-table-column>
+          </el-table>
 
       </div>
       <div>
-      <el-button class="bg-bottom" type="primary" size="small" @click="reject()">驳回
+        <div style='width:90%;margin:10px auto;text-align:right;'>
+          <el-button class="bg-bottom" type="primary" size="small" @click="reject()">驳回
         </el-button>
         <el-button class="bg-bottom" type="primary" size="small" @click="pass()">通过
         </el-button>
+        </div>
+      
     </div>
     <el-dialog
       title="驳回"
@@ -142,14 +137,15 @@
 </div>
       <span slot="footer" class="dialog-footer">
         <el-button @click="dialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="rejectshow = false">确 定</el-button>
+        <el-button type="primary" @click="rejectclick">确 定</el-button>
       </span>
     </el-dialog>
     </div>
+    </div>
   </div>
 </template>
 <script>
-  import {} from '@/model/profitable/index'
+  import {setexpense,getcontract,getwarehouse,addexenseinfo,getwarehousingorder,lookexenseinfo} from '@/model/profitable/index'
   export default {
     components: {},
     data() {
@@ -164,7 +160,6 @@
         dates:'固定日期',
         moneys:'按重量自动分配',
         goods:'全部货品',
-        amount:0,
         goodsList:[],
         warecontractList:[],
         feeDetailsDistributions:[{proDate:'',weight:'',money:'',warehouse:'',belonging:'',index:0}],
@@ -188,11 +183,21 @@
       }
     },
     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: {
       pass(){
          this.$confirm('确认通过请款信息?', '提示', {
@@ -200,11 +205,54 @@
             cancelButtonText: '取消',
             type: 'warning'
           })
-          .then(() => {})
+          .then(() => {
+            woekflowhandle({
+                taskId: this.deptBudgetList.taskId,
+                approved: true,
+                auditMind: '34',
+                needReapply: false,
+              })
+              .toPromise()
+              .then((response) => {
+                this.$message({
+                  message: '通过成功!',
+                  type: 'success',
+                })
+                this.$router.go(-1)
+              }).catch((response) => {
+                this.$message({
+                  message: '通过失败!',
+                  type: 'success',
+                })
+              })
+          })
+      },
+      returnsales(){
+        this.$router.go(-1)
       },
       reject(){
         this.rejectshow=true
       },
+      rejectclick(){
+        woekflowhandle({
+          taskId: this.deptBudgetList.taskId,
+          approved: true,
+          auditMind: '34',
+          needReapply: false,
+        }).toPromise()
+        .then((response) => {
+          this.$message({
+            message: '驳回成功!',
+            type: 'success',
+          })
+          this.$router.go(-1)
+        }).catch((response) => {
+          this.$message({
+            message: '驳回失败!',
+            type: 'success',
+          })
+        })
+      },
       modeselect(e){
           console.log(e)
       },selectware(e){
@@ -220,14 +268,45 @@
           this.feeDetailsDistributions.splice(row.index,1)
       },
       getList() {
-        // getceshi({
-        //  driverId:'8f1f3c624d7946d79a9d44a4057d969b'
-        // })
-        // .toPromise()
-        // .then((response) => {
-        // debugger
-        // console.log(response)
-        // })
+       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 
+          if(response.addressUrl){
+            var arr=[]
+            var srcs=response.addressUrl.split(',')
+            this.srcList=srcs
+          }
+          if(response.expenseAllocationInfoList){
+            this.feeDetailsDistributions=response.expenseAllocationInfoList
+          }
+          
+          
+        })
 
       },
       detail(){
@@ -263,127 +342,6 @@
       pickerOptions() {
 
       },
-      initCharts() {
-        let app = this;
-        let myChart7 = app.$echarts.init(this.$refs.myEchart7);
-        var option;
-        option = {
-            // title: {
-            //   text: 'Rainfall vs Evaporation',
-            //   subtext: 'Fake Data'
-            // },
-            tooltip: {
-              trigger: 'axis'
-            },
-            legend: {
-              data: ['支出', '收入']
-            },
-            toolbox: {
-              show: true,
-              feature: {
-                dataView: {
-                  show: false,
-                  readOnly: false
-                },
-                magicType: {
-                  show: false,
-                  type: ['line', 'bar']
-                },
-                restore: {
-                  show: false
-                },
-                saveAsImage: {
-                  show: false
-                }
-              }
-            },
-            calculable: true,
-            xAxis: [{
-              name: '种类',
-              type: 'category',
-              // prettier-ignore
-              data: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct']
-            }],
-            yAxis: [{
-              name: '储量(吨)',
-              type: 'value'
-            }],
-            series: [{
-                name: '支出',
-                type: 'bar',
-                right: 0,
-                // label: {
-                //   show: true,
-                //   position: 'inside'
-                // },
-                 label: {
-                  show: true,
-                  precision: 1,
-                  position: 'top',
-                  valueAnimation: true,
-                  fontFamily: 'monospace'
-                },
-                data: [
-                  6.0, 60.9, 90.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0
-                ],
-                color: ['#5878E8 '],
-                formatter: '{value} 元',
-
-              },
-              {
-                name: '收入',
-                type: 'bar',
-                right: 20,
-                label: {
-                  show: true,
-                  precision: 1,
-                  position: 'top',
-                  valueAnimation: true,
-                  fontFamily: 'monospace'
-                },
-                data: [
-                  102.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8
-                ],
-                color: ['#FF9F24'],
-                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>
@@ -464,6 +422,9 @@
   /deep/.el-form{
     width:90%;
     margin:0 auto;
+    .el-form-item__label{
+      color:#8890B1;
+    }
   }
   /deep/.el-form-item {
     width: 50%;

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

@@ -249,39 +249,6 @@ const profitableRouter = {
     //   },
     //   hidden:true,
     // },
-    // // 费用管理收款
-    // {
-    //   path: 'receipt',
-    //   component: () =>
-    //     import(/* webpackChunkName: "applDetail" */ '@/views/profitable/receipt'),
-    //   name: 'receipt',
-    //   meta: {
-    //     title: 'receipt',
-    //     shortcutEntrance: 'profitable',
-    //     module: 'contractManagement.exContract.exContractInfo.view',
-    //     permissicon: [],
-    //     keepAlive: true
-    //     // module: 'procurement.sparepart.applDetail'
-    //   },
-    //   hidden:true,
-    // }, 
-    
-    // // 费用管理收款确认
-    // {
-    //   path: 'receiptaduit',
-    //   component: () =>
-    //     import(/* webpackChunkName: "applDetail" */ '@/views/profitable/receiptaduit'),
-    //   name: 'receiptaduit',
-    //   meta: {
-    //     title: 'receiptaduit',
-    //     shortcutEntrance: 'profitable',
-    //     module: 'contractManagement.exContract.exContractInfo.view',
-    //     permissicon: [],
-    //     keepAlive: true
-    //     // module: 'procurement.sparepart.applDetail'
-    //   },
-    //   hidden:true,
-    // }, 
     // // 费用管理付款
     // {
     //   path: 'payment',

+ 63 - 20
src/views/profitable/contractcost.vue

@@ -12,12 +12,12 @@
     <div class="center">
       <el-row style='margin-bottom:10px;'>
         <el-col :span="12">
- <ws-select v-model="searchTypeText" placeholder="" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in contractList" :key="item.value" :label="item.value" :value="item.value"
+ <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"
             style="color: #8890b1" />
         </ws-select>
-            <el-input placeholder="可按合同名称、买方名称、卖方名称查找" class="input_css" v-model="searchKeyWord"></el-input>
+        <span>{{name}}</span>
+            <!-- <el-input placeholder="可按合同名称、买方名称、卖方名称查找" class="input_css" v-model="searchKeyWord"></el-input> -->
         </el-col>
         <el-col :span="12">
           <div class="datascreen">
@@ -26,7 +26,7 @@
       </el-row>
       <el-row style='margin-bottom:10px;'>
         <el-col :span="18">
-        支出粮款:50000元   收入粮款:50000元    费用收入:100000元    费用支出:10000元    当期利润: 100000
+        支出粮款:{{foodExpenditure}}元   收入粮款:{{grainIncome}}元    费用收入:{{expenseIncome}}元    费用支出:{{expensesPay}}元    当期利润: {{currentProfit}}
         </el-col>
         <el-col :span="6">
 
@@ -40,11 +40,17 @@
               <span v-else>{{ scope.$index + 1 }}</span>
             </template>
           </el-table-column>
-          <el-table-column prop="reexType" label="费用名称"></el-table-column>
-          <el-table-column prop="createDate" label="所属库点"></el-table-column>
-          <el-table-column prop="amountMoney" label="费用金额"></el-table-column>
-          <el-table-column prop="expenseName" label="请款人/收款人"></el-table-column>
-          <el-table-column prop="expenseRemarks" label="日期"></el-table-column>
+          <el-table-column prop="feeType" label="类型">
+            <template slot-scope="scope">
+              <div v-if='scope.row.expensesType==1'>收入</div>
+              <div v-if='scope.row.expensesType==2'>支出</div>
+            </template>
+          </el-table-column>
+          <el-table-column prop="expensesName" label="费用名称"></el-table-column>
+          <el-table-column prop="warehouseName" label="所属库点"></el-table-column>
+          <el-table-column prop="expensesPrice" label="费用金额"></el-table-column>
+          <el-table-column prop="personName" label="请款人/收款人"></el-table-column>
+          <el-table-column prop="payDeadline" label="日期"></el-table-column>
         </el-table>
       </div>
       <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
@@ -57,7 +63,8 @@
 </template>
 <script>
   import {
-    getInOutDetailed
+    getcontractexpenseinfo,
+    getcontract
   } from '@/model/profitable/index'
   export default {
     components: {},
@@ -72,15 +79,22 @@
         contractList:[],
         taskTypeList:[],
         searchType:"",
+        contractNo:'',
         searchKeyWord:"",
         startDate:"",
         endDate:"",
         outtotal:0,
         intotal:0,
+        foodExpenditure:0,
+        grainIncome:0,
+        expenseIncome:0,
+        expensesPay:0,
+        currentProfit:0,
       }
     },
     activated() {
-         this.getPassYearFormatDate()
+      this.contractNo=this.$route.query.contractNo
+        //  this.getPassYearFormatDate()
       this.getList()
     },
     methods: {
@@ -88,6 +102,17 @@
         this.searchType = num
         this.getList()
       },
+      changecontract(e){
+          for (let i = 0; i < this.contractList.length; i++) {
+            if(this.contractList[i].contractNo==e){
+              if(this.contractList[i].contractType==2){
+                this.name=this.contractList[i].seller
+              }else{
+                this.name=this.contractList[i].buyer
+              }
+            }
+          }
+        },
       getPassYearFormatDate () {
           var nowDate = new Date()
           var _date = new Date()
@@ -123,22 +148,40 @@
         .then((response) => {
           this.contractList=response
         })
-         getInOutDetailed({
+         getcontractexpenseinfo({
             // warehouseType: 1,
             compId: localStorage.getItem('ws-pf_compId'),
-            startDate:this.startDate,
-            endDate:this.endDate,
-            searchKeyWord:this.searchKeyWord,
+            contractNo:this.contractNo,
             currentPage: this.currentPage,
             pageSize:this.pageSize ,
-            searchType:this.searchType
+            costType:1
           })
           .toPromise()
           .then(response => {
             this.tableData = response.records
-            if(this.tableData.length > 0){
-              this.intotal = Number(this.tableData[0].inContractMoney) + Number(this.tableData[0].inWarehouseMoney) + Number(this.tableData[0].inManageMoney)
-            this.outtotal = Number(this.tableData[0].outContractMoney) + Number(this.tableData[0].outWarehouseMoney) + Number(this.tableData[0].outManageMoney)
+            if(this.tableData){
+              this.foodExpenditure=0
+              this.grainIncome=0
+              this.expenseIncome=0
+              this.expensesPay=0
+              this.currentProfit=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)
+                }
+              }
             }
             
            this.deptBudgetTotal = response.total

+ 25 - 17
src/views/profitable/contractinventory.vue

@@ -12,12 +12,11 @@
     <div class="center">
       <el-row style='margin-bottom:10px;'>
         <el-col :span="12">
- <ws-select v-model="searchTypeText" placeholder="" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in contractList" :key="item.value" :label="item.value" :value="item.value"
+        <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"
             style="color: #8890b1" />
         </ws-select>
-            <el-input placeholder="可按合同名称、买方名称、卖方名称查找" class="input_css" v-model="searchKeyWord"></el-input>
+         <span>{{name}}</span>
         </el-col>
         <el-col :span="12">
           <div class="datascreen">
@@ -32,13 +31,13 @@
               <span v-else>{{ scope.$index + 1 }}</span>
             </template>
           </el-table-column>
-          <el-table-column prop="reexType" label="仓库名称"></el-table-column>
-          <el-table-column prop="createDate" label="入库量(吨)"></el-table-column>
-          <el-table-column prop="amountMoney" label="销售量(吨)"></el-table-column>
-          <el-table-column prop="expenseName" label="移出量(吨)"></el-table-column>
-          <el-table-column prop="expenseRemarks" label="盘亏(吨)"></el-table-column>
-          <el-table-column prop="expenseName" label="盘盈(吨)"></el-table-column>
-          <el-table-column prop="expenseRemarks" label="成本(元/吨)"></el-table-column>
+          <el-table-column prop="warehouse" label="仓库名称"></el-table-column>
+          <el-table-column prop="inStorage" label="入库量(吨)"></el-table-column>
+          <el-table-column prop="saleStorage" label="销售量(吨)"></el-table-column>
+          <el-table-column prop="removeStorage" label="移出量(吨)"></el-table-column>
+          <el-table-column prop="loss" label="盘亏(吨)"></el-table-column>
+          <el-table-column prop="surplus" label="盘盈(吨)"></el-table-column>
+          <el-table-column prop="cost" label="成本(元/吨)"></el-table-column>
         </el-table>
       </div>
       <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
@@ -50,7 +49,7 @@
 </template>
 <script>
   import {
-    getInOutDetailed,
+    getinventoryinfo,
     getcontract
   } from '@/model/profitable/index'
   export default {
@@ -69,6 +68,7 @@
         searchKeyWord:"",
         startDate:"",
         endDate:"",
+        name:'',
         outtotal:0,
         intotal:0,
       }
@@ -109,6 +109,17 @@
           this.endDate = year1 + '-' + month1 +'-' + strDate1
           this.value=[this.startDate,this.endDate]
         },
+        changecontract(e){
+          for (let i = 0; i < this.contractList.length; i++) {
+            if(this.contractList[i].contractNo==e){
+              if(this.contractList[i].contractType==2){
+                this.name=this.contractList[i].seller
+              }else{
+                this.name=this.contractList[i].buyer
+              }
+            }
+          }
+        },
       getList() {
         getcontract({
         compId:localStorage.getItem('ws-pf_compId'),
@@ -117,7 +128,7 @@
         .then((response) => {
           this.contractList=response
         })
-         getInOutDetailed({
+         getinventoryinfo({
             // warehouseType: 1,
             compId: localStorage.getItem('ws-pf_compId'),
             startDate:this.startDate,
@@ -125,15 +136,12 @@
             searchKeyWord:this.searchKeyWord,
             currentPage: this.currentPage,
             pageSize:this.pageSize ,
+            inventoryType:1,
             searchType:this.searchType
           })
           .toPromise()
           .then(response => {
             this.tableData = response.records
-            if(this.tableData.length > 0){
-              this.intotal = Number(this.tableData[0].inContractMoney) + Number(this.tableData[0].inWarehouseMoney) + Number(this.tableData[0].inManageMoney)
-            this.outtotal = Number(this.tableData[0].outContractMoney) + Number(this.tableData[0].outWarehouseMoney) + Number(this.tableData[0].outManageMoney)
-            }
             
            this.deptBudgetTotal = response.total
           })

+ 46 - 29
src/views/profitable/contractprofitsdetails.vue

@@ -12,7 +12,7 @@
     <div class="center">
       <el-row style='margin-bottom:10px;'>
         <el-col :span="12">
-          <el-button style="margin-left:10px" @click="typeChange('')" type="primary">导出</el-button>
+          <!-- <el-button style="margin-left:10px" @click="typeChange('')" type="primary">导出</el-button> -->
         </el-col>
         <el-col :span="12">
           <div class="datascreen">
@@ -28,11 +28,11 @@
       <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 @click="typeChange(1)" :type="searchType == 1?'primary':''">采购合同</el-button>
-          <el-button @click="typeChange(2)" :type="searchType == 2?'primary':''">销售合同</el-button>
-          <el-button @click="typeChange(1)" :type="searchType == 1?'primary':''">代收合同</el-button>
-          <el-button @click="typeChange(2)" :type="searchType == 2?'primary':''">代储合同</el-button>
-          <el-button @click="typeChange(1)" :type="searchType == 1?'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>
+          <el-button @click="typeChange(4)" :type="searchContractType == 4?'primary':''">代储合同</el-button>
+          <!-- <el-button @click="typeChange(1)" :type="searchType == 1?'primary':''">收储合同</el-button> -->
         </el-col>
         <el-col :span="6">
 
@@ -40,11 +40,11 @@
       </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 @click="typeChange(1)" :type="searchType == 1?'primary':''">待执行</el-button>
-          <el-button @click="typeChange(2)" :type="searchType == 2?'primary':''">执行中</el-button>
-          <el-button @click="typeChange(1)" :type="searchType == 1?'primary':''">发运结束</el-button>
-          <el-button @click="typeChange(2)" :type="searchType == 2?'primary':''">已完成</el-button>
+          <el-button style="margin-left:10px" @click="typeChange1('')" :type="searchType == ''?'primary':''">全部状态</el-button>
+          <el-button @click="typeChange1(4)" :type="searchTypeCon == 4?'primary':''">待执行</el-button>
+          <el-button @click="typeChange1(1)" :type="searchTypeCon == 1?'primary':''">执行中</el-button>
+          <el-button @click="typeChange1(3)" :type="searchTypeCon == 3?'primary':''">发运结束</el-button>
+          <el-button @click="typeChange1(2)" :type="searchTypeCon == 2?'primary':''">已完成</el-button>
         </el-col>
         <el-col :span="6">
 
@@ -62,18 +62,23 @@
               <span v-else>{{ scope.$index + 1 }}</span>
             </template>
           </el-table-column>
-          <el-table-column prop="reexType" label="合同编号"></el-table-column>
-          <el-table-column prop="createDate" label="合同类型"></el-table-column>
-          <el-table-column prop="amountMoney" label="买方"></el-table-column>
-          <el-table-column prop="expenseName" label="卖方"></el-table-column>
-          <el-table-column prop="expenseRemarks" label="剩余(吨)"></el-table-column>
-          <el-table-column prop="expenseRemarks" label="利润(万元)"></el-table-column>
-          <el-table-column prop="expenseRemarks" label="状态"></el-table-column>
-          <el-table-column prop="expenseRemarks" label="签订日期"></el-table-column>
+          <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>
+            </template>
+          </el-table-column>
+          <el-table-column prop="buyer" label="买方"></el-table-column>
+          <el-table-column prop="seller" label="卖方"></el-table-column>
+          <el-table-column prop="surplus" label="剩余(吨)"></el-table-column>
+          <el-table-column prop="profit" label="利润(万元)"></el-table-column>
+          <el-table-column prop="status" label="状态"></el-table-column>
+          <el-table-column prop="signingDate" 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="cost(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>
@@ -87,7 +92,7 @@
 </template>
 <script>
   import {
-    getInOutDetailed
+    getcontractdetails
   } from '@/model/profitable/index'
   export default {
     components: {},
@@ -98,10 +103,13 @@
         deptBudgetTotal: 0,
         currentPage: 1,
         pageSize: 10,
+        agreementType:'',
         deptCircularPage: {},
         searchType:"",
         searchKeyWord:"",
         startDate:"",
+        searchContractType:'',
+        searchTypeCon:'',
         endDate:"",
         outtotal:0,
         intotal:0,
@@ -113,14 +121,21 @@
     },
     methods: {
       typeChange(num){
-        this.searchType = num
+        this.searchContractType= num
         this.getList()
       },
-      inventory(){
-        this.$router.push({name:'contractinventory'})
+      typeChange1(num){
+        this.searchTypeCon= num
+        this.getList()
+      },
+      inventory(row){
+        this.$router.push({name:'contractinventory',query:{warehouseName:row.warehouseName}})
+      },
+      returnsales(){
+        this.$router.go(-1)
       },
       cost(){
-        this.$router.push({name:'contractcost'})
+        this.$router.push({name:'contractcost',query:{contractNo:row.contractNo}})
       },
       getPassYearFormatDate () {
           var nowDate = new Date()
@@ -150,15 +165,17 @@
           this.value=[this.startDate,this.endDate]
         },
       getList() {
-         getInOutDetailed({
+         getcontractdetails({
             // warehouseType: 1,
-            compId: localStorage.getItem('ws-pf_compId'),
+            agreementType: this.agreementType,
             startDate:this.startDate,
             endDate:this.endDate,
             searchKeyWord:this.searchKeyWord,
             currentPage: this.currentPage,
             pageSize:this.pageSize ,
-            searchType:this.searchType
+            searchType:this.searchType,
+            searchContractType:this.searchContractType,
+            searchTypeCon:this.searchTypeCon
           })
           .toPromise()
           .then(response => {

+ 274 - 215
src/views/profitable/expenseallot.vue

@@ -10,107 +10,114 @@
         </el-button></el-col>
     </el-row>
     <div class="center">
-     <div>基本信息</div>
-      <div class="table_css">
-        <ws-form>
-          <ws-form-item label="用途" span="1" prop="contractNo" class="readonly">
-              <div v-if="deptBudgetList.purpose==1">合同费用</div>
-              <div v-if="deptBudgetList.purpose==2">库点费用</div>
-              <div v-if="deptBudgetList.purpose==3">经营性费用</div>
-          </ws-form-item>
-          <ws-form-item v-if='deptBudgetList.purpose==1||deptBudgetList.purpose==2' label="类型" span="1" prop="contractNo" class="readonly">
-            <div v-if='deptBudgetList.type==1'>粮款</div>
-            <div v-if='deptBudgetList.type==2'>非粮款</div>
-            <div v-if='deptBudgetList.type==3&&deptBudgetList.purpose==1'>保证金</div>
-          </ws-form-item>
-          <ws-form-item label="合同编号" span="1" prop="contractNo" class="readonly">
+     
+      <div>
+        <el-form label-position="left">
+          <div style='margin:10px auto; '>基本信息</div>
+          <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="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.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 v-if='deptBudgetList.expensesPurpose==3' label-width='100px' label="仓库名称" span="1" prop="warehouse" class="readonly">
+          {{deptBudgetList.warehouse}}
+          </el-form-item>
+          <el-form-item v-if='deptBudgetList.expensesPurpose==1' label-width='100px' label="合同编号" span="1" prop="contractNo" class="readonly">
           {{deptBudgetList.contractNo}}
-          </ws-form-item>
-          <ws-form-item label="费用名称" span="1" prop="settlementMethod">
+          </el-form-item>
+          <el-form-item label-width='100px' label="费用名称" span="1" prop="settlementMethod">
             {{deptBudgetList.expenseName}}
-          </ws-form-item>
-          <ws-form-item label="金额" span="1" prop="contractNo" class="readonly">
-            {{deptBudgetList.money}}
-          </ws-form-item>
-          <ws-form-item label="备注" span="1" prop="settlementMethod">
+          </el-form-item>
+          <el-form-item label-width='100px' label="金额" span="1" prop="contractNo" class="readonly">
+            {{deptBudgetList.amountMoney}}
+          </el-form-item>
+          <el-form-item label-width='100px' label="备注" span="1" prop="settlementMethod">
             <el-input
             disabled
             type="textarea"
-            :rows="2"
+            :rows="5"
             placeholder="选填,不超过50个字"
             v-model="deptBudgetList.remark">
             </el-input>
-          </ws-form-item>
-          <ws-form-item 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>
-        </ws-form-item>
-        </ws-form>
-        <div v-if='deptBudgetList.type==2'>费用分配</div>
-        <div v-if='deptBudgetList.type==2' style='margin-bottom:10px;'>
-            <ws-select v-model="mode" placeholder="费用分配方式" class="typeselect" @change="modeselect"
-          :value="searchType">
+          </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-form-item>
+        </el-form>
+        <div style='margin:10px auto;width:90%;'>费用分配</div>
+        <div style='margin:10px auto;width:90%;'>
+            <ws-select v-model="mode" placeholder="费用分配方式" class="typeselect" @change="modeselect">
           <ws-option v-for="item in modeList" :key="item.value" :label="item.value" :value="item.value"
             style="color: #8890b1" />
         </ws-select>
-         <ws-select v-if='deptBudgetList.purpose==1' v-model="ware" placeholder="费用分配仓库" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in wareList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-        <ws-select v-if='deptBudgetList.purpose==2' v-model="goods" placeholder="费用分配产品" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in goodsList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-         <ws-select v-model="dates" placeholder="费用分配日期" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in datesList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-         <ws-select v-model="moneys" placeholder="费用分配金额" class="typeselect" @change="selecttaskType"
-          :value="searchType">
+         <ws-select v-model="moneys" placeholder="费用分配金额" class="typeselect" >
           <ws-option v-for="item in moneysList" :key="item.value" :label="item.value" :value="item.value"
             style="color: #8890b1" />
         </ws-select>
         合计分配:{{amount}}元
         </div>
-        <el-table :data="feeDetailsDistributions" style="width: 80%;margin:0 auto;">
-          <el-table-column prop="date" label="所属" min-width="110">
+        <el-table v-if='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-if='deptBudgetList.purpose==2' v-model="scope.row.belonging" placeholder="选择仓库或合同" class="typeselect" @change="selectware"
-          :value="searchType">
-          <ws-option v-for="item in warecontractList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-        <ws-select v-if='deptBudgetList.purpose==1' v-model="scope.row.belonging" placeholder="选择仓库" class="typeselect" @change="selectware"
-          :value="searchType">
-          <ws-option v-for="item in warehouseList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
+              <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"
+                  style="color: #8890b1" />
+              </ws-select>
             </template>
           </el-table-column>
-          <el-table-column prop="date" label="日期">
+          <el-table-column v-if='deptBudgetList.purpose=="合同费用"' prop="date" label="日期">
             <template slot-scope="scope">
-                <ws-date-picker v-model="scope.row.proDate" type="date" placeholder="请选择日期"
-              value-format="yyyy-MM-dd" />
+               <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"
+                  style="color: #8890b1" />
+              </ws-select>
             </template>
           </el-table-column>
-          <el-table-column prop="date" label="货名">
+          <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="请选择日期"
+              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.goodsName" placeholder="选择货名" class="typeselect" @change="goodsNameselect"
-                    :value="searchType">
-                    <ws-option v-for="item in goodsList" :key="item.value" :label="item.value" :value="item.value"
+                <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"
                         style="color: #8890b1" />
                 </ws-select>
             </template>
           </el-table-column>
-          <el-table-column prop="date" label="库存(吨)"></el-table-column>
+          <el-table-column v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="货名">
+            <template slot-scope="scope">
+               <span>{{scope.row.goodsName?scope.row.goodsName:'自动获取'}}</span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="inWarehouseWeight" label="入库量(吨)">
+            <template slot-scope="scope">
+               <span>{{scope.row.inWarehouseWeight?scope.row.inWarehouseWeight:'自动获取'}}</span>
+            </template>
+          </el-table-column>
           <el-table-column prop="date" label="分配金额(元)">
             <template slot-scope="scope">
-                <el-input placeholder="输入费用名称,1-15个字" class="input_css" v-model="scope.row.money"></el-input>
+                <el-input placeholder="输入费用名称,1-15个字" class="input_css" v-model="scope.row.distributionMoney"></el-input>
             </template>
           </el-table-column>
           <el-table-column prop="address" label="操作" width="200">
@@ -120,19 +127,21 @@
             </template>
           </el-table-column>
         </el-table>
-
       </div>
       <div>
-      <el-button class="bg-bottom" type="primary" size="small" @click="returnsales()">驳回
+        <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>
+        </div>
+      
     </div>
     </div>
   </div>
 </template>
 <script>
-  import {} from '@/model/profitable/index'
+  import {lookexenseinfo,getcontract,getwarehouse,addexenseinfo,getwarehousingorder,editexenseinfo} from '@/model/profitable/index'
   export default {
     components: {},
     data() {
@@ -147,13 +156,17 @@
         dates:'固定日期',
         moneys:'按重量自动分配',
         goods:'全部货品',
-        amount:0,
         goodsList:[],
+        srcList:[],
         warecontractList:[],
         feeDetailsDistributions:[{proDate:'',weight:'',money:'',warehouse:'',belonging:'',index:0}],
         deptBudgetList:{},
         makeWordData: {},
         warehouseList:[],
+        goodsourcelist:[],
+        signingDate:'',
+        datelist:[],
+        disabled: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:'指定日期'}],
@@ -170,17 +183,154 @@
       }
     },
     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: {
       modeselect(e){
-          console.log(e)
+        if(e=='全部分配'){
+          this.moneys='按重量自动分配'
+          this.disabled=false
+        }else if(e=='部分分配'){
+          this.moneys='指定分配金额'
+          this.disabled=true
+        }
       },selectware(e){
           console.log(e)
       },
+      returnsales(){
+        this.$router.go(-1)
+      },
+       submit(){
+          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.expenseAllocationInfoList=this.feeDetailsDistributions
+         if(this.deptBudgetList.expensesPurpose==1){
+        var data=[]
+          for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+            if(data.length==0){
+              data.push(this.feeDetailsDistributions[i])
+            }else{
+              var repetition=data.filter((item,index)=>{
+                return this.feeDetailsDistributions[i].orderId==item.orderId&&this.feeDetailsDistributions[i].receiptDocDate==item.receiptDocDate
+              })
+              if(repetition.length==0){
+                data.push(this.feeDetailsDistributions[i])
+              }else{
+                this.$message({
+                    message: '货源重复!',
+                    type: 'warning',
+                  })
+                  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',
+              //     })
+              //   }
+              // }
+            }
+            
+          }
+        }
+        if(this.deptBudgetList.expensesPurpose==3){
+        var data=[]
+          for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+            if(data.length==0){
+              data.push(this.feeDetailsDistributions[i])
+            }else{
+              var repetition=data.filter((item,index)=>{
+                return this.feeDetailsDistributions[i].warehouseName==item.warehouseName&&this.feeDetailsDistributions[i].receiptDocDate==item.receiptDocDate
+              })
+              if(repetition.length==0){
+                data.push(this.feeDetailsDistributions[i])
+              }else{
+                this.$message({
+                    message: '货源重复!',
+                    type: 'warning',
+                  })
+                  return
+              }
+
+            }
+            
+          }
+        }
+        if(this.mode=='全部分配'){
+          if(this.amount!=this.deptBudgetList.amountMoney){
+            this.$message({
+                message: '请款金额与分配金额不相等!',
+                type: 'warning',
+          })
+          return
+          }
+        }
+        if(this.mode=='部分分配'){
+          if(this.amount>this.deptBudgetList.amountMoney){
+            this.$message({
+                message: '分配金额不可超过请款金额!',
+                type: 'warning',
+          })
+          return
+          }
+        }
+       
+        this.deptBudgetList.addressUrl=this.paymentScreenshot.toString()
+        this.deptBudgetList.flag=3
+        this.$confirm('确定提交分配信息', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          })
+          .then(() => {
+        editexenseinfo(this.deptBudgetList).toPromise()
+          .then(response => {
+            this.$message({
+              message: '提交成功!',
+              type: 'success',
+            })
+            this.$router.go(-1)
+          })
+          })
+      },
       goodsNameselect(e){
           console.log(e)
       },
@@ -191,18 +341,46 @@
           this.feeDetailsDistributions.splice(row.index,1)
       },
       getList() {
-        // getceshi({
-        //  driverId:'8f1f3c624d7946d79a9d44a4057d969b'
-        // })
-        // .toPromise()
-        // .then((response) => {
-        // debugger
-        // console.log(response)
-        // })
-
-      },
-      detail(){
-        this.$router.push({name:'contractprofitsdetails'})
+        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 
+          if(response.addressUrl){
+            var arr=[]
+            var srcs=response.addressUrl.split(',')
+            this.paymentScreenshot=srcs
+            this.srcList=srcs
+          }
+          if(response.expenseAllocationInfoList){
+            this.feeDetailsDistributions=response.expenseAllocationInfoList
+          }
+          
+          
+        })
       },
       getPassYearFormatDate() {
         var nowDate = new Date()
@@ -234,127 +412,6 @@
       pickerOptions() {
 
       },
-      initCharts() {
-        let app = this;
-        let myChart7 = app.$echarts.init(this.$refs.myEchart7);
-        var option;
-        option = {
-            // title: {
-            //   text: 'Rainfall vs Evaporation',
-            //   subtext: 'Fake Data'
-            // },
-            tooltip: {
-              trigger: 'axis'
-            },
-            legend: {
-              data: ['支出', '收入']
-            },
-            toolbox: {
-              show: true,
-              feature: {
-                dataView: {
-                  show: false,
-                  readOnly: false
-                },
-                magicType: {
-                  show: false,
-                  type: ['line', 'bar']
-                },
-                restore: {
-                  show: false
-                },
-                saveAsImage: {
-                  show: false
-                }
-              }
-            },
-            calculable: true,
-            xAxis: [{
-              name: '种类',
-              type: 'category',
-              // prettier-ignore
-              data: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct']
-            }],
-            yAxis: [{
-              name: '储量(吨)',
-              type: 'value'
-            }],
-            series: [{
-                name: '支出',
-                type: 'bar',
-                right: 0,
-                // label: {
-                //   show: true,
-                //   position: 'inside'
-                // },
-                 label: {
-                  show: true,
-                  precision: 1,
-                  position: 'top',
-                  valueAnimation: true,
-                  fontFamily: 'monospace'
-                },
-                data: [
-                  6.0, 60.9, 90.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0
-                ],
-                color: ['#5878E8 '],
-                formatter: '{value} 元',
-
-              },
-              {
-                name: '收入',
-                type: 'bar',
-                right: 20,
-                label: {
-                  show: true,
-                  precision: 1,
-                  position: 'top',
-                  valueAnimation: true,
-                  fontFamily: 'monospace'
-                },
-                data: [
-                  102.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8
-                ],
-                color: ['#FF9F24'],
-                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>
@@ -362,14 +419,16 @@
   .container {
     background: #E8ECF6;
   }
-
+.add,.del{
+  width:25px;height:25px;
+}
   .center {
     margin: 0 auto;
     background: #ffffff;
-    height: calc(100vh - 13vh);
     border-radius: 4px;
     margin-top: 10px;
     overflow:scroll;
+    padding-top:30px;
   }
 
   .row_top {

+ 234 - 237
src/views/profitable/expenseallotaduit.vue

@@ -1,4 +1,4 @@
-//确认费用分配
+//确认分配
 <template>
   <div class="container">
     <el-row class="row_top">
@@ -10,129 +10,142 @@
         </el-button></el-col>
     </el-row>
     <div class="center">
-     <div>基本信息</div>
-      <div class="table_css">
-        <ws-form>
-          <ws-form-item label="用途" span="1" prop="contractNo" class="readonly">
-              <div v-if="deptBudgetList.purpose==1">合同费用</div>
-              <div v-if="deptBudgetList.purpose==2">库点费用</div>
-              <div v-if="deptBudgetList.purpose==3">经营性费用</div>
-          </ws-form-item>
-          <ws-form-item v-if='deptBudgetList.purpose==1||deptBudgetList.purpose==2' label="类型" span="1" prop="contractNo" class="readonly">
-            <div v-if='deptBudgetList.type==1'>粮款</div>
-            <div v-if='deptBudgetList.type==2'>非粮款</div>
-            <div v-if='deptBudgetList.type==3&&deptBudgetList.purpose==1'>保证金</div>
-          </ws-form-item>
-          <ws-form-item label="合同编号" span="1" prop="contractNo" class="readonly">
+      <div >
+        <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="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.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 v-if='deptBudgetList.expensesPurpose==3' label-width='100px' label="仓库名称" span="1" prop="warehouse" class="readonly">
+          {{deptBudgetList.warehouse}}
+          </el-form-item>
+          <el-form-item v-if='deptBudgetList.expensesPurpose==1' label-width='100px' label="合同编号" span="1" prop="contractNo" class="readonly">
           {{deptBudgetList.contractNo}}
-          </ws-form-item>
-          <ws-form-item label="费用名称" span="1" prop="settlementMethod">
+          </el-form-item>
+          <el-form-item label-width='100px' label="费用名称" span="1" prop="settlementMethod">
             {{deptBudgetList.expenseName}}
-          </ws-form-item>
-          <ws-form-item label="金额" span="1" prop="contractNo" class="readonly">
-            {{deptBudgetList.money}}
-          </ws-form-item>
-          <ws-form-item label="备注" span="1" prop="settlementMethod">
+          </el-form-item>
+          <el-form-item label-width='100px' label="金额" span="1" prop="contractNo" class="readonly">
+            {{deptBudgetList.amountMoney}}
+          </el-form-item>
+          <el-form-item label-width='100px' label="备注" span="1" prop="settlementMethod">
             <el-input
             disabled
             type="textarea"
-            :rows="2"
+            :rows="5"
             placeholder="选填,不超过50个字"
             v-model="deptBudgetList.remark">
             </el-input>
-          </ws-form-item>
-          <ws-form-item 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>
-        </ws-form-item>
-        </ws-form>
-        <div v-if='deptBudgetList.type==2'>费用分配</div>
-        <div v-if='deptBudgetList.type==2' style='margin-bottom:10px;'>
-            <ws-select v-model="mode" placeholder="费用分配方式" class="typeselect" @change="modeselect"
-          :value="searchType">
-          <ws-option v-for="item in modeList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-         <ws-select v-if='deptBudgetList.purpose==1' v-model="ware" placeholder="费用分配仓库" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in wareList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-        <ws-select v-if='deptBudgetList.purpose==2' v-model="goods" placeholder="费用分配产品" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in goodsList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-         <ws-select v-model="dates" placeholder="费用分配日期" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in datesList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-         <ws-select v-model="moneys" placeholder="费用分配金额" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in moneysList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-        合计分配:{{amount}}元
-        </div>
-        <el-table :data="feeDetailsDistributions" style="width: 80%;margin:0 auto;">
-          <el-table-column prop="date" label="所属" min-width="110">
-            <template slot-scope="scope">
-                <ws-select v-if='deptBudgetList.purpose==2' v-model="scope.row.belonging" placeholder="选择仓库或合同" class="typeselect" @change="selectware"
-          :value="searchType">
-          <ws-option v-for="item in warecontractList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-        <ws-select v-if='deptBudgetList.purpose==1' v-model="scope.row.belonging" placeholder="选择仓库" class="typeselect" @change="selectware"
-          :value="searchType">
-          <ws-option v-for="item in warehouseList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-            </template>
-          </el-table-column>
-          <el-table-column prop="date" label="日期">
-            <template slot-scope="scope">
-                <ws-date-picker v-model="scope.row.proDate" type="date" placeholder="请选择日期"
-              value-format="yyyy-MM-dd" />
-            </template>
-          </el-table-column>
-          <el-table-column prop="date" label="货名">
+          </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-form-item>
+        </el-form>
+        <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">
+                <ws-select disabled 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"
+                    style="color: #8890b1" />
+                </ws-select>
+              </template>
+            </el-table-column>
+            <el-table-column v-if='deptBudgetList.expensesPurpose==1' prop="date" label="日期">
               <template slot-scope="scope">
-                <ws-select v-model="scope.row.goodsName" placeholder="选择货名" class="typeselect" @change="goodsNameselect"
-                    :value="searchType">
-                    <ws-option v-for="item in goodsList" :key="item.value" :label="item.value" :value="item.value"
-                        style="color: #8890b1" />
+                <ws-select disabled 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"
+                    style="color: #8890b1" />
                 </ws-select>
-            </template>
-          </el-table-column>
-          <el-table-column prop="date" label="库存(吨)"></el-table-column>
-          <el-table-column prop="date" label="分配金额(元)">
-            <template slot-scope="scope">
-                <el-input placeholder="输入费用名称,1-15个字" class="input_css" v-model="scope.row.money"></el-input>
-            </template>
-          </el-table-column>
-          <el-table-column prop="address" label="操作" width="200">
-            <template slot-scope="scope">
-                <img class='add' @click='addlist()' src="../../../public/img/add.png" alt="">
-                <img class='del' @click='dellist(scope.row)' src="../../../public/img/del.png" alt="">
-            </template>
-          </el-table-column>
-        </el-table>
+              </template>
+            </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="请选择日期"
+                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-option v-for="item in goodsourcelist" :key="item.id" :label="item.goodsSource" :value="item.id"
+                          style="color: #8890b1" />
+                  </ws-select>
+              </template>
+            </el-table-column>
+            <el-table-column v-if='deptBudgetList.expensesPurpose==3' prop="date" label="货名">
+              <template slot-scope="scope">
+                <span>{{scope.row.goodsName?scope.row.goodsName:'自动获取'}}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="inWarehouseWeight" label="入库量(吨)">
+              <template slot-scope="scope">
+                <span>{{scope.row.inWarehouseWeight?scope.row.inWarehouseWeight:'自动获取'}}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="date" label="分配金额(元)">
+              <template slot-scope="scope">
+                  <el-input disabled placeholder="输入费用名称,1-15个字" class="input_css" v-model="scope.row.distributionMoney"></el-input>
+              </template>
+            </el-table-column>
+          </el-table>
 
       </div>
       <div>
-      <el-button class="bg-bottom" type="primary" size="small" @click="returnsales()">驳回
+        <div style='width:90%;margin:10px auto;text-align:right;'>
+          <el-button class="bg-bottom" type="primary" size="small" @click="reject()">驳回
         </el-button>
-        <el-button class="bg-bottom" type="primary" size="small" @click="returnsales()">通过
+        <el-button class="bg-bottom" type="primary" size="small" @click="pass()">通过
         </el-button>
+        </div>
+      
+    </div>
+    <el-dialog
+      title="驳回"
+      :visible.sync="rejectshow"
+      width="30%"
+      :before-close="handleClose">
+      <span>驳回原因</span>
+      <div><el-input
+  type="textarea"
+  :rows="2"
+  placeholder="请输入驳回原因"
+  v-model="textarea">
+</el-input>
+</div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="rejectclick">确 定</el-button>
+      </span>
+    </el-dialog>
     </div>
     </div>
   </div>
 </template>
 <script>
-  import {} from '@/model/profitable/index'
+  import {setexpense,getcontract,getwarehouse,addexenseinfo,getwarehousingorder,lookexenseinfo} from '@/model/profitable/index'
   export default {
     components: {},
     data() {
@@ -147,13 +160,13 @@
         dates:'固定日期',
         moneys:'按重量自动分配',
         goods:'全部货品',
-        amount:0,
         goodsList:[],
         warecontractList:[],
         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:'指定日期'}],
@@ -170,12 +183,83 @@
       }
     },
     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: {
+      pass(){
+        this.$confirm('确认通过分配信息?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          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',
+              })
+              this.$router.go(-1)
+            }).catch((response) => {
+              this.$message({
+                message: '通过失败!',
+                type: 'success',
+              })
+            })
+          })
+        })
+      },
+      returnsales(){
+        this.$router.go(-1)
+      },
+      reject(){
+        this.rejectshow=true
+      },
+      rejectclick(){
+        this.deptBudgetList.flag=5
+        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.$router.go(-1)
+        }).catch((response) => {
+          this.$message({
+            message: '驳回失败!',
+            type: 'success',
+          })
+        })
+        })
+      },
       modeselect(e){
           console.log(e)
       },selectware(e){
@@ -191,14 +275,45 @@
           this.feeDetailsDistributions.splice(row.index,1)
       },
       getList() {
-        // getceshi({
-        //  driverId:'8f1f3c624d7946d79a9d44a4057d969b'
-        // })
-        // .toPromise()
-        // .then((response) => {
-        // debugger
-        // console.log(response)
-        // })
+       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 
+          if(response.addressUrl){
+            var arr=[]
+            var srcs=response.addressUrl.split(',')
+            this.srcList=srcs
+          }
+          if(response.expenseAllocationInfoList){
+            this.feeDetailsDistributions=response.expenseAllocationInfoList
+          }
+          
+          
+        })
 
       },
       detail(){
@@ -234,127 +349,6 @@
       pickerOptions() {
 
       },
-      initCharts() {
-        let app = this;
-        let myChart7 = app.$echarts.init(this.$refs.myEchart7);
-        var option;
-        option = {
-            // title: {
-            //   text: 'Rainfall vs Evaporation',
-            //   subtext: 'Fake Data'
-            // },
-            tooltip: {
-              trigger: 'axis'
-            },
-            legend: {
-              data: ['支出', '收入']
-            },
-            toolbox: {
-              show: true,
-              feature: {
-                dataView: {
-                  show: false,
-                  readOnly: false
-                },
-                magicType: {
-                  show: false,
-                  type: ['line', 'bar']
-                },
-                restore: {
-                  show: false
-                },
-                saveAsImage: {
-                  show: false
-                }
-              }
-            },
-            calculable: true,
-            xAxis: [{
-              name: '种类',
-              type: 'category',
-              // prettier-ignore
-              data: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct']
-            }],
-            yAxis: [{
-              name: '储量(吨)',
-              type: 'value'
-            }],
-            series: [{
-                name: '支出',
-                type: 'bar',
-                right: 0,
-                // label: {
-                //   show: true,
-                //   position: 'inside'
-                // },
-                 label: {
-                  show: true,
-                  precision: 1,
-                  position: 'top',
-                  valueAnimation: true,
-                  fontFamily: 'monospace'
-                },
-                data: [
-                  6.0, 60.9, 90.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0
-                ],
-                color: ['#5878E8 '],
-                formatter: '{value} 元',
-
-              },
-              {
-                name: '收入',
-                type: 'bar',
-                right: 20,
-                label: {
-                  show: true,
-                  precision: 1,
-                  position: 'top',
-                  valueAnimation: true,
-                  fontFamily: 'monospace'
-                },
-                data: [
-                  102.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8
-                ],
-                color: ['#FF9F24'],
-                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>
@@ -435,6 +429,9 @@
   /deep/.el-form{
     width:90%;
     margin:0 auto;
+    .el-form-item__label{
+      color:#8890B1;
+    }
   }
   /deep/.el-form-item {
     width: 50%;

+ 107 - 71
src/views/profitable/expensemanagement.vue

@@ -26,7 +26,7 @@
     </el-row>
       <div class="chart_css">
         <div class="table">
-          <div ref="myEchart7" style="height: 410px;"></div>
+          <div ref="myEchart7" style="height: 440px;"></div>
         </div>
         <div class="makeWord_css">
           <!-- <div ref="myEchart6" style="height: 410px"></div> -->
@@ -41,7 +41,7 @@
         <ws-form>
           <ws-info-table>
           <ws-form-item label="合同费用收入(万元)" span="1" prop="contractNo" class="readonly">
-            
+            {{tablelist.contractIn}}
           </ws-form-item>
           <ws-form-item label="库点费用收入(万元)" span="1" prop="settlementMethod">
           </ws-form-item>
@@ -97,7 +97,7 @@
   </div>
 </template>
 <script>
-  import {} from '@/model/profitable/index'
+  import {getexpensechat,getexpensechatlist} from '@/model/profitable/index'
   export default {
     components: {},
     data() {
@@ -110,6 +110,10 @@
         deptBudgetList:{},
         start: 2021,
         yearList:[],
+        tablelist:{},
+        monthlist:[],
+        incomelist:[],
+        expenditurelist:[],
         year: '',
         makeWordData: {},
         forbidden:false,
@@ -125,8 +129,10 @@
       }
     },
     activated() {
-      this.makeWordData = this.getData(2)
+      this.getPassYearFormatDate()
+      // this.makeWordData = this.getData(2)
       this.year = new Date().getFullYear()
+      this.getList()
       for (var i = this.start; i <= this.year; i++) {
         this.yearList.push({
           value: i
@@ -138,20 +144,34 @@
       if (this.year <= this.start) {
         this.forbidden = true
       }
-      this.initCharts()
-      this.getPassYearFormatDate()
-      this.getList()
     },
     methods: {
       getList() {
-        // getceshi({
-        //  driverId:'8f1f3c624d7946d79a9d44a4057d969b'
-        // })
-        // .toPromise()
-        // .then((response) => {
-        // debugger
-        // console.log(response)
-        // })
+        getexpensechat({
+         compId:localStorage.getItem('ws-pf_compId'),
+         year:this.year
+        })
+        .toPromise()
+        .then((response) => {
+          for (let i = 0; i < response.length; i++) {
+            // if(response[i]){
+              this.monthlist.push(response[i].month+'月')
+            // }
+              this.incomelist.push((response[i].income/10000).toFixed(4))
+              this.expenditurelist.push((response[i].expenditure/10000).toFixed(4))
+            this.initCharts()
+          }
+        })
+        getexpensechatlist({
+         compId:localStorage.getItem('ws-pf_compId'),
+         startDate:this.startDate,
+         endDate:this.endDate
+        })
+        .toPromise()
+        .then((response) => {
+          this.tablelist=response[0]
+          console.log(response)
+        })
 
       },
       minus() {
@@ -203,6 +223,7 @@
 
       },
       initCharts() {
+        console.log(this.monthlist)
         let app = this;
         let myChart7 = app.$echarts.init(this.$refs.myEchart7);
         var option;
@@ -238,16 +259,49 @@
             },
             calculable: true,
             xAxis: [{
-              name: '种类',
-              type: 'category',
+              // type: 'category',
               // prettier-ignore
-              data: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct']
+              type: 'category',
+              axisLabel: {
+            //x轴文字的配置
+            show: true,
+            interval: 0,//使x轴文字显示全
+},
+              data: this.monthlist
             }],
             yAxis: [{
-              name: '储量(吨)',
-              type: 'value'
+              name: '费用(万元)',
+              
             }],
-            series: [{
+            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)
+    },
+  },
+
+            series: [
+              {
+                name: '收入',
+                type: 'bar',
+                right: 20,
+                label: {
+                  show: true,
+                  precision: 1,
+                  position: 'top',
+                  valueAnimation: true,
+                  fontFamily: 'monospace'
+                },
+                data: this.incomelist,
+                color: ['#FF9F24'],
+                formatter: '{value} 元',
+              },{
                 name: '支出',
                 type: 'bar',
                 right: 0,
@@ -262,67 +316,49 @@
                   valueAnimation: true,
                   fontFamily: 'monospace'
                 },
-                data: [
-                  6.0, 60.9, 90.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0
-                ],
+                data:this.expenditurelist,
                 color: ['#5878E8 '],
                 formatter: '{value} 元',
 
-              },
-              {
-                name: '收入',
-                type: 'bar',
-                right: 20,
-                label: {
-                  show: true,
-                  precision: 1,
-                  position: 'top',
-                  valueAnimation: true,
-                  fontFamily: 'monospace'
-                },
-                data: [
-                  102.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8
-                ],
-                color: ['#FF9F24'],
-                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)
-          });
-        }
+      // 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
-        };
+      //   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('');
-        // }
+      //   // 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>

+ 147 - 48
src/views/profitable/expensemanagementdetails.vue

@@ -1,4 +1,4 @@
-//合同利润详情
+//费用详情
 <template>
   <div class="container">
     <el-row class="row_top">
@@ -12,14 +12,14 @@
     <div class="center">
       <el-row style='margin-bottom:10px;'>
         <el-col :span="12">
-          <el-button style="margin-left:10px" @click="typeChange('')" type="primary">导出</el-button>
+          <!-- <el-button style="margin-left:10px" @click="typeChange('')" type="primary">导出</el-button> -->
         </el-col>
         <el-col :span="12">
           <div class="datascreen">
             <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-input placeholder="可按合同名称、买方名称、卖方名称查找" class="input_css" v-model="searchKeyWord"></el-input>
+            <el-input placeholder="可按费用名称查找" class="input_css" v-model="searchKeyWord"></el-input>
             <el-button class="find" type="primary" @click="find()"><img width="16" height="16" style="left: -8px;"
                 src="../../../public/img/sousuo.png" alt="" /></el-button>
           </div>
@@ -44,22 +44,24 @@
               <span v-else>{{ scope.$index + 1 }}</span>
             </template>
           </el-table-column>
+          <el-table-column prop="costNo" label="编号">
+          </el-table-column>
           <el-table-column prop="feeType" label="类型">
             <template slot-scope="scope">
-              <div v-if='scope.row.feeType==1'>支出</div>
-              <div v-if='scope.row.feeType==2'>收入</div>
+              <div v-if='scope.row.expensesType==1'>收入</div>
+              <div v-if='scope.row.expensesType==2'>支出</div>
             </template>
           </el-table-column>
           <el-table-column prop="purpose" label="用途">
             <template slot-scope="scope">
-              <div v-if='scope.row.purpose==1'>合同费用<span v-if='scope.row.type==1'>-粮款</span></div>
-              <div v-if='scope.row.purpose==2'>库点费用<span v-if='scope.row.type==1'>-粮款</span></div>
-              <div v-if='scope.row.purpose==3'>经营性费用<span v-if='scope.row.type==1'>-粮款</span></div>
+              <div v-if='scope.row.expensesPurpose==1'>合同费用<span v-if='scope.row.costType==1'>-粮款</span></div>
+              <div v-if='scope.row.expensesPurpose==3'>库点费用<span v-if='scope.row.costType==1'>-粮款</span></div>
+              <div v-if='scope.row.expensesPurpose==5'>经营性费用<span v-if='scope.row.costType==1'>-粮款</span></div>
             </template>
           </el-table-column>
           <el-table-column prop="expenseName" label="费用名称"></el-table-column>
-          <el-table-column prop="money" label="费用金额(元)"></el-table-column>
-          <el-table-column prop="expenseRemarks" label="未分配(元)"></el-table-column>
+          <el-table-column prop="amountMoney" width="120" label="费用金额(元)"></el-table-column>
+          <el-table-column prop="unallocatedAmount" width="100" label="未分配(元)"></el-table-column>
           <el-table-column prop="expenseRemarks" label="附件">
               <template slot-scope="scope">
           <img width="18" height="20" style="vertical-align: text-top; position: relative; top: -1px"
@@ -73,31 +75,42 @@
           </span>
         </template>
           </el-table-column>
-          <el-table-column prop="handler" label="经办人"></el-table-column>
-          <el-table-column prop="expenseRemarks" label="发起日期"></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="费用状态">
             <template slot-scope="scope">
               <span v-if='scope.row.approveStatus'>{{scope.row.approveStatus}}</span><span v-else>{{scope.row.status}}</span>
               <i @click="handlerecord(scope.row)" class="el-icon-s-claim"></i>
             </template>
           </el-table-column>
-          <el-table-column prop="address" label="操作" width="200">
+          <el-table-column prop="address" label="操作" width="500">
             <template slot-scope="scope">
-              <el-button @click="look(1)" type="primary">查看</el-button>
-              <el-button @click="shoukuanqueren(1)" type="primary">确认</el-button>
-              <el-button v-if='scope.row.status=="待确认"' @click="accomplish(1)" type="primary">完成</el-button>
-              <el-button v-if='scope.row.status=="已驳回"' @click="edit(1)" type="primary">编辑</el-button>
-              <el-button @click="allot(1)" type="primary">分配</el-button>
-              <el-button v-if='scope.row.status=="已驳回"' @click="del(0,scope.row)" type="primary">删除</el-button>
-              <el-button @click="aduit(1)" type="primary">审核</el-button>
-              <el-button @click="payment(1)" type="primary">付款</el-button>
+              <el-button @click="look(scope.row)" type="primary">查看</el-button>
+              <el-button @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  @click="expenseedit(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.approveStatus=="已驳回"' @click="del(0,scope.row)" type="primary">删除</el-button> -->
+              <el-button @click="del(0,scope.row)" type="primary">删除</el-button>
+              <el-button @click="aduit(scope.row)" type="primary">审核</el-button>
+              <el-button @click="payment(scope.row)" type="primary">付款</el-button>
             </template>
           </el-table-column>
-          <el-table-column prop="expenseRemarks" label="分配状态"></el-table-column>
-          <el-table-column prop="address" label="分配相关" width="200">
+          <el-table-column prop="expenseRemarks" label="分配状态">
             <template slot-scope="scope">
-              <el-button @click="allotaduit(1)" type="primary">确认</el-button>
-              <el-button @click="allot(1)" type="primary">编辑</el-button>
+              <span>{{scope.row.distributionStatus}}</span>
+              <el-tooltip 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>
             </template>
           </el-table-column>
@@ -118,11 +131,21 @@
         <div style='width:100%;text-align:center;'>{{item.verifyRemark}}</div>
       </div>
     </el-dialog>
+    <WinseaContentModal v-model="fujianshow" :title="title"
+      @on-cancel="handleClose">
+     <span v-for='item in appendixIdss'><el-image
+              style="width: 100px; height: 100px;border:1px solid #000;display:inline-block;margin:10px;"
+              :src="item"
+               :preview-src-list="appendixIdss"></el-image></span>
+    </WinseaContentModal>
   </div>
 </template>
 <script>
   import {
-    getInOutDetailed
+    getInOutDetailed,
+    getexenseinfo,
+    delexenseinfo,
+    delallocationinfo,editexenseinfo
   } from '@/model/profitable/index'
   export default {
     components: {},
@@ -140,8 +163,11 @@
         searchKeyWord:"",
         startDate:"",
         endDate:"",
+        title:'附件',
         outtotal:0,
         intotal:0,
+        fujianshow:false,
+        appendixIdss:[],
       }
     },
     activated() {
@@ -156,53 +182,117 @@
                   this.dialogVisible1=true
                 }).catch((response) => {})
       },
-      
+      returnsales(){
+        this.$router.go(-1)
+      },
+      handleClose() {
+        this.fujianshow = false
+      },
+      fujian(row) {
+        this.id = row.id
+        this.fujianshow = true
+        if(row.addressUrl){
+          this.appendixIdss = row.addressUrl.split(',')
+        }
+      },
       look(row){
-        
+        this.$router.push({name:'expensemanagentlook',query:{id:row.id}})
       },
       del(status,row){
         var title=''
           if(status==1){
             title='确定删除分配信息?'
           }else{
-            title='确定删除请款信息?'
+            if(row.expensesType==1){
+              title='确定删除收款信息?'
+            }else{
+              title='确定删除请款信息?'
+            }
+            
           }
            this.$confirm(title, '提示', {
             confirmButtonText: '确定',
             cancelButtonText: '取消',
             type: 'warning'
           })
-          .then(() => {})
+          .then(() => {
+            if(status==1){
+              delallocationinfo({id:row.id}).toPromise()
+              .then(response => {
+                this.$message({
+                message: '删除成功',
+                type: 'success',
+              })
+                this.getList()
+              }).catch(response => {
+                this.$message({
+                message: '删除失败',
+                type: 'warning',
+              })
+              })
+            }else{
+              delexenseinfo({id:row.id}).toPromise()
+              .then(response => {
+                this.$message({
+                message: '删除成功',
+                type: 'success',
+              })
+                this.getList()
+              }).catch(response => {
+                this.$message({
+                message: '删除失败',
+                type: 'warning',
+              })
+              })
+            }
+          })
       },
       accomplish(row){
-          this.$confirm('尚有未分配的金额,是否确认不在分配?', '提示', {
+        var title1=''
+        if(row.unallocatedAmount>0){
+          title1='尚有未分配的金额,是否确认不在分配?'
+        }else{
+          title1='确定将费用状态修改为已完成?'
+        }
+          this.$confirm(title1, '提示', {
             confirmButtonText: '确定',
             cancelButtonText: '取消',
             type: 'warning'
           })
-          .then(() => {})
+          .then(() => {
+            row.flag=1
+            editexenseinfo(row).toPromise()
+          .then(response => {
+            this.$message({
+              message: '提交成功!',
+              type: 'success',
+            })
+            this.getList()
+            // this.$router.go(-1)
+          })
+          })
       },
       typeChange(num){
         this.searchType = num
         this.getList()
       },
-      edit(){
-        this.$router.push({name:'expensemanagentedit'})
+      expenseedit(row){
+        this.$router.push({name:'expensemanagentedit',query:{id:row.id}})
       },
-      shoukuanqueren(){
-        this.$router.push({name:'receiptaduit'})
+      shoukuanqueren(row){
+        this.$router.push({name:'receiptaduit',query:{id:row.id}})
       },
-      aduit(){
-        this.$router.push({name:'cashoutaduit'})
+      aduit(row){
+        this.$router.push({name:'cashoutaduit',query:{id:row.id}})
       },
-      allotaduit(){
-        this.$router.push({name:'expenseallotaduit'})
+      allotaduit(row){
+        this.$router.push({name:'expenseallotaduit',query:{id:row.id}})
       },
-      payment(){
-        this.$router.push({name:'payment'})
+      payment(row){
+        this.$router.push({name:'payment',query:{id:row.id}})
       },
-      allot(){
-        this.$router.push({name:'expenseallot'})
+      allot(row){
+        this.$router.push({name:'expenseallot',query:{id:row.id}})
       },
       cashout(){
         this.$router.push({name:'cashout'})
@@ -210,9 +300,9 @@
       receipt(){
         this.$router.push({name:'receipt'})
       },
-      inventory(){
-        this.$router.push({name:'contractinventory'})
-      },
+      // inventory(){
+      //   this.$router.push({name:'contractinventory'})
+      // },
       getPassYearFormatDate () {
           var nowDate = new Date()
           var _date = new Date()
@@ -241,7 +331,7 @@
           this.value=[this.startDate,this.endDate]
         },
       getList() {
-         getInOutDetailed({
+         getexenseinfo({
             // warehouseType: 1,
             compId: localStorage.getItem('ws-pf_compId'),
             startDate:this.startDate,
@@ -253,7 +343,16 @@
           })
           .toPromise()
           .then(response => {
+            if(response.records.length>0){
+              for (let i = 0; i < response.records.length; i++) {
+                if(response.records[i].addressUrl){
+                  response.records[i].addressUrlArray=response.records[i].addressUrl.split(',')
+                }
+                
+              }
+            }
             this.tableData = response.records
+            
             if(this.tableData.length > 0){
               this.intotal = Number(this.tableData[0].inContractMoney) + Number(this.tableData[0].inWarehouseMoney) + Number(this.tableData[0].inManageMoney)
             this.outtotal = Number(this.tableData[0].outContractMoney) + Number(this.tableData[0].outWarehouseMoney) + Number(this.tableData[0].outManageMoney)

+ 438 - 221
src/views/profitable/expensemanagentedit.vue

@@ -1,9 +1,9 @@
-//请款
+//费用编辑
 <template>
   <div class="container">
     <el-row class="row_top">
       <el-col :span="12">
-        <h2 class="bg-left title">请款</h2>
+        <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="" />返回
@@ -11,65 +11,67 @@
     </el-row>
     <div class="center">
      
+     <div class="center">
+     
       <div>
-        <ws-form label-position="left"  label-width="140px"><div style='margin:30px 0 30px;'>基本信息</div>
-          <ws-form-item label="用途" span="1" prop="contractNo" class="readonly">
-             <el-radio-group v-model="deptBudgetList.purpose">
-                <el-radio :label="1">合同费用</el-radio>
-                <el-radio :label="2">库点费用</el-radio>
-                <el-radio :label="3">经营性费用</el-radio>
-            </el-radio-group>
-          </ws-form-item>
-          <ws-form-item v-if='deptBudgetList.purpose==1||deptBudgetList.purpose==2' label="类型" span="1" prop="contractNo" class="readonly">
-             <el-radio-group v-model="deptBudgetList.type">
-                <el-radio :label="1">粮款</el-radio>
-                <el-radio :label="2">非粮款</el-radio>
-                <el-radio v-if='deptBudgetList.purpose==1' :label="3">保证金</el-radio>
-            </el-radio-group>
-          </ws-form-item>
-          <ws-form-item v-if='deptBudgetList.purpose==1' label="合同编号" span="1" prop="contractNo" class="readonly">
-            <ws-select v-model="deptBudgetList.contractNo" placeholder="" class="typeselect" @change="selectcontent"
-          :value="searchType">
-          <ws-option v-for="item in contractList" :key="item.contractNo" :label="item.contractNo" :value="item.contractNo"
-            style="color: #8890b1" />
-        </ws-select>
-          </ws-form-item>
-           <ws-form-item v-if='deptBudgetList.purpose==2' label="仓库名称" span="1" prop="contractNo" class="readonly">
-            <ws-select v-model="deptBudgetList.warehouse" placeholder="" class="typeselect" @change="selectwarehouse"
-          :value="searchType">
-          <ws-option v-for="item in contractList" :key="item.contractNo" :label="item.contractNo" :value="item.contractNo"
-            style="color: #8890b1" />
-        </ws-select>
-          </ws-form-item>
-          <ws-form-item label="费用名称" span="1" prop="settlementMethod">
-            <el-input placeholder="输入费用名称,1-15个字" class="input_css" v-model="deptBudgetList.expenseName"></el-input>
-          </ws-form-item>
-          <ws-form-item label="金额(元)" span="1" prop="contractNo" class="readonly">
-            <el-input placeholder="输入请款金额" class="input_css" v-model="deptBudgetList.money"></el-input>
-          </ws-form-item>
-          <ws-form-item label="备注" span="1" prop="settlementMethod">
+        <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="2"
+            :rows="5"
             placeholder="选填,不超过50个字"
             v-model="deptBudgetList.remark">
             </el-input>
-          </ws-form-item>
-          <ws-form-item label="附件">
-          <el-upload ref='uploadfiles' :file-list='dataList' action="https://www.zthymaoyi.com/upload/admin" list-type="picture-card"
+          </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>
-        </ws-form-item>
-        </ws-form>
-        <div v-if='deptBudgetList.type==2'>费用分配</div>
-        <div v-if='deptBudgetList.type==2' style='margin-bottom:10px;'>
-            <ws-select v-model="mode" placeholder="费用分配方式" class="typeselect" @change="modeselect"
-          :value="searchType">
+        </el-form-item>
+        </el-form>
+        <div v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"||deptBudgetList.purpose=="库点费用"' class='expensetitle'>费用分配</div>
+        <div v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"||deptBudgetList.purpose=="库点费用"' style='margin:0  auto 10px;width:90%;'>
+            <ws-select v-model="mode" placeholder="费用分配方式" @change="modeselect">
           <ws-option v-for="item in modeList" :key="item.value" :label="item.value" :value="item.value"
             style="color: #8890b1" />
         </ws-select>
-         <ws-select v-if='deptBudgetList.purpose==1' v-model="ware" placeholder="费用分配仓库" class="typeselect" @change="selectwareType"
+         <!-- <ws-select v-if='deptBudgetList.purpose==1' v-model="ware" placeholder="费用分配仓库" class="typeselect" @change="selectwareType"
           :value="searchType">
           <ws-option v-for="item in wareList" :key="item.value" :label="item.value" :value="item.value"
             style="color: #8890b1" />
@@ -83,48 +85,57 @@
           :value="searchType">
           <ws-option v-for="item in datesList" :key="item.value" :label="item.value" :value="item.value"
             style="color: #8890b1" />
-        </ws-select>
-         <ws-select v-model="moneys" placeholder="费用分配金额" class="typeselect" @change="selecttaskType"
-          :value="searchType">
+        </ws-select> -->
+         <ws-select :disabled='disabled' v-model="moneys" placeholder="费用分配金额">
           <ws-option v-for="item in moneysList" :key="item.value" :label="item.value" :value="item.value"
             style="color: #8890b1" />
         </ws-select>
-        合计分配:{{amount}}元
+        <span v-if='mode!="暂不分配"'>合计分配:{{amount}}元</span>  
         </div>
-        <el-table v-if='deptBudgetList.type==2' :data="feeDetailsDistributions" style="width: 80%;margin:0 auto;">
-          <el-table-column prop="date" label="所属" min-width="110">
+        <el-table 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-if='deptBudgetList.purpose==2' v-model="scope.row.belonging" placeholder="选择仓库或合同" class="typeselect" @change="selectware"
-          :value="searchType">
-          <ws-option v-for="item in warecontractList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-        <ws-select v-if='deptBudgetList.purpose==1' v-model="scope.row.belonging" placeholder="选择仓库" class="typeselect" @change="selectware"
-          :value="searchType">
-          <ws-option v-for="item in warehouseList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
+              <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"
+                  style="color: #8890b1" />
+              </ws-select>
             </template>
           </el-table-column>
-          <el-table-column prop="date" label="日期">
+          <el-table-column v-if='deptBudgetList.purpose=="合同费用"' prop="date" label="日期">
             <template slot-scope="scope">
-                <ws-date-picker v-model="scope.row.proDate" type="date" placeholder="请选择日期"
-              value-format="yyyy-MM-dd" />
+               <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"
+                  style="color: #8890b1" />
+              </ws-select>
             </template>
           </el-table-column>
-          <el-table-column prop="date" label="货名">
+          <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="请选择日期"
+              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.goodsName" placeholder="选择货名" class="typeselect" @change="goodsNameselect"
-                    :value="searchType">
-                    <ws-option v-for="item in goodsList" :key="item.value" :label="item.value" :value="item.value"
+                <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"
                         style="color: #8890b1" />
                 </ws-select>
             </template>
           </el-table-column>
-          <el-table-column prop="date" label="库存(吨)"></el-table-column>
+          <el-table-column v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="货名">
+            <template slot-scope="scope">
+               <span>{{scope.row.goodsName?scope.row.goodsName:'自动获取'}}</span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="inWarehouseWeight" label="入库量(吨)">
+            <template slot-scope="scope">
+               <span>{{scope.row.inWarehouseWeight?scope.row.inWarehouseWeight:'自动获取'}}</span>
+            </template>
+          </el-table-column>
           <el-table-column prop="date" label="分配金额(元)">
             <template slot-scope="scope">
-                <el-input placeholder="输入费用名称,1-15个字" class="input_css" v-model="scope.row.money"></el-input>
+                <el-input placeholder="输入费用名称,1-15个字" class="input_css" v-model="scope.row.distributionMoney"></el-input>
             </template>
           </el-table-column>
           <el-table-column prop="address" label="操作" width="200">
@@ -140,10 +151,11 @@
     </div>
       </div>
     </div>
+    </div>
   </div>
 </template>
 <script>
-  import {setexpense,getcontract} from '@/model/profitable/index'
+  import {lookexenseinfo,getcontract,getwarehouse,addexenseinfo,getwarehousingorder,editexenseinfo} from '@/model/profitable/index'
   export default {
     components: {},
     data() {
@@ -154,25 +166,28 @@
           count: 2000,
         }],
         mode:'全部分配',
-        ware:'指定仓库',
-        dates:'固定日期',
         moneys:'按重量自动分配',
-        goods:'全部货品',
-        amount:0,
+        dataList:[],
         goodsList:[],
+        disabled:false,
         warecontractList:[],
-        feeDetailsDistributions:[{proDate:'',weight:'',money:'',warehouse:'',belonging:'',index:0}],
-        deptBudgetList:{purpose:1,type:1},
+        // 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
           },
@@ -189,26 +204,134 @@
       // this.initCharts()
       // this.getPassYearFormatDate()
       this.getList()
+    },
+     computed: {
+    // 计算属性的 getter
+      amount: function () {
+        // `this` 指向 vm 实例
+        var num=0
+        for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+          num+=Number(this.feeDetailsDistributions[i].distributionMoney)
+        }
+        return num
+      }
     },
     methods: {
-      selectwarehouse(){
-
+      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)      
       },
-      selectwareType(e){
-        if(e=='全部仓库'){
-          for (let i = 0; i < this.choosablewareList.length; i++) {
-            this.feeDetailsDistributions.push(this.choosablewareList[i])
+      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})
+            }
+          })
+      },
+      selectgoodsSource(e,item){
+        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.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
+            }
+        }
+        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)
+            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
+            }
             
           }
         }
       },
-      selectproductType(){
-        if(e=='全部产品'){
-
+      selecttime(e,item){
+        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.length; i++) {
+          if(this.datelist[i].time==e){
+            item.orderId=this.datelist[i].id
+            item.inWarehouseWeight=this.datelist[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)
+            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=[]
+        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})
+            }
+          })
       },
       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.signingDate=this.contractList[i].signingDate
+            // this.disabledDate()
+          }
+        }
       },
       handlefujian(file) {
         // console.log(file)
@@ -216,21 +339,185 @@
         // this.dialogVisible = true
       },
       submit(){
-        if(!this.deptBudgetList.contractNo&&this.deptBudgetList.purpose==1){
+        this.deptBudgetList.totalDistribution=this.amount
+        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
+            }
+          }
+        }
+        if(this.deptBudgetList.purpose=='合同费用'){
+          this.deptBudgetList.expensesPurpose=1
+        }else if(this.deptBudgetList.purpose=='库点费用'){
+          this.deptBudgetList.expensesPurpose=3
+        }else if(this.deptBudgetList.purpose=='经营性费用'){
+          this.deptBudgetList.expensesPurpose=5
+        }
+        if(this.deptBudgetList.expensesPurpose==1){
+          if(this.deptBudgetList.type=='粮款'){
+            this.deptBudgetList.costType=1
+            this.deptBudgetList.expenseAllocationInfoList=[]
+          }else if(this.deptBudgetList.type=='非粮款'){
+            this.deptBudgetList.costType=3
+            this.deptBudgetList.expenseAllocationInfoList=this.feeDetailsDistributions
+          }else if(this.deptBudgetList.type=='保证金'){
+            this.deptBudgetList.expensesPurpose=5
+            this.deptBudgetList.expenseAllocationInfoList=[]
+          }
+        }
+         if(this.deptBudgetList.expensesPurpose==1){
+        var data=[]
+          for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+            if(data.length==0){
+              data.push(this.feeDetailsDistributions[i])
+            }else{
+              var repetition=data.filter((item,index)=>{
+                return this.feeDetailsDistributions[i].orderId==item.orderId&&this.feeDetailsDistributions[i].receiptDocDate==item.receiptDocDate
+              })
+              if(repetition.length==0){
+                data.push(this.feeDetailsDistributions[i])
+              }else{
+                this.$message({
+                    message: '货源重复!',
+                    type: 'warning',
+                  })
+                  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',
+              //     })
+              //   }
+              // }
+            }
+            
+          }
+        }
+        if(this.deptBudgetList.expensesPurpose==3){
+        var data=[]
+          for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+            if(data.length==0){
+              data.push(this.feeDetailsDistributions[i])
+            }else{
+              var repetition=data.filter((item,index)=>{
+                return this.feeDetailsDistributions[i].warehouseName==item.warehouseName&&this.feeDetailsDistributions[i].receiptDocDate==item.receiptDocDate
+              })
+              if(repetition.length==0){
+                data.push(this.feeDetailsDistributions[i])
+              }else{
+                this.$message({
+                    message: '货源重复!',
+                    type: 'warning',
+                  })
+                  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',
+              //     })
+              //   }
+              // }
+            }
+            
+          }
+        }
+        this.deptBudgetList.expensesType=2
+        if(!this.deptBudgetList.contractNo&&this.deptBudgetList.expensesPurpose==1){
           this.$message({
                 message: '合同编号不能为空!',
                 type: 'warning',
               })
+              return
         }
-        if(!this.deptBudgetList.warehouse&&this.deptBudgetList.purpose==2){
+        if(!this.deptBudgetList.warehouse&&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
+          }
         }
-        this.deptBudgetList.applUrl=this.paymentScreenshot.toString()
-        setexpense(this.deptBudgetList).toPromise()
-          .then(response => {})
+        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.deptBudgetList.flag=4
+        editexenseinfo(this.deptBudgetList).toPromise()
+          .then(response => {
+            this.$message({
+              message: '提交成功!',
+              type: 'success',
+            })
+            this.$router.go(-1)
+          })
       },
       modeselect(e){
           console.log(e)
@@ -249,7 +536,6 @@
         }
       },
       getList() {
-        console.log(1222)
         getcontract({
         compId:localStorage.getItem('ws-pf_compId'),
         })
@@ -257,10 +543,60 @@
         .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 
+          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.srcList=arr
+          }
+          if(response.expenseAllocationInfoList){
+            this.feeDetailsDistributions=response.expenseAllocationInfoList
+          }
+          
+          
+        })
       },
-      detail(){
-        this.$router.push({name:'contractprofitsdetails'})
+      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)
+          }
+          
+        }
       },
       getPassYearFormatDate() {
         var nowDate = new Date()
@@ -292,127 +628,6 @@
       pickerOptions() {
 
       },
-      initCharts() {
-        let app = this;
-        let myChart7 = app.$echarts.init(this.$refs.myEchart7);
-        var option;
-        option = {
-            // title: {
-            //   text: 'Rainfall vs Evaporation',
-            //   subtext: 'Fake Data'
-            // },
-            tooltip: {
-              trigger: 'axis'
-            },
-            legend: {
-              data: ['支出', '收入']
-            },
-            toolbox: {
-              show: true,
-              feature: {
-                dataView: {
-                  show: false,
-                  readOnly: false
-                },
-                magicType: {
-                  show: false,
-                  type: ['line', 'bar']
-                },
-                restore: {
-                  show: false
-                },
-                saveAsImage: {
-                  show: false
-                }
-              }
-            },
-            calculable: true,
-            xAxis: [{
-              name: '种类',
-              type: 'category',
-              // prettier-ignore
-              data: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct']
-            }],
-            yAxis: [{
-              name: '储量(吨)',
-              type: 'value'
-            }],
-            series: [{
-                name: '支出',
-                type: 'bar',
-                right: 0,
-                // label: {
-                //   show: true,
-                //   position: 'inside'
-                // },
-                 label: {
-                  show: true,
-                  precision: 1,
-                  position: 'top',
-                  valueAnimation: true,
-                  fontFamily: 'monospace'
-                },
-                data: [
-                  6.0, 60.9, 90.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0
-                ],
-                color: ['#5878E8 '],
-                formatter: '{value} 元',
-
-              },
-              {
-                name: '收入',
-                type: 'bar',
-                right: 20,
-                label: {
-                  show: true,
-                  precision: 1,
-                  position: 'top',
-                  valueAnimation: true,
-                  fontFamily: 'monospace'
-                },
-                data: [
-                  102.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8
-                ],
-                color: ['#FF9F24'],
-                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>
@@ -420,7 +635,9 @@
   .container {
     background: #E8ECF6;
   }
-
+  .expensetitle{
+    margin:0  auto 10px;width:90%;border-top:1px solid #D8DCE6;padding-top:30px;
+  }
   .center {
     margin: 0 auto;
     background: #ffffff;

+ 109 - 145
src/views/profitable/expensemanagentlook.vue

@@ -10,120 +10,114 @@
         </el-button></el-col>
     </el-row>
     <div class="center">
-     <div>基本信息</div>
-      <div class="table_css">
-        <ws-form>
-          <ws-form-item label="用途" span="1" prop="contractNo" class="readonly">
-             <el-radio-group v-model="radio">
-                <el-radio :label="3">合同费用</el-radio>
-                <el-radio :label="6">库点费用</el-radio>
-                <el-radio :label="9">经营性费用</el-radio>
-            </el-radio-group>
-          </ws-form-item>
-          <ws-form-item label="类型" span="1" prop="contractNo" class="readonly">
-             <el-radio-group v-model="radio">
-                <el-radio :label="3">粮款</el-radio>
-                <el-radio :label="6">非粮款</el-radio>
-                <el-radio :label="9">保证金</el-radio>
-            </el-radio-group>
-          </ws-form-item>
-          <ws-form-item label="合同编号" span="1" prop="contractNo" class="readonly">
-            <ws-select v-model="searchTypeText" placeholder="" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in taskTypeList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-          </ws-form-item>
-          <ws-form-item label="费用名称" span="1" prop="settlementMethod">
-            <el-input placeholder="输入费用名称,1-15个字" class="input_css" v-model="searchKeyWord"></el-input>
-          </ws-form-item>
-          <ws-form-item label="金额" span="1" prop="contractNo" class="readonly">
-            <el-input placeholder="输入请款金额" class="input_css" v-model="searchKeyWord"></el-input>
-          </ws-form-item>
-          <ws-form-item label="备注" span="1" prop="settlementMethod">
+     <div style='margin:0 auto 10px;width:90%;'>基本信息</div>
+      <div>
+        <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="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.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 v-if='deptBudgetList.expensesPurpose==3' label-width='100px' label="仓库名称" span="1" prop="warehouse" class="readonly">
+          {{deptBudgetList.warehouse}}
+          </el-form-item>
+          <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">
+            {{deptBudgetList.expenseName}}
+          </el-form-item>
+          <el-form-item label-width='100px' label="金额" span="1" prop="contractNo" class="readonly">
+            {{deptBudgetList.amountMoney}}
+          </el-form-item>
+          <el-form-item label-width='100px' label="备注" span="1" prop="settlementMethod">
             <el-input
+            disabled
             type="textarea"
-            :rows="2"
+            :rows="5"
             placeholder="选填,不超过50个字"
-            v-model="textarea">
+            v-model="deptBudgetList.remark">
             </el-input>
-          </ws-form-item>
-          <ws-form-item 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>
-        </ws-form-item>
-        </ws-form>
-        <div>费用分配</div>
-        <div>
-            <ws-select v-model="searchTypeText" placeholder="" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in taskTypeList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-         <ws-select v-model="searchTypeText" placeholder="" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in taskTypeList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-         <ws-select v-model="searchTypeText" placeholder="" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in taskTypeList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-         <ws-select v-model="searchTypeText" placeholder="" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in taskTypeList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-        合计分配:1000元
-        </div>
-        <el-table :data="valueData" style="width: 100%">
-          <el-table-column prop="date" label="所属" min-width="110">
-            <template slot-scope="scope">
-                <ws-select v-model="searchTypeText" placeholder="选择仓库或合同" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in taskTypeList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-            </template>
-          </el-table-column>
-          <el-table-column prop="date" label="日期">
-            <template slot-scope="scope">
-                <ws-date-picker v-model="deptBudgetList" type="date" placeholder="请选择交货日期(止)"
-              value-format="yyyy-MM-dd" />
-            </template>
-          </el-table-column>
-          <el-table-column prop="date" label="货名">
+          </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-form-item>
+        </el-form>
+        <div v-if='deptBudgetList.expensesPurpose==1&&deptBudgetList.costType==3||deptBudgetList.expensesPurpose==2' style='width:90%;margin:10px auto;'>
+          <div style='margin-bottom:20px;'>费用分配</div>
+          <!-- <div> -->
+          <el-table :data="deptBudgetList.expenseAllocationInfoList">
+            <el-table-column v-if='deptBudgetList.purpose=="合同费用"' prop="date" label="仓库名称" min-width="110">
               <template slot-scope="scope">
-                <ws-select v-model="searchTypeText" placeholder="选择仓库或合同" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in taskTypeList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-            </template>
-          </el-table-column>
-          <el-table-column prop="date" label="库存(吨)"></el-table-column>
-          <el-table-column prop="date" label="分配金额(元)">
-            <template slot-scope="scope">
-                <el-input placeholder="输入费用名称,1-15个字" class="input_css" v-model="searchKeyWord"></el-input>
-            </template>
-          </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>
-            </template>
-          </el-table-column>
-        </el-table>
-
+                <ws-select disabled 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"
+                    style="color: #8890b1" />
+                </ws-select>
+              </template>
+            </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-option v-for="item in datelist" :key="item.time" :label="item.time" :value="item.time"
+                    style="color: #8890b1" />
+                </ws-select>
+              </template>
+            </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="请选择日期"
+                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-option v-for="item in goodsourcelist" :key="item.id" :label="item.goodsSource" :value="item.id"
+                          style="color: #8890b1" />
+                  </ws-select>
+              </template>
+            </el-table-column>
+            <el-table-column v-if='deptBudgetList.expensesPurpose==3' prop="date" label="货名">
+              <template slot-scope="scope">
+                <span>{{scope.row.goodsName?scope.row.goodsName:'自动获取'}}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="inWarehouseWeight" label="入库量(吨)">
+              <template slot-scope="scope">
+                <span>{{scope.row.inWarehouseWeight?scope.row.inWarehouseWeight:'自动获取'}}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="date" label="分配金额(元)">
+              <template slot-scope="scope">
+                  <el-input disabled placeholder="输入费用名称,1-15个字" class="input_css" v-model="scope.row.distributionMoney"></el-input>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
       </div>
     </div>
   </div>
 </template>
 <script>
-  import {expenseLook} from '@/model/profitable/index'
+  import {lookexenseinfo} from '@/model/profitable/index'
   export default {
     components: {},
     data() {
@@ -135,6 +129,7 @@
         }],
         deptBudgetList:{},
         makeWordData: {},
+        srcList:[],
         valueData: [{
             date: 10
           },
@@ -150,55 +145,22 @@
     },
     methods: {
       getList() {
-        expenseLook({
-         id:this.id
+        lookexenseinfo({
+         id:this.$route.query.id
         })
         .toPromise()
         .then((response) => {
           this.deptBudgetList=response
+          this.srcList=response.addressUrl.split(',')
         })
 
       },
+      returnsales(){
+        this.$router.go(-1)
+      },
       detail(){
         this.$router.push({name:'contractprofitsdetails'})
       },
-     
-      pickerOptions() {
-
-      },
-      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>
@@ -210,9 +172,10 @@
   .center {
     margin: 0 auto;
     background: #ffffff;
-    height: calc(100vh - 13vh);
     border-radius: 4px;
     margin-top: 10px;
+    padding-top:30px;
+    overflow-y: scroll;
   }
 
   .row_top {
@@ -277,8 +240,9 @@
   }
   /deep/.el-form{
     width:90%;
-    margin:0 auto;
+    margin:10px auto;
   }
+  
   /deep/.el-form-item {
     width: 50%;
 }

+ 91 - 222
src/views/profitable/payment.vue

@@ -1,69 +1,76 @@
-//
+//
 <template>
   <div class="container">
     <el-row class="row_top">
       <el-col :span="12">
-        <h2 class="bg-left title">款</h2>
+        <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>基本信息</div>
-      <div class="table_css">
-        <ws-form>
-             <el-radio-group v-model="deptBudgetList.purpose">
-                <el-radio :label="1">合同费用</el-radio>
-                <el-radio :label="2">库点费用</el-radio>
-                <el-radio :label="3">经营性费用</el-radio>
-            </el-radio-group>
-          </ws-form-item>
-          <ws-form-item v-if='deptBudgetList.purpose==1||deptBudgetList.purpose==2' label="用途" span="1" prop="contractNo" class="readonly">
-             <el-radio-group v-model="deptBudgetList.type">
-                <el-radio :label="1">粮款</el-radio>
-                <el-radio :label="2">非粮款</el-radio>
-                <el-radio v-if='deptBudgetList.purpose==1' :label="3">保证金</el-radio>
-            </el-radio-group>
-          </ws-form-item>
-          <ws-form-item label="合同编号" span="1" prop="contractNo" class="readonly">
-            <ws-select v-model="deptBudgetList.contractNo" placeholder="" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in taskTypeList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-          </ws-form-item>
-          <ws-form-item label="费用名称" span="1" prop="settlementMethod">
-            <el-input placeholder="输入费用名称,1-15个字" class="input_css" v-model="deptBudgetList.expenseName"></el-input>
-          </ws-form-item>
-          <ws-form-item label="金额" span="1" prop="contractNo" class="readonly">
-            <el-input placeholder="输入请款金额" class="input_css" v-model="deptBudgetList.money"></el-input>
-          </ws-form-item>
-          <ws-form-item label="备注" span="1" prop="settlementMethod">
+     <div style='margin:0 auto 10px;width:90%;'>基本信息</div>
+      <div>
+        <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="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.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 v-if='deptBudgetList.expensesPurpose==3' label-width='100px' label="仓库名称" span="1" prop="warehouse" class="readonly">
+          {{deptBudgetList.warehouse}}
+          </el-form-item>
+          <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">
+            {{deptBudgetList.expenseName}}
+          </el-form-item>
+          <el-form-item label-width='100px' label="金额" span="1" prop="contractNo" class="readonly">
+            {{deptBudgetList.amountMoney}}
+          </el-form-item>
+          <el-form-item label-width='100px' label="备注" span="1" prop="settlementMethod">
             <el-input
+            disabled
             type="textarea"
-            :rows="2"
+            :rows="5"
             placeholder="选填,不超过50个字"
             v-model="deptBudgetList.remark">
             </el-input>
-          </ws-form-item>
-          <ws-form-item 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>
-        </ws-form-item>
-        </ws-form>
-         <div style='text-align:right;margin-right:30px;'>
-            <el-button class="bg-bottom" type="primary" size="small" @click="submit()">提交
-            </el-button>
-        </div>
+          </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-form-item>
+        </el-form>
+        <div style='width:90%;margin:10px auto;text-align:right;'>
+        <el-button class="bg-bottom" type="primary" size="small" @click="submit()">提交
+        </el-button></div>
       </div>
     </div>
   </div>
 </template>
 <script>
-  import {} from '@/model/profitable/index'
+  import {lookexenseinfo,expensepayment} from '@/model/profitable/index'
+  import {woekflowhandle,} from '@/model/tasksport/index'
   export default {
     components: {},
     data() {
@@ -73,8 +80,11 @@
           name: "玉米",
           count: 2000,
         }],
+        rejectshow:false,
         deptBudgetList:{},
         makeWordData: {},
+        srcList:[],
+        textarea:'',
         valueData: [{
             date: 10
           },
@@ -86,188 +96,45 @@
       }
     },
     activated() {
-      this.makeWordData = this.getData(2)
-      this.initCharts()
-      this.getPassYearFormatDate()
       this.getList()
     },
     methods: {
-      submit(){
-        this.$confirm('确认通过请款信息?', '提示', {
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'warning'
-          })
-          .then(() => {
-            expenseshougou().toPromise()
-          .then(response => {})
-          })
-      },
       getList() {
-        // getceshi({
-        //  driverId:'8f1f3c624d7946d79a9d44a4057d969b'
-        // })
-        // .toPromise()
-        // .then((response) => {
-        // debugger
-        // console.log(response)
-        // })
+        lookexenseinfo({
+         id:this.$route.query.id
+        })
+        .toPromise()
+        .then((response) => {
+          this.deptBudgetList=response
+          this.srcList=response.addressUrl.split(',')
+        })
 
       },
-      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() {
-
+      returnsales(){
+        this.$router.go(-1)
       },
-      initCharts() {
-        let app = this;
-        let myChart7 = app.$echarts.init(this.$refs.myEchart7);
-        var option;
-        option = {
-            // title: {
-            //   text: 'Rainfall vs Evaporation',
-            //   subtext: 'Fake Data'
-            // },
-            tooltip: {
-              trigger: 'axis'
-            },
-            legend: {
-              data: ['支出', '收入']
-            },
-            toolbox: {
-              show: true,
-              feature: {
-                dataView: {
-                  show: false,
-                  readOnly: false
-                },
-                magicType: {
-                  show: false,
-                  type: ['line', 'bar']
-                },
-                restore: {
-                  show: false
-                },
-                saveAsImage: {
-                  show: false
-                }
-              }
-            },
-            calculable: true,
-            xAxis: [{
-              name: '种类',
-              type: 'category',
-              // prettier-ignore
-              data: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct']
-            }],
-            yAxis: [{
-              name: '储量(吨)',
-              type: 'value'
-            }],
-            series: [{
-                name: '支出',
-                type: 'bar',
-                right: 0,
-                // label: {
-                //   show: true,
-                //   position: 'inside'
-                // },
-                 label: {
-                  show: true,
-                  precision: 1,
-                  position: 'top',
-                  valueAnimation: true,
-                  fontFamily: 'monospace'
-                },
-                data: [
-                  6.0, 60.9, 90.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0
-                ],
-                color: ['#5878E8 '],
-                formatter: '{value} 元',
-
-              },
-              {
-                name: '收入',
-                type: 'bar',
-                right: 20,
-                label: {
-                  show: true,
-                  precision: 1,
-                  position: 'top',
-                  valueAnimation: true,
-                  fontFamily: 'monospace'
-                },
-                data: [
-                  102.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8
-                ],
-                color: ['#FF9F24'],
-                formatter: '{value} 元',
-              }
-            ]
-          },
-          myChart7.setOption(option)
+      submit(){
+        this.$confirm('确定提交付款信息?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          expensepayment(this.deptBudgetList)
+          .toPromise()
+          .then((response) => {
+            this.$message({
+              message: '提交成功!',
+              type: 'success',
+            })
+            this.$router.go(-1)
+          }).catch((response) => {
+            this.$message({
+              message: '提交失败!',
+              type: 'success',
+            })
+          })
+        })
       },
-      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>
@@ -279,9 +146,10 @@
   .center {
     margin: 0 auto;
     background: #ffffff;
-    height: calc(100vh - 13vh);
     border-radius: 4px;
     margin-top: 10px;
+    padding-top:30px;
+    overflow-y: scroll;
   }
 
   .row_top {
@@ -346,8 +214,9 @@
   }
   /deep/.el-form{
     width:90%;
-    margin:0 auto;
+    margin:10px auto;
   }
+  
   /deep/.el-form-item {
     width: 50%;
 }

+ 210 - 243
src/views/profitable/receipt.vue

@@ -10,129 +10,68 @@
         </el-button></el-col>
     </el-row>
     <div class="center">
-      <div class="table_css">
-        <ws-form><div>基本信息</div>
-          <ws-form-item label="用途" span="1" prop="contractNo" class="readonly">
-             <el-radio-group v-model="deptBudgetList.purpose">
-                <el-radio :label="1">合同费用</el-radio>
-                <el-radio :label="2">库点费用</el-radio>
-                <el-radio :label="3">经营性费用</el-radio>
-            </el-radio-group>
-          </ws-form-item>
-          <ws-form-item v-if='deptBudgetList.purpose==1||deptBudgetList.purpose==2' label="用途" span="1" prop="contractNo" class="readonly">
-             <el-radio-group v-model="deptBudgetList.type">
-                <el-radio :label="1">粮款</el-radio>
-                <el-radio :label="2">非粮款</el-radio>
-                <el-radio v-if='deptBudgetList.purpose==1' :label="3">保证金</el-radio>
-            </el-radio-group>
-          </ws-form-item>
-          <ws-form-item label="合同编号" span="1" prop="contractNo" class="readonly">
-            <ws-select v-model="deptBudgetList.contractNo" placeholder="" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in taskTypeList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-          </ws-form-item>
-          <ws-form-item label="费用名称" span="1" prop="settlementMethod">
-            <el-input placeholder="输入费用名称,1-15个字" class="input_css" v-model="deptBudgetList.expenseName"></el-input>
-          </ws-form-item>
-          <ws-form-item label="金额" span="1" prop="contractNo" class="readonly">
-            <el-input placeholder="输入请款金额" class="input_css" v-model="deptBudgetList.money"></el-input>
-          </ws-form-item>
-          <ws-form-item label="备注" span="1" prop="settlementMethod">
+      <div>
+        <el-form label-position='left'><div style='margin:30px 0;'>基本信息</div>
+          <el-form-item  label-width='100px' label="用途" span="1" prop="contractNo" class="readonly">
+            <ws-select v-model="deptBudgetList.purpose" placeholder="" class="typeselect" >
+              <ws-option label="合同费用" value="1"
+                style="color: #8890b1" />
+                <ws-option label="库点费用" value="2"
+                style="color: #8890b1" />
+                <ws-option label="经营性费用" value="3"
+                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="1" style="color: #8890b1" />
+                <ws-option label="非粮款" value="2" style="color: #8890b1" />
+                <ws-option label="保证金" value="3" 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">
+              <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">
+              <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 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-form-item>
+          <el-form-item label-width='100px' label="备注" span="1" prop="settlementMethod">
             <el-input
             type="textarea"
-            :rows="2"
+            :rows="5"
             placeholder="选填,不超过50个字"
             v-model="deptBudgetList.remark">
             </el-input>
-          </ws-form-item>
-          <ws-form-item label="附件">
+          </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>
-        </ws-form-item>
-        </ws-form>
-        <div v-if='deptBudgetList.type==1'>费用分配</div>
-        <div v-if='deptBudgetList.type==1' style='margin-bottom:10px;'>
-            <ws-select v-model="mode" placeholder="费用分配方式" class="typeselect" @change="modeselect"
-          :value="searchType">
-          <ws-option v-for="item in modeList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-         <ws-select v-if='deptBudgetList.purpose==1' v-model="ware" placeholder="费用分配仓库" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in wareList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-        <ws-select v-if='deptBudgetList.purpose==2' v-model="goods" placeholder="费用分配产品" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in goodsList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-         <ws-select v-model="dates" placeholder="费用分配日期" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in datesList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-         <ws-select v-model="moneys" placeholder="费用分配金额" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in moneysList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-        合计分配:{{amount}}元
+        </el-form-item>
+        </el-form>
+        </div>
+        <div style='text-align:right;margin-right:30px;'>
+            <el-button class="bg-bottom" type="primary" size="small" @click="submit()">提交
+            </el-button>
         </div>
-        <el-table :data="feeDetailsDistributions" style="width: 80%;margin:0 auto;">
-          <el-table-column prop="date" label="所属" min-width="110">
-            <template slot-scope="scope">
-                <ws-select v-if='deptBudgetList.purpose==2' v-model="scope.row.belonging" placeholder="选择仓库或合同" class="typeselect" @change="selectware"
-          :value="searchType">
-          <ws-option v-for="item in warecontractList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-        <ws-select v-if='deptBudgetList.purpose==1' v-model="scope.row.belonging" placeholder="选择仓库" class="typeselect" @change="selectware"
-          :value="searchType">
-          <ws-option v-for="item in warehouseList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-            </template>
-          </el-table-column>
-          <el-table-column prop="date" label="日期">
-            <template slot-scope="scope">
-                <ws-date-picker v-model="scope.row.proDate" type="date" placeholder="请选择日期"
-              value-format="yyyy-MM-dd" />
-            </template>
-          </el-table-column>
-          <el-table-column prop="date" label="货名">
-              <template slot-scope="scope">
-                <ws-select v-model="scope.row.goodsName" placeholder="选择货名" class="typeselect" @change="goodsNameselect"
-                    :value="searchType">
-                    <ws-option v-for="item in goodsList" :key="item.value" :label="item.value" :value="item.value"
-                        style="color: #8890b1" />
-                </ws-select>
-            </template>
-          </el-table-column>
-          <el-table-column prop="date" label="库存(吨)"></el-table-column>
-          <el-table-column prop="date" label="分配金额(元)">
-            <template slot-scope="scope">
-                <el-input placeholder="输入费用名称,1-15个字" class="input_css" v-model="scope.row.money"></el-input>
-            </template>
-          </el-table-column>
-          <el-table-column prop="address" label="操作" width="200">
-            <template slot-scope="scope">
-                <img class='add' @click='addlist()' src="../../../public/img/add.png" alt="">
-                <img class='del' @click='dellist(scope.row)' src="../../../public/img/del.png" alt="">
-            </template>
-          </el-table-column>
-        </el-table>
-
-      </div>
     </div>
   </div>
 </template>
 <script>
-  import {} from '@/model/profitable/index'
+  import {setexpense,getcontract,getwarehouse,addexenseinfo,getwarehousingorder} from '@/model/profitable/index'
   export default {
     components: {},
     data() {
@@ -149,11 +88,14 @@
         goods:'全部货品',
         amount:0,
         goodsList:[],
+        dataList:[],
         warecontractList:[],
         feeDetailsDistributions:[{proDate:'',weight:'',money:'',warehouse:'',belonging:'',index:0}],
-        deptBudgetList:{purpose:1,type:1},
+        deptBudgetList:{purpose:'合同费用',type:'粮款'},
         makeWordData: {},
         warehouseList:[],
+        contractList:[],
+        paymentScreenshot:[],
         modeList:[{key:1,value:'全部分配'},{key:2,value:'部分分配'},{key:3,value:'暂不分配'}],
         wareList:[{key:1,value:'指定仓库'},{key:2,value:'全部仓库'}],
         datesList:[{key:1,value:'固定日期'},{key:2,value:'指定日期'}],
@@ -170,12 +112,143 @@
       }
     },
     activated() {
-      this.makeWordData = this.getData(2)
-      this.initCharts()
-      this.getPassYearFormatDate()
       this.getList()
     },
     methods: {
+      returnsales(){
+        this.$router.go(-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
+			},
+      // 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()
+      //     }
+      //   }
+      // },
+      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)
+          }
+          
+        }
+      },
+      submit(){
+        this.deptBudgetList.compId=localStorage.getItem('ws-pf_compId')
+        this.deptBudgetList.agent=localStorage.getItem('ws-pf_staffName')
+        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.expenseAllocationInfoList=[]
+           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
+            this.deptBudgetList.expenseAllocationInfoList=[]
+          }else if(this.deptBudgetList.type=='非粮款'){
+            this.deptBudgetList.costType=3
+            this.deptBudgetList.expenseAllocationInfoList=[]
+          }else if(this.deptBudgetList.type=='保证金'){
+            this.deptBudgetList.expensesPurpose=5
+            this.deptBudgetList.expenseAllocationInfoList=[]
+          }
+        }
+        this.deptBudgetList.expensesType=1
+        if(!this.deptBudgetList.contractNo&&this.deptBudgetList.expensesPurpose==1){
+          this.$message({
+                message: '合同编号不能为空!',
+                type: 'warning',
+              })
+        }
+        if(!this.deptBudgetList.warehouse&&this.deptBudgetList.expensesPurpose==3){
+          this.$message({
+                message: '仓库名称不能为空!',
+                type: 'warning',
+              })
+        }
+        if(!this.deptBudgetList.expenseName){
+          this.$message({
+                message: '费用名称不能为空!',
+                type: 'warning',
+          })
+        }
+        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',
+          })
+        }
+        if(this.deptBudgetList.amountMoney<0.01||this.deptBudgetList.amountMoney>100000000){
+          this.$message({
+                message: '金额输入错误!',
+                type: 'warning',
+          })
+        }
+        this.deptBudgetList.addressUrl=this.paymentScreenshot.toString()
+        addexenseinfo(this.deptBudgetList).toPromise()
+          .then(response => {
+            this.$message({
+              message: '提交成功!',
+              type: 'success',
+            })
+            this.$router.go(-1)
+            })
+      },
       modeselect(e){
           console.log(e)
       },selectware(e){
@@ -191,14 +264,21 @@
           this.feeDetailsDistributions.splice(row.index,1)
       },
       getList() {
-        // getceshi({
-        //  driverId:'8f1f3c624d7946d79a9d44a4057d969b'
-        // })
-        // .toPromise()
-        // .then((response) => {
-        // debugger
-        // console.log(response)
-        // })
+         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
+        })
 
       },
       detail(){
@@ -234,127 +314,6 @@
       pickerOptions() {
 
       },
-      initCharts() {
-        let app = this;
-        let myChart7 = app.$echarts.init(this.$refs.myEchart7);
-        var option;
-        option = {
-            // title: {
-            //   text: 'Rainfall vs Evaporation',
-            //   subtext: 'Fake Data'
-            // },
-            tooltip: {
-              trigger: 'axis'
-            },
-            legend: {
-              data: ['支出', '收入']
-            },
-            toolbox: {
-              show: true,
-              feature: {
-                dataView: {
-                  show: false,
-                  readOnly: false
-                },
-                magicType: {
-                  show: false,
-                  type: ['line', 'bar']
-                },
-                restore: {
-                  show: false
-                },
-                saveAsImage: {
-                  show: false
-                }
-              }
-            },
-            calculable: true,
-            xAxis: [{
-              name: '种类',
-              type: 'category',
-              // prettier-ignore
-              data: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct']
-            }],
-            yAxis: [{
-              name: '储量(吨)',
-              type: 'value'
-            }],
-            series: [{
-                name: '支出',
-                type: 'bar',
-                right: 0,
-                // label: {
-                //   show: true,
-                //   position: 'inside'
-                // },
-                 label: {
-                  show: true,
-                  precision: 1,
-                  position: 'top',
-                  valueAnimation: true,
-                  fontFamily: 'monospace'
-                },
-                data: [
-                  6.0, 60.9, 90.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0
-                ],
-                color: ['#5878E8 '],
-                formatter: '{value} 元',
-
-              },
-              {
-                name: '收入',
-                type: 'bar',
-                right: 20,
-                label: {
-                  show: true,
-                  precision: 1,
-                  position: 'top',
-                  valueAnimation: true,
-                  fontFamily: 'monospace'
-                },
-                data: [
-                  102.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8
-                ],
-                color: ['#FF9F24'],
-                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>
@@ -371,7 +330,12 @@
     margin-top: 10px;
     overflow:scroll;
   }
-
+  /deep/.input50>.el-input__inner{
+    width:50%;
+  }
+  /deep/.typeselect.el-select{
+    width:50%;
+  }
   .row_top {
     // background: #F6F7FC;
     border-radius: 4px;
@@ -435,6 +399,9 @@
   /deep/.el-form{
     width:90%;
     margin:0 auto;
+    .el-form-item__label{
+      color:#8890B1;
+    }
   }
   /deep/.el-form-item {
     width: 50%;

+ 146 - 304
src/views/profitable/receiptaduit.vue

@@ -1,138 +1,95 @@
-//
+//确认收
 <template>
   <div class="container">
     <el-row class="row_top">
       <el-col :span="12">
-        <h2 class="bg-left title">款</h2>
+        <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>基本信息</div>
-      <div class="table_css">
-        <ws-form>
-          <ws-form-item label="用途" span="1" prop="contractNo" class="readonly">
-              <div v-if="deptBudgetList.purpose==1">合同费用</div>
-              <div v-if="deptBudgetList.purpose==2">库点费用</div>
-              <div v-if="deptBudgetList.purpose==3">经营性费用</div>
-          </ws-form-item>
-          <ws-form-item v-if='deptBudgetList.purpose==1||deptBudgetList.purpose==2' label="用途" span="1" prop="contractNo" class="readonly">
-            <div v-if='deptBudgetList.type==1'>粮款</div>
-            <div v-if='deptBudgetList.type==2'>非粮款</div>
-            <div v-if='deptBudgetList.type==3&&deptBudgetList.purpose==1'>保证金</div>
-          </ws-form-item>
-          <ws-form-item label="合同编号" span="1" prop="contractNo" class="readonly">
+     <div style='margin:0 auto 10px;width:90%;'>基本信息</div>
+      <div>
+        <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="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.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 v-if='deptBudgetList.expensesPurpose==3' label-width='100px' label="仓库名称" span="1" prop="warehouse" class="readonly">
+          {{deptBudgetList.warehouse}}
+          </el-form-item>
+          <el-form-item v-if='deptBudgetList.expensesPurpose==1' label-width='100px' label="合同编号" span="1" prop="contractNo" class="readonly">
           {{deptBudgetList.contractNo}}
-          </ws-form-item>
-          <ws-form-item label="费用名称" span="1" prop="settlementMethod">
+          </el-form-item>
+          <el-form-item label-width='100px' label="费用名称" span="1" prop="settlementMethod">
             {{deptBudgetList.expenseName}}
-          </ws-form-item>
-          <ws-form-item label="金额" span="1" prop="contractNo" class="readonly">
-            {{deptBudgetList.money}}
-          </ws-form-item>
-          <ws-form-item label="备注" span="1" prop="settlementMethod">
+          </el-form-item>
+          <el-form-item label-width='100px' label="金额" span="1" prop="contractNo" class="readonly">
+            {{deptBudgetList.amountMoney}}
+          </el-form-item>
+          <el-form-item label-width='100px' label="备注" span="1" prop="settlementMethod">
             <el-input
             disabled
             type="textarea"
-            :rows="2"
+            :rows="5"
             placeholder="选填,不超过50个字"
             v-model="deptBudgetList.remark">
             </el-input>
-          </ws-form-item>
-          <ws-form-item 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>
-        </ws-form-item>
-        </ws-form>
-        <div v-if='deptBudgetList.type==2'>费用分配</div>
-        <div v-if='deptBudgetList.type==2' style='margin-bottom:10px;'>
-            <ws-select v-model="mode" placeholder="费用分配方式" class="typeselect" @change="modeselect"
-          :value="searchType">
-          <ws-option v-for="item in modeList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-         <ws-select v-if='deptBudgetList.purpose==1' v-model="ware" placeholder="费用分配仓库" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in wareList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-        <ws-select v-if='deptBudgetList.purpose==2' v-model="goods" placeholder="费用分配产品" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in goodsList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-         <ws-select v-model="dates" placeholder="费用分配日期" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in datesList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-         <ws-select v-model="moneys" placeholder="费用分配金额" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in moneysList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-        合计分配:{{amount}}元
-        </div>
-        <el-table :data="feeDetailsDistributions" style="width: 80%;margin:0 auto;">
-          <el-table-column prop="date" label="所属" min-width="110">
-            <template slot-scope="scope">
-                <ws-select v-if='deptBudgetList.purpose==2' v-model="scope.row.belonging" placeholder="选择仓库或合同" class="typeselect" @change="selectware"
-          :value="searchType">
-          <ws-option v-for="item in warecontractList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-        <ws-select v-if='deptBudgetList.purpose==1' v-model="scope.row.belonging" placeholder="选择仓库" class="typeselect" @change="selectware"
-          :value="searchType">
-          <ws-option v-for="item in warehouseList" :key="item.value" :label="item.value" :value="item.value"
-            style="color: #8890b1" />
-        </ws-select>
-            </template>
-          </el-table-column>
-          <el-table-column prop="date" label="日期">
-            <template slot-scope="scope">
-                <ws-date-picker v-model="scope.row.proDate" type="date" placeholder="请选择日期"
-              value-format="yyyy-MM-dd" />
-            </template>
-          </el-table-column>
-          <el-table-column prop="date" label="货名">
-              <template slot-scope="scope">
-                <ws-select v-model="scope.row.goodsName" placeholder="选择货名" class="typeselect" @change="goodsNameselect"
-                    :value="searchType">
-                    <ws-option v-for="item in goodsList" :key="item.value" :label="item.value" :value="item.value"
-                        style="color: #8890b1" />
-                </ws-select>
-            </template>
-          </el-table-column>
-          <el-table-column prop="date" label="库存(吨)"></el-table-column>
-          <el-table-column prop="date" label="分配金额(元)">
-            <template slot-scope="scope">
-                <el-input placeholder="输入费用名称,1-15个字" class="input_css" v-model="scope.row.money"></el-input>
-            </template>
-          </el-table-column>
-          <el-table-column prop="address" label="操作" width="200">
-            <template slot-scope="scope">
-                <img class='add' @click='addlist()' src="../../../public/img/add.png" alt="">
-                <img class='del' @click='dellist(scope.row)' src="../../../public/img/del.png" alt="">
-            </template>
-          </el-table-column>
-        </el-table>
-
-      </div>
-      <div>
-      <el-button class="bg-bottom" type="primary" size="small" @click="returnsales()">驳回
+          </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-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()">驳回
         </el-button>
-        <el-button class="bg-bottom" type="primary" size="small" @click="returnsales()">通过
-        </el-button>
-    </div>
+        <el-button class="bg-bottom" type="primary" size="small" @click="submit()">确认收款
+        </el-button></div>
+        <el-dialog
+      title="驳回"
+      :visible.sync="rejectshow"
+      width="30%"
+      :before-close="handleClose">
+      <span>驳回原因</span>
+      <div><el-input
+  type="textarea"
+  :rows="2"
+  placeholder="请输入驳回原因"
+  v-model="textarea">
+</el-input>
+</div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="rejectclick">确 定</el-button>
+      </span>
+    </el-dialog>
+      </div>
     </div>
   </div>
 </template>
 <script>
-  import {} from '@/model/profitable/index'
+  import {lookexenseinfo,editexenseinfo} from '@/model/profitable/index'
+  import {woekflowhandle,} from '@/model/tasksport/index'
   export default {
     components: {},
     data() {
@@ -142,23 +99,11 @@
           name: "玉米",
           count: 2000,
         }],
-        mode:'全部分配',
-        ware:'指定仓库',
-        dates:'固定日期',
-        moneys:'按重量自动分配',
-        goods:'全部货品',
-        amount:0,
-        goodsList:[],
-        warecontractList:[],
-        feeDetailsDistributions:[{proDate:'',weight:'',money:'',warehouse:'',belonging:'',index:0}],
+        rejectshow:false,
         deptBudgetList:{},
         makeWordData: {},
-        warehouseList:[],
-        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:[],
+        textarea:'',
         valueData: [{
             date: 10
           },
@@ -170,191 +115,87 @@
       }
     },
     activated() {
-      this.makeWordData = this.getData(2)
-      this.initCharts()
-      this.getPassYearFormatDate()
       this.getList()
     },
     methods: {
-      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})
+      getList() {
+        lookexenseinfo({
+         id:this.$route.query.id
+        })
+        .toPromise()
+        .then((response) => {
+          this.deptBudgetList=response
+          this.srcList=response.addressUrl.split(',')
+        })
+
       },
-      dellist(row){
-          this.feeDetailsDistributions.splice(row.index,1)
+      returnsales(){
+        this.$router.go(-1)
       },
-      getList() {
-        // getceshi({
-        //  driverId:'8f1f3c624d7946d79a9d44a4057d969b'
+      submit(){
+          this.$confirm('确定提交确认收款信息?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          })
+          .then(() => {
+        this.deptBudgetList.flag=0
+        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.$router.go(-1)
+        }).catch((response) => {
+                this.$message({
+                  message: '确认失败!',
+                  type: 'success',
+                })
+              })
         // })
-        // .toPromise()
+        })
+      },
+      rejectclick(){
+        // woekflowhandle({
+        //   taskId: this.deptBudgetList.taskId,
+        //   approved: true,
+        //   auditMind: '34',
+        //   needReapply: false,
+        // }).toPromise()
         // .then((response) => {
-        // debugger
-        // console.log(response)
-        // })
-
+          this.deptBudgetList.flag=6
+          this.deptBudgetList.reason=this.testarea
+        editexenseinfo(this.deptBudgetList)
+        .toPromise()
+        .then((response) => {
+          this.$message({
+            message: '驳回成功!',
+            type: 'success',
+          })
+          this.$router.go(-1)
+        }).catch((response) => {
+          this.$message({
+            message: '驳回失败!',
+            type: 'success',
+          })
+        })
+      },
+      reject(){
+        this.rejectshow=true
       },
       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() {
-
-      },
-      initCharts() {
-        let app = this;
-        let myChart7 = app.$echarts.init(this.$refs.myEchart7);
-        var option;
-        option = {
-            // title: {
-            //   text: 'Rainfall vs Evaporation',
-            //   subtext: 'Fake Data'
-            // },
-            tooltip: {
-              trigger: 'axis'
-            },
-            legend: {
-              data: ['支出', '收入']
-            },
-            toolbox: {
-              show: true,
-              feature: {
-                dataView: {
-                  show: false,
-                  readOnly: false
-                },
-                magicType: {
-                  show: false,
-                  type: ['line', 'bar']
-                },
-                restore: {
-                  show: false
-                },
-                saveAsImage: {
-                  show: false
-                }
-              }
-            },
-            calculable: true,
-            xAxis: [{
-              name: '种类',
-              type: 'category',
-              // prettier-ignore
-              data: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct']
-            }],
-            yAxis: [{
-              name: '储量(吨)',
-              type: 'value'
-            }],
-            series: [{
-                name: '支出',
-                type: 'bar',
-                right: 0,
-                // label: {
-                //   show: true,
-                //   position: 'inside'
-                // },
-                 label: {
-                  show: true,
-                  precision: 1,
-                  position: 'top',
-                  valueAnimation: true,
-                  fontFamily: 'monospace'
-                },
-                data: [
-                  6.0, 60.9, 90.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0
-                ],
-                color: ['#5878E8 '],
-                formatter: '{value} 元',
-
-              },
-              {
-                name: '收入',
-                type: 'bar',
-                right: 20,
-                label: {
-                  show: true,
-                  precision: 1,
-                  position: 'top',
-                  valueAnimation: true,
-                  fontFamily: 'monospace'
-                },
-                data: [
-                  102.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8
-                ],
-                color: ['#FF9F24'],
-                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>
@@ -366,10 +207,10 @@
   .center {
     margin: 0 auto;
     background: #ffffff;
-    height: calc(100vh - 13vh);
     border-radius: 4px;
     margin-top: 10px;
-    overflow:scroll;
+    padding-top:30px;
+    overflow-y: scroll;
   }
 
   .row_top {
@@ -434,8 +275,9 @@
   }
   /deep/.el-form{
     width:90%;
-    margin:0 auto;
+    margin:10px auto;
   }
+  
   /deep/.el-form-item {
     width: 50%;
 }

+ 68 - 18
src/views/profitable/warehousecost.vue

@@ -12,12 +12,14 @@
     <div class="center">
       <el-row style='margin-bottom:10px;'>
         <el-col :span="12">
- <ws-select v-model="searchTypeText" placeholder="" class="typeselect" @change="selecttaskType"
-          :value="searchType">
-          <ws-option v-for="item in taskTypeList" :key="item.value" :label="item.value" :value="item.value"
+          <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.value" :label="item.value" :value="item.value"
             style="color: #8890b1" />
         </ws-select>
-            <el-input placeholder="可按合同名称、买方名称、卖方名称查找" class="input_css" v-model="searchKeyWord"></el-input>
+
         </el-col>
         <el-col :span="12">
           <div class="datascreen">
@@ -26,7 +28,7 @@
       </el-row>
       <el-row style='margin-bottom:10px;'>
         <el-col :span="18">
-        支出粮款:50000元   收入粮款:50000元    费用收入:100000元    费用支出:10000元    当期利润: 100000
+       支出粮款:{{foodExpenditure}}元   收入粮款:{{grainIncome}}元    费用收入:{{expenseIncome}}元    费用支出:{{expensesPay}}元    当期利润: {{currentProfit}}
         </el-col>
         <el-col :span="6">
 
@@ -40,12 +42,17 @@
               <span v-else>{{ scope.$index + 1 }}</span>
             </template>
           </el-table-column>
-          <el-table-column prop="reexType" label="类型"></el-table-column>
-          <el-table-column prop="reexType" label="费用名称"></el-table-column>
-          <el-table-column prop="createDate" label="所属库点"></el-table-column>
-          <el-table-column prop="amountMoney" label="费用金额"></el-table-column>
-          <el-table-column prop="expenseName" label="请款人/收款人"></el-table-column>
-          <el-table-column prop="expenseRemarks" label="日期"></el-table-column>
+           <el-table-column prop="feeType" label="类型">
+            <template slot-scope="scope">
+              <div v-if='scope.row.expensesType==1'>收入</div>
+              <div v-if='scope.row.expensesType==2'>支出</div>
+            </template>
+          </el-table-column>
+          <el-table-column prop="expensesName" label="费用名称"></el-table-column>
+          <el-table-column prop="warehouseName" label="所属库点"></el-table-column>
+          <el-table-column prop="expensesPrice" label="费用金额"></el-table-column>
+          <el-table-column prop="personName" label="请款人/收款人"></el-table-column>
+          <el-table-column prop="payDeadline" label="日期"></el-table-column>
         </el-table>
       </div>
       <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
@@ -64,7 +71,7 @@
     components: {},
     data() {
       return {
-        value: "",
+        value: [],
         tableData: [],
         deptBudgetTotal: 0,
         currentPage: 1,
@@ -72,15 +79,22 @@
         deptCircularPage: {},
         taskTypeList:[],
         warehouse:[],
+        warehouseName:'',
         searchType:"",
         searchKeyWord:"",
         startDate:"",
         endDate:"",
         outtotal:0,
         intotal:0,
+         foodExpenditure:0,
+        grainIncome:0,
+        expenseIncome:0,
+        expensesPay:0,
+        currentProfit:0,
       }
     },
     activated() {
+      this.warehouseName=this.$route.query.warehouseName
          this.getPassYearFormatDate()
       this.getList()
     },
@@ -89,6 +103,16 @@
         this.searchType = num
         this.getList()
       },
+      changeDate(){
+        if(this.value){
+          this.startDate = this.value[0]
+          this.endDate = this.value[1]
+        }
+        this.getList()
+      },
+      selectwarehouse(){
+        this.getList()
+      },
       getPassYearFormatDate () {
           var nowDate = new Date()
           var _date = new Date()
@@ -122,22 +146,48 @@
             this.warehouse = response
           
           })
-         getInOutDetailed({
+        //   getcontract({
+        // compId:localStorage.getItem('ws-pf_compId'),
+        // })
+        // .toPromise()
+        // .then((response) => {
+        //   this.contractList=response
+        // })
+         getcontractexpenseinfo({
             // warehouseType: 1,
             compId: localStorage.getItem('ws-pf_compId'),
             startDate:this.startDate,
             endDate:this.endDate,
-            searchKeyWord:this.searchKeyWord,
             currentPage: this.currentPage,
             pageSize:this.pageSize ,
-            searchType:this.searchType
+            costType:3
           })
           .toPromise()
           .then(response => {
             this.tableData = response.records
-            if(this.tableData.length > 0){
-              this.intotal = Number(this.tableData[0].inContractMoney) + Number(this.tableData[0].inWarehouseMoney) + Number(this.tableData[0].inManageMoney)
-            this.outtotal = Number(this.tableData[0].outContractMoney) + Number(this.tableData[0].outWarehouseMoney) + Number(this.tableData[0].outManageMoney)
+            if(this.tableData){
+              this.foodExpenditure=0
+              this.grainIncome=0
+              this.expenseIncome=0
+              this.expensesPay=0
+              this.currentProfit=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)
+                }
+              }
             }
             
            this.deptBudgetTotal = response.total

+ 41 - 7
src/views/profitable/warehouseinventory.vue

@@ -32,7 +32,7 @@
               <span v-else>{{ scope.$index + 1 }}</span>
             </template>
           </el-table-column>
-          <el-table-column prop="reexType" label="所属仓库"></el-table-column>
+          <el-table-column prop="warehouseName" label="所属仓库"></el-table-column>
           <el-table-column prop="createDate" label="所在仓库"></el-table-column>
           <el-table-column prop="amountMoney" label="货名"></el-table-column>
           <el-table-column prop="expenseName" label="剩余库存(吨)"></el-table-column>
@@ -47,8 +47,9 @@
   </div>
 </template>
 <script>
-  import {
-    getInOutDetailed
+    import {
+    getinventoryinfo,
+    getcontract
   } from '@/model/profitable/index'
   export default {
     components: {},
@@ -67,6 +68,11 @@
         endDate:"",
         outtotal:0,
         intotal:0,
+         foodExpenditure:0,
+        grainIncome:0,
+        expenseIncome:0,
+        expensesPay:0,
+        currentProfit:0,
       }
     },
     activated() {
@@ -106,7 +112,14 @@
           this.value=[this.startDate,this.endDate]
         },
       getList() {
-         getInOutDetailed({
+        getcontract({
+        compId:localStorage.getItem('ws-pf_compId'),
+        })
+        .toPromise()
+        .then((response) => {
+          this.contractList=response
+        })
+         getinventoryinfo({
             // warehouseType: 1,
             compId: localStorage.getItem('ws-pf_compId'),
             startDate:this.startDate,
@@ -114,14 +127,35 @@
             searchKeyWord:this.searchKeyWord,
             currentPage: this.currentPage,
             pageSize:this.pageSize ,
+            inventoryType:3,
             searchType:this.searchType
           })
           .toPromise()
           .then(response => {
             this.tableData = response.records
-            if(this.tableData.length > 0){
-              this.intotal = Number(this.tableData[0].inContractMoney) + Number(this.tableData[0].inWarehouseMoney) + Number(this.tableData[0].inManageMoney)
-            this.outtotal = Number(this.tableData[0].outContractMoney) + Number(this.tableData[0].outWarehouseMoney) + Number(this.tableData[0].outManageMoney)
+             if(this.tableData){
+              this.foodExpenditure=0
+              this.grainIncome=0
+              this.expenseIncome=0
+              this.expensesPay=0
+              this.currentProfit=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)
+                }
+              }
             }
             
            this.deptBudgetTotal = response.total

+ 14 - 17
src/views/profitable/warehouseprofitsdetails.vue

@@ -12,14 +12,14 @@
     <div class="center">
       <el-row style='margin-bottom:10px;'>
         <el-col :span="12">
-          <el-button style="margin-left:10px" @click="typeChange('')" type="primary">导出</el-button>
+          <!-- <el-button style="margin-left:10px" @click="typeChange('')" type="primary">导出</el-button> -->
         </el-col>
         <el-col :span="12">
           <div class="datascreen">
             <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-input placeholder="可按合同名称、买方名称、卖方名称查找" class="input_css" v-model="searchKeyWord"></el-input>
+            <el-input placeholder="可按仓库名称查找" class="input_css" v-model="searchKeyWord"></el-input>
             <el-button class="find" type="primary" @click="find()"><img width="16" height="16" style="left: -8px;"
                 src="../../../public/img/sousuo.png" alt="" /></el-button>
           </div>
@@ -37,12 +37,12 @@
               <span v-else>{{ scope.$index + 1 }}</span>
             </template>
           </el-table-column>
-          <el-table-column prop="reexType" label="仓库名"></el-table-column>
-          <el-table-column prop="createDate" label="收购量(吨)"></el-table-column>
-          <el-table-column prop="amountMoney" label="销量(吨)"></el-table-column>
-          <el-table-column prop="expenseName" label="销售额(万元)"></el-table-column>
-          <el-table-column prop="expenseRemarks" label="成本(万元)"></el-table-column>
-          <el-table-column prop="expenseRemarks" label="利润(万元)"></el-table-column>
+          <el-table-column prop="warehouseName" label="仓库名"></el-table-column>
+          <el-table-column prop="acquisitionWeight" label="收购量(吨)"></el-table-column>
+          <el-table-column prop="saleWeight" label="销量(吨)"></el-table-column>
+          <el-table-column prop="salesVolume" label="销售额(万元)"></el-table-column>
+          <el-table-column prop="cost" label="成本(万元)"></el-table-column>
+          <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>
@@ -60,7 +60,7 @@
 </template>
 <script>
   import {
-    getInOutDetailed,
+    getwarehousedetails,
     getwarehouse
   } from '@/model/profitable/index'
   export default {
@@ -91,8 +91,11 @@
         this.searchType = num
         this.getList()
       },
-      inventory(){
-        this.$router.push({name:'contractinventory'})
+      inventory(row){
+        this.$router.push({name:'warehouseinventory',query:{warehouseName:row.warehouseName}})
+      },
+      cost(){
+        this.$router.push({name:'warehousecost',query:{warehouseName:row.warehouseName}})
       },
       getPassYearFormatDate () {
           var nowDate = new Date()
@@ -131,16 +134,10 @@
             searchKeyWord:this.searchKeyWord,
             currentPage: this.currentPage,
             pageSize:this.pageSize ,
-            searchType:this.searchType
           })
           .toPromise()
           .then(response => {
             this.tableData = response.records
-            if(this.tableData.length > 0){
-              this.intotal = Number(this.tableData[0].inContractMoney) + Number(this.tableData[0].inWarehouseMoney) + Number(this.tableData[0].inManageMoney)
-            this.outtotal = Number(this.tableData[0].outContractMoney) + Number(this.tableData[0].outWarehouseMoney) + Number(this.tableData[0].outManageMoney)
-            }
-            
            this.deptBudgetTotal = response.total
           })
       },

+ 72 - 154
src/views/taskManagement/outsupplyofgoods.vue

@@ -22,7 +22,7 @@
           </div>
       </template>
       <template slot="right">
-        <ws-input @keyup.enter.native="find()" class='findValue' v-model="searchKeyWord" placeholder="可按合同编号或任务编号查找" clearable maxlength="300" type="input"></ws-input>
+        <ws-input @keyup.enter.native="find()" class='findValue' v-model="searchKeyWord" placeholder="可按车牌号查找" clearable maxlength="300" type="input"></ws-input>
         <ws-button class="find" type="primary" @click="lookUp()">
           <img width="16" height="16" style="
               vertical-align: text-top;
@@ -34,17 +34,17 @@
       </template>
     </BaseHeaderLayout>
     <el-row style='margin:10px;'>
-        <el-col :span="12">已选 10 条,合计出库重量  100吨,玉米(潮粮)50吨,玉米(机收)20吨,玉米 30吨</el-col>
+        <el-col :span="12">已选 10 条,合计出库重量  {{num}}吨,</el-col>
         <el-col style='text-align:right;' :span="12">
-             <ws-button type="primary" @click="handleAdd()" v-hasPermission="
+            <ws-button type="primary" @click="preview()" v-hasPermission="
             `warehouseManagement.warehouse.warehouseInfoTask.add`
           ">预览
         </ws-button>
-         <ws-button type="primary" @click="handleAdd()" v-hasPermission="
+         <ws-button type="primary" @click="cancelpreview()" v-hasPermission="
             `warehouseManagement.warehouse.warehouseInfoTask.add`
           ">取消预览
         </ws-button>
-         <ws-button type="primary" @click="handleAdd()" v-hasPermission="
+         <ws-button type="primary" @click="submit()" v-hasPermission="
             `warehouseManagement.warehouse.warehouseInfoTask.add`
           ">提交
         </ws-button>
@@ -117,6 +117,7 @@
         // 年
         year: '',
         gainList: [],
+        num:0,
         currentPage: 1,
         primary: '1',
                 pickerOptions: {
@@ -169,70 +170,7 @@
         searchTypeText: '待审核',
         searchKeyWord: '',
         inOutType:'',
-        inOutTypeList:[
-          {
-            value: '销售出库',
-            type: 1
-          },
-          {
-            value: '移库出库',
-            type: 3
-          },
-          {
-            value: '暂存出库',
-            type: 2
-          },
-          {
-            value: '贸易服务出库',
-            type: 4
-          },
-          {
-            value: '采购出库',
-            type: 5
-          },
-          {
-            value: '采购入库',
-            type: 6
-          },
-          {
-            value: '移库入库',
-            type: 7
-          },
-          {
-            value: '暂存入库',
-            type: 8
-          },
-          {
-            value: '贸易服务入库',
-            type: 9
-          },
-          {
-            value: '退库',
-            type: 10
-          },
-        ],
         contractType: 2,
-        taskTypeList: [{
-            value: '待审核',
-            type: 1
-          },
-          {
-            value: '执行中',
-            type: 3
-          },
-          {
-            value: '已驳回',
-            type: 2
-          },
-          {
-            value: '已完成',
-            type: 4
-          },
-          {
-            value: '全部任务',
-            type: ''
-          },
-        ],
         // 提交类型
         submitType: true,
         size: 10,
@@ -261,8 +199,19 @@
     methods: {
       selectinOutType(){
         this.getList()
+      },
+      preview(){
+        this.gainList=this.multipleSelection
+         this.deptBudgetTotal=this.multipleSelection.length
+      },
+      cancelpreview(){
+        this.getList()
       },
        handleSelectionChange(val) {
+         this.num=0
+         for (let i = 0; i < val.length; i++) {
+          this.num+=val[i].outWeight;
+         }
         this.multipleSelection = val;
       },
       //添加
@@ -276,38 +225,7 @@
         this.currentPage = 1
         this.getList()
       },
-      deleteclick(row) {
-        var text = ''
-        if (
-          (row.taskTypeKey == 3 && row.inOutType == '移库出库') ||
-          (row.taskTypeKey == 4 && row.inOutType == '销售出库') ||
-          (row.taskTypeKey == 4 && row.inOutType == '退库')
-        ) {
-          text = '相同任务编号的任务将一并删除且不可恢复,是否确定删除?'
-        } else {
-          text = `任务删除后不可恢复,是否确定删除?`
-        }
-        //cancelButtonClass: "btn-custom-cancel"
-        this.$confirm(text, {
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'warning',
-          })
-          .then(() => {
-            outdelete({
-                id: row.id,
-                relevanceId: row.relevanceId,
-                inOutFlag: row.inOutFlag,
-              })
-              .toPromise()
-              .then((response) => {
-                this.getList()
-              })
-          })
-          .catch(() => {
-            return false
-          })
-      },
+
       getList() {
         getoreditoutput({
             compId: localStorage.getItem('ws-pf_compId'),
@@ -325,27 +243,6 @@
             this.deptBudgetTotal = response.total
           })
       },
-      //编辑
-      delivery(item) {
-        this.$router.push({
-          path: 'tranManagementWarehouseInOuttaskedit',
-          query: {
-            relevanceId: item.relevanceId,
-            inOutFlag: item.inOutFlag
-          },
-        })
-      },
-      audit(item) {
-        this.$router.push({
-          path: 'tranManagementWarehouseInOuttaskaudit',
-          query: {
-            relevanceId: item.relevanceId,
-            taskId: item.taskId,
-            businessKey: item.id,
-            workflowId: item.workflowId,
-          },
-        })
-      },
       getSpanArr(data) {
         let that = this
 
@@ -387,6 +284,59 @@
             workflowId: row.workflowId,
           },
         })
+      },
+       submit(){
+         for (let i = 0; i < this.multipleSelection.length; i++) {
+          if(!this.multipleSelection[i].outWeight){
+              this.$message({
+              message: '预计出库重量不能为空',
+              type: 'error'
+              });
+              return
+
+          }
+          if(this.multipleSelection[i].outWeight>this.multipleSelection[i].surplusWeight){
+            this.$message({
+              message: '预计出库重量不能超过剩余重量',
+              type: 'error'
+              });
+              return
+          }   
+          if(this.multipleSelection[i].outWeight.indexOf('.')!=-1&&this.multipleSelection[i].outWeight.substring(this.multipleSelection[i].outWeight.indexOf('.')+1, this.multipleSelection[i].outWeight.length).length>3){
+            this.$message({
+              message: '预计出库重量输入错误',
+              type: 'error'
+              });
+              return
+          }
+          
+        }
+        var that=this
+        this.$confirm(`确定提交货源信息?`, {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
+          })
+          .then(() => {
+        editSourceOfGoods({orderList:this.multipleSelection,taskFlag:0}).toPromise()
+          .then((response) => {
+            this.$message({
+					message: '提交成功',
+					type: 'success'
+					});
+            localStorage.setItem("supplygoods",JSON.stringify(this.multipleSelection));
+            that.$router.go(-1)
+          }).catch((response) => {
+             this.$message({
+              message: '提交失败',
+              type: 'error'
+              }); 
+                // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+              })
+          })
+      },
+      returnsales(){
+        this.$router.go(-1)
       },
       dateFormat(fmt, date) {
         let ret
@@ -423,39 +373,7 @@
         console.log(`当前页: ${val}`)
         this.getList()
       },
-      editClick(row) {
-        var status = ''
-        if (row.taskStatus == '待审核' || row.taskStatus == '已完成') {
-          status = '执行中'
-        } else if (row.taskStatus == '执行中') {
-          status = '已完成'
-        }
-        //cancelButtonClass: "btn-custom-cancel"
-        this.$confirm(`是否将状态改为${status}`, {
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'warning',
-          })
-          .then(() => {
-            movestates({
-                id: row.id
-              })
-              .toPromise()
-              .then((response) => {
-                this.$notify.success({
-                  title: '成功',
-                  message: '状态修改成功',
-                })
-                this.getList()
-              })
-              .catch((response) => {
-                // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
-              })
-          })
-          .catch(() => {
-            return false
-          })
-      },
+     
       selecttaskType(e) {
         for (var i = 0; i < this.taskTypeList.length; i++) {
           if (this.taskTypeList[i].value == e) {

+ 48 - 154
src/views/taskManagement/outsupplyofgoodsedit.vue

@@ -22,7 +22,7 @@
           </div>
       </template>
       <template slot="right">
-        <ws-input @keyup.enter.native="find()" class='findValue' v-model="searchKeyWord" placeholder="可按合同编号或任务编号查找" clearable maxlength="300" type="input"></ws-input>
+        <ws-input @keyup.enter.native="find()" class='findValue' v-model="searchKeyWord" placeholder="可按车牌号查找" clearable maxlength="300" type="input"></ws-input>
         <ws-button class="find" type="primary" @click="lookUp()">
           <img width="16" height="16" style="
               vertical-align: text-top;
@@ -34,17 +34,17 @@
       </template>
     </BaseHeaderLayout>
     <el-row style='margin:10px;'>
-        <el-col :span="12">已选 10 条,合计出库重量  100吨,玉米(潮粮)50吨,玉米(机收)20吨,玉米 30吨</el-col>
+        <el-col :span="12">已选 10 条,合计出库重量  {{num}}吨,</el-col>
         <el-col style='text-align:right;' :span="12">
-             <ws-button type="primary" @click="handleAdd()" v-hasPermission="
+            <ws-button type="primary" @click="preview()" v-hasPermission="
             `warehouseManagement.warehouse.warehouseInfoTask.add`
           ">预览
         </ws-button>
-         <ws-button type="primary" @click="handleAdd()" v-hasPermission="
+         <ws-button type="primary" @click="cancelpreview()" v-hasPermission="
             `warehouseManagement.warehouse.warehouseInfoTask.add`
           ">取消预览
         </ws-button>
-         <ws-button type="primary" @click="handleAdd()" v-hasPermission="
+         <ws-button type="primary" @click="submit()" v-hasPermission="
             `warehouseManagement.warehouse.warehouseInfoTask.add`
           ">提交
         </ws-button>
@@ -117,6 +117,7 @@
         // 年
         year: '',
         gainList: [],
+        num:0,
         currentPage: 1,
         primary: '1',
                 pickerOptions: {
@@ -169,70 +170,7 @@
         searchTypeText: '待审核',
         searchKeyWord: '',
         inOutType:'',
-        inOutTypeList:[
-          {
-            value: '销售出库',
-            type: 1
-          },
-          {
-            value: '移库出库',
-            type: 3
-          },
-          {
-            value: '暂存出库',
-            type: 2
-          },
-          {
-            value: '贸易服务出库',
-            type: 4
-          },
-          {
-            value: '采购出库',
-            type: 5
-          },
-          {
-            value: '采购入库',
-            type: 6
-          },
-          {
-            value: '移库入库',
-            type: 7
-          },
-          {
-            value: '暂存入库',
-            type: 8
-          },
-          {
-            value: '贸易服务入库',
-            type: 9
-          },
-          {
-            value: '退库',
-            type: 10
-          },
-        ],
         contractType: 2,
-        taskTypeList: [{
-            value: '待审核',
-            type: 1
-          },
-          {
-            value: '执行中',
-            type: 3
-          },
-          {
-            value: '已驳回',
-            type: 2
-          },
-          {
-            value: '已完成',
-            type: 4
-          },
-          {
-            value: '全部任务',
-            type: ''
-          },
-        ],
         // 提交类型
         submitType: true,
         size: 10,
@@ -261,8 +199,19 @@
     methods: {
       selectinOutType(){
         this.getList()
+      },
+      preview(){
+        this.gainList=this.multipleSelection
+         this.deptBudgetTotal=this.multipleSelection.length
+      },
+      cancelpreview(){
+        this.getList()
       },
        handleSelectionChange(val) {
+         this.num=0
+         for (let i = 0; i < val.length; i++) {
+          this.num+=val[i].outWeight;
+         }
         this.multipleSelection = val;
       },
       //添加
@@ -276,38 +225,7 @@
         this.currentPage = 1
         this.getList()
       },
-      deleteclick(row) {
-        var text = ''
-        if (
-          (row.taskTypeKey == 3 && row.inOutType == '移库出库') ||
-          (row.taskTypeKey == 4 && row.inOutType == '销售出库') ||
-          (row.taskTypeKey == 4 && row.inOutType == '退库')
-        ) {
-          text = '相同任务编号的任务将一并删除且不可恢复,是否确定删除?'
-        } else {
-          text = `任务删除后不可恢复,是否确定删除?`
-        }
-        //cancelButtonClass: "btn-custom-cancel"
-        this.$confirm(text, {
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'warning',
-          })
-          .then(() => {
-            outdelete({
-                id: row.id,
-                relevanceId: row.relevanceId,
-                inOutFlag: row.inOutFlag,
-              })
-              .toPromise()
-              .then((response) => {
-                this.getList()
-              })
-          })
-          .catch(() => {
-            return false
-          })
-      },
+
       getList() {
         getoreditoutput({
             compId: localStorage.getItem('ws-pf_compId'),
@@ -325,27 +243,6 @@
             this.deptBudgetTotal = response.total
           })
       },
-      //编辑
-      delivery(item) {
-        this.$router.push({
-          path: 'tranManagementWarehouseInOuttaskedit',
-          query: {
-            relevanceId: item.relevanceId,
-            inOutFlag: item.inOutFlag
-          },
-        })
-      },
-      audit(item) {
-        this.$router.push({
-          path: 'tranManagementWarehouseInOuttaskaudit',
-          query: {
-            relevanceId: item.relevanceId,
-            taskId: item.taskId,
-            businessKey: item.id,
-            workflowId: item.workflowId,
-          },
-        })
-      },
       getSpanArr(data) {
         let that = this
 
@@ -387,6 +284,35 @@
             workflowId: row.workflowId,
           },
         })
+      },
+       submit(){
+  
+        var that=this
+        this.$confirm(`确定提交货源信息?`, {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
+          })
+          .then(() => {
+        editSourceOfGoods({orderList:this.multipleSelection,taskFlag:1}).toPromise()
+          .then((response) => {
+            this.$message({
+					message: '提交成功',
+					type: 'success'
+					});
+            localStorage.setItem("supplygoods",JSON.stringify(this.multipleSelection));
+            that.$router.go(-1)
+          }).catch((response) => {
+             this.$message({
+              message: '提交失败',
+              type: 'error'
+              }); 
+                // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+              })
+          })
+      },
+      returnsales(){
+        this.$router.go(-1)
       },
       dateFormat(fmt, date) {
         let ret
@@ -423,39 +349,7 @@
         console.log(`当前页: ${val}`)
         this.getList()
       },
-      editClick(row) {
-        var status = ''
-        if (row.taskStatus == '待审核' || row.taskStatus == '已完成') {
-          status = '执行中'
-        } else if (row.taskStatus == '执行中') {
-          status = '已完成'
-        }
-        //cancelButtonClass: "btn-custom-cancel"
-        this.$confirm(`是否将状态改为${status}`, {
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'warning',
-          })
-          .then(() => {
-            movestates({
-                id: row.id
-              })
-              .toPromise()
-              .then((response) => {
-                this.$notify.success({
-                  title: '成功',
-                  message: '状态修改成功',
-                })
-                this.getList()
-              })
-              .catch((response) => {
-                // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
-              })
-          })
-          .catch(() => {
-            return false
-          })
-      },
+     
       selecttaskType(e) {
         for (var i = 0; i < this.taskTypeList.length; i++) {
           if (this.taskTypeList[i].value == e) {

+ 4 - 4
src/views/taskManagement/outsupplyofgoodslook.vue

@@ -28,12 +28,12 @@
             <span v-else>{{ scope.$index + 1 }}</span>
           </template>
         </el-table-column>
-        <el-table-column prop="inOutTaskNo" label="车牌号" width="160"></el-table-column>
-        <el-table-column prop="contractNo" label="出库时间" width="160">
+        <el-table-column prop="carNo" label="车牌号" width="160"></el-table-column>
+        <el-table-column prop="inOutDate" label="出库时间" width="160">
         </el-table-column>
         <el-table-column prop="warehouseName" class="table_td" label="净重(吨)"></el-table-column>
-        <el-table-column prop="inOutType" class="table_td" label="出货库"></el-table-column>
-        <el-table-column prop="goodsName" class="table_td" label="货源"></el-table-column>
+        <el-table-column prop="deliverywarehouse" class="table_td" label="出货库"></el-table-column>
+        <el-table-column prop="goodsSource" class="table_td" label="货源"></el-table-column>
       </el-table>
       <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
         :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="deptBudgetTotal"></el-pagination>

+ 78 - 188
src/views/taskManagement/supplyofgoods.vue

@@ -20,11 +20,11 @@
         </el-date-picker>
   
           </div>
-        <ws-button type="primary" @click="handleAdd()" v-hasPermission="
+        <ws-button type="primary" @click="getList()" v-hasPermission="
             `warehouseManagement.warehouse.warehouseInfoTask.add`
           ">按日期排序
         </ws-button>
-        <ws-button type="primary" @click="handleAdd()" v-hasPermission="
+        <ws-button type="primary" @click="costsort()" v-hasPermission="
             `warehouseManagement.warehouse.warehouseInfoTask.add`
           ">按成本排序
         </ws-button>
@@ -42,23 +42,23 @@
       </template>
     </BaseHeaderLayout>
     <el-row style='margin:10px;'>
-        <el-col :span="12">已选 10 条,合计出库重量  100吨,玉米(潮粮)50吨,玉米(机收)20吨,玉米 30吨</el-col>
+        <el-col :span="12">已选 {{this.multipleSelection.length}} 条,合计出库重量  {{num}}吨,{{content}}</el-col>
         <el-col style='text-align:right;' :span="12">
-             <ws-button type="primary" @click="handleAdd()" v-hasPermission="
+             <ws-button type="primary" @click="preview()" v-hasPermission="
             `warehouseManagement.warehouse.warehouseInfoTask.add`
           ">预览
         </ws-button>
-         <ws-button type="primary" @click="handleAdd()" v-hasPermission="
+         <ws-button type="primary" @click="cancelpreview()" v-hasPermission="
             `warehouseManagement.warehouse.warehouseInfoTask.add`
           ">取消预览
         </ws-button>
-         <ws-button type="primary" @click="handleAdd()" v-hasPermission="
+         <ws-button type="primary" @click="submit()" v-hasPermission="
             `warehouseManagement.warehouse.warehouseInfoTask.add`
           ">提交
         </ws-button>
         </el-col>
     </el-row>   
-      <el-table class="wenzi" :data="gainList.records" style="width: 100%"  @selection-change="handleSelectionChange" height="calc(100% - 110px)">
+      <el-table class="wenzi" :data="gainList" style="width: 100%"  @selection-change="handleSelectionChange" height="calc(100% - 110px)">
           <el-table-column
       type="selection"
       width="55">
@@ -69,15 +69,15 @@
             <span v-else>{{ scope.$index + 1 }}</span>
           </template>
         </el-table-column>
-        <el-table-column prop="inOutTaskNo" label="货源" width="160"></el-table-column>
-        <el-table-column prop="contractNo" label="货名" width="160">
+        <el-table-column prop="goodsSource" label="货源" width="160"></el-table-column>
+        <el-table-column prop="goodsName" label="货名" width="160">
         </el-table-column>
-        <el-table-column prop="warehouseName" class="table_td" label="剩余重量(吨)"></el-table-column>
-        <el-table-column prop="inOutType" class="table_td" label="平均成本(吨)"></el-table-column>
+        <el-table-column prop="surplusWeight" class="table_td" label="剩余重量(吨)"></el-table-column>
+        <el-table-column prop="avgCost" class="table_td" label="平均成本(吨)"></el-table-column>
         <el-table-column prop="goodsName" class="table_td" label="入库单日期"></el-table-column>
-        <el-table-column prop="weight" class="table_td" label="预计出库重量(吨)">
+        <el-table-column prop="outWeight" class="table_td" label="预计出库重量(吨)">
             <template slot-scope="scope">
-                <el-input v-model="input" placeholder="输入本次出库重量"></el-input>
+                <el-input v-model="scope.row.outWeight" placeholder="输入本次出库重量"></el-input>
             </template>
         </el-table-column>
       </el-table>
@@ -87,13 +87,15 @@
 </template>
 <script>
   import {
-    getoreditoutput,
-    outdelete,
-    movestates
+    editSourceOfGoods
   } from '@/model/tasksport/index'
   import {
     downloadFile
   } from '@/utils/batchDown'
+   import {
+  getwarehousingorder,
+  paymoney
+} from '@/model/warehouse/index'
   import Pagination from '@/components/Pagination'
   import WsUpload from '@/components/WsUpload'
   import {
@@ -130,6 +132,7 @@
         // 年
         year: '',
         gainList: [],
+        gainList1:[],
         currentPage: 1,
         primary: '1',
                 pickerOptions: {
@@ -180,77 +183,18 @@
         pageSize: 10,
         searchType: 1,
         searchTypeText: '待审核',
+        multipleSelection:[],
         searchKeyWord: '',
         inOutType:'',
-        inOutTypeList:[
-          {
-            value: '销售出库',
-            type: 1
-          },
-          {
-            value: '移库出库',
-            type: 3
-          },
-          {
-            value: '暂存出库',
-            type: 2
-          },
-          {
-            value: '贸易服务出库',
-            type: 4
-          },
-          {
-            value: '采购出库',
-            type: 5
-          },
-          {
-            value: '采购入库',
-            type: 6
-          },
-          {
-            value: '移库入库',
-            type: 7
-          },
-          {
-            value: '暂存入库',
-            type: 8
-          },
-          {
-            value: '贸易服务入库',
-            type: 9
-          },
-          {
-            value: '退库',
-            type: 10
-          },
-        ],
+        num:0,
+        content:'',
         contractType: 2,
-        taskTypeList: [{
-            value: '待审核',
-            type: 1
-          },
-          {
-            value: '执行中',
-            type: 3
-          },
-          {
-            value: '已驳回',
-            type: 2
-          },
-          {
-            value: '已完成',
-            type: 4
-          },
-          {
-            value: '全部任务',
-            type: ''
-          },
-        ],
         // 提交类型
         submitType: true,
         size: 10,
         spanArr: [],
         warehouseName: '',
+        baseId:'',
         deptBudgetTotal: 0,
         compId: localStorage.getItem('ws-pf_compId'),
         deptCircularPage: {},
@@ -263,19 +207,33 @@
         accessoryTFs: false,
       }
     },
-    activated() {
-      this.getList()
-      this.showType = this.isShow
-    },
+    // activated(//) {
+      // this.getList()
+      // this.showType = this.isShow
+    // },
     mounted() {
+      this.baseId=this.$route.query.baseId
       this.getList()
       this.showType = this.isShow
     },
     methods: {
       selectinOutType(){
         this.getList()
+      },
+      preview(){
+        this.gainList=this.multipleSelection
+         this.deptBudgetTotal=this.multipleSelection.length
+      },
+      cancelpreview(){
+        this.getList()
       },
        handleSelectionChange(val) {
+         this.num=0
+         this.content=''
+         for (let i = 0; i < val.length; i++) {
+          this.num+=val[i].outWeight;
+          this.content=this.content?this.content:''+val[i].goodsName+val[i].outWeight+','
+         }
         this.multipleSelection = val;
       },
       //添加
@@ -289,75 +247,58 @@
         this.currentPage = 1
         this.getList()
       },
-      deleteclick(row) {
-        var text = ''
-        if (
-          (row.taskTypeKey == 3 && row.inOutType == '移库出库') ||
-          (row.taskTypeKey == 4 && row.inOutType == '销售出库') ||
-          (row.taskTypeKey == 4 && row.inOutType == '退库')
-        ) {
-          text = '相同任务编号的任务将一并删除且不可恢复,是否确定删除?'
-        } else {
-          text = `任务删除后不可恢复,是否确定删除?`
-        }
-        //cancelButtonClass: "btn-custom-cancel"
-        this.$confirm(text, {
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'warning',
-          })
-          .then(() => {
-            outdelete({
-                id: row.id,
-                relevanceId: row.relevanceId,
-                inOutFlag: row.inOutFlag,
-              })
-              .toPromise()
-              .then((response) => {
-                this.getList()
-              })
-          })
-          .catch(() => {
-            return false
+      costsort(){
+          this.gainList.sort(function(a,b){
+              var x = a['avgCost'];
+              var y = b[avgCost];
+              return ((y<x)?-1:(x>y)?1:0)   //从小到大排序
           })
+      
       },
+      
       getList() {
-        getoreditoutput({
+         getwarehousingorder({
             compId: localStorage.getItem('ws-pf_compId'),
             currentPage: this.currentPage,
             pageSize: this.pageSize,
             searchType: this.searchType,
             searchKeyWord: this.searchKeyWord,
-            inOutType:this.inOutType
+            inOutType:this.inOutType,
+            baseId:this.baseId
           })
           .toPromise()
           .then((response) => {
-            this.gainList = response
-            this.currentPage = response.current
-            this.pageSize = response.size
+            this.gainList = response.records
             this.deptBudgetTotal = response.total
           })
       },
-      //编辑
-      delivery(item) {
-        this.$router.push({
-          path: 'tranManagementWarehouseInOuttaskedit',
-          query: {
-            relevanceId: item.relevanceId,
-            inOutFlag: item.inOutFlag
-          },
-        })
+      submit(){
+        var that=this
+        this.$confirm(`确定提交货源信息?`, {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
+          })
+          .then(() => {
+        editSourceOfGoods({orderList:this.multipleSelection,taskFlag:0}).toPromise()
+          .then((response) => {
+            this.$message({
+					message: '提交成功',
+					type: 'success'
+					});
+            localStorage.setItem("supplygoods",JSON.stringify(this.multipleSelection));
+            that.$router.go(-1)
+          }).catch((response) => {
+             this.$message({
+              message: '提交失败',
+              type: 'error'
+              }); 
+                // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+              })
+          })
       },
-      audit(item) {
-        this.$router.push({
-          path: 'tranManagementWarehouseInOuttaskaudit',
-          query: {
-            relevanceId: item.relevanceId,
-            taskId: item.taskId,
-            businessKey: item.id,
-            workflowId: item.workflowId,
-          },
-        })
+      returnsales(){
+        this.$router.go(-1)
       },
       getSpanArr(data) {
         let that = this
@@ -436,48 +377,6 @@
         console.log(`当前页: ${val}`)
         this.getList()
       },
-      editClick(row) {
-        var status = ''
-        if (row.taskStatus == '待审核' || row.taskStatus == '已完成') {
-          status = '执行中'
-        } else if (row.taskStatus == '执行中') {
-          status = '已完成'
-        }
-        //cancelButtonClass: "btn-custom-cancel"
-        this.$confirm(`是否将状态改为${status}`, {
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'warning',
-          })
-          .then(() => {
-            movestates({
-                id: row.id
-              })
-              .toPromise()
-              .then((response) => {
-                this.$notify.success({
-                  title: '成功',
-                  message: '状态修改成功',
-                })
-                this.getList()
-              })
-              .catch((response) => {
-                // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
-              })
-          })
-          .catch(() => {
-            return false
-          })
-      },
-      selecttaskType(e) {
-        for (var i = 0; i < this.taskTypeList.length; i++) {
-          if (this.taskTypeList[i].value == e) {
-            this.searchType = this.taskTypeList[i].type
-          }
-        }
-        this.currentPage = 1,
-          this.getList()
-      },
       handleExamine(row) {
         this.$router.push({
           name: 'salesContractExamine',
@@ -490,15 +389,6 @@
       handleCloe() {
         this.dialogViewSpareMoney = false
       },
-      history(row) {
-        billoperatehis({
-            id: row.id
-          })
-          .toPromise()
-          .then((response) => {
-            this.historyList = response
-          })
-      },
       find() {
         this.currentPage = 1
         this.getList()

+ 103 - 188
src/views/taskManagement/supplyofgoodsedit.vue

@@ -20,11 +20,11 @@
         </el-date-picker>
   
           </div>
-        <ws-button type="primary" @click="handleAdd()" v-hasPermission="
+        <ws-button type="primary" @click="getList()" v-hasPermission="
             `warehouseManagement.warehouse.warehouseInfoTask.add`
           ">按日期排序
         </ws-button>
-        <ws-button type="primary" @click="handleAdd()" v-hasPermission="
+        <ws-button type="primary" @click="costsort()" v-hasPermission="
             `warehouseManagement.warehouse.warehouseInfoTask.add`
           ">按成本排序
         </ws-button>
@@ -42,23 +42,23 @@
       </template>
     </BaseHeaderLayout>
     <el-row style='margin:10px;'>
-        <el-col :span="12">已选 10 条,合计出库重量  100吨,玉米(潮粮)50吨,玉米(机收)20吨,玉米 30吨</el-col>
+        <el-col :span="12">已选 {{this.multipleSelection.length}} 条,合计出库重量  {{num}}吨,{{content}}</el-col>
         <el-col style='text-align:right;' :span="12">
-             <ws-button type="primary" @click="handleAdd()" v-hasPermission="
+             <ws-button type="primary" @click="preview()" v-hasPermission="
             `warehouseManagement.warehouse.warehouseInfoTask.add`
           ">预览
         </ws-button>
-         <ws-button type="primary" @click="handleAdd()" v-hasPermission="
+         <ws-button type="primary" @click="cancelpreview()" v-hasPermission="
             `warehouseManagement.warehouse.warehouseInfoTask.add`
           ">取消预览
         </ws-button>
-         <ws-button type="primary" @click="handleAdd()" v-hasPermission="
+         <ws-button type="primary" @click="submit()" v-hasPermission="
             `warehouseManagement.warehouse.warehouseInfoTask.add`
           ">提交
         </ws-button>
         </el-col>
     </el-row>   
-      <el-table class="wenzi" :data="gainList.records" style="width: 100%"  @selection-change="handleSelectionChange" height="calc(100% - 110px)">
+      <el-table class="wenzi" :data="gainList" style="width: 100%"  @selection-change="handleSelectionChange" height="calc(100% - 110px)">
           <el-table-column
       type="selection"
       width="55">
@@ -69,15 +69,15 @@
             <span v-else>{{ scope.$index + 1 }}</span>
           </template>
         </el-table-column>
-        <el-table-column prop="inOutTaskNo" label="货源" width="160"></el-table-column>
-        <el-table-column prop="contractNo" label="货名" width="160">
+        <el-table-column prop="goodsSource" label="货源" width="160"></el-table-column>
+        <el-table-column prop="goodsName" label="货名" width="160">
         </el-table-column>
-        <el-table-column prop="warehouseName" class="table_td" label="剩余重量(吨)"></el-table-column>
-        <el-table-column prop="inOutType" class="table_td" label="平均成本(吨)"></el-table-column>
+        <el-table-column prop="surplusWeight" class="table_td" label="剩余重量(吨)"></el-table-column>
+        <el-table-column prop="avgCost" class="table_td" label="平均成本(吨)"></el-table-column>
         <el-table-column prop="goodsName" class="table_td" label="入库单日期"></el-table-column>
-        <el-table-column prop="weight" class="table_td" label="预计出库重量(吨)">
+        <el-table-column prop="outWeight" class="table_td" label="预计出库重量(吨)">
             <template slot-scope="scope">
-                <el-input v-model="input" placeholder="输入本次出库重量"></el-input>
+                <el-input v-model="scope.row.outWeight" placeholder="输入本次出库重量"></el-input>
             </template>
         </el-table-column>
       </el-table>
@@ -87,13 +87,15 @@
 </template>
 <script>
   import {
-    getoreditoutput,
-    outdelete,
-    movestates
+    editSourceOfGoods
   } from '@/model/tasksport/index'
   import {
     downloadFile
   } from '@/utils/batchDown'
+   import {
+  getwarehousingorder,
+  paymoney
+} from '@/model/warehouse/index'
   import Pagination from '@/components/Pagination'
   import WsUpload from '@/components/WsUpload'
   import {
@@ -130,6 +132,7 @@
         // 年
         year: '',
         gainList: [],
+        gainList1:[],
         currentPage: 1,
         primary: '1',
                 pickerOptions: {
@@ -180,77 +183,18 @@
         pageSize: 10,
         searchType: 1,
         searchTypeText: '待审核',
+        multipleSelection:[],
         searchKeyWord: '',
         inOutType:'',
-        inOutTypeList:[
-          {
-            value: '销售出库',
-            type: 1
-          },
-          {
-            value: '移库出库',
-            type: 3
-          },
-          {
-            value: '暂存出库',
-            type: 2
-          },
-          {
-            value: '贸易服务出库',
-            type: 4
-          },
-          {
-            value: '采购出库',
-            type: 5
-          },
-          {
-            value: '采购入库',
-            type: 6
-          },
-          {
-            value: '移库入库',
-            type: 7
-          },
-          {
-            value: '暂存入库',
-            type: 8
-          },
-          {
-            value: '贸易服务入库',
-            type: 9
-          },
-          {
-            value: '退库',
-            type: 10
-          },
-        ],
+        num:0,
+        content:'',
         contractType: 2,
-        taskTypeList: [{
-            value: '待审核',
-            type: 1
-          },
-          {
-            value: '执行中',
-            type: 3
-          },
-          {
-            value: '已驳回',
-            type: 2
-          },
-          {
-            value: '已完成',
-            type: 4
-          },
-          {
-            value: '全部任务',
-            type: ''
-          },
-        ],
         // 提交类型
         submitType: true,
         size: 10,
         spanArr: [],
         warehouseName: '',
+        baseId:'',
         deptBudgetTotal: 0,
         compId: localStorage.getItem('ws-pf_compId'),
         deptCircularPage: {},
@@ -263,19 +207,33 @@
         accessoryTFs: false,
       }
     },
-    activated() {
-      this.getList()
-      this.showType = this.isShow
-    },
+    // activated(//) {
+      // this.getList()
+      // this.showType = this.isShow
+    // },
     mounted() {
+      this.baseId=this.$route.query.baseId
       this.getList()
       this.showType = this.isShow
     },
     methods: {
       selectinOutType(){
         this.getList()
+      },
+      preview(){
+        this.gainList=this.multipleSelection
+         this.deptBudgetTotal=this.multipleSelection.length
+      },
+      cancelpreview(){
+        this.getList()
       },
        handleSelectionChange(val) {
+         this.num=0
+         this.content=''
+         for (let i = 0; i < val.length; i++) {
+          this.num+=val[i].outWeight;
+          this.content=this.content?this.content:''+val[i].goodsName+val[i].outWeight+','
+         }
         this.multipleSelection = val;
       },
       //添加
@@ -289,75 +247,83 @@
         this.currentPage = 1
         this.getList()
       },
-      deleteclick(row) {
-        var text = ''
-        if (
-          (row.taskTypeKey == 3 && row.inOutType == '移库出库') ||
-          (row.taskTypeKey == 4 && row.inOutType == '销售出库') ||
-          (row.taskTypeKey == 4 && row.inOutType == '退库')
-        ) {
-          text = '相同任务编号的任务将一并删除且不可恢复,是否确定删除?'
-        } else {
-          text = `任务删除后不可恢复,是否确定删除?`
-        }
-        //cancelButtonClass: "btn-custom-cancel"
-        this.$confirm(text, {
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'warning',
-          })
-          .then(() => {
-            outdelete({
-                id: row.id,
-                relevanceId: row.relevanceId,
-                inOutFlag: row.inOutFlag,
-              })
-              .toPromise()
-              .then((response) => {
-                this.getList()
-              })
-          })
-          .catch(() => {
-            return false
+      costsort(){
+          this.gainList.sort(function(a,b){
+              var x = a['avgCost'];
+              var y = b[avgCost];
+              return ((y<x)?-1:(x>y)?1:0)   //从小到大排序
           })
+      
       },
+      
       getList() {
-        getoreditoutput({
+         getwarehousingorder({
             compId: localStorage.getItem('ws-pf_compId'),
             currentPage: this.currentPage,
             pageSize: this.pageSize,
             searchType: this.searchType,
             searchKeyWord: this.searchKeyWord,
-            inOutType:this.inOutType
+            inOutType:this.inOutType,
+            baseId:this.baseId
           })
           .toPromise()
           .then((response) => {
-            this.gainList = response
-            this.currentPage = response.current
-            this.pageSize = response.size
+            this.gainList = response.records
             this.deptBudgetTotal = response.total
           })
       },
-      //编辑
-      delivery(item) {
-        this.$router.push({
-          path: 'tranManagementWarehouseInOuttaskedit',
-          query: {
-            relevanceId: item.relevanceId,
-            inOutFlag: item.inOutFlag
-          },
-        })
+      submit(){
+        for (let i = 0; i < this.multipleSelection.length; i++) {
+          if(!this.multipleSelection[i].outWeight){
+              this.$message({
+              message: '预计出库重量不能为空',
+              type: 'error'
+              });
+              return
+
+          }
+          if(this.multipleSelection[i].outWeight>this.multipleSelection[i].surplusWeight){
+            this.$message({
+              message: '预计出库重量不能超过剩余重量',
+              type: 'error'
+              });
+              return
+          }   
+          if(this.multipleSelection[i].outWeight.indexOf('.')!=-1&&this.multipleSelection[i].outWeight.substring(this.multipleSelection[i].outWeight.indexOf('.')+1, this.multipleSelection[i].outWeight.length).length>3){
+            this.$message({
+              message: '预计出库重量输入错误',
+              type: 'error'
+              });
+              return
+          }
+          
+        }
+        var that=this
+        this.$confirm(`确定提交货源信息?`, {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
+          })
+          .then(() => {
+        editSourceOfGoods({orderList:this.multipleSelection,taskFlag:1}).toPromise()
+          .then((response) => {
+            this.$message({
+					message: '提交成功',
+					type: 'success'
+					});
+            localStorage.setItem("supplygoods",JSON.stringify(this.multipleSelection));
+            that.$router.go(-1)
+          }).catch((response) => {
+             this.$message({
+              message: '提交失败',
+              type: 'error'
+              }); 
+                // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+              })
+          })
       },
-      audit(item) {
-        this.$router.push({
-          path: 'tranManagementWarehouseInOuttaskaudit',
-          query: {
-            relevanceId: item.relevanceId,
-            taskId: item.taskId,
-            businessKey: item.id,
-            workflowId: item.workflowId,
-          },
-        })
+      returnsales(){
+        this.$router.go(-1)
       },
       getSpanArr(data) {
         let that = this
@@ -436,48 +402,6 @@
         console.log(`当前页: ${val}`)
         this.getList()
       },
-      editClick(row) {
-        var status = ''
-        if (row.taskStatus == '待审核' || row.taskStatus == '已完成') {
-          status = '执行中'
-        } else if (row.taskStatus == '执行中') {
-          status = '已完成'
-        }
-        //cancelButtonClass: "btn-custom-cancel"
-        this.$confirm(`是否将状态改为${status}`, {
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'warning',
-          })
-          .then(() => {
-            movestates({
-                id: row.id
-              })
-              .toPromise()
-              .then((response) => {
-                this.$notify.success({
-                  title: '成功',
-                  message: '状态修改成功',
-                })
-                this.getList()
-              })
-              .catch((response) => {
-                // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
-              })
-          })
-          .catch(() => {
-            return false
-          })
-      },
-      selecttaskType(e) {
-        for (var i = 0; i < this.taskTypeList.length; i++) {
-          if (this.taskTypeList[i].value == e) {
-            this.searchType = this.taskTypeList[i].type
-          }
-        }
-        this.currentPage = 1,
-          this.getList()
-      },
       handleExamine(row) {
         this.$router.push({
           name: 'salesContractExamine',
@@ -490,15 +414,6 @@
       handleCloe() {
         this.dialogViewSpareMoney = false
       },
-      history(row) {
-        billoperatehis({
-            id: row.id
-          })
-          .toPromise()
-          .then((response) => {
-            this.historyList = response
-          })
-      },
       find() {
         this.currentPage = 1
         this.getList()

+ 15 - 148
src/views/taskManagement/supplyofgoodslook.vue

@@ -3,7 +3,7 @@
   <div class="container">
       	<el-row>
 			<el-col :span="12">
-				<h2 class="bg-left title">选择货源</h2>
+				<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()">
@@ -12,53 +12,12 @@
 				</el-button>
 			</el-col>
 		</el-row>
-    <BaseHeaderLayout :leftSpan="16">
-      <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">
-        </el-date-picker>
-  
-          </div>
-        <ws-button type="primary" @click="handleAdd()" v-hasPermission="
-            `warehouseManagement.warehouse.warehouseInfoTask.add`
-          ">按日期排序
-        </ws-button>
-        <ws-button type="primary" @click="handleAdd()" v-hasPermission="
-            `warehouseManagement.warehouse.warehouseInfoTask.add`
-          ">按成本排序
-        </ws-button>
-      </template>
-      <template slot="right">
-        <ws-input @keyup.enter.native="find()" class='findValue' v-model="searchKeyWord" placeholder="可按合同编号或任务编号查找" clearable maxlength="300" type="input"></ws-input>
-        <ws-button class="find" type="primary" @click="lookUp()">
-          <img width="16" height="16" style="
-              vertical-align: text-top;
-              position: relative;
-              top: 0px;
-              left: -8px;
-            " src="../../../public/img/sousuo.png" alt />
-        </ws-button>
-      </template>
-    </BaseHeaderLayout>
     <el-row style='margin:10px;'>
-        <el-col :span="12">已选 10 条,合计出库重量  100吨,玉米(潮粮)50吨,玉米(机收)20吨,玉米 30吨</el-col>
+        <el-col :span="12">共 {{this.gainList.length}} 条,合计出库重量  100吨,玉米(潮粮)50吨,玉米(机收)20吨,玉米 30吨</el-col>
         <el-col style='text-align:right;' :span="12">
-             <ws-button type="primary" @click="handleAdd()" v-hasPermission="
-            `warehouseManagement.warehouse.warehouseInfoTask.add`
-          ">预览
-        </ws-button>
-         <ws-button type="primary" @click="handleAdd()" v-hasPermission="
-            `warehouseManagement.warehouse.warehouseInfoTask.add`
-          ">取消预览
-        </ws-button>
-         <ws-button type="primary" @click="handleAdd()" v-hasPermission="
-            `warehouseManagement.warehouse.warehouseInfoTask.add`
-          ">提交
-        </ws-button>
         </el-col>
     </el-row>   
-      <el-table class="wenzi" :data="gainList.records" style="width: 100%"  @selection-change="handleSelectionChange" height="calc(100% - 110px)">
+      <el-table class="wenzi" :data="gainList" style="width: 100%"  @selection-change="handleSelectionChange" height="calc(100% - 110px)">
           <el-table-column
       type="selection"
       width="55">
@@ -69,15 +28,15 @@
             <span v-else>{{ scope.$index + 1 }}</span>
           </template>
         </el-table-column>
-        <el-table-column prop="inOutTaskNo" label="货源" width="160"></el-table-column>
-        <el-table-column prop="contractNo" label="货名" width="160">
+        <el-table-column prop="goodsSource" label="货源" width="160"></el-table-column>
+        <el-table-column prop="goodsName" label="货名" width="160">
         </el-table-column>
-        <el-table-column prop="warehouseName" class="table_td" label="剩余重量(吨)"></el-table-column>
-        <el-table-column prop="inOutType" class="table_td" label="平均成本(吨)"></el-table-column>
+        <el-table-column prop="surplusWeight" class="table_td" label="剩余重量(吨)"></el-table-column>
+        <el-table-column prop="avgCost" class="table_td" label="平均成本(吨)"></el-table-column>
         <el-table-column prop="goodsName" class="table_td" label="入库单日期"></el-table-column>
-        <el-table-column prop="weight" class="table_td" label="预计出库重量(吨)">
+        <el-table-column prop="estimateOutWarehouseWeight" class="table_td" label="预计出库重量(吨)">
             <template slot-scope="scope">
-                <el-input v-model="input" placeholder="输入本次出库重量"></el-input>
+                <el-input v-model="scope.row.estimateOutWarehouseWeight" placeholder="输入本次出库重量"></el-input>
             </template>
         </el-table-column>
       </el-table>
@@ -89,7 +48,8 @@
   import {
     getoreditoutput,
     outdelete,
-    movestates
+    movestates,
+    getSourceOfGoods
   } from '@/model/tasksport/index'
   import {
     downloadFile
@@ -130,6 +90,7 @@
         // 年
         year: '',
         gainList: [],
+        gainList1: [],
         currentPage: 1,
         primary: '1',
                 pickerOptions: {
@@ -182,78 +143,15 @@
         searchTypeText: '待审核',
         searchKeyWord: '',
         inOutType:'',
-        inOutTypeList:[
-          {
-            value: '销售出库',
-            type: 1
-          },
-          {
-            value: '移库出库',
-            type: 3
-          },
-          {
-            value: '暂存出库',
-            type: 2
-          },
-          {
-            value: '贸易服务出库',
-            type: 4
-          },
-          {
-            value: '采购出库',
-            type: 5
-          },
-          {
-            value: '采购入库',
-            type: 6
-          },
-          {
-            value: '移库入库',
-            type: 7
-          },
-          {
-            value: '暂存入库',
-            type: 8
-          },
-          {
-            value: '贸易服务入库',
-            type: 9
-          },
-          {
-            value: '退库',
-            type: 10
-          },
-        ],
         contractType: 2,
-        taskTypeList: [{
-            value: '待审核',
-            type: 1
-          },
-          {
-            value: '执行中',
-            type: 3
-          },
-          {
-            value: '已驳回',
-            type: 2
-          },
-          {
-            value: '已完成',
-            type: 4
-          },
-          {
-            value: '全部任务',
-            type: ''
-          },
-        ],
         // 提交类型
         submitType: true,
         size: 10,
         spanArr: [],
         warehouseName: '',
+        multipleSelection:[],
         deptBudgetTotal: 0,
         compId: localStorage.getItem('ws-pf_compId'),
-        deptCircularPage: {},
         historyList: [],
         pickerBeginDateBefore: {
           disabledDate: (time) => {
@@ -289,40 +187,9 @@
         this.currentPage = 1
         this.getList()
       },
-      deleteclick(row) {
-        var text = ''
-        if (
-          (row.taskTypeKey == 3 && row.inOutType == '移库出库') ||
-          (row.taskTypeKey == 4 && row.inOutType == '销售出库') ||
-          (row.taskTypeKey == 4 && row.inOutType == '退库')
-        ) {
-          text = '相同任务编号的任务将一并删除且不可恢复,是否确定删除?'
-        } else {
-          text = `任务删除后不可恢复,是否确定删除?`
-        }
-        //cancelButtonClass: "btn-custom-cancel"
-        this.$confirm(text, {
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'warning',
-          })
-          .then(() => {
-            outdelete({
-                id: row.id,
-                relevanceId: row.relevanceId,
-                inOutFlag: row.inOutFlag,
-              })
-              .toPromise()
-              .then((response) => {
-                this.getList()
-              })
-          })
-          .catch(() => {
-            return false
-          })
-      },
+     
       getList() {
-        getoreditoutput({
+        getSourceOfGoods({
             compId: localStorage.getItem('ws-pf_compId'),
             currentPage: this.currentPage,
             pageSize: this.pageSize,

+ 40 - 3
src/views/taskManagement/tranManagementWarehouseInOutTask.vue

@@ -115,9 +115,9 @@
 
             <span class="corles" v-hasPermission="
                 `warehouseManagement.warehouse.warehouseInfoTask.delete`
-              " v-if="scope.row.taskId == null" @click="deleteclick(scope.row)">矫正</span>
+              " v-if="scope.row.show" @click="rectify(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.show"></el-divider>
             </span>
 
             <span class="corles" v-hasPermission="
@@ -134,7 +134,8 @@
   import {
     getoreditoutput,
     outdelete,
-    movestates
+    movestates,
+    setcorrect
   } from '@/model/tasksport/index'
   import {
     downloadFile
@@ -272,6 +273,30 @@
       this.showType = this.isShow
     },
     methods: {
+      rectify(){
+        this.$confirm('确定矫正出库任务重量并结束任务?', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
+          })
+          .then(() => {
+            setcorrect({id:row.id}).toPromise()
+              .then((response) => {
+                 this.$notify.success({
+                  title: '成功',
+                  message: '矫正成功',
+                })
+                this.getList()
+              }).catch(() => {
+                 this.$notify.error({
+                  title: '失败',
+                  message: '矫正失败',
+                })
+              })
+          }).catch(() => {
+            return false
+          })
+      },
       selectinOutType(){
         this.getList()
       },
@@ -329,6 +354,18 @@
           })
           .toPromise()
           .then((response) => {
+            for (let i = 0; i < response.records.length; i++) {
+              if(response.records[i].taskStatus=='执行中'&&response.records[i].inOutType=='销售出库'&&response.records[i].completedQuantity<response.records[i].weight
+              ||response.records[i].taskStatus=='执行中'&&response.records[i].inOutType=='移库出库'&&response.records[i].completedQuantity<response.records[i].weight){
+                response.records[i].show=true
+              }else if(response.records[i].taskStatus=='已完成'&&response.records[i].inOutType=='销售出库'&&response.records[i].completedQuantity<response.records[i].weight
+               ||response.records[i].taskStatus=='执行中'&&response.records[i].inOutType=='移库出库'&&response.records[i].completedQuantity<response.records[i].weight){
+                 response.records[i].show=true
+              }else{
+                response.records[i].show=false
+              }
+              
+            }
             this.gainList = response
             this.currentPage = response.current
             this.pageSize = response.size

+ 40 - 11
src/views/taskManagement/tranManagementWarehouseInOutTaskAdd.vue

@@ -165,19 +165,21 @@
 						</el-select>
 					</el-form-item>
 					<el-form-item v-if="dataList1.taskTypeKey == 3" label="移库任务编号">
-						<el-input disabled v-model="dataList1.moveTaskNo" placeholder="请输入移库任务编号" class="typeselect">
+						<el-select disabled v-model="dataList1.moveTaskNo" placeholder="请输入移库任务编号" class="typeselect">
 							<el-option v-for="item in contractNoList" :key="item.constKey" :label="item.contractNo"
 								:value="item.contractNo"></el-option>
-						</el-input>
+						</el-select>
 					</el-form-item>
 					<!-- 货名 -->
-					<el-form-item label="货" class="huom">
-						<el-select :disabled="dataList.taskTypeKey != 3 || dataList.taskTypeKey == 3" filterable clearable
+					<el-form-item label="货" class="huom">
+						<!-- <el-select :disabled="dataList.taskTypeKey != 3 || dataList.taskTypeKey == 3" filterable clearable
 							v-model="dataList.goodsName" placeholder="货名" class="huom" @change="selectgoodsName1">
 							<el-option v-for="item in goodnameList" :key="item.constKey" :label="item.constValue"
 								:value="item.constValue"></el-option>
-						</el-select>
-						<el-button class="bg-bottom" type="primary" size="small" @click="supplygoods()">选择货源</el-button>
+						</el-select> -->
+						<el-input disabled v-model="dataList.sourceId" placeholder="请选择货源"
+							maxlength="120" size="small" class="huom" />
+						<el-button v-if='dataList.taskTypeKey!=3' class="bg-bottom" type="primary" size="small" @click="supplygoods()">选择货源</el-button>
 					</el-form-item>
 					<!--重量(吨)-->
 					<el-form-item label="重量(吨)">
@@ -281,12 +283,14 @@
 					</el-form-item>
 					<!-- 货名 -->
 					<el-form-item label="货名" class="huom">
-						<el-select :disabled="dataList.taskTypeKey != 3" v-model="dataList.goodsName" placeholder="货名"
+						<!-- <el-select :disabled="dataList.taskTypeKey != 3" v-model="dataList.goodsName" placeholder="货名"
 							class="huom" @change="selectgoodsName " filterable clearable>
 							<el-option v-for="item in goodnameList" :key="item.constKey" :label="item.constValue"
-								:value="item.constValue"></el-option>
-						</el-select>
-						<el-button class="bg-bottom" type="primary" size="small" @click="supplygoods()">选择货源</el-button>
+								:value="item.constValue"></el-option> 
+						</el-select>-->
+						<el-input disabled v-model="dataList.sourceId" placeholder="请选择货源"
+							maxlength="120" size="small" class="huom" />
+						<!-- <el-button class="bg-bottom" type="primary" size="small" @click="supplygoods()">选择货源</el-button> -->
 					</el-form-item>
 					<!--重量(吨)-->
 					<el-form-item label="重量(吨)">
@@ -454,6 +458,7 @@
 				warehouseNameList1: [],
 				appendixIdsAdd: '',
 				uploadSuccess: {},
+				baseId:'',
 				deletetask: false,
 				warehouseInOutDetail: {},
 				onChange: {},
@@ -478,6 +483,7 @@
 				contractList: [],
 				inOutTaskNo: '',
 				inOutTaskNo1: '',
+				sourceId:'',
 				dataList: {
 					taskTypeKey: '1'
 				},
@@ -497,6 +503,16 @@
 		},
 		activated() {
 			this.getList()
+			var goods=''
+			this.sourceId=''
+			if(localStorage.setItem("supplygoods")){
+				var supplygoods=JSON.parse(localStorage.setItem("supplygoods"))
+				for (let i = 0; i < supplygoods.length; i++) {
+					goods+=supplygoods[i].goodsName
+					this.sourceId=this.sourceId+','+supplygoods[i].id
+				}
+			}
+			
 		},
 		methods: {
 			//返回按钮
@@ -504,7 +520,19 @@
 				this.$router.go(-1)
 			},
 			supplygoods(){
-        		this.$router.push({name:'supplyofgoods'})
+				if(this.dataList.warehouseName){
+					if(this.dataList.taskTypeKey==4){
+						this.$router.push({name:'outsupplyofgoods',query:{baseId:this.baseId}})
+					}else{
+						this.$router.push({name:'supplyofgoods',query:{baseId:this.baseId}})
+					}
+				}else{
+					this.$message({
+					message: '请先选择仓库',
+					type: 'warning'
+					});
+
+				}
       		},
 			returnsales() {
 				this.dataList = {
@@ -665,6 +693,7 @@
 				}
 			},
 			selectwarehouseName(e) {
+				this.baseId=e
 				for (var i = 0; i < this.warehouseNameList.length; i++) {
 					if (this.warehouseNameList[i].id == e) {
 						this.dataList.warehouseName = this.warehouseNameList[i].warehouseName

+ 28 - 28
src/views/warehousenew/component/router/index.js

@@ -419,34 +419,34 @@ const warehouseManagementRouter = {
       },
       hidden: true
     },  
-    {
-      path: 'warehousingOrder',
-      component: () =>
-        import(/* webpackChunkName: "applDetail" */ '@/views/warehousenew/warehousingOrder'),
-      name: 'warehousingOrder',
-      meta: {
-        title: 'warehousingOrder',
-        shortcutEntrance: 'warehousingOrder',
-        module: 'warehouseManagement.warehouse.warehouseInfo',
-        permissicon: [],
-        keepAlive: true
-        // module: 'procurement.sparepart.applDetail'
-      },
-    },
-    {
-      path: 'inventoryCheck',
-      component: () =>
-        import(/* webpackChunkName: "applDetail" */ '@/views/warehousenew/inventoryCheck'),
-      name: 'inventoryCheck',
-      meta: {
-        title: 'inventoryCheck',
-        shortcutEntrance: 'inventoryCheck',
-        module: 'warehouseManagement.warehouse.warehouseInfo',
-        permissicon: [],
-        keepAlive: true
-        // module: 'procurement.sparepart.applDetail'
-      },
-    },        
+    // {
+    //   path: 'warehousingOrder',
+    //   component: () =>
+    //     import(/* webpackChunkName: "applDetail" */ '@/views/warehousenew/warehousingOrder'),
+    //   name: 'warehousingOrder',
+    //   meta: {
+    //     title: 'warehousingOrder',
+    //     shortcutEntrance: 'warehousingOrder',
+    //     module: 'warehouseManagement.warehousingOrder',
+    //     permissicon: [],
+    //     keepAlive: true
+    //     // module: 'procurement.sparepart.applDetail'
+    //   },
+    // },
+    // {
+    //   path: 'inventoryCheck',
+    //   component: () =>
+    //     import(/* webpackChunkName: "applDetail" */ '@/views/warehousenew/inventoryCheck'),
+    //   name: 'inventoryCheck',
+    //   meta: {
+    //     title: 'inventoryCheck',
+    //     shortcutEntrance: 'inventoryCheck',
+    //     module: 'warehouseManagement.warehousingOrder',
+    //     permissicon: [],
+    //     keepAlive: true
+    //     // module: 'procurement.sparepart.applDetail'
+    //   },
+    // },        
   ],
 };
 export default warehouseManagementRouter;

+ 671 - 14
src/views/warehousenew/inventoryCheck.vue

@@ -1,20 +1,677 @@
+<!--出入库任务-->
 <template>
-  <div></div>
+  <div class="container">
+    <BaseHeaderLayout :leftSpan="16">
+      <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">
+        </el-date-picker>
+  
+          </div>
+      </template>
+      <template slot="right">
+        <ws-input @keyup.enter.native="find()" class='findValue' v-model="searchKeyWord" placeholder="可按货源查找" clearable maxlength="300" type="input"></ws-input>
+        <ws-button class="find" type="primary" @click="lookUp()">
+          <img width="16" height="16" style="
+              vertical-align: text-top;
+              position: relative;
+              top: 0px;
+              left: -8px;
+            " src="../../../public/img/sousuo.png" alt />
+        </ws-button>
+      </template>
+    </BaseHeaderLayout>
+    <el-row style='margin:10px;'>
+        <el-col :span="12">
+             <ws-button :type="flag===''?'primary':''" @click="handleAdd()" v-hasPermission="
+            `warehouseManagement.warehouse.warehouseInfoTask.add`
+          ">全部
+        </ws-button>
+         <ws-button :type="flag===0?'primary':''" @click="handleAdd()" v-hasPermission="
+            `warehouseManagement.warehouse.warehouseInfoTask.add`
+          ">盘盈
+        </ws-button>
+         <ws-button :type="flag===1?'primary':''" @click="handleAdd()" v-hasPermission="
+            `warehouseManagement.warehouse.warehouseInfoTask.add`
+          ">盘亏
+        </ws-button>
+        </el-col>
+        <el-col style='text-align:right;' :span="12">
+          
+        </el-col>
+    </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.warehouseName}}</div>
+        <div>
+          <ws-button type="primary" @click="profit(item.warehouseName)" v-hasPermission="
+            `warehouseManagement.warehousingOrder.surplus`
+          ">盘盈
+        </ws-button>
+         <ws-button type="primary" @click="lose(item.warehouseName)" v-hasPermission="
+            `warehouseManagement.warehousingOrder.loss`
+          ">盘亏
+        </ws-button>
+        </div>
+      </div>
+      <el-table ref='multipleTable' class="wenzi" :data="item.goodssourcelist" style="width: 100%"  @selection-change="handleSelectionChange" height="calc(100% - 110px)">
+        <el-table-column  width="40">
+          <template scope="scope">
+            <el-radio @change='radiochange(scope.row)' v-model="scope.row.select" :label="scope.row.id"><span></span></el-radio>
+          </template>
+    </el-table-column>
+        <el-table-column type="index" label="序号">
+          <template scope="scope">
+            <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
+            <span v-else>{{ scope.$index + 1 }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="goodsSource" label="货源" width="80"></el-table-column>
+        <el-table-column prop="deliveryWarehouse" label="发货库" width="80"></el-table-column>
+        <el-table-column prop="goodsName" label="货名" width="80">
+        </el-table-column>
+        <el-table-column prop="inWarehouseWeight"  width="130" class="table_td" label="入库重量(吨)"></el-table-column>
+        <el-table-column prop="outWarehouseWOOeight"  width="130" class="table_td" label="出库重量(吨)"></el-table-column>
+        <el-table-column prop="profitAndLoss" class="table_td" label="盈亏(吨)">
+           <template slot-scope="scope">
+           <span>{{scope.row.profitAndLoss}}</span>
+           <i @click="handlerecord(scope.row)" class="el-icon-s-claim"></i>
+        </template>
+        </el-table-column>
+        <el-table-column prop="surplusWeight" width="130" class="table_td" label="剩余重量(吨)"></el-table-column>
+        <el-table-column prop="approveStatus" label="状态" width="90">
+          <template slot-scope="scope">
+            <template>
+              <span slot="reference">
+                <span v-if="scope.row.taskStatus == '待审核'" class="executory"></span>
+                <span v-if="scope.row.taskStatus == '执行中'" class="inExecution"></span>
+                <span v-if="scope.row.taskStatus == '已完成'" class="done"></span>
+                {{ scope.row.taskStatus }}
+              </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"
+              @click="editClick(scope.row)" alt />
+          </template>
+        </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>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+        :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="deptBudgetTotal"></el-pagination>
+        <el-dialog
+        :title="title"
+        :visible.sync="aduitshow"
+        width="50%"
+        :before-close="handleClose">
+        <div>
+          <el-form ref="form" :model="form" label-width="120px">
+            <el-form-item label="计算剩余(吨)">
+              <el-input disabled v-model="form.surplusWeight"></el-input>
+            </el-form-item>
+            <el-form-item label="实际剩余(吨)">
+              <el-input :disabled='disabled' v-model="form.num"></el-input>
+            </el-form-item>
+          </el-form>
+        </div>
+        <span v-if='title=="审核"' slot="footer" class="dialog-footer">
+          <el-button @click="reject">驳回</el-button>
+          <el-button type="primary" @click="pass">通过</el-button>
+        </span>
+        <span v-else slot="footer" class="dialog-footer">
+          <el-button @click="aduitshow = false">取消</el-button>
+          <el-button type="primary" @click="loseprofit">提交</el-button>
+        </span>
+      </el-dialog>
+          <el-dialog width='30%' :visible.sync="dialogVisible1" title="审核记录" top="20vh">
+      <div v-for="(item,index) in recordList" :key="index" class="audit">
+        <div class="audit_item">
+          <div class="audit_left">
+            <span class="audit_name">{{item.dealMsg}}</span>
+          </div>
+          <span class="audit_date">{{item.verifyRemark}}</span>
+        </div>
+        <div class="audit_item">
+          <div class="audit_left">
+            <span class="audit_name">{{item.operateUser}}</span>
+          </div>
+          <span class="audit_date">{{item.createDate}}</span>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
 </template>
 <script>
-export default {
-  data() {
-    return {}
-  },
-  activated() {
-    this.getList()
-  },
-  methods: {
-    getList(){
+  import {
+    getoreditoutput,
+    outdelete,
+    movestates,
+    gettaskhistories,
+    woekflowhandle
+  } from '@/model/tasksport/index'
+    import {
+  getwarehousingorder,
+  editwarehousingorder
+} from '@/model/warehouse/index'
+  import {
+    downloadFile
+  } from '@/utils/batchDown'
+  import Pagination from '@/components/Pagination'
+  import WsUpload from '@/components/WsUpload'
+  import {
+    dayjs,
+    fmoney,
+    EventBus
+  } from 'base-core-lib'
+  export default {
+    name: 'viewSpareMoney',
+    components: {
+      WsUpload,
+      Pagination,
+    },
+    watch: {
+      vesselId(val) {
+        this.getList()
+      },
+      isShow(val) {
+        this.showType = val
+      },
+    },
+    data() {
+      return {
+        //弹出框
+        dialogViewSpareMoney: false,
+        dialogApproveFormVisible: false,
+        // 船舶类型
+        monetaryKey: null,
+        form:{},
+        // 表格显示数据
+        tableDate: [],
+
+        // 是否显示
+        showType: true,
+        // 年
+        year: '',
+        title:'',
+        disabled:false,
+        gainList: [],
+        currentPage: 1,
+        primary: '1',
+        pickerOptions: {
+          shortcuts: [{
+              text: '本周',
+              onClick(picker) {
+                const end = new Date()
+                const start = new Date()
+                var thisDay = start.getDay()
+                var thisDate = start.getDate()
+                if (thisDay != 0) {
+                  start.setDate(thisDate - thisDay)
+                }
+                picker.$emit('pick', [start, end])
+              },
+            },
+            {
+              text: '本月',
+              onClick(picker) {
+                const end = new Date()
+                const start = new Date()
+                start.setDate(1)
+                picker.$emit('pick', [start, end])
+              },
+            },
+            {
+              text: '本季度',
+              onClick(picker) {
+                var oDate = new Date()
+
+                var thisYear = oDate.getFullYear()
+                var thisMonth = oDate.getMonth() + 1
+
+                var n = Math.ceil(thisMonth / 3) // 季度
+
+                var Month = n * 3 - 1
+
+                var start = new Date(thisYear, Month - 2, 1)
+                var end = new Date()
+
+                picker.$emit('pick', [start, end])
+              },
+            },
+          ],
+        },
+        value1: '',
+        value2: '',
+        pageSize: 10,
+        searchType: 1,
+        searchTypeText: '待审核',
+        searchKeyWord: '',
+        inOutType:'',
+        contractType: 2,
+        multipleSelection:{},
+        // 提交类型
+        submitType: true,
+        size: 10,
+        form:{},
+        spanArr: [],
+        aduitList:[],
+        flag:'',
+        warehouseName: '',
+        deptBudgetTotal: 0,
+        compId: localStorage.getItem('ws-pf_compId'),
+        historyList: [],
+        aduitshow:false,
+        pickerBeginDateBefore: {
+          disabledDate: (time) => {
+            return time.getTime() > Date.now()
+          },
+        },
+        recordList:[],
+        dialogVisible1:false,
+        accessoryTFs: false,
+      }
+    },
+    // activated() {
+    //   this.getList()
+    //   this.showType = this.isShow
+    // },
+    mounted() {
       
-    }
-  },
-}
+      this.getList()
+      this.value2=this.getNowTime()
+      this.showType = this.isShow
+    },
+    methods: {
+      handlerecord(row){
+        gettaskhistories({ businessKey: row.id,
+            workflowId: row.workflowId}).toPromise()
+                .then((response) => {
+                  this.recordList=response
+                  this.dialogVisible1=true
+                }).catch((response) => {})
+        
+      },
+      getNowTime() {
+      const start = new Date(new Date().getTime() - 3600 * 1000 * 24*30 )
+        .toISOString()
+        .replace('T', ' ')
+        .split('.')[0] //默认开始时间30天前
+      const end = new Date(new Date().getTime())
+        .toISOString()
+        .replace('T', ' ')
+        .split('.')[0]//默认结束时间今天
+      console.log([start, end])
+      return [start, end]
+    },
+      selectinOutType(){
+        this.getList()
+      },
+      radiochange(row){
+
+        this.multipleSelection[row.warehouseName]=row
+      },
+       handleSelectionChange(val) {
+         console.log(this.$refs)
+  this.$refs.multipleTable.clearSelection()
+        this.multipleSelection = val;
+      },
+      aduit(row){
+        this.aduitList=row
+        this.form.id=row.id
+        this.form.surplusWeight=row.surplusWeight
+        this.title='审核'
+        this.aduitshow=true
+        this.disabled=true
+      },
+      lose(ware){
+        if(this.multipleSelection[ware]){
+          this.form.id=this.multipleSelection[ware].id
+          this.form.surplusWeight=this.multipleSelection[ware].surplusWeight
+          this.title='盘亏'
+          this.slecetwarehouseName=''
+          this.aduitshow=true
+          this.disabled=false
+        }else{
+          this.$notify.warning({
+            title: '警告',
+            message: '未选择要盘点的入库记录',
+          })
+        }
+        
+      },
+      profit(ware){
+        if(this.multipleSelection[ware]){
+        this.form.id=this.multipleSelection[ware].id
+        this.form.surplusWeight=this.multipleSelection[ware].surplusWeight
+        this.title='盘盈'
+        this.aduitshow=true
+        this.disabled=false
+        }else{
+          this.$notify.warning({
+            title: '警告',
+            message: '未选择要盘点的入库记录',
+          })
+        }
+      },
+      loseprofit(){
+        if(this.form.num<0){
+            this.$notify.warning({
+              title: '警告',
+              message: '实际剩余应大于0',
+            })
+            return
+          }
+        if(this.title=='盘盈'){
+          this.form.profitAndLoss=this.form.surplusWeight-this.form.num
+          this.form.flag=0
+          if(this.form.num<this.form.surplusWeight){
+            this.$notify.warning({
+              title: '警告',
+              message: '实际剩余不能小于计算剩余',
+            })
+            return
+          }
+        }
+        if(this.title=='盘亏'){
+          this.form.profitAndLoss=-this.form.surplusWeight-this.form.num
+          this.form.flag=1
+          if(this.form.num>this.form.surplusWeight){
+            this.$notify.warning({
+              title: '警告',
+              message: '实际剩余不能大于计算剩余',
+            })
+            return
+          }
+        }
+        editwarehousingorder(this.form).toPromise()
+              .then((response) => {
+                this.aduitshow=false
+                this.getList()
+              })
+      },
+      pass(){
+        this.$confirm('确定通过盘点操作?', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
+          })
+          .then(() => {
+            woekflowhandle({
+                taskId: this.aduitList.taskId,
+                approved: true,
+                auditMind: '34',
+                needReapply: false,
+              }).toPromise()
+              .then((response) => {
+                this.aduitshow=false
+                this.getList()
+              })
+          }).catch(() => {
+            return false
+          })
+
+      },
+      reject(){
+        this.$confirm('确定驳回盘点操作?', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
+          })
+          .then(() => {
+            woekflowhandle({
+                taskId: this.aduitList.taskId,
+                approved: false,
+                auditMind: '驳回',
+                needReapply: false,
+              }).toPromise()
+              .then((response) => {
+                this.aduitshow=false
+                this.getList()
+              })
+              }).catch(() => {
+            return false
+          })
+      },
+      //查找
+      lookUp() {
+        this.currentPage = 1
+        this.getList()
+      },
+      copare(arr){
+        // 缓存用于记录
+        const newArr = [];
+        for (const t of arr) {
+          // 检查缓存中是否已经存在
+          if (
+            newArr.find(
+              (c) =>
+                c.warehouseName === t.warehouseName 
+            )
+          ) {
+            // 已经存在说明以前记录过,现在这个就是多余的,直接忽略
+            continue;
+          }
+          // 不存在就说明以前没遇到过,把它记录下来
+          newArr.push(t);
+        }
+
+        // 记录结果就是过滤后的结果
+        return newArr;
+      },
+      getList() {
+        getwarehousingorder({
+            compId: localStorage.getItem('ws-pf_compId'),
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            searchType: this.searchType,
+            searchKeyWord: this.searchKeyWord,
+            inOutType:this.inOutType,
+            flag:this.flag
+          })
+          .toPromise()
+          .then((response) => {
+            var arr=this.copare(response.records)
+            for (let i = 0; i < response.records.length; i++) {
+              response.records[i].surplusWeight=response.records[i].inWarehouseWeight-response.records[i].outWarehouseWeight+response.records[i].profitAndLoss
+              response.records[i].select=''
+              
+            }
+            for (let i = 0; i < arr.length; i++) {
+              // if(arr[i].warehouseName){
+                var arr1=response.records.filter(function(item,index){
+                  return arr[i].warehouseName==item.warehouseName
+                })
+                arr[i].goodssourcelist=JSON.parse(JSON.stringify(arr1))
+                console.log(arr1)
+              // }
+            }
+
+            this.gainList = arr
+            // this.currentPage = response.current
+            // this.pageSize = response.size
+            console.log(arr)
+            this.deptBudgetTotal = arr.length
+          })
+      },
+      //编辑
+      delivery(item) {
+        this.$router.push({
+          path: 'tranManagementWarehouseInOuttaskedit',
+          query: {
+            relevanceId: item.relevanceId,
+            inOutFlag: item.inOutFlag
+          },
+        })
+      },
+      audit(item) {
+        this.$router.push({
+          path: 'tranManagementWarehouseInOuttaskaudit',
+          query: {
+            relevanceId: item.relevanceId,
+            taskId: item.taskId,
+            businessKey: item.id,
+            workflowId: item.workflowId,
+          },
+        })
+      },
+      getSpanArr(data) {
+        let that = this
+
+        //页面展示的数据,不一定是全部的数据,所以每次都清空之前存储的 保证遍历的数据是最新的数据。以免造成数据渲染混乱
+
+        that.spanArr = []
+
+        that.pos = 0
+
+        //遍历数据
+
+        data.forEach((item, index) => {
+          //判断是否是第一项
+
+          // if (index === 0) {
+          //   this.spanArr.push(1)
+          //   this.pos = 0
+          // } else {
+          //不是第一项时,就根据标识去存储
+          if (data[index].warehouseNumViewList.length > 1) {
+            // 查找到符合条件的数据时每次要把之前存储的数据+1
+            this.spanArr[this.pos] = data[index].warehouseNumViewList.length
+            this.spanArr.push(0)
+          } else {
+            // 没有符合的数据时,要记住当前的index
+            this.spanArr.push(1)
+            this.pos = index
+          }
+          // }
+        })
+      },
+      //查看//传参
+      nocomplete(row) {
+        this.$router.push({
+          path: 'inOutWarehousetaskEdit',
+          query: {
+            relevanceId: row.relevanceId,
+            businessKey: row.id,
+            workflowId: row.workflowId,
+          },
+        })
+      },
+      dateFormat(fmt, date) {
+        let ret
+        const opt = {
+          'Y+': date.getFullYear().toString(), // 年
+          'm+': (date.getMonth() + 1).toString(), // 月
+          'd+': date.getDate().toString(), // 日
+          'H+': date.getHours().toString(), // 时
+          // "M+": date.getMinutes().toString(),         // 分
+          // "S+": date.getSeconds().toString()          // 秒
+          // 有其他格式化字符需求可以继续添加,必须转化成字符串
+        }
+        for (let k in opt) {
+          ret = new RegExp('(' + k + ')').exec(fmt)
+          if (ret) {
+            fmt = fmt.replace(
+              ret[1],
+              ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
+            )
+          }
+        }
+        return fmt
+      },
+      handleClose() {
+        this.accessoryTFs = false
+      },
+      handleSizeChange(val) {
+        console.log(`每页 ${val} 条`)
+        this.pageSize = val
+        this.getList()
+      },
+      handleCurrentChange(val) {
+        this.currentPage = val
+        console.log(`当前页: ${val}`)
+        this.getList()
+      },
+      selecttaskType(e) {
+        for (var i = 0; i < this.taskTypeList.length; i++) {
+          if (this.taskTypeList[i].value == e) {
+            this.searchType = this.taskTypeList[i].type
+          }
+        }
+        this.currentPage = 1,
+          this.getList()
+      },
+      handleExamine(row) {
+        this.$router.push({
+          name: 'salesContractExamine',
+          query: {
+            id: row.id
+          },
+        })
+      },
+      // 关闭 dialog时 处理文件url 初始化upload组件
+      handleCloe() {
+        this.dialogViewSpareMoney = false
+      },
+      history(row) {
+        billoperatehis({
+            id: row.id
+          })
+          .toPromise()
+          .then((response) => {
+            this.historyList = response
+          })
+      },
+      find() {
+        this.currentPage = 1
+        this.getList()
+      },
+    },
+  }
 </script>
-<style  lang="scss" scoped>
+<style lang="scss" scoped>
+ 
+
+  .el-select {
+    width: 30%;
+    margin-right: 10px;
+  }
+.audit {
+    margin-bottom: 20px;
+    border-bottom: 1px solid #AFB3BF;
+    height: 70px;
+
+    .audit_item {
+      width: 100%;
+      display: flex;
+      height: 30px;
+
+      .audit_name {
+        margin-right: 30px;
+        font-size: 16px;
+        font-weight: 600;
+      }
+
+      .audit_left {
+        width: 60%;
+      }
+
+      .audit_date {
+        width: 40%;
+        justify-content: flex-end;
+        display: flex;
+        color: #AFB3BF;
+      }
+    }
+
+    .audit_opinion {}
+  }
 </style>

+ 861 - 13
src/views/warehousenew/warehousingOrder.vue

@@ -1,18 +1,866 @@
+<!--出入库任务-->
 <template>
-  <div></div>
+  <div class="container">
+    <BaseHeaderLayout :leftSpan="16">
+      <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">
+        </el-date-picker>
+  
+          </div>
+      </template>
+      <template slot="right">
+        <ws-input @keyup.enter.native="find()" class='findValue' v-model="searchKeyWord" placeholder="可按货源查找" clearable maxlength="300" type="input"></ws-input>
+        <ws-button class="find" type="primary" @click="lookUp()">
+          <img width="16" height="16" style="
+              vertical-align: text-top;
+              position: relative;
+              top: 0px;
+              left: -8px;
+            " src="../../../public/img/sousuo.png" alt />
+        </ws-button>
+      </template>
+    </BaseHeaderLayout>
+    <el-row style='margin:10px;'>
+        <el-col :span="12">
+             <ws-button :type="searchType===''?'primary':''" @click="handleAdd()" v-hasPermission="
+            `warehouseManagement.warehouse.warehouseInfoTask.add`
+          ">全部
+        </ws-button>
+         <ws-button :type="searchType==='1'?'primary':''" @click="handleAdd()" v-hasPermission="
+            `warehouseManagement.warehouse.warehouseInfoTask.add`
+          ">未付款
+        </ws-button>
+        </el-col>
+        <el-col style='text-align:right;' :span="12">
+          <!-- <el-button type="primary" @click="warehousingorder()" v-hasPermission="
+            `warehouseManagement.warehouse.warehouseInfoTask.add`
+          ">出单
+        </el-button> -->
+        </el-col>
+    </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 v-if=''>{{item.warehouseName}}入库单</div>
+        <div>
+          <ws-button v-if='item.payshow' type="primary" @click="payout(item)" v-hasPermission="
+            `warehouseManagement.warehousingOrder.appl`
+          ">请款
+        </ws-button>
+         <ws-button v-if='!item.payshow' type="primary" @click="cancel()" v-hasPermission="
+            `warehouseManagement.warehousingOrder.appl`
+          ">取消
+        </ws-button>
+        <ws-button v-if='!item.payshow' type="primary" @click="submit(item)" v-hasPermission="
+            `warehouseManagement.warehousingOrder.appl`
+          ">提交
+        </ws-button>
+        <ws-button type="primary" @click="aduit(item)" v-hasPermission="
+            `warehouseManagement.warehousingOrder.View`
+          ">审核
+        </ws-button>
+         <ws-button type="primary" @click="payment(item)" v-hasPermission="
+            `warehouseManagement.warehousingOrder.pay`
+          ">付款
+        </ws-button>
+        </div>
+      </div>
+      <el-table class="wenzi" :data="item.goodssourcelist" style="width: 100%"  @selection-change="handleSelectionChange" height="calc(100% - 110px)">
+          <el-table-column
+          :selectable='selectInit'
+      type="selection"
+      width="55">
+    </el-table-column>
+        <el-table-column type="index" label="序号">
+          <template scope="scope">
+            <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
+            <span v-else>{{ scope.$index + 1 }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="goodsSource" label="货源" width="80"></el-table-column>
+        <el-table-column prop="deliveryWarehouse" label="发货库" width="80"></el-table-column>
+        <el-table-column prop="goodsName" label="货名" width="80">
+        </el-table-column>
+        <el-table-column prop="inWarehouseWeight"  width="130" class="table_td" label="入库重量(吨)">
+          <template scope="scope">
+            <span>{{scope.row.inWarehouseWeight}}</span>
+            <i @click="changeWeight(scope.row)" v-if="
+                scope.row.weightedit&&scope.row.weightshow" class="iconfont icon-dui"></i>
+            <img v-if="!scope.row.weightedit&&scope.row.weightshow" width="17" height="18" style="vertical-align: text-top; position: relative; top: -1px"
+              src="../../../public/img/edit.png" @click="editWeight(scope.row)" alt="" />
+          </template>
+        </el-table-column>
+        <el-table-column prop="outWarehouseWOOeight"  width="130" class="table_td" label="出库重量(吨)"></el-table-column>
+        <el-table-column prop="profitAndLoss" class="table_td" label="盈亏(吨)"></el-table-column>
+        <el-table-column prop="surplusWeight" width="130" class="table_td" label="剩余重量(吨)"></el-table-column>
+        <el-table-column prop="grainFund"  width="130" class="table_td" label="粮款(元)"></el-table-column>
+        <el-table-column prop="amountEdPayable"  width="130" class="table_td" label="已付(元)">
+          <template scope="scope">
+            <span >{{scope.row.amountEdPayable}}</span>
+            <img v-if='scope.row.addressUrl' width="18" height="20" style="vertical-align: text-top; position: relative; top: -1px"
+            src="../../../public/img/fujian.png" @click="fujian(scope.row)" alt="" />
+          </template>
+        </el-table-column>
+        <el-table-column prop="amountNotPayable" class="table_td" label="未付(元)"></el-table-column>
+        <el-table-column prop="amountMoney" width="130" class="table_td" label="费用(元)">
+          <template scope="scope">
+            <span @click='costclick(scope.row)'>{{scope.row.amountMoney}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="avgCost"  width="130" class="table_td" label="平均成本(元/吨)"></el-table-column>
+        <el-table-column prop="requestFunds"  width="130" class="table_td" label="请款">
+          <template scope="scope">
+            <span v-if="!scope.row.select">{{ scope.row.requestFunds }}</span>
+            <el-input v-else v-model='scope.row.requestFunds'></el-input>
+          </template>
+        </el-table-column>
+        <el-table-column prop="taskStatus" label="请款状态" width="90">
+          <template slot-scope="scope">
+            <template>
+              <span slot="reference">
+                <span v-if="scope.row.taskStatus == '待审核'" class="executory"></span>
+                <span v-if="scope.row.taskStatus == '执行中'" class="inExecution"></span>
+                <span v-if="scope.row.taskStatus == '已完成'" class="done"></span>
+                {{ scope.row.taskStatus }}
+              </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"
+              @click="editClick(scope.row)" alt />
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+        :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="deptBudgetTotal"></el-pagination>
+        <el-dialog
+        title="付款"
+        :visible.sync="aduitshow"
+        width="50%"
+        :before-close="handleClose">
+        <div>
+          <el-form ref="form" :model="form" label-width="120px">
+            <el-form-item label="合计金额">
+              <el-input disabled v-model="form.name"></el-input>
+            </el-form-item>
+            <el-form-item 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>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="aduitshow = false">取消</el-button>
+          <el-button type="primary" @click="paymentsubmit">确定</el-button>
+        </span>
+      </el-dialog>
+      <!-- <el-dialog
+  title="提示"
+  :visible.sync="dialogVisible"
+  width="30%"
+  :before-close="handleClose">
+  <div> 
+    <el-time-picker
+    v-model="value1"
+      format='HH:mm'
+    value-format="HH:mm"
+
+    
+    placeholder="任意时间点"> </el-time-picker>
+    <ws-button type="primary" @click="handleAdd()" v-hasPermission="
+            `warehouseManagement.warehouse.warehouseInfoTask.add`
+          ">修改
+        </ws-button>
+  </div>
+</el-dialog> -->
+<el-dialog width='50%' :visible.sync="dialogVisible1" title="附件" top="20vh">
+      <div v-for="(item,index) in appendixIdss" :key="'fujian'+index" >
+       <el-image 
+        style="width: 100px; height: 100px"
+        :src="item" 
+        :preview-src-list="appendixIdss">
+      </el-image>
+      </div>
+    </el-dialog>
+  <el-dialog width='30%' :visible.sync="dialogVisible1" title="费用" top="20vh">
+      <div v-for="(item,index) in costlist" :key="index" class="audit">
+        <div class="audit_item">
+          <div class="audit_left">
+            <span class="audit_name">{{item.costNo}}</span>
+          </div>
+          <div class='audit_date'><span>{{item.expenseDate}}</span></div>
+        </div>
+        <div class="audit_item">
+          <div class="audit_left">
+            <span class="audit_name">{{item.expensesName}}</span>
+          </div>
+          <div class='audit_date'><span>{{item.expensesPrice}}</span></div>
+        </div>
+      </div>
+    </el-dialog>
+</div>
+  </div>
 </template>
 <script>
-export default {
-  data() {
-    return {}
-  },
-  activated() {
-    this.getList()
-  },
-  methods: {
-    getList,
-  },
-}
+  import {
+    getoreditoutput,
+    outdelete,
+    movestates,
+    woekflowhandle
+  } from '@/model/tasksport/index'
+  import {
+  getwarehousingorder,
+  paymoney,
+  editwarehousingorder,
+  getexenseinfo
+} from '@/model/warehouse/index'
+  import {
+    downloadFile
+  } from '@/utils/batchDown'
+  import Pagination from '@/components/Pagination'
+  import WsUpload from '@/components/WsUpload'
+  import {
+    dayjs,
+    fmoney,
+    EventBus
+  } from 'base-core-lib'
+import { findLastIndexOfIterate } from 'xe-utils/methods'
+  export default {
+    name: 'viewSpareMoney',
+    components: {
+      WsUpload,
+      Pagination,
+    },
+    watch: {
+      vesselId(val) {
+        this.getList()
+      },
+      isShow(val) {
+        this.showType = val
+      },
+    },
+    data() {
+      return {
+        currectdata:{},
+        //弹出框
+        dialogViewSpareMoney: false,
+        dialogApproveFormVisible: false,
+        dataList:[],
+        // 船舶类型
+        monetaryKey: null,
+        form:{},
+        // 表格显示数据
+        tableDate: [],
+
+        // 是否显示
+        showType: true,
+        dialogVisible:false,
+        // 年
+        year: '',
+        title:'',
+        disabled:false,
+        gainList: [],
+        currentPage: 1,
+        primary: '1',
+        dialogVisible1:false,
+        pickerOptions: {
+          shortcuts: [{
+              text: '本周',
+              onClick(picker) {
+                const end = new Date()
+                const start = new Date()
+                var thisDay = start.getDay()
+                var thisDate = start.getDate()
+                if (thisDay != 0) {
+                  start.setDate(thisDate - thisDay)
+                }
+                picker.$emit('pick', [start, end])
+              },
+            },
+            {
+              text: '本月',
+              onClick(picker) {
+                const end = new Date()
+                const start = new Date()
+                start.setDate(1)
+                picker.$emit('pick', [start, end])
+              },
+            },
+            {
+              text: '本季度',
+              onClick(picker) {
+                var oDate = new Date()
+
+                var thisYear = oDate.getFullYear()
+                var thisMonth = oDate.getMonth() + 1
+
+                var n = Math.ceil(thisMonth / 3) // 季度
+
+                var Month = n * 3 - 1
+
+                var start = new Date(thisYear, Month - 2, 1)
+                var end = new Date()
+
+                picker.$emit('pick', [start, end])
+              },
+            },
+          ],
+        },
+        value1: '',
+        value:'',
+        value2: '',
+        pageSize: 9999,
+        searchType: '',
+        searchTypeText: '待审核',
+        searchKeyWord: '',
+        inOutType:'',
+        contractType: 2,
+        // 提交类型
+        submitType: true,
+        multipleSelection:[],
+        size: 10,
+        spanArr: [],
+        id:'',
+        appendixIdss:[],
+        accessoryTFs:'',
+        paymentScreenshot:[],
+        warehouseName: '',
+        deptBudgetTotal: 0,
+        compId: localStorage.getItem('ws-pf_compId'),
+        historyList: [],
+        aduitshow:false,
+        costlist:[],
+        pickerBeginDateBefore: {
+          disabledDate: (time) => {
+            return time.getTime() > Date.now()
+          },
+        },
+        accessoryTFs: false,
+      }
+    },
+    // activated() {
+    //   this.getList()
+    //   this.showType = this.isShow
+    // },
+    mounted() {
+      this.getList()
+      this.value2=this.getNowTime()
+      this.showType = this.isShow
+    },
+    methods: {
+      fujian(row) {
+        this.id = row.id
+        this.accessoryTFs = true
+        this.appendixIdss = row.addressUrl.split(',')
+        console.log(this.appendixIdss)
+      },
+      selectinOutType(){
+        this.getList()
+      },
+       handleSelectionChange(val) {
+        this.multipleSelection = val;
+      },
+      editWeight(row){
+        row.weightedit=true
+      },
+      changeWeight(row){
+        if(row.inWarehouseWeight<row.outWarehouseWOOeight){
+          this.$message({
+            message: '入库量不能小于出库量',
+            type: 'warning'
+          });
+          return 
+        }
+        this.$confirm('确定提交入库重量?', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
+          })
+          .then(() => {
+            editwarehousingorder({id:row.id,inWarehouseWeight:row.inWarehouseWeight}).toPromise()
+              .then((response) => {
+                // row.weightedit=false
+                this.getList()
+              })
+          })
+      },
+      payout(item){
+        if(this.multipleSelection.length>0){
+          item.payshow=false
+          for (let i = 0; i < this.multipleSelection.length; i++) {
+            this.multipleSelection[i].select=true
+            
+          }
+        }else{
+           this.$message({
+          message: '至少选择一条待请款条目',
+          type: 'warning'
+        });
+        }
+        
+      },
+      getNowTime() {
+      const start = new Date(new Date().getTime() - 3600 * 1000 * 24 )
+        .toISOString()
+        .replace('T', ' ')
+        .split('.')[0] //默认开始时间1天前
+      const end = new Date(new Date().getTime())
+        .toISOString()
+        .replace('T', ' ')
+        .split('.')[0]//默认结束时间今天
+      console.log([start, end])
+      return [start, end]
+    },
+      cancel(item){
+        item.payshow=true
+      },
+      costclick(row){
+        this.costlist=row.expenseAllocationInfoList
+        // getexenseinfo({id:row.id}).toPromise()
+        //   .then((response) => {
+        //     this.costlist=response
+        //   }).catch(() => {
+        //   })
+      },
+      selectInit(row,index){
+        if(localStorage.getItem('ws-pf_roleName')=='内勤'){
+          if(row.inType=='移库入库'||row.inType=='退库入库'){
+            return false
+          }else{
+            if(row.amountNotPayable>0){
+              if(row.taskStatus!='请款中'){
+                return true
+              }else{
+                return false
+              }
+            }else{
+              return false
+            }
+          }
+          
+        }else if(localStorage.getItem('ws-pf_roleName')=='采购副总'){
+          return true
+        }else if(localStorage.getItem('ws-pf_roleName')=='财务'){
+          return true
+        }else if(localStorage.getItem('ws-pf_roleName')=='出纳'){
+          return true
+        }else{
+          return false
+        }
+      },
+      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)
+          }
+          
+        }
+      },
+      submit(item){
+        var arr1=this.multipleSelection.filter(function(items,index){
+                  return item.warehouseName==items.warehouseName
+                })
+        for (let i = 0; i < arr1.length; i++) {
+          if(!arr1[i].requestFunds){
+            this.$message({
+              message: '请款金额不能为空!',
+              type: 'warning'
+            });
+            return
+          }
+           if(arr[i].requestFunds>arr[i].amountNotPayable){
+            this.$message({
+              message: '请款金额不能大于未付金额!',
+              type: 'warning'
+            });
+            return
+          }
+        }
+            this.$confirm('确认提交请款信息', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
+          })
+          .then(() => {  
+            paymoney({flag:1,warehousingOrderList:arr1}).toPromise()
+          .then((response) => {
+            this.$message({
+              message: '提交成功',
+              type: 'success'
+            });
+          }).catch(() => {
+           this.$message({
+              message: '提交失败',
+              type: 'warning'
+            });
+          })
+          }).catch(() => {
+            return false
+          })
+      },
+      paymentsubmit(){
+         var arr2=this.multipleSelection.filter(function(items,index){
+                  return this.currectdata.warehouseName==items.warehouseName
+                })
+          if(this.paymentScreenshot.length==0){
+            this.$message({
+              message: '请上传付款截图',
+              type: 'warning'
+            });
+            return
+          }
+          for (let i = 0; i < arr2.length; i++) {
+            arr2[i].addressUrl=this.paymentScreenshot.toString()
+            
+          }
+            paymoney({flag:0,warehousingOrderList:arr2}).toPromise()
+          .then((response) => {
+            this.$message({
+              message: '付款成功',
+              type: 'success'
+            });
+          }).catch(() => {
+           this.$message({
+              message: '付款失败',
+              type: 'warning'
+            });
+          })
+  
+      },
+      payment(item){
+        this.currectdata=item
+        this.aduitshow=true
+        
+      },
+      aduit(row){
+        var arr2=this.multipleSelection.filter(function(items,index){
+          return row.warehouseName==items.warehouseName
+        })
+        if(arr2.length==0){
+          if(localStorage.getItem('ws-pf_roleName')=='采购副总'){
+            this.$message({
+              message: '至少选择一条待决策人审核的条目',
+              type: 'eroor'
+            });
+            return
+          }else if(localStorage.getItem('ws-pf_roleName')=='财务'){
+            this.$message({
+              message: '至少选择一条待财务审核的条目',
+              type: 'eroor'
+            });
+            return
+          }
+           
+        }
+          this.$confirm('审核请款信息', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
+          })
+          .then(() => {
+            this.aduithandle(arr2,0,true)
+          }).catch(() => {
+            this.aduithandle(arr2,0,false)
+          })       
+      },
+      aduithandle(item,index,status){
+        if(index<item.length){
+          woekflowhandle({
+                taskId: item[index].taskId,
+                approved:status,
+                auditMind: '34',
+                needReapply: false,
+              }).toPromise()
+              .then((response) => {
+               this.aduithandle(item,index+1,status)
+              }).catch(() => {
+                if(status){
+                  this.$message({
+                    message: '通过失败',
+                    type: 'error'
+                  });
+                }else{
+                  this.$message({
+                    message: '驳回失败',
+                    type: 'error'
+                  });
+                }
+              })  
+        }else{
+          if(status){
+            this.$message({
+              message: '通过成功',
+              type: 'success'
+            });
+          }else{
+            this.$message({
+              message: '驳回成功',
+              type: 'success'
+            });
+          }
+        }
+          
+      },
+      //查找
+      lookUp() {
+        this.currentPage = 1
+        this.getList()
+      },
+      warehousingorder(){
+        this.dialogVisible=true
+      },
+      getList() {
+        getwarehousingorder({
+            compId: localStorage.getItem('ws-pf_compId'),
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            searchType: this.searchType,
+            searchKeyWord: this.searchKeyWord,
+          })
+          .toPromise()
+          .then((response) => {
+            for (let i = 0; i < response.records.length; i++) {
+              response.records[i].select=false
+              response.records[i].surplusWeight=response.records[i].inWarehouseWeight-response.records[i].outWarehouseWeight+response.records[i].profitAndLoss
+              response.records[i].weightedit=false
+              if(response.records[i].warehouseName.indexOf('临')){
+                response.records[i].weightshow=true
+              }else{
+                response.records[i].weightshow=false
+              }
+            }
+            var arr=this.copare(response.records)
+            for (let i = 0; i < arr.length; i++) {
+              arr[i].payshow=true
+              // if(arr[i].warehouseName){
+                var arr1=response.records.filter(function(item,index){
+                  return arr[i].warehouseName==item.warehouseName
+                })
+                arr[i].goodssourcelist=JSON.parse(JSON.stringify(arr1))
+                console.log(arr1)
+              // }
+            }
+
+            this.gainList = arr
+            // this.currentPage = response.current
+            // this.pageSize = response.size
+            console.log(arr)
+            this.deptBudgetTotal = arr.length
+          })
+      },
+      copare(arr){
+        // 缓存用于记录
+        const newArr = [];
+        for (const t of arr) {
+          // 检查缓存中是否已经存在
+          if (
+            newArr.find(
+              (c) =>
+                c.warehouseName === t.warehouseName 
+            )
+          ) {
+            // 已经存在说明以前记录过,现在这个就是多余的,直接忽略
+            continue;
+          }
+          // 不存在就说明以前没遇到过,把它记录下来
+          newArr.push(t);
+        }
+
+        // 记录结果就是过滤后的结果
+        return newArr;
+      },
+      getSpanArr(data) {
+        let that = this
+
+        //页面展示的数据,不一定是全部的数据,所以每次都清空之前存储的 保证遍历的数据是最新的数据。以免造成数据渲染混乱
+
+        that.spanArr = []
+
+        that.pos = 0
+
+        //遍历数据
+
+        data.forEach((item, index) => {
+          //判断是否是第一项
+
+          // if (index === 0) {
+          //   this.spanArr.push(1)
+          //   this.pos = 0
+          // } else {
+          //不是第一项时,就根据标识去存储
+          if (data[index].warehouseNumViewList.length > 1) {
+            // 查找到符合条件的数据时每次要把之前存储的数据+1
+            this.spanArr[this.pos] = data[index].warehouseNumViewList.length
+            this.spanArr.push(0)
+          } else {
+            // 没有符合的数据时,要记住当前的index
+            this.spanArr.push(1)
+            this.pos = index
+          }
+          // }
+        })
+      },
+      //查看//传参
+      nocomplete(row) {
+        this.$router.push({
+          path: 'inOutWarehousetaskEdit',
+          query: {
+            relevanceId: row.relevanceId,
+            businessKey: row.id,
+            workflowId: row.workflowId,
+          },
+        })
+      },
+      dateFormat(fmt, date) {
+        let ret
+        const opt = {
+          'Y+': date.getFullYear().toString(), // 年
+          'm+': (date.getMonth() + 1).toString(), // 月
+          'd+': date.getDate().toString(), // 日
+          'H+': date.getHours().toString(), // 时
+          // "M+": date.getMinutes().toString(),         // 分
+          // "S+": date.getSeconds().toString()          // 秒
+          // 有其他格式化字符需求可以继续添加,必须转化成字符串
+        }
+        for (let k in opt) {
+          ret = new RegExp('(' + k + ')').exec(fmt)
+          if (ret) {
+            fmt = fmt.replace(
+              ret[1],
+              ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
+            )
+          }
+        }
+        return fmt
+      },
+      handleClose() {
+        this.accessoryTFs = false
+      },
+      handleSizeChange(val) {
+        console.log(`每页 ${val} 条`)
+        this.pageSize = val
+        this.getList()
+      },
+      handleCurrentChange(val) {
+        this.currentPage = val
+        console.log(`当前页: ${val}`)
+        this.getList()
+      },
+      editClick(row) {
+        var status = ''
+        if (row.taskStatus == '待审核' || row.taskStatus == '已完成') {
+          status = '执行中'
+        } else if (row.taskStatus == '执行中') {
+          status = '已完成'
+        }
+        //cancelButtonClass: "btn-custom-cancel"
+        this.$confirm(`是否将状态改为${status}`, {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
+          })
+          .then(() => {
+            movestates({
+                id: row.id
+              })
+              .toPromise()
+              .then((response) => {
+                this.$notify.success({
+                  title: '成功',
+                  message: '状态修改成功',
+                })
+                this.getList()
+              })
+              .catch((response) => {
+                // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+              })
+          })
+          .catch(() => {
+            return false
+          })
+      },
+      selecttaskType(e) {
+        for (var i = 0; i < this.taskTypeList.length; i++) {
+          if (this.taskTypeList[i].value == e) {
+            this.searchType = this.taskTypeList[i].type
+          }
+        }
+        this.currentPage = 1,
+          this.getList()
+      },
+      handleExamine(row) {
+        this.$router.push({
+          name: 'salesContractExamine',
+          query: {
+            id: row.id
+          },
+        })
+      },
+      // 关闭 dialog时 处理文件url 初始化upload组件
+      handleCloe() {
+        this.dialogViewSpareMoney = false
+      },
+      history(row) {
+        billoperatehis({
+            id: row.id
+          })
+          .toPromise()
+          .then((response) => {
+            this.historyList = response
+          })
+      },
+      find() {
+        this.currentPage = 1
+        this.getList()
+      },
+    },
+  }
 </script>
-<style  lang="scss" scoped>
+<style lang="scss" scoped>
+ 
+
+  .el-select {
+    width: 30%;
+    margin-right: 10px;
+  }
+.audit {
+    margin-bottom: 20px;
+    border-bottom: 1px solid #AFB3BF;
+    height: 70px;
+
+    .audit_item {
+      width: 100%;
+      display: flex;
+      height: 30px;
+
+      .audit_name {
+        margin-right: 30px;
+        font-size: 16px;
+        font-weight: 600;
+      }
+
+      .audit_left {
+        width: 60%;
+      }
+
+      .audit_date {
+        width: 40%;
+        justify-content: flex-end;
+        display: flex;
+        color: #AFB3BF;
+      }
+    }
+
+    .audit_opinion {}
+  }
 </style>