index.vue 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032
  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="fTaskType" label-width="90px">
  290. <el-select v-model="form.fTaskType" placeholder="请选择作业费类型" :disabled="browseStatus">
  291. <el-option label="车队作业费" value="1"/>
  292. <el-option label="劳务作业费" value="2"/>
  293. </el-select>
  294. </el-form-item>
  295. <el-form-item label="费用类型" prop="fDc">
  296. <el-select v-model="form.fDc" 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. fTaskType: '1',
  520. fDc : "D"
  521. },
  522. // 表单校验
  523. rules: {
  524. fBillno: [
  525. {
  526. required: true,
  527. message: ' ',
  528. trigger: 'blur'
  529. }
  530. ],
  531. fCorpid: [
  532. { required: true, message: ' ', trigger: 'blur' }
  533. ],
  534. tPackages:[
  535. { required: true, message: ' ', trigger: 'blur' }
  536. ],
  537. fBegindate:[
  538. { required: true, message: ' ', trigger: 'blur' }
  539. ],
  540. fEnddate:[
  541. { required: true, message: ' ', trigger: 'blur' }
  542. ]
  543. }
  544. }
  545. },
  546. created() {
  547. this.getList()
  548. this.getDicts('data_settlement_method').then(response => {
  549. this.fStltypeidOptions = response.data
  550. })
  551. this.getDicts('data_package_unit').then(response => {
  552. this.tPackagesOptions = response.data
  553. })
  554. this.getDicts('data_trademodes').then(response => {
  555. this.fTrademodeidOptions = response.data
  556. })
  557. this.getDicts("data_goods_category").then(response => {
  558. this.fTypeidOptions = response.data;
  559. });
  560. this.getDicts("data_unitfees").then(response => {
  561. this.jFeetunitOptions = response.data;
  562. });
  563. this.register()
  564. },
  565. activated(){
  566. this.adoPt()
  567. },
  568. methods: {
  569. // 默认录入人
  570. register() {
  571. queryUserVal().then((response)=>{
  572. this.lander = response.user.userName
  573. })
  574. },
  575. immediateApproval(){
  576. this.addOrUpdateVisib = true
  577. this.$nextTick(() => {
  578. this.$refs.ApprovalComments.init(this.approval.billId,320)
  579. })
  580. },
  581. adoPt(){
  582. this.tablefilter = true
  583. this.approval = this.$route.query.data
  584. if (this.approval){
  585. this.cancelButton = false
  586. this.determine = true
  587. this.Xbutton = false
  588. this.tablefilter = true
  589. this.browseStatus = true
  590. this.approval = JSON.parse(this.approval)
  591. this.approvalProhibit = true
  592. this.pass = {
  593. fAmtdr: '', //应收合计
  594. fAmtcr: '', //应付合计
  595. fMblno: '', //提单号
  596. fName: '', //货权方
  597. fFeesName: '', //结算单位
  598. fCorpid: '' //结算单位ID
  599. }
  600. getAgreement(this.approval.billId).then(response => {
  601. this.deptName = response.data.dept.deptName
  602. this.form = response.data.tWarehouseAgreement
  603. this.$set(this.form, 'fEnddate', Date.parse(this.form.fEnddate))
  604. this.$set(this.form, 'fBegindate', Date.parse(this.form.fBegindate))
  605. this.fMblnoOptions = response.data.corps
  606. this.agreementitemsList = response.data.tWarehouseAgreementitems
  607. for (let item in this.agreementitemsList) {
  608. this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
  609. }
  610. this.fWbuOptions = response.data.feesList
  611. this.open = true
  612. this.title = '修改作业费'
  613. })
  614. }
  615. },
  616. viewAudit(){
  617. this.addOrUpdateVisible = true
  618. this.addOrUpdateVisib = false
  619. let id = '448'
  620. let actId = '110'
  621. this.$nextTick(() => {
  622. this.$refs.addOrUpdate.init(this.form.fId,320)
  623. })
  624. },
  625. returnData(){
  626. this.open = false
  627. this.addOrUpdateVisib = false
  628. this.homePage()
  629. },
  630. getDataList(){
  631. this.addOrUpdateVisible = false
  632. },
  633. homePage(){
  634. let view = {
  635. fullPath: "/agreement/agreementTask",
  636. hash: "",
  637. matched: Array(2),
  638. meta: Object,
  639. name: "AgreementTask",
  640. params: Object,
  641. path: "/agreement/agreementTask",
  642. query: Object,
  643. title: "作业费协议",
  644. }
  645. this.$router.push({ path: '/index' })
  646. this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
  647. if (this.isActive(view)) {
  648. this.toLastView(visitedViews, view)
  649. }
  650. })
  651. Global.$emit('removeCache', 'closeSelectedTag', view)
  652. },
  653. /** 创建仓储费明细表列表 */
  654. getList_s() {
  655. queryUserVal().then((response) => {
  656. this.agreementitemsList.push({
  657. //行号
  658. fLineno: '',
  659. //计价单位
  660. fFeeunitid: '',
  661. //费用名称
  662. fFeeid: '',
  663. //开始天数
  664. fFromdays: '',
  665. //结束天数
  666. fEndays: '',
  667. //单价
  668. fPrice: '',
  669. //录入人
  670. createBy: response.user.userName,
  671. //创建时间
  672. createTime: moment(Date.parse(new Date())).format('YYYY-MM-DD HH:mm:ss')
  673. })
  674. this.deptName = response.dept.deptName
  675. this.form.fDeptid = response.dept.deptId
  676. this.agreementitemsList.createBy = response.user.userName
  677. })
  678. },
  679. speed_s(row, res) {
  680. this.stop = true
  681. this.determine = true
  682. this.tablefilter = true
  683. this.browseStatus = true
  684. this.approvalProhibit = false
  685. const fId = row.fId || this.ids
  686. getAgreement(fId).then(response => {
  687. this.deptName = response.data.dept.deptName
  688. this.form = response.data.tWarehouseAgreement
  689. this.$set(this.form, 'fTaskType', this.form.fTaskType + '')
  690. this.$set(this.form, 'fEnddate', Date.parse(this.form.fEnddate))
  691. this.$set(this.form, 'fBegindate', Date.parse(this.form.fBegindate))
  692. this.operator = this.form.createBy
  693. this.fMblnoOptions = response.data.corps
  694. this.agreementitemsList = response.data.tWarehouseAgreementitems
  695. for (let item in this.agreementitemsList) {
  696. this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
  697. }
  698. this.fWbuOptions = response.data.feesList
  699. this.open = true
  700. this.title = '查看作业费'
  701. })
  702. },
  703. speed(row, res) {
  704. this.register()
  705. if (res === 1) {
  706. this.tablefilter = false
  707. }
  708. this.determine = true
  709. this.browseStatus = true
  710. this.approvalProhibit = false
  711. const fId = row.fId || this.ids
  712. getAgreement(fId).then(response => {
  713. this.fMblnoOptions = response.data.corps
  714. this.deptName = response.data.dept.deptName
  715. this.form = response.data.tWarehouseAgreement
  716. this.$set(this.form, 'fEnddate', Date.parse(this.form.fEnddate))
  717. this.$set(this.form, 'fBegindate', Date.parse(this.form.fBegindate))
  718. this.operator = this.form.createBy
  719. this.agreementitemsList = response.data.tWarehouseAgreementitems
  720. for (let item in this.agreementitemsList) {
  721. this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
  722. }
  723. this.fWbuOptions = response.data.feesList
  724. this.open = true
  725. this.title = '查看作业费'
  726. })
  727. },
  728. revocationApproval(){
  729. let data = {
  730. id:this.form.fId,
  731. actId: 320,
  732. billId:this.form.fId
  733. }
  734. revocation(data).then(data =>{
  735. if (data.code === 200){
  736. this.$message.success('撤销成功');
  737. this.open = false
  738. this.getList()
  739. }
  740. })
  741. },
  742. // 请核
  743. confirmCharge() {
  744. if (this.agreementitemsList.length <= 0) {
  745. this.$message.error('作业费明细为空无法操作')
  746. return false
  747. }
  748. for (let agr = 0; agr < this.agreementitemsList.length; agr ++) {
  749. if (!this.agreementitemsList[agr].fFeeid) {
  750. this.$message.error('请维护费用名称')
  751. return false
  752. }
  753. if (!this.agreementitemsList[agr].fFeeunitid) {
  754. this.$message.error('请维计价单位')
  755. return false
  756. }
  757. if (!this.agreementitemsList[agr].fPrice) {
  758. this.$message.error('请维单价')
  759. return false
  760. }
  761. }
  762. this.$refs['form'].validate(valid => {
  763. if (valid) {
  764. let formData = new window.FormData()
  765. formData.append('agreement', JSON.stringify(this.form))
  766. formData.append('agreementitems', JSON.stringify(this.agreementitemsList))
  767. collecTask(formData).then(response => {
  768. this.msgSuccess('请核成功')
  769. this.open = false
  770. this.agreementitemsList = []
  771. this.getList()
  772. })
  773. }
  774. })
  775. },
  776. // 撤销作业费
  777. revokeCharge(){
  778. this.form.fBillstatus = '1'
  779. let formDate = new window.FormData()
  780. formDate.append('agreement', JSON.stringify(this.form))
  781. formDate.append('agreementitems', JSON.stringify(this.agreementitemsList))
  782. backCharge(formDate).then(response => {
  783. this.open = false
  784. this.msgSuccess('操作成功')
  785. this.getList()
  786. })
  787. },
  788. /* 远程模糊查询商品 */
  789. goodsRemoteMethod(name) {
  790. if (name == null || name === "") {
  791. return false;
  792. }
  793. let queryParams = { pageNum: 1, pageSize: 10, fName: name };
  794. listGoods(queryParams).then((response) => {
  795. this.goodsOptions = response.rows;
  796. });
  797. },
  798. // 计价单位
  799. fFeeunitidFormat(row, column) {
  800. return this.selectDictLabel(this.fFeeunitidOptions, row.fFeeunitid);
  801. },
  802. /** 查询作业费列表 */
  803. getList() {
  804. this.loading = true
  805. listAgreement(this.queryParams).then(response => {
  806. this.agreementList = response.rows
  807. this.total = response.total
  808. this.loading = false
  809. })
  810. },
  811. // 结算方式,也可以从表t_stltypes中下拉选择,存储id,显示name字典翻译
  812. fStltypeidFormat(row, column) {
  813. return this.selectDictLabel(this.fStltypeidOptions, row.fStltypeid)
  814. },
  815. // 货物类别,存储t_packages,f_id 显示名称,可以多选t_packages 中的no或 name,模糊查找选择后,存储f_id,显示name字典翻译
  816. tPackagesFormat(row, column) {
  817. return this.selectDictLabel(this.tPackagesOptions, row.tPackages)
  818. },
  819. // 贸易方式,对应t_trademodels 字典翻译
  820. fTrademodeidFormat(row, column) {
  821. return this.selectDictLabel(this.fTrademodeidOptions, row.fTrademodeid)
  822. },
  823. // 取消按钮
  824. cancel() {
  825. this.reset()
  826. this.getList()
  827. this.open = false
  828. },
  829. handleClose(){
  830. this.reset()
  831. this.getList()
  832. this.open = false
  833. },
  834. // 表单重置
  835. reset() {
  836. this.determine = false
  837. this.browseStatus = false
  838. this.agreementitemsList = []
  839. this.form = {
  840. fId: null,
  841. fBillno: null,
  842. fDeptid: null,
  843. fContractno: null,
  844. fCorpid: null,
  845. fStltypeid: null,
  846. fGoodsid: null,
  847. fFeetypeid: null,
  848. tPackages: null,
  849. fTrademodeid: null,
  850. fFreedays: null,
  851. fBegindate: null,
  852. fEnddate: null,
  853. fBillstatus: '0',
  854. delFlag: null,
  855. createBy: null,
  856. createTime: null,
  857. updateBy: null,
  858. updateTime: null,
  859. remark: null
  860. }
  861. this.resetForm('form')
  862. },
  863. /** 搜索按钮操作 */
  864. handleQuery() {
  865. this.queryParams.pageNum = 1
  866. this.getList()
  867. },
  868. // 变更计价单位
  869. changeFeeUnit(row) {
  870. if (!row.fFeeUnitid) {
  871. return false;
  872. }
  873. if (row.fFeeUnitid === "0") {
  874. this.$set(row, "fQty", this.fCntqty);
  875. } else if (row.fFeeUnitid === "1") {
  876. this.$set(row, "fQty", this.fGrossweight);
  877. }
  878. if (row.fUnitprice) {
  879. this.$set(row, "fAmount", parseFloat(Number(row.fUnitprice) * Number(row.fQty)).toFixed(2));
  880. }
  881. },
  882. /** 重置按钮操作 */
  883. resetQuery() {
  884. this.resetForm('queryForm')
  885. this.handleQuery()
  886. },
  887. // 多选框选中数据
  888. handleSelectionChange(selection) {
  889. this.ids = selection.map(item => item.fId)
  890. this.single = selection.length !== 1
  891. this.multiple = !selection.length
  892. },
  893. // 远程模糊查询费用名称
  894. fWRemoteMethod(name) {
  895. this.fWbuOptions = []
  896. if (name == null || name === "") {
  897. return false;
  898. }
  899. let queryParams = { pageNum: 1, pageSize: 10, fName: name };
  900. listFees(queryParams).then((response) => {
  901. this.fWbuOptions = response.rows
  902. });
  903. },
  904. // 作业费状态修改
  905. handleStatusChange(row) {
  906. if (row.fBillstatus == '6'){
  907. let text = row.fStatus === "0" ? "启用" : "停用";
  908. this.$confirm('确认要"' + text + '""' + row.fCorpid + '"用户吗?', "警告", {
  909. confirmButtonText: "确定",
  910. cancelButtonText: "取消",
  911. type: "warning"
  912. }).then(function() {
  913. return updateAgreements(row.fId, row.fStatus);
  914. }).then(() => {
  915. this.msgSuccess(text + "成功");
  916. }).catch(function() {
  917. row.fStatus = row.fStatus === "0" ? "1" : "0";
  918. });
  919. }else {
  920. row.fStatus = 0
  921. this.$message.error('审核完成时才能启用');
  922. }
  923. },
  924. /** 新增按钮操作 */
  925. handleAdd() {
  926. this.stop = false
  927. this.determine = false
  928. this.browseStatus = false
  929. this.reset()
  930. this.open = true
  931. this.title = '添加作业费'
  932. this.form = {
  933. fTaskType :'1',
  934. fDc:"D"
  935. }
  936. queryUserVal().then((response) => {
  937. this.deptName = response.dept.deptName
  938. this.form.fDeptid = response.dept.deptId
  939. });
  940. },
  941. /** 修改按钮操作 */
  942. handleUpdate(row) {
  943. this.stop = false
  944. this.browseStatus = false
  945. this.determine = false
  946. this.reset()
  947. this.cancelButton = true
  948. const fId = row.fId || this.ids
  949. getAgreement(fId).then(response => {
  950. this.register()
  951. this.deptName = response.data.dept.deptName
  952. this.form = response.data.tWarehouseAgreement
  953. this.$set(this.form, 'fTaskType', this.form.fTaskType + '')
  954. this.$set(this.form, 'fEnddate', Date.parse(this.form.fEnddate))
  955. this.$set(this.form, 'fBegindate', Date.parse(this.form.fBegindate))
  956. this.operator = this.form.createBy
  957. this.fMblnoOptions = response.data.corps
  958. this.agreementitemsList = response.data.tWarehouseAgreementitems
  959. for (let item in this.agreementitemsList) {
  960. this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
  961. }
  962. this.fWbuOptions = response.data.feesList
  963. this.open = true
  964. this.title = '修改作业费'
  965. })
  966. },
  967. /** 远程模糊查询用户 */
  968. corpsRemoteMethod(name) {
  969. if (name == null || name === "") {
  970. return false;
  971. }
  972. let queryParams = { pageNum: 1, pageSize: 10, fName: name, type: 1 };
  973. listCorps(queryParams).then((response) => {
  974. this.fMblnoOptions = response.rows;
  975. this.KHblnoOptions = response.rows;
  976. });
  977. },
  978. /** 提交按钮 */
  979. submitForm() {
  980. this.$refs['form'].validate(valid => {
  981. if (valid) {
  982. let formData = new window.FormData()
  983. formData.append('agreement', JSON.stringify(this.form))
  984. formData.append('agreementitems', JSON.stringify(this.agreementitemsList))
  985. addAgreement(formData).then(response => {
  986. this.msgSuccess('操作成功')
  987. this.form = response.data.tWarehouseAgreement
  988. this.$set(this.form, 'fTaskType', this.form.fTaskType + '')
  989. this.$set(this.form, 'fEnddate', Date.parse(this.form.fEnddate))
  990. this.$set(this.form, 'fBegindate', Date.parse(this.form.fBegindate))
  991. })
  992. }
  993. })
  994. },
  995. /** 删除按钮操作 */
  996. handleDelete(row) {
  997. const fIds = row.fId || this.ids;
  998. this.$confirm('是否确认删除作业费编号为"' + fIds + '"的数据项?', "警告", {
  999. confirmButtonText: "确定",
  1000. cancelButtonText: "取消",
  1001. type: "warning"
  1002. }).then(function() {
  1003. return delAgreement(fIds);
  1004. }).then(() => {
  1005. this.getList();
  1006. this.msgSuccess("删除成功");
  1007. })
  1008. },
  1009. /** 导出按钮操作 */
  1010. handleExport() {
  1011. const queryParams = this.queryParams
  1012. this.$confirm('是否确认导出所有作业费数据项?', '警告', {
  1013. confirmButtonText: '确定',
  1014. cancelButtonText: '取消',
  1015. type: 'warning'
  1016. }).then(function() {
  1017. return exportAgreement(queryParams)
  1018. }).then(response => {
  1019. this.download(response.msg)
  1020. })
  1021. },
  1022. deleteRow(index, rows) {
  1023. rows.splice(index, 1);
  1024. },
  1025. }
  1026. }
  1027. </script>