index.vue 38 KB

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