index.vue 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <!-- <el-form-item label="业务编号" prop="fBillno">-->
  5. <!-- <el-input-->
  6. <!-- v-model="queryParams.fBillno"-->
  7. <!-- placeholder="请输入业务编号"-->
  8. <!-- clearable-->
  9. <!-- size="small"-->
  10. <!-- @keyup.enter.native="handleQuery"-->
  11. <!-- />-->
  12. <!-- </el-form-item>-->
  13. <el-form-item label="客户名称" prop="fCorpid">
  14. <el-select
  15. v-model="queryParams.fCorpid"
  16. filterable
  17. remote
  18. clearable
  19. style="width: 200px"
  20. @keyup.enter.native="handleQuery"
  21. :remote-method="corpsRemoteMethod"
  22. placeholder="请输入客户名称"
  23. >
  24. <el-option
  25. v-for="(dict, index) in fMblnoOptions"
  26. :key="index.fId"
  27. :label="dict.fName"
  28. :value="dict.fId"
  29. ></el-option>
  30. </el-select>
  31. </el-form-item>
  32. <!-- <el-form-item label="货物品名" prop="fGoodsid">-->
  33. <!-- <el-select-->
  34. <!-- v-model="queryParams.fGoodsid"-->
  35. <!-- filterable-->
  36. <!-- remote-->
  37. <!-- clearable-->
  38. <!-- style="width: 200px"-->
  39. <!-- :remote-method="goodsRemoteMethod"-->
  40. <!-- @keyup.enter.native="handleQuery"-->
  41. <!-- placeholder="请输入货物品名"-->
  42. <!-- >-->
  43. <!-- <el-option-->
  44. <!-- v-for="(dict, index) in goodsOptions"-->
  45. <!-- :key="index.fId"-->
  46. <!-- :label="dict.fName"-->
  47. <!-- :value="dict.fId"-->
  48. <!-- ></el-option>-->
  49. <!-- </el-select>-->
  50. <!-- </el-form-item>-->
  51. <el-form-item label="制单部门" prop="fDeptid">
  52. <el-input
  53. v-model="queryParams.fDeptid"
  54. placeholder="请输入制单部门"
  55. clearable
  56. size="small"
  57. @keyup.enter.native="handleQuery"
  58. />
  59. </el-form-item>
  60. <el-form-item label="有效期起" prop="fBegindate">
  61. <el-date-picker clearable size="small" style="width: 200px"
  62. v-model="queryParams.fBegindate"
  63. type="date"
  64. value-format="yyyy-MM-dd"
  65. placeholder="选择有效期起"
  66. >
  67. </el-date-picker>
  68. </el-form-item>
  69. <el-form-item label="有效期至" prop="fEnddate">
  70. <el-date-picker clearable size="small" style="width: 200px"
  71. v-model="queryParams.fEnddate"
  72. type="date"
  73. value-format="yyyy-MM-dd"
  74. placeholder="选择有效期至"
  75. >
  76. </el-date-picker>
  77. </el-form-item>
  78. <el-form-item label="协议编号" prop="fContractno">
  79. <el-input
  80. v-model="queryParams.fContractno"
  81. placeholder="请输入协议编号"
  82. clearable
  83. size="small"
  84. @keyup.enter.native="handleQuery"
  85. />
  86. </el-form-item>
  87. <el-form-item>
  88. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  89. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  90. </el-form-item>
  91. </el-form>
  92. <el-row :gutter="10" class="mb8">
  93. <el-col :span="1.5">
  94. <el-button
  95. type="primary"
  96. icon="el-icon-plus"
  97. size="mini"
  98. @click="handleAdd()"
  99. v-hasPermi="['warehouseBusiness:agreement:add']"
  100. >新增
  101. </el-button>
  102. </el-col>
  103. <el-col :span="1.5">
  104. <el-button
  105. type="success"
  106. icon="el-icon-edit"
  107. size="mini"
  108. :disabled="single"
  109. @click="handleUpdate"
  110. v-hasPermi="['warehouseBusiness:agreement:edit']"
  111. >修改
  112. </el-button>
  113. </el-col>
  114. <el-col :span="1.5">
  115. <el-button
  116. type="danger"
  117. icon="el-icon-delete"
  118. size="mini"
  119. :disabled="multiple"
  120. @click="handleDelete"
  121. v-hasPermi="['warehouseBusiness:agreement:remove']"
  122. >删除
  123. </el-button>
  124. </el-col>
  125. <el-col :span="1.5">
  126. <el-button
  127. type="warning"
  128. icon="el-icon-download"
  129. size="mini"
  130. @click="handleExport"
  131. v-hasPermi="['warehouseBusiness:agreement:export']"
  132. >导出
  133. </el-button>
  134. </el-col>
  135. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  136. </el-row>
  137. <el-table v-loading="loading" :data="agreementList" @selection-change="handleSelectionChange">
  138. <el-table-column type="selection" width="55" align="center"/>
  139. <el-table-column label="客户名称" align="center" prop="fCorpid"/>
  140. <el-table-column label="协议编号" align="center" prop="fContractno"/>
  141. <!-- <el-table-column label="费用名称" align="center" prop="fFeeid"/>-->
  142. <el-table-column label="有效期起" align="center" prop="fBegindate" width="180">
  143. <template slot-scope="scope">
  144. <span>{{ parseTime(scope.row.fBegindate, '{y}-{m}-{d}') }}</span>
  145. </template>
  146. </el-table-column>
  147. <el-table-column label="有效期至" align="center" prop="fEnddate" width="180">
  148. <template slot-scope="scope">
  149. <span>{{ parseTime(scope.row.fEnddate, '{y}-{m}-{d}') }}</span>
  150. </template>
  151. </el-table-column>
  152. <!-- <el-table-column label="状态" align="center" prop="fId" />-->
  153. <el-table-column label="是否启用" align="center" prop="fStatus">
  154. <template slot-scope="scope">
  155. <el-switch
  156. v-model="scope.row.fStatus"
  157. active-value="0"
  158. inactive-value="1"
  159. @change="handleStatusChange(scope.row)"
  160. ></el-switch>
  161. </template>
  162. </el-table-column>
  163. <el-table-column label="状态" align="center" prop="fBillstatus">
  164. <template slot-scope="scope">
  165. <span v-if="scope.row.fBillstatus == '1'">保存</span>
  166. <span v-else-if="scope.row.fBillstatus == '2'">暂存</span>
  167. <span v-else-if="scope.row.fBillstatus == '3'">审批驳回</span>
  168. <span v-else-if="scope.row.fBillstatus == '4'">提交审核</span>
  169. <span v-else-if="scope.row.fBillstatus == '5'">审核中</span>
  170. <span v-else-if="scope.row.fBillstatus == '6'">审核完成</span>
  171. </template>
  172. </el-table-column>
  173. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  174. <template slot-scope="scope">
  175. <el-button
  176. size="mini"
  177. type="text"
  178. icon="el-icon-edit"
  179. @click="handleUpdate(scope.row)"
  180. v-if="scope.row.fBillstatus <= 3"
  181. v-hasPermi="['warehouseBusiness:agreement:edit']"
  182. >修改
  183. </el-button>
  184. <el-button
  185. size="mini"
  186. type="text"
  187. icon="el-icon-delete"
  188. @click="handleDelete(scope.row)"
  189. v-if="scope.row.fBillstatus <= 3"
  190. v-hasPermi="['warehouseBusiness:agreement:remove']"
  191. >删除
  192. </el-button>
  193. <el-button
  194. size="mini"
  195. type="text"
  196. icon="el-icon-delete"
  197. @click="speed(scope.row,0)"
  198. v-if="scope.row.fBillstatus == 6"
  199. v-hasPermi="['warehouseBusiness:agreement:remove']"
  200. >查看
  201. </el-button>
  202. <el-button
  203. size="mini"
  204. type="text"
  205. icon="el-icon-delete"
  206. @click="speed(scope.row,1)"
  207. v-if="scope.row.fBillstatus == 4 || scope.row.fBillstatus == 5"
  208. v-hasPermi="['warehouseBusiness:agreement:remove']"
  209. >审批进度
  210. </el-button>
  211. </template>
  212. </el-table-column>
  213. <!-- <el-table-column label="业务编号" align="center" prop="fBillno" />-->
  214. <!-- <el-table-column label="制单部门" align="center" prop="fDeptid" />-->
  215. <!-- <el-table-column label="结算方式" align="center" prop="fStltypeid" :formatter="fStltypeidFormat" />-->
  216. <!-- <el-table-column label="费用类型" align="center" prop="fFeetypeid" />-->
  217. <!-- <el-table-column label="货物类别" align="center" prop="tPackages" :formatter="tPackagesFormat" />-->
  218. <!-- <el-table-column label="贸易方式" align="center" prop="fTrademodeid" :formatter="fTrademodeidFormat" />-->
  219. <!-- <el-table-column label="免堆天数" align="center" prop="fFreedays" />-->
  220. <!-- <el-table-column label="备注" align="center" prop="remark" />-->
  221. </el-table>
  222. <pagination
  223. v-show="total>0"
  224. :total="total"
  225. :page.sync="queryParams.pageNum"
  226. :limit.sync="queryParams.pageSize"
  227. @pagination="getList"
  228. />
  229. <!-- 添加或修改作业费对话框 -->
  230. <el-dialog :title="title" :visible.sync="open" :show-close="Xbutton" width="65%" append-to-body :before-close="handleClose" :close-on-click-modal="false">
  231. <el-form ref="form" :model="form" :rules="rules" label-width="80px"
  232. style="display: flex;flex-wrap: wrap;"
  233. >
  234. <el-form-item label="客户名称" prop="fCorpid">
  235. <el-select
  236. v-model="form.fCorpid"
  237. filterable
  238. remote
  239. clearable
  240. :disabled="prohibit"
  241. style="width: 200px"
  242. @keyup.enter.native="handleQuery"
  243. :remote-method="corpsRemoteMethod"
  244. placeholder="请输入客户名称"
  245. >
  246. <el-option
  247. v-for="(dict, index) in fMblnoOptions"
  248. :key="index.fId"
  249. :label="dict.fName"
  250. :value="dict.fId"
  251. ></el-option>
  252. </el-select>
  253. </el-form-item>
  254. <el-form-item label="制单部门">
  255. <el-input v-model="deptName" :disabled="true" placeholder="请输入制单部门" style="width: 200px"/>
  256. </el-form-item>
  257. <el-form-item label="有效期起" prop="fBegindate">
  258. <el-date-picker clearable size="small" style="width: 200px"
  259. v-model="form.fBegindate"
  260. type="date"
  261. :disabled="prohibit"
  262. value-format="yyyy-MM-dd"
  263. placeholder="选择有效期起"
  264. >
  265. </el-date-picker>
  266. </el-form-item>
  267. <el-form-item label="有效期至" prop="fEnddate">
  268. <el-date-picker clearable size="small" style="width: 200px"
  269. v-model="form.fEnddate"
  270. type="date"
  271. :disabled="prohibit"
  272. value-format="yyyy-MM-dd"
  273. placeholder="选择有效期至"
  274. >
  275. </el-date-picker>
  276. </el-form-item>
  277. <el-form-item label="协议编号" prop="fContractno">
  278. <el-input v-model="form.fContractno" placeholder="请输入协议编号" :disabled="prohibit" style="width: 200px"/>
  279. </el-form-item>
  280. <el-form-item label="商品类别" prop="tPackages">
  281. <el-select v-model="form.tPackages" placeholder="请选择商品类别" :disabled="prohibit">
  282. <el-option
  283. v-for="dict in fTypeidOptions"
  284. :key="dict.dictValue"
  285. :label="dict.dictLabel"
  286. :value="dict.dictValue"
  287. style="width: 210px;"
  288. ></el-option>
  289. </el-select>
  290. </el-form-item>
  291. </el-form>
  292. <el-button @click="confirmCharge" v-if="form.fBillstatus < 4" type="primary">请 核</el-button>
  293. <el-button @click="revokeCharge" v-if="form.fBillstatus == 6" type="danger">撤销请核</el-button>
  294. <el-button @click="revocationApproval" :disabled="tablefilter" v-if="form.fBillstatus == 4" type="danger">撤销审批</el-button>
  295. <div class="dialogTableTitle flex a-center jlr">
  296. <h2>作业费明细</h2>
  297. <el-button @click="getList_s" :disabled="prohibit">新增</el-button>
  298. </div>
  299. <el-table v-loading="loading_s" :data="agreementitemsList" @selection-change="handleSelectionChange">
  300. <!-- <el-table-column type="selection" width="55" align="center"/>-->
  301. <el-table-column label="行号" align="center" type="index"/>
  302. <el-table-column
  303. prop="fFeeid"
  304. header-align="center"
  305. align="center"
  306. width="180px"
  307. label="费用名称"
  308. >
  309. <template slot-scope="scope">
  310. <el-select
  311. v-model="scope.row.fFeeid"
  312. filterable
  313. :disabled="browseStatus"
  314. remote
  315. :remote-method="fWRemoteMethod"
  316. placeholder="费用名称"
  317. >
  318. <el-option
  319. v-for="(dict, index) in fWbuOptions"
  320. :key="index.fId"
  321. :label="dict.fName"
  322. :value="dict.fId"
  323. ></el-option>
  324. </el-select>
  325. </template>
  326. </el-table-column>
  327. <el-table-column
  328. prop="fFeeunitid"
  329. header-align="center"
  330. align="center"
  331. width="180px"
  332. label="计价单位"
  333. >
  334. <template slot-scope="scope">
  335. <el-select
  336. v-model="scope.row.fFeeunitid"
  337. placeholder="请选择计价单位"
  338. @change="changeFeeUnit(scope.row)"
  339. clearable
  340. :disabled="browseStatus"
  341. >
  342. <el-option
  343. v-for="(dict, index) in jFeetunitOptions"
  344. :key="index.dictValue"
  345. :label="dict.dictLabel"
  346. :value="dict.dictValue"
  347. />
  348. </el-select>
  349. </template>
  350. </el-table-column>
  351. <el-table-column label="单价" align="center">
  352. <el-input
  353. slot-scope="scope"
  354. v-model="scope.row.fPrice"
  355. placeholder="请输入单价"
  356. :disabled="prohibit"
  357. clearable
  358. size="small"
  359. />
  360. </el-table-column>
  361. <el-table-column label="录入人" align="center">
  362. <el-input
  363. slot-scope="scope"
  364. v-model="scope.row.createBy"
  365. :disabled="true"
  366. placeholder="默认录入人"
  367. clearable
  368. size="small"
  369. />
  370. </el-table-column>
  371. <el-table-column label="录入时间" align="center">
  372. <el-input
  373. slot-scope="scope"
  374. v-model="scope.row.createTime"
  375. placeholder="默认录入时间"
  376. :disabled="true"
  377. clearable
  378. size="small"
  379. />
  380. </el-table-column>
  381. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  382. <template slot-scope="scope">
  383. <el-button
  384. size="mini"
  385. type="text"
  386. icon="el-icon-delete"
  387. :disabled="prohibit"
  388. @click.native.prevent="deleteRow(scope.$index, agreementitemsList)"
  389. >删除
  390. </el-button>
  391. </template>
  392. </el-table-column>
  393. </el-table>
  394. <div slot="footer" class="dialog-footer">
  395. <el-button v-if="approvalProhibit" @click="immediateApproval">审批</el-button>
  396. <el-button v-if="form.fBillstatus > 2" @click="viewAudit">查看审批</el-button>
  397. <el-button type="primary" @click="submitForm" :disabled="determine">确 定</el-button>
  398. <el-button v-if="cancelButton === true" @click="cancel">取 消</el-button>
  399. <el-button v-if="cancelButton === false" @click="homePage">取 消</el-button>
  400. <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
  401. <approval-comments v-if="addOrUpdateVisib" ref="ApprovalComments" @refreshDataList="returnData"></approval-comments>
  402. </div>
  403. </el-dialog>
  404. </div>
  405. </template>
  406. <script>
  407. import moment from 'moment'
  408. import {
  409. listAgreement,
  410. getAgreement,
  411. delAgreement,
  412. addAgreement,
  413. updateAgreement,
  414. exportAgreement,
  415. listAgreementitems,
  416. queryUserVal,
  417. updateAgreements,
  418. collecTask,
  419. backCharge,
  420. revocation
  421. } from '@/api/agreement/agreement'
  422. import { listCorps } from '@/api/basicdata/corps'
  423. import { listGoods } from '@/api/basicdata/goods'
  424. import { listFees } from '@/api/basicdata/fees'
  425. import AddOrUpdate from '@/views/viewApproval'
  426. import ApprovalComments from '@/views/startApproval'
  427. import Global from "@/layout/components/global.js";
  428. export default {
  429. name: 'Agreement',
  430. components: {
  431. AddOrUpdate,
  432. ApprovalComments
  433. },
  434. data() {
  435. return {
  436. dataList: '',
  437. // 遮罩层
  438. loading: true,
  439. determine:false,
  440. cancelButton:true,
  441. approvalProhibit:false,
  442. loading_s: false,
  443. browseStatus: false,
  444. Xbutton:true,
  445. prohibit:false,
  446. addOrUpdateVisible:false,
  447. addOrUpdateVisib:false,
  448. tablefilter:false,
  449. // 计价单位
  450. jFeetunitOptions: [
  451. { dictLabel: "件数", dictValue: "1" },
  452. { dictLabel: "毛重", dictValue: "2" },
  453. { dictLabel: "净重", dictValue: "3" },
  454. { dictLabel: "尺码", dictValue: "4" },
  455. { dictLabel: "固定", dictValue: "5" },
  456. ],
  457. goodsOptions:[],
  458. fTypeidOptions: [],
  459. // 选中数组
  460. ids: [],
  461. deptName:'',
  462. // 客户(客户数据)
  463. fMblnoOptions: [],
  464. fFeeunitidOptions: [],
  465. fWbuOptions: [],
  466. // 非单个禁用
  467. single: true,
  468. // 非多个禁用
  469. multiple: true,
  470. // 显示搜索条件
  471. showSearch: true,
  472. // 总条数
  473. total: 0,
  474. // 仓储费表格数据
  475. agreementList: [],
  476. // 弹出层标题
  477. title: '',
  478. // 是否显示弹出层
  479. open: false,
  480. // 结算方式,也可以从表t_stltypes中下拉选择,存储id,显示name字典
  481. fStltypeidOptions: [],
  482. // 货物类别,存储t_packages,f_id 显示名称,可以多选t_packages 中的no或 name,模糊查找选择后,存储f_id,显示name字典
  483. tPackagesOptions: [],
  484. // 贸易方式,对应t_trademodels 字典
  485. fTrademodeidOptions: [],
  486. // 仓储费明细表表格数据
  487. agreementitemsList: [],
  488. // 查询参数
  489. queryParams: {
  490. pageNum: 1,
  491. pageSize: 10,
  492. fBillno: null,
  493. fDeptid: null,
  494. fContractno: null,
  495. fCorpid: null,
  496. fStltypeid: null,
  497. fGoodsid: null,
  498. fFeetypeid: null,
  499. tPackages: null,
  500. fTrademodeid: null,
  501. fFreedays: null,
  502. fBegindate: null,
  503. fEnddate: null,
  504. fBillstatus: null
  505. },
  506. // 表单参数
  507. form: {},
  508. // 表单校验
  509. rules: {
  510. fBillno: [
  511. {
  512. required: true,
  513. message: ' ',
  514. trigger: 'blur'
  515. }
  516. ],
  517. fCorpid: [
  518. { required: true, message: ' ', trigger: 'blur' }
  519. ]
  520. }
  521. }
  522. },
  523. created() {
  524. this.getList()
  525. this.getDicts('data_settlement_method').then(response => {
  526. this.fStltypeidOptions = response.data
  527. })
  528. this.getDicts('data_package_unit').then(response => {
  529. this.tPackagesOptions = response.data
  530. })
  531. this.getDicts('data_trademodes').then(response => {
  532. this.fTrademodeidOptions = response.data
  533. })
  534. this.getDicts("data_goods_category").then(response => {
  535. this.fTypeidOptions = response.data;
  536. });
  537. // this.getDicts("data_unitfees").then(response => {
  538. // this.jFeetunitOptions = response.data;
  539. // });
  540. },
  541. activated(){
  542. this.adoPt()
  543. },
  544. methods: {
  545. immediateApproval(){
  546. this.addOrUpdateVisib = true
  547. console.log(this.approval)
  548. this.$nextTick(() => {
  549. this.$refs.ApprovalComments.init(this.approval.billId,320)
  550. })
  551. },
  552. adoPt(){
  553. this.tablefilter = true
  554. this.approval = this.$route.query.data
  555. this.cancelButton = false
  556. if (this.approval){
  557. this.determine = true
  558. this.prohibit = true
  559. this.browseStatus = true
  560. this.Xbutton = false
  561. this.approval = JSON.parse(this.approval)
  562. this.approvalProhibit = true
  563. this.reset()
  564. this.pass = {
  565. fAmtdr: '', //应收合计
  566. fAmtcr: '', //应付合计
  567. fMblno: '', //提单号
  568. fName: '', //货权方
  569. fFeesName: '', //结算单位
  570. fCorpid: '' //结算单位ID
  571. }
  572. getAgreement(this.approval.billId).then(response => {
  573. console.log(this.deptName)
  574. console.log(response)
  575. this.deptName = response.data.dept.deptName
  576. this.form = response.data.tWarehouseAgreement
  577. this.fMblnoOptions = response.data.corps
  578. this.agreementitemsList = response.data.tWarehouseAgreementitems
  579. for (let item in this.agreementitemsList) {
  580. this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
  581. }
  582. this.fWbuOptions = response.data.feesList
  583. console.log(JSON.stringify(this.agreementitemsList))
  584. this.open = true
  585. this.title = '修改作业费'
  586. })
  587. }
  588. },
  589. viewAudit(){
  590. this.addOrUpdateVisible = true
  591. this.addOrUpdateVisib = false
  592. console.log(this.form)
  593. let id = '448'
  594. let actId = '110'
  595. this.$nextTick(() => {
  596. this.$refs.addOrUpdate.init(this.form.fId,320)
  597. })
  598. },
  599. returnData(){
  600. this.open = false
  601. this.addOrUpdateVisib = false
  602. this.homePage()
  603. },
  604. getDataList(){
  605. this.open = false
  606. this.addOrUpdateVisible = false
  607. this.homePage()
  608. },
  609. homePage(){
  610. let view = {
  611. fullPath: "/agreement/agreementTask",
  612. hash: "",
  613. matched: Array(2),
  614. meta: Object,
  615. name: "AgreementTask",
  616. params: Object,
  617. path: "/agreement/agreementTask",
  618. query: Object,
  619. title: "作业费协议",
  620. }
  621. this.$router.push({ path: '/index'})
  622. this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
  623. if (this.isActive(view)) {
  624. this.toLastView(visitedViews, view)
  625. }
  626. })
  627. Global.$emit("removeCache", "closeSelectedTag", view);
  628. },
  629. test_s(){
  630. console.log(this.agreementitemsList)
  631. },
  632. /** 创建仓储费明细表列表 */
  633. getList_s() {
  634. console.log(this.agreementitemsList)
  635. queryUserVal().then((response) => {
  636. this.agreementitemsList.push({
  637. //行号
  638. fLineno:'',
  639. //计价单位
  640. fFeeunitid:'',
  641. //费用名称
  642. fFeeid:'',
  643. //开始天数
  644. fFromdays:'',
  645. //结束天数
  646. fEndays:'',
  647. //单价
  648. fPrice: '',
  649. //录入人
  650. createBy:response.user.userName,
  651. //创建时间
  652. createTime:moment(Date.parse(new Date())).format("YYYY-MM-DD HH:mm:ss")
  653. })
  654. // this.$set("deptName", response.dept.deptName);
  655. this.deptName = response.dept.deptName
  656. this.form.fDeptid = response.dept.deptId
  657. this.agreementitemsList.createBy = response.user.userName
  658. // this.$set(this.agreementitemsList, "createBy", response.user.userName);
  659. //格式化时间戳
  660. // this.$set(this.agreementitemsList, "createTime", moment(Date.parse(new Date())).format("YYYY-MM-DD HH:mm:ss"));
  661. });
  662. listAgreementitems(this.queryParams).then(response => {
  663. console.log(response)
  664. })
  665. },
  666. speed(row,res){
  667. if(res == 1){
  668. this.determine = true
  669. this.prohibit = true
  670. this.browseStatus = true
  671. this.approvalProhibit = false
  672. this.reset()
  673. const fId = row.fId || this.ids
  674. getAgreement(fId).then(response => {
  675. console.log(this.deptName)
  676. console.log(response)
  677. this.deptName = response.data.dept.deptName
  678. this.form = response.data.tWarehouseAgreement
  679. this.fMblnoOptions = response.data.corps
  680. this.agreementitemsList = response.data.tWarehouseAgreementitems
  681. for (let item in this.agreementitemsList) {
  682. this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
  683. }
  684. this.fWbuOptions = response.data.feesList
  685. console.log(JSON.stringify(this.agreementitemsList))
  686. this.open = true
  687. this.title = '查看作业费'
  688. })
  689. }else {
  690. this.prohibit = true
  691. this.determine = true
  692. this.browseStatus = true
  693. this.approvalProhibit = false
  694. this.reset()
  695. const fId = row.fId || this.ids
  696. getAgreement(fId).then(response => {
  697. console.log(this.deptName)
  698. console.log(response)
  699. this.deptName = response.data.dept.deptName
  700. this.form = response.data.tWarehouseAgreement
  701. this.fMblnoOptions = response.data.corps
  702. this.agreementitemsList = response.data.tWarehouseAgreementitems
  703. for (let item in this.agreementitemsList) {
  704. this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
  705. }
  706. this.fWbuOptions = response.data.feesList
  707. console.log(JSON.stringify(this.agreementitemsList))
  708. this.open = true
  709. this.title = '查看作业费'
  710. })
  711. }
  712. },
  713. revocationApproval(){
  714. let data = {
  715. id:this.form.fId,
  716. actId: 320,
  717. billId:this.form.fId
  718. }
  719. console.log(this.form)
  720. revocation(data).then(data =>{
  721. console.log(data)
  722. if (data.code === 200){
  723. this.$message.success('撤销成功');
  724. this.open = false
  725. this.getList()
  726. }
  727. })
  728. },
  729. // 请核
  730. confirmCharge() {
  731. console.log(this.agreementitemsList)
  732. if(this.agreementitemsList.length !== 0){
  733. this.$refs['form'].validate(valid => {
  734. if (valid) {
  735. if (this.form.fId != null) {
  736. updateAgreement(this.form).then(response => {
  737. let formData = new window.FormData();
  738. // 附件数据
  739. this.form.fBillstatus = 4
  740. formData.append("agreement",JSON.stringify(this.form))
  741. formData.append("agreementitems", JSON.stringify(this.agreementitemsList));
  742. collecTask(formData).then(response => {
  743. this.msgSuccess('请核成功')
  744. this.open = false
  745. this.getList()
  746. this.agreementitemsList = []
  747. })
  748. })
  749. }
  750. }
  751. })
  752. }else {
  753. this.$message.error('作业费明细为空无法操作');
  754. }
  755. },
  756. // 撤销作业费
  757. revokeCharge(){
  758. this.form.fBillstatus = '1'
  759. let formDate = new window.FormData()
  760. formDate.append('agreement', JSON.stringify(this.form))
  761. formDate.append('agreementitems', JSON.stringify(this.agreementitemsList))
  762. backCharge(formDate).then(response => {
  763. console.log(response)
  764. this.open = false
  765. this.msgSuccess('操作成功')
  766. this.getList()
  767. })
  768. },
  769. /* 远程模糊查询商品 */
  770. goodsRemoteMethod(name) {
  771. if (name == null || name === "") {
  772. return false;
  773. }
  774. let queryParams = { pageNum: 1, pageSize: 10, fName: name };
  775. listGoods(queryParams).then((response) => {
  776. this.goodsOptions = response.rows;
  777. });
  778. },
  779. // 计价单位
  780. fFeeunitidFormat(row, column) {
  781. return this.selectDictLabel(this.fFeeunitidOptions, row.fFeeunitid);
  782. },
  783. /** 查询作业费列表 */
  784. getList() {
  785. this.loading = true
  786. listAgreement(this.queryParams).then(response => {
  787. console.log(response)
  788. this.agreementList = response.rows
  789. this.total = response.total
  790. this.loading = false
  791. })
  792. },
  793. // 结算方式,也可以从表t_stltypes中下拉选择,存储id,显示name字典翻译
  794. fStltypeidFormat(row, column) {
  795. return this.selectDictLabel(this.fStltypeidOptions, row.fStltypeid)
  796. },
  797. // 货物类别,存储t_packages,f_id 显示名称,可以多选t_packages 中的no或 name,模糊查找选择后,存储f_id,显示name字典翻译
  798. tPackagesFormat(row, column) {
  799. return this.selectDictLabel(this.tPackagesOptions, row.tPackages)
  800. },
  801. // 贸易方式,对应t_trademodels 字典翻译
  802. fTrademodeidFormat(row, column) {
  803. return this.selectDictLabel(this.fTrademodeidOptions, row.fTrademodeid)
  804. },
  805. // 取消按钮
  806. cancel() {
  807. this.open = false
  808. this.agreementitemsList = []
  809. this.reset()
  810. },
  811. handleClose(){
  812. this.open = false
  813. this.agreementitemsList = []
  814. this.reset()
  815. },
  816. // 表单重置
  817. reset() {
  818. this.form = {
  819. fId: null,
  820. fBillno: null,
  821. fDeptid: null,
  822. fContractno: null,
  823. fCorpid: null,
  824. fStltypeid: null,
  825. fGoodsid: null,
  826. fFeetypeid: null,
  827. tPackages: null,
  828. fTrademodeid: null,
  829. fFreedays: null,
  830. fBegindate: null,
  831. fEnddate: null,
  832. fBillstatus: '0',
  833. delFlag: null,
  834. createBy: null,
  835. createTime: null,
  836. updateBy: null,
  837. updateTime: null,
  838. remark: null
  839. }
  840. this.resetForm('form')
  841. },
  842. /** 搜索按钮操作 */
  843. handleQuery() {
  844. this.queryParams.pageNum = 1
  845. this.getList()
  846. },
  847. // 变更计价单位
  848. changeFeeUnit(row) {
  849. console.log(this.fCntqty);
  850. console.log(row);
  851. if (!row.fFeeUnitid) {
  852. return false;
  853. }
  854. if (row.fFeeUnitid === "0") {
  855. this.$set(row, "fQty", this.fCntqty);
  856. } else if (row.fFeeUnitid === "1") {
  857. this.$set(row, "fQty", this.fGrossweight);
  858. }
  859. if (row.fUnitprice) {
  860. this.$set(
  861. row,
  862. "fAmount",
  863. parseFloat(Number(row.fUnitprice) * Number(row.fQty)).toFixed(2)
  864. );
  865. }
  866. },
  867. /** 重置按钮操作 */
  868. resetQuery() {
  869. this.resetForm('queryForm')
  870. this.handleQuery()
  871. },
  872. // 多选框选中数据
  873. handleSelectionChange(selection) {
  874. this.ids = selection.map(item => item.fId)
  875. this.single = selection.length !== 1
  876. this.multiple = !selection.length
  877. },
  878. // 远程模糊查询费用名称
  879. fWRemoteMethod(name) {
  880. this.fWbuOptions = []
  881. if (name == null || name === "") {
  882. return false;
  883. }
  884. let queryParams = { pageNum: 1, pageSize: 10, fName: name };
  885. listFees(queryParams).then((response) => {
  886. this.fWbuOptions = response.rows
  887. // let fWbuOptions = this.fWbuOptions.concat(response.rows)
  888. // this.fWbuOptions = Array.from(new Set(fWbuOptions))
  889. });
  890. },
  891. // 作业费状态修改
  892. handleStatusChange(row) {
  893. if (row.fBillstatus == '6'){
  894. let text = row.fStatus === "0" ? "启用" : "停用";
  895. this.$confirm('确认要"' + text + '""' + row.fCorpid + '"用户吗?', "警告", {
  896. confirmButtonText: "确定",
  897. cancelButtonText: "取消",
  898. type: "warning"
  899. }).then(function() {
  900. return updateAgreements(row.fId, row.fStatus);
  901. }).then(() => {
  902. this.msgSuccess(text + "成功");
  903. }).catch(function() {
  904. row.fStatus = row.fStatus === "0" ? "1" : "0";
  905. });
  906. }else {
  907. row.fStatus = 0
  908. this.$message.error('审核完成时才能启用');
  909. }
  910. },
  911. /** 新增按钮操作 */
  912. handleAdd() {
  913. this.reset()
  914. this.open = true
  915. this.title = '添加作业费'
  916. queryUserVal().then((response) => {
  917. // this.$set("deptName", response.dept.deptName);
  918. this.deptName = response.dept.deptName
  919. this.form.fDeptid = response.dept.deptId
  920. // this.agreementitemsList.createBy = response.user.userName
  921. // this.$set(this.agreementitemsList, "createBy", response.user.userName);
  922. //格式化时间戳
  923. // this.$set(this.agreementitemsList, "createTime", moment(Date.parse(new Date())).format("YYYY-MM-DD HH:mm:ss"));
  924. });
  925. },
  926. /** 修改按钮操作 */
  927. handleUpdate(row) {
  928. this.reset()
  929. const fId = row.fId || this.ids
  930. getAgreement(fId).then(response => {
  931. console.log(this.deptName)
  932. console.log(response)
  933. this.deptName = response.data.dept.deptName
  934. this.form = response.data.tWarehouseAgreement
  935. this.fMblnoOptions = response.data.corps
  936. this.agreementitemsList = response.data.tWarehouseAgreementitems
  937. for (let item in this.agreementitemsList) {
  938. this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
  939. }
  940. this.fWbuOptions = response.data.feesList
  941. console.log(JSON.stringify(this.agreementitemsList))
  942. this.open = true
  943. this.title = '修改作业费'
  944. })
  945. },
  946. /** 远程模糊查询用户 */
  947. corpsRemoteMethod(name) {
  948. if (name == null || name === "") {
  949. return false;
  950. }
  951. let queryParams = { pageNum: 1, pageSize: 10, fName: name, type: 1 };
  952. listCorps(queryParams).then((response) => {
  953. this.fMblnoOptions = response.rows;
  954. this.KHblnoOptions = response.rows;
  955. });
  956. },
  957. /** 提交按钮 */
  958. submitForm() {
  959. this.$refs['form'].validate(valid => {
  960. if (valid) {
  961. if (this.form.fId != null) {
  962. updateAgreement(this.form).then(response => {
  963. let formData = new window.FormData();
  964. // 附件数据
  965. formData.append("agreement",JSON.stringify(this.form))
  966. formData.append("agreementitems", JSON.stringify(this.agreementitemsList));
  967. addAgreement(formData).then(response => {
  968. this.msgSuccess('修改成功')
  969. this.getList()
  970. })
  971. })
  972. } else {
  973. let formData = new window.FormData();
  974. // 附件数据
  975. formData.append("agreement",JSON.stringify(this.form))
  976. formData.append("agreementitems", JSON.stringify(this.agreementitemsList));
  977. addAgreement(formData).then(response => {
  978. this.msgSuccess('新增成功')
  979. this.getList()
  980. })
  981. }
  982. }
  983. })
  984. },
  985. /** 删除按钮操作 */
  986. handleDelete(row) {
  987. console.log(row)
  988. const fIds = row.fId || this.ids;
  989. this.$confirm('是否确认删除作业费编号为"' + fIds + '"的数据项?', "警告", {
  990. confirmButtonText: "确定",
  991. cancelButtonText: "取消",
  992. type: "warning"
  993. }).then(function() {
  994. return delAgreement(fIds);
  995. }).then(() => {
  996. this.getList();
  997. this.msgSuccess("删除成功");
  998. })
  999. },
  1000. /** 导出按钮操作 */
  1001. handleExport() {
  1002. const queryParams = this.queryParams
  1003. this.$confirm('是否确认导出所有作业费数据项?', '警告', {
  1004. confirmButtonText: '确定',
  1005. cancelButtonText: '取消',
  1006. type: 'warning'
  1007. }).then(function() {
  1008. return exportAgreement(queryParams)
  1009. }).then(response => {
  1010. this.download(response.msg)
  1011. })
  1012. },
  1013. deleteRow(index, rows) {
  1014. rows.splice(index, 1);
  1015. },
  1016. }
  1017. }
  1018. </script>