index.vue 39 KB

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