index.vue 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112
  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. <el-button type="success" @click="BackSubmit" v-if="form.fBillstatus === '6'">撤销请核</el-button>
  295. <div class="dialogTableTitle flex a-center jlr">
  296. <h2>标题</h2>
  297. <el-button @click="getList_s()" :disabled="notChange">新增</el-button>
  298. </div>
  299. <el-table v-loading="loading_s" :data="agreementitemsList" @selection-change="handleSelectionChange">
  300. <!-- <el-table-column type="selection" width="55" align="center"/>-->
  301. <el-table-column label="行号" align="center" type="index"/>
  302. <el-table-column
  303. prop="fFeeunitid"
  304. header-align="center"
  305. align="center"
  306. width="180px"
  307. label="计价单位"
  308. >
  309. <template slot-scope="scope">
  310. <el-select
  311. v-model="scope.row.fFeeunitid"
  312. placeholder="请选择计价单位"
  313. @change="changeFeeUnit(scope.row)"
  314. clearable
  315. :disabled="browseStatus"
  316. >
  317. <el-option
  318. v-for="(dict, index) in jFeetunitOptions"
  319. :key="index.dictValue"
  320. :label="dict.dictLabel"
  321. :value="dict.dictValue"
  322. />
  323. </el-select>
  324. </template>
  325. </el-table-column>
  326. <el-table-column label="开始天数" align="center">
  327. <template slot-scope="scope">
  328. <el-input
  329. v-model="scope.row.fFromdays"
  330. placeholder="请输入开始天数"
  331. clearable
  332. size="small"
  333. :disabled="notChange"
  334. />
  335. </template>
  336. </el-table-column>
  337. <el-table-column label="结束天数" align="center">
  338. <template slot-scope="scope">
  339. <el-input
  340. v-model="scope.row.fEndays"
  341. placeholder="请输入结束天数"
  342. clearable
  343. size="small"
  344. :disabled="notChange"
  345. />
  346. </template>
  347. </el-table-column>
  348. <el-table-column label="单价" align="center">
  349. <el-input
  350. slot-scope="scope"
  351. v-model="scope.row.fPrice"
  352. placeholder="请输入单价"
  353. clearable
  354. size="small"
  355. :disabled="notChange"
  356. />
  357. </el-table-column>
  358. <el-table-column label="录入人" align="center">
  359. <el-input
  360. slot-scope="scope"
  361. v-model="scope.row.createBy"
  362. :disabled="true"
  363. placeholder="默认录入人"
  364. clearable
  365. size="small"
  366. />
  367. </el-table-column>
  368. <el-table-column label="录入时间" align="center">
  369. <el-input
  370. slot-scope="scope"
  371. v-model="scope.row.createTime"
  372. placeholder="默认录入时间"
  373. :disabled="true"
  374. clearable
  375. size="small"
  376. />
  377. </el-table-column>
  378. <el-table-column
  379. prop="fFeeid"
  380. header-align="center"
  381. align="center"
  382. width="180px"
  383. label="费用名称"
  384. >
  385. <template slot-scope="scope">
  386. <el-select
  387. v-model="scope.row.fFeeid"
  388. filterable
  389. remote
  390. :disabled="browseStatus"
  391. :remote-method="fWRemoteMethod"
  392. placeholder="费用名称"
  393. >
  394. <el-option
  395. v-for="(dict, index) in fWbuOptions"
  396. :key="index.fId"
  397. :label="dict.fName"
  398. :value="dict.fId"
  399. ></el-option>
  400. </el-select>
  401. </template>
  402. </el-table-column>
  403. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  404. <template slot-scope="scope">
  405. <el-button
  406. size="mini"
  407. type="text"
  408. icon="el-icon-delete"
  409. @click.native.prevent="deleteRow(scope.$index, agreementitemsList)"
  410. >删除
  411. </el-button>
  412. </template>
  413. </el-table-column>
  414. </el-table>
  415. <div slot="footer" class="dialog-footer">
  416. <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
  417. <approval-comments v-if="addOrUpdateVisib" ref="ApprovalComments" @refreshDataList="returnData"></approval-comments>
  418. <el-button v-if="approve === true" @click="goApproval">审批</el-button>
  419. <el-button type="danger" :disabled="disappear" @click="approvalRevocation" v-if="form.fBillstatus === '4'">撤销审批</el-button>
  420. <el-button type="info" v-if="notChange" @click="addOrUpdateHandle()">查看审批流</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. },
  572. activated(){
  573. this.Jump()
  574. },
  575. methods: {
  576. homepaGe(){
  577. let view = {
  578. fullPath: "/agreement/agreementStorage",
  579. hash: "",
  580. matched: Array(2),
  581. meta: Object,
  582. name: "AgreementStorage",
  583. params: Object,
  584. path: "/agreement/agreementStorage",
  585. query: Object,
  586. title: "仓储费协议"
  587. }
  588. this.$router.push({ path: '/index'})
  589. this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
  590. if (this.isActive(view)) {
  591. this.toLastView(visitedViews, view)
  592. }
  593. })
  594. Global.$emit("removeCache", "closeSelectedTag", view);
  595. },
  596. homePage() {
  597. this.open = false
  598. let view = {
  599. fullPath: "/agreement/agreementStorage",
  600. hash: "",
  601. matched: Array(2),
  602. meta: Object,
  603. name: "AgreementStorage",
  604. params: Object,
  605. path: "/agreement/agreementStorage",
  606. query: Object,
  607. title: "仓储费协议"
  608. }
  609. this.$router.push({ path: '/index' })
  610. this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
  611. console.log(visitedViews)
  612. if (this.isActive(view)) {
  613. this.toLastView(visitedViews, view)
  614. }
  615. })
  616. Global.$emit("removeCache", "closeSelectedTag", view);
  617. },
  618. Jump(){
  619. this.approval = this.$route.query.data
  620. if(this.approval) {
  621. this.approval = JSON.parse(this.approval)
  622. this.hide = false
  623. this.open = true
  624. this.notChange = true
  625. this.approve = true
  626. this.disappear = true
  627. this.cancelButton = false
  628. this.reset()
  629. getAgreement(this.approval.billId).then(response => {
  630. console.log(response)
  631. this.deptName = response.data.dept.deptName
  632. this.form = response.data.tWarehouseAgreement
  633. this.fMblnoOptions = response.data.corps
  634. this.agreementitemsList = response.data.tWarehouseAgreementitems
  635. for (let item in this.agreementitemsList) {
  636. this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
  637. // this.fWRemoteMethod(this.agreementitemsList[item].fFeeid)
  638. }
  639. // console.log(response.data.feesList)
  640. this.fWbuOptions = response.data.feesList
  641. // this.add = row
  642. console.log(JSON.stringify(this.agreementitemsList))
  643. this.open = true
  644. this.browseStatus = true
  645. })
  646. }
  647. },
  648. goApproval(){
  649. this.addOrUpdateVisib = true
  650. console.log(this.approval)
  651. this.$nextTick(() => {
  652. this.$refs.ApprovalComments.init(this.form.fId,this.agreementId)
  653. })
  654. },
  655. returnData(){
  656. this.addOrUpdateVisib = false
  657. this.open = false
  658. this.homepaGe()
  659. },
  660. getDataList(){
  661. this.addOrUpdateVisible = false
  662. },
  663. // 查看审批流
  664. addOrUpdateHandle() {
  665. this.addOrUpdateVisible = true
  666. this.addOrUpdateVisib = false
  667. let id = '448'
  668. let actId = '110'
  669. console.log(this.form.fId)
  670. this.$nextTick(() => {
  671. this.$refs.addOrUpdate.init(this.form.fId, this.agreementId)
  672. })
  673. },
  674. register() {
  675. queryUserVal().then((response) => {
  676. this.Lander = response.user.userName
  677. })
  678. },
  679. // 查看按钮
  680. check(row, res) {
  681. this.notChange = true
  682. this.browseStatus = true
  683. getAgreement(row.fId).then(response => {
  684. console.log(response)
  685. this.Operator = response.data.corps.createBy
  686. console.log(response.data.corps.createBy)
  687. console.log(response)
  688. this.deptName = response.data.dept.deptName
  689. this.form = response.data.tWarehouseAgreement
  690. this.fMblnoOptions = response.data.corps
  691. this.agreementitemsList = response.data.tWarehouseAgreementitems
  692. for (let item in this.agreementitemsList) {
  693. this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
  694. // this.fWRemoteMethod(this.agreementitemsList[item].fFeeid)
  695. }
  696. // console.log(response.data.feesList)
  697. this.fWbuOptions = response.data.feesList
  698. this.add = row
  699. console.log(JSON.stringify(this.agreementitemsList))
  700. this.open = true
  701. this.disappear = true
  702. this.title = '修改仓储费'
  703. if (res == 1) {
  704. this.notChange = true
  705. if (this.Operator == this.Lander) {
  706. this.disappear = false
  707. this.reset()
  708. const fId = row.fId || this.ids
  709. // getAgreement(row.fId).then(response => {
  710. // console.log(response)
  711. // this.deptName = response.data.dept.deptName
  712. // this.form = response.data.tWarehouseAgreement
  713. // this.fMblnoOptions = response.data.corps
  714. // this.agreementitemsList = response.data.tWarehouseAgreementitems
  715. // for (let item in this.agreementitemsList) {
  716. // this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
  717. // // this.fWRemoteMethod(this.agreementitemsList[item].fFeeid)
  718. // }
  719. // // console.log(response.data.feesList)
  720. // this.fWbuOptions = response.data.feesList
  721. // this.add = row
  722. // console.log(JSON.stringify(this.agreementitemsList))
  723. // this.open = true
  724. // })
  725. }else {
  726. this.notChange = true
  727. }
  728. }else{
  729. this.notChange = true
  730. this.reset()
  731. }
  732. })
  733. const fId = row.fId || this.ids
  734. getAgreement(row.fId).then(response => {
  735. console.log(response)
  736. this.deptName = response.data.dept.deptName
  737. this.form = response.data.tWarehouseAgreement
  738. this.fMblnoOptions = response.data.corps
  739. this.agreementitemsList = response.data.tWarehouseAgreementitems
  740. for (let item in this.agreementitemsList) {
  741. this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
  742. // this.fWRemoteMethod(this.agreementitemsList[item].fFeeid)
  743. }
  744. // console.log(response.data.feesList)
  745. this.fWbuOptions = response.data.feesList
  746. this.add = row
  747. console.log(JSON.stringify(this.agreementitemsList))
  748. this.open = true
  749. })
  750. },
  751. //撤销审批
  752. approvalRevocation() {
  753. let data = {
  754. id: this.form.fId,
  755. actId: this.agreementId,
  756. billId: this.form.fId
  757. }
  758. console.log(this.queryParams)
  759. revocation(data).then(data => {
  760. console.log(data)
  761. if (data.code === 200) {
  762. this.$message.success('撤销成功')
  763. this.open = false
  764. this.getList()
  765. }
  766. })
  767. },
  768. // 撤销请核
  769. BackSubmit() {
  770. console.log(this.form)
  771. this.form.fBillstatus = '1'
  772. let formDate = new window.FormData()
  773. formDate.append('agreement', JSON.stringify(this.form))
  774. formDate.append('agreementitems', JSON.stringify(this.agreementitemsList))
  775. console.log(formDate)
  776. ReturnCheck(formDate).then(response => {
  777. this.open = false
  778. this.msgSuccess('操作成功')
  779. this.getList()
  780. })
  781. },
  782. // 请核按钮
  783. submit() {
  784. if (this.agreementitemsList.length !== 0) {
  785. this.form.fBillstatus = '4'
  786. let formData = new window.FormData()
  787. // 附件数据
  788. formData.append('agreement', JSON.stringify(this.form))
  789. formData.append('agreementitems', JSON.stringify(this.agreementitemsList))
  790. PleaseCheck(formData).then(response => {
  791. this.msgSuccess('请核成功')
  792. this.open = false
  793. this.getList()
  794. })
  795. } else {
  796. this.$message.error('仓储费协议明细为空,无法操作')
  797. }
  798. },
  799. // 仓储费状态修改
  800. handleStatusChange(row) {
  801. if(row.fBillstatus == '6'){
  802. let text = row.fBillstatus === '0' ? '启用' : '停用'
  803. this.$confirm('确认要"' + text + '""' + row.fCorpid + '"用户吗?', '警告', {
  804. confirmButtonText: '确定',
  805. cancelButtonText: '取消',
  806. type: 'warning'
  807. }).then(function() {
  808. return updateAgreement_s(row.fId, row.fBillstatus)
  809. }).then(() => {
  810. this.msgSuccess(text + '成功')
  811. }).catch(function() {
  812. row.fBillstatus = row.fBillstatus === '0' ? '1' : '0'
  813. })
  814. }else{
  815. row.fStatus = 0
  816. this.$message.error('审核完成时才能启用');
  817. }
  818. },
  819. test_s() {
  820. console.log(this.agreementitemsList)
  821. },
  822. /** 创建仓储费明细表列表 */
  823. getList_s() {
  824. console.log(this.agreementitemsList)
  825. queryUserVal().then((response) => {
  826. this.agreementitemsList.push({
  827. //行号
  828. fLineno: '',
  829. //计价单位
  830. fFeeunitid: '',
  831. //费用名称
  832. fFeeid: '',
  833. //开始天数
  834. fFromdays: '',
  835. //结束天数
  836. fEndays: '',
  837. //单价
  838. fPrice: '',
  839. //录入人
  840. createBy: response.user.userName,
  841. //创建时间
  842. createTime: moment(Date.parse(new Date())).format('YYYY-MM-DD HH:mm:ss')
  843. })
  844. // this.$set("deptName", response.dept.deptName);
  845. this.deptName = response.dept.deptName
  846. this.form.fDeptid = response.dept.deptId
  847. this.agreementitemsList.createBy = response.user.userName
  848. // this.$set(this.agreementitemsList, "createBy", response.user.userName);
  849. //格式化时间戳
  850. // this.$set(this.agreementitemsList, "createTime", moment(Date.parse(new Date())).format("YYYY-MM-DD HH:mm:ss"));
  851. })
  852. listAgreementitems(this.queryParams).then(response => {
  853. console.log(response)
  854. })
  855. },
  856. /* 远程模糊查询商品 */
  857. goodsRemoteMethod(name) {
  858. if (name == null || name === '') {
  859. return false
  860. }
  861. let queryParams = { pageNum: 1, pageSize: 10, fName: name }
  862. listGoods(queryParams).then((response) => {
  863. this.goodsOptions = response.rows
  864. })
  865. },
  866. // 计价单位
  867. fFeeunitidFormat(row, column) {
  868. return this.selectDictLabel(this.fFeeunitidOptions, row.fFeeunitid)
  869. },
  870. /** 查询仓储费列表 */
  871. getList() {
  872. this.loading = true
  873. listAgreements(this.queryParams).then(response => {
  874. console.log(response)
  875. this.agreementList = response.rows
  876. this.total = response.total
  877. this.loading = false
  878. })
  879. },
  880. // 远程模糊查询费用名称
  881. fWRemoteMethod(name) {
  882. this.fWbuOptions = []
  883. if (name == null || name === '') {
  884. return false
  885. }
  886. let queryParams = { pageNum: 1, pageSize: 10, fName: name }
  887. listFees(queryParams).then((response) => {
  888. console.log(this.fWbuOptions)
  889. this.fWbuOptions = response.rows
  890. })
  891. },
  892. // 结算方式,也可以从表t_stltypes中下拉选择,存储id,显示name字典翻译
  893. fStltypeidFormat(row, column) {
  894. return this.selectDictLabel(this.fStltypeidOptions, row.fStltypeid)
  895. },
  896. // 货物类别,存储t_packages,f_id 显示名称,可以多选t_packages 中的no或 name,模糊查找选择后,存储f_id,显示name字典翻译
  897. tPackagesFormat(row, column) {
  898. return this.selectDictLabel(this.tPackagesOptions, row.tPackages)
  899. },
  900. // 贸易方式,对应t_trademodels 字典翻译
  901. fTrademodeidFormat(row, column) {
  902. return this.selectDictLabel(this.fTrademodeidOptions, row.fTrademodeid)
  903. },
  904. // 取消按钮
  905. cancel() {
  906. this.open = false
  907. this.agreementitemsList = []
  908. this.reset()
  909. },
  910. handleClose() {
  911. this.open = false
  912. this.agreementitemsList = []
  913. this.reset()
  914. },
  915. // 表单重置
  916. reset() {
  917. this.form = {
  918. fId: null,
  919. fBillno: null,
  920. fDeptid: null,
  921. fContractno: null,
  922. fCorpid: null,
  923. fStltypeid: null,
  924. fGoodsid: null,
  925. fFeetypeid: null,
  926. tPackages: null,
  927. fTrademodeid: null,
  928. fFreedays: null,
  929. fBegindate: null,
  930. fEnddate: null,
  931. fBillstatus: 'T',
  932. delFlag: null,
  933. createBy: null,
  934. createTime: null,
  935. updateBy: null,
  936. updateTime: null,
  937. remark: null
  938. }
  939. this.resetForm('form')
  940. },
  941. /** 搜索按钮操作 */
  942. handleQuery() {
  943. this.queryParams.pageNum = 1
  944. this.getList()
  945. },
  946. // 变更计价单位
  947. changeFeeUnit(row) {
  948. console.log(this.fCntqty)
  949. console.log(row)
  950. if (!row.fFeeUnitid) {
  951. return false
  952. }
  953. if (row.fFeeUnitid === '0') {
  954. this.$set(row, 'fQty', this.fCntqty)
  955. } else if (row.fFeeUnitid === '1') {
  956. this.$set(row, 'fQty', this.fGrossweight)
  957. }
  958. if (row.fUnitprice) {
  959. this.$set(
  960. row,
  961. 'fAmount',
  962. parseFloat(Number(row.fUnitprice) * Number(row.fQty)).toFixed(2)
  963. )
  964. }
  965. },
  966. /** 重置按钮操作 */
  967. resetQuery() {
  968. this.resetForm('queryForm')
  969. this.handleQuery()
  970. },
  971. // 多选框选中数据
  972. handleSelectionChange(selection) {
  973. this.ids = selection.map(item => item.fId)
  974. this.single = selection.length !== 1
  975. this.multiple = !selection.length
  976. },
  977. /** 新增按钮操作 */
  978. handleAdd() {
  979. this.reset()
  980. this.open = true
  981. this.notChange = false
  982. this.title = '添加仓储费'
  983. queryUserVal().then((response) => {
  984. // this.$set("deptName", response.dept.deptName);
  985. this.deptName = response.dept.deptName
  986. this.form.fDeptid = response.dept.deptId
  987. // this.agreementitemsList.createBy = response.user.userName
  988. // this.$set(this.agreementitemsList, "createBy", response.user.userName);
  989. //格式化时间戳
  990. // this.$set(this.agreementitemsList, "createTime", moment(Date.parse(new Date())).format("YYYY-MM-DD HH:mm:ss"));
  991. })
  992. },
  993. /** 修改按钮操作 */
  994. handleUpdate(row) {
  995. this.reset()
  996. this.notChange = false
  997. this.browseStatus = false
  998. const fId = row.fId || this.ids
  999. getAgreement(fId).then(response => {
  1000. console.log(response)
  1001. this.deptName = response.data.dept.deptName
  1002. this.form = response.data.tWarehouseAgreement
  1003. this.fMblnoOptions = response.data.corps
  1004. this.agreementitemsList = response.data.tWarehouseAgreementitems
  1005. for (let item in this.agreementitemsList) {
  1006. this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
  1007. // this.fWRemoteMethod(this.agreementitemsList[item].fFeeid)
  1008. }
  1009. // console.log(response.data.feesList)
  1010. this.fWbuOptions = response.data.feesList
  1011. this.add = row
  1012. console.log(JSON.stringify(this.agreementitemsList))
  1013. this.open = true
  1014. this.title = '修改仓储费'
  1015. })
  1016. },
  1017. /** 远程模糊查询用户 */
  1018. corpsRemoteMethod(name) {
  1019. if (name == null || name === '') {
  1020. return false
  1021. }
  1022. let queryParams = { pageNum: 1, pageSize: 10, fName: name, type: 1 }
  1023. listCorps(queryParams).then((response) => {
  1024. this.fMblnoOptions = response.rows
  1025. this.KHblnoOptions = response.rows
  1026. })
  1027. },
  1028. /** 提交按钮 */
  1029. submitForm() {
  1030. console.log(this.form)
  1031. this.$refs['form'].validate(valid => {
  1032. if (valid) {
  1033. if (this.form.fId != null) {
  1034. updateAgreement(this.form).then(response => {
  1035. let formData = new window.FormData()
  1036. // 附件数据
  1037. formData.append('agreement', JSON.stringify(this.form))
  1038. formData.append('agreementitems', JSON.stringify(this.agreementitemsList))
  1039. addAgreement(formData).then(response => {
  1040. this.msgSuccess('修改成功')
  1041. this.open = false
  1042. this.getList()
  1043. this.agreementitemsList = []
  1044. })
  1045. })
  1046. } else {
  1047. let formData = new window.FormData()
  1048. // 附件数据
  1049. formData.append('agreement', JSON.stringify(this.form))
  1050. formData.append('agreementitems', JSON.stringify(this.agreementitemsList))
  1051. addAgreement(formData).then(response => {
  1052. this.msgSuccess('新增成功')
  1053. this.open = false
  1054. this.getList()
  1055. this.agreementitemsList = []
  1056. })
  1057. }
  1058. }
  1059. })
  1060. },
  1061. /** 删除按钮操作 */
  1062. handleDelete(row) {
  1063. const fIds = row.fId || this.ids
  1064. this.$confirm('是否确认删除仓储费编号为"' + fIds + '"的数据项?', '警告', {
  1065. confirmButtonText: '确定',
  1066. cancelButtonText: '取消',
  1067. type: 'warning'
  1068. }).then(function() {
  1069. return delAgreement(fIds)
  1070. }).then(() => {
  1071. this.getList()
  1072. this.msgSuccess('删除成功')
  1073. })
  1074. },
  1075. /** 导出按钮操作 */
  1076. handleExport() {
  1077. const queryParams = this.queryParams
  1078. this.$confirm('是否确认导出所有仓储费数据项?', '警告', {
  1079. confirmButtonText: '确定',
  1080. cancelButtonText: '取消',
  1081. type: 'warning'
  1082. }).then(function() {
  1083. return exportAgreement(queryParams)
  1084. }).then(response => {
  1085. this.download(response.msg)
  1086. })
  1087. },
  1088. deleteRow(index, rows) {
  1089. rows.splice(index, 1)
  1090. }
  1091. }
  1092. }
  1093. </script>