index.vue 35 KB

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