index.vue 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576
  1. <template>
  2. <div class="app-container">
  3. <el-form
  4. :model="queryParams"
  5. ref="queryForm"
  6. :inline="true"
  7. v-show="showSearch"
  8. label-width="88px"
  9. >
  10. <el-row>
  11. <el-form-item label="客户名称" prop="fCorpid">
  12. <el-select
  13. v-model="queryParams.fCorpid"
  14. filterable
  15. remote
  16. clearable
  17. style="width: 200px"
  18. @keyup.enter.native="handleQuery"
  19. :remote-method="corpsRemoteMethod"
  20. placeholder="请输入客户名称"
  21. >
  22. <el-option
  23. v-for="(dict, index) in fMblnoOptions"
  24. :key="index.fId"
  25. :label="dict.fName"
  26. :value="dict.fId"
  27. ></el-option>
  28. </el-select>
  29. </el-form-item>
  30. <el-form-item label="制单部门" prop="fDeptid">
  31. <el-input
  32. v-model="queryParams.fDeptid"
  33. placeholder="请输入制单部门"
  34. clearable
  35. size="small"
  36. @keyup.enter.native="handleQuery"
  37. />
  38. </el-form-item>
  39. <el-form-item label="有效期起" prop="fBegindate">
  40. <el-date-picker
  41. clearable
  42. size="small"
  43. style="width: 200px"
  44. v-model="queryParams.fBegindate"
  45. type="date"
  46. value-format="yyyy-MM-dd"
  47. placeholder="选择有效期起"
  48. >
  49. </el-date-picker>
  50. </el-form-item>
  51. <el-form-item label="有效期至" prop="fEnddate">
  52. <el-date-picker
  53. clearable
  54. size="small"
  55. style="width: 200px"
  56. v-model="queryParams.fEnddate"
  57. type="date"
  58. value-format="yyyy-MM-dd"
  59. placeholder="选择有效期至"
  60. >
  61. </el-date-picker>
  62. </el-form-item>
  63. <el-form-item label="协议编号" prop="fContractno">
  64. <el-input
  65. v-model="queryParams.fContractno"
  66. placeholder="请输入协议编号"
  67. clearable
  68. size="small"
  69. @keyup.enter.native="handleQuery"
  70. />
  71. </el-form-item>
  72. <el-form-item label="作业费类型" prop="fTaskType" label-width="90px">
  73. <el-select
  74. v-model="queryParams.fTaskType"
  75. clearable
  76. placeholder="请选择作业费类型"
  77. :disabled="browseStatus"
  78. >
  79. <el-option label="车队作业费" value="1" />
  80. <el-option label="劳务作业费" value="2" />
  81. </el-select>
  82. </el-form-item>
  83. <el-form-item label="商品类别" prop="tPackages">
  84. <el-select
  85. v-model="queryParams.tPackages"
  86. clearable
  87. placeholder="请选择商品类别"
  88. :disabled="browseStatus"
  89. >
  90. <el-option
  91. v-for="(dict, index) in fTypeidOptions"
  92. :key="index.dictValue"
  93. :label="dict.dictLabel"
  94. :value="dict.dictValue"
  95. style="width: 200px"
  96. ></el-option>
  97. </el-select>
  98. </el-form-item>
  99. <el-form-item label="费用类型" prop="fDc">
  100. <el-select
  101. v-model="queryParams.fDc"
  102. clearable
  103. placeholder="请选择费用类型"
  104. style="width: 200px"
  105. :disabled="browseStatus"
  106. >
  107. <el-option label="收" value="D"></el-option>
  108. <el-option label="付" value="C"></el-option>
  109. </el-select>
  110. </el-form-item>
  111. <el-form-item>
  112. <el-button
  113. type="cyan"
  114. icon="el-icon-search"
  115. size="mini"
  116. @click="handleQuery"
  117. >搜索</el-button
  118. >
  119. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  120. >重置</el-button
  121. >
  122. </el-form-item>
  123. </el-row>
  124. </el-form>
  125. <el-row :gutter="10" class="mb8">
  126. <el-col :span="1.5">
  127. <el-button
  128. type="primary"
  129. icon="el-icon-plus"
  130. size="mini"
  131. @click="handleAdd()"
  132. v-hasPermi="['agreement:agreementTask:add']"
  133. >新增
  134. </el-button>
  135. </el-col>
  136. <!-- <el-col :span="1.5">-->
  137. <!-- <el-button-->
  138. <!-- type="success"-->
  139. <!-- icon="el-icon-edit"-->
  140. <!-- size="mini"-->
  141. <!-- :disabled="single"-->
  142. <!-- @click="handleUpdate"-->
  143. <!-- v-hasPermi="['agreement:agreementTask:edit']"-->
  144. <!-- >修改-->
  145. <!-- </el-button>-->
  146. <!-- </el-col>-->
  147. <!-- <el-col :span="1.5">-->
  148. <!-- <el-button-->
  149. <!-- type="danger"-->
  150. <!-- icon="el-icon-delete"-->
  151. <!-- size="mini"-->
  152. <!-- :disabled="multiple"-->
  153. <!-- @click="handleDelete"-->
  154. <!-- v-hasPermi="['agreement:agreementTask:remove']"-->
  155. <!-- >删除-->
  156. <!-- </el-button>-->
  157. <!-- </el-col>-->
  158. <el-col :span="1.5">
  159. <el-button
  160. type="warning"
  161. icon="el-icon-download"
  162. size="mini"
  163. @click="handleExport"
  164. v-hasPermi="['agreement:agreementTask:export']"
  165. >导出
  166. </el-button>
  167. </el-col>
  168. <el-col :span="1.5">
  169. <el-button
  170. type="info"
  171. icon="el-icon-download"
  172. size="mini"
  173. :disabled="single"
  174. @click="handleUpdate(null, 2)"
  175. v-hasPermi="['agreement:agreementStorage:export']"
  176. >复制新增
  177. </el-button>
  178. </el-col>
  179. <right-toolbar
  180. :showSearch.sync="showSearch"
  181. @queryTable="getList"
  182. ></right-toolbar>
  183. </el-row>
  184. <el-table
  185. v-loading="loading"
  186. :data="agreementList"
  187. @selection-change="handleSelectionChange"
  188. >
  189. <el-table-column type="selection" width="55" align="center" />
  190. <el-table-column type="index" label="行号" align="center" fixed />
  191. <el-table-column
  192. label="客户名称"
  193. sortable
  194. align="center"
  195. prop="fCorpid"
  196. fixed
  197. width="220"
  198. />
  199. <el-table-column
  200. label="作业费类型"
  201. sortable
  202. align="center"
  203. prop="fTaskType"
  204. fixed
  205. width="120"
  206. >
  207. <template slot-scope="scope">
  208. <span v-if="scope.row.fTaskType === 1">车队作业费</span>
  209. <span v-if="scope.row.fTaskType === 2">劳务作业费</span>
  210. </template>
  211. </el-table-column>
  212. <el-table-column
  213. label="商品类别"
  214. sortable
  215. align="center"
  216. prop="tPackages"
  217. fixed
  218. width="100"
  219. :formatter="tPackagesFormat"
  220. />
  221. <el-table-column
  222. label="费用类型"
  223. sortable
  224. align="center"
  225. prop="fDc"
  226. fixed
  227. width="100"
  228. >
  229. <template slot-scope="scope">
  230. <span v-if="scope.row.fDc === 'D'">收</span>
  231. <span v-if="scope.row.fDc === 'C'">付</span>
  232. </template>
  233. </el-table-column>
  234. <el-table-column
  235. label="业务类型"
  236. sortable
  237. align="center"
  238. prop="fBilltypeName"
  239. fixed
  240. width="120"
  241. show-overflow-tooltip
  242. />
  243. <el-table-column
  244. label="协议编号"
  245. sortable
  246. align="center"
  247. prop="fContractno"
  248. show-overflow-tooltip
  249. />
  250. <!-- <el-table-column label="费用名称" align="center" prop="fFeeid"/>-->
  251. <el-table-column
  252. label="有效期起"
  253. sortable
  254. align="center"
  255. prop="fBegindate"
  256. width="180"
  257. >
  258. <template slot-scope="scope">
  259. <span>{{ parseTime(scope.row.fBegindate, "{y}-{m}-{d}") }}</span>
  260. </template>
  261. </el-table-column>
  262. <el-table-column
  263. label="有效期至"
  264. sortable
  265. align="center"
  266. prop="fEnddate"
  267. width="180"
  268. >
  269. <template slot-scope="scope">
  270. <span>{{ parseTime(scope.row.fEnddate, "{y}-{m}-{d}") }}</span>
  271. </template>
  272. </el-table-column>
  273. <!-- <el-table-column label="状态" align="center" prop="fId" />-->
  274. <el-table-column label="是否启用" align="center" prop="fStatus">
  275. <template slot-scope="scope">
  276. <el-switch
  277. v-model="scope.row.fStatus"
  278. active-value="0"
  279. inactive-value="1"
  280. @change="handleStatusChange(scope.row)"
  281. ></el-switch>
  282. </template>
  283. </el-table-column>
  284. <el-table-column label="状态" align="center" prop="fBillstatus">
  285. <template slot-scope="scope">
  286. <span v-if="scope.row.fBillstatus == '1'">保存</span>
  287. <span v-else-if="scope.row.fBillstatus == '2'">暂存</span>
  288. <span v-else-if="scope.row.fBillstatus == '3'">审批驳回</span>
  289. <span v-else-if="scope.row.fBillstatus == '4'">提交审核</span>
  290. <span v-else-if="scope.row.fBillstatus == '5'">审核中</span>
  291. <span v-else-if="scope.row.fBillstatus == '6'">审核完成</span>
  292. </template>
  293. </el-table-column>
  294. <el-table-column
  295. label="操作"
  296. align="center"
  297. class-name="small-padding fixed-width"
  298. min-width="250px"
  299. >
  300. <template slot-scope="scope">
  301. <el-button
  302. size="mini"
  303. type="text"
  304. icon="el-icon-view"
  305. @click="speed_s(scope.row, 0)"
  306. v-hasPermi="['agreement:agreementTask:remove']"
  307. >查看
  308. </el-button>
  309. <el-button
  310. size="mini"
  311. type="text"
  312. icon="el-icon-edit"
  313. @click="handleUpdate(scope.row)"
  314. v-if="scope.row.fBillstatus <= 3"
  315. v-hasPermi="['agreement:agreementTask:edit']"
  316. >修改
  317. </el-button>
  318. <el-button
  319. size="mini"
  320. type="text"
  321. icon="el-icon-delete"
  322. @click="handleDelete(scope.row)"
  323. v-if="scope.row.fBillstatus <= 3"
  324. v-hasPermi="['agreement:agreementTask:remove']"
  325. >删除
  326. </el-button>
  327. <el-button
  328. size="mini"
  329. type="text"
  330. icon="el-icon-delete"
  331. @click="speed(scope.row, 1)"
  332. v-if="
  333. scope.row.fBillstatus === '4' || scope.row.fBillstatus === '5'
  334. "
  335. v-hasPermi="['agreement:agreementTask:remove']"
  336. >审批进度
  337. </el-button>
  338. </template>
  339. </el-table-column>
  340. <!-- <el-table-column label="业务编号" align="center" prop="fBillno" />-->
  341. <!-- <el-table-column label="制单部门" align="center" prop="fDeptid" />-->
  342. <!-- <el-table-column label="结算方式" align="center" prop="fStltypeid" :formatter="fStltypeidFormat" />-->
  343. <!-- <el-table-column label="费用类型" align="center" prop="fFeetypeid" />-->
  344. <!-- <el-table-column label="货物类别" align="center" prop="tPackages" :formatter="tPackagesFormat" />-->
  345. <!-- <el-table-column label="贸易方式" align="center" prop="fTrademodeid" :formatter="fTrademodeidFormat" />-->
  346. <!-- <el-table-column label="免堆天数" align="center" prop="fFreedays" />-->
  347. <!-- <el-table-column label="备注" align="center" prop="remark" />-->
  348. </el-table>
  349. <pagination
  350. v-show="total > 0"
  351. :total="total"
  352. :page.sync="queryParams.pageNum"
  353. :limit.sync="queryParams.pageSize"
  354. @pagination="getList"
  355. />
  356. <!-- 添加或修改作业费对话框 -->
  357. <el-dialog
  358. v-dialogDrag
  359. :fullscreen="dialogFull"
  360. :title="title"
  361. :visible.sync="open"
  362. :show-close="Xbutton"
  363. width="65%"
  364. append-to-body
  365. :before-close="handleClose"
  366. :close-on-click-modal="false"
  367. >
  368. <template slot="title">
  369. <div class="avue-crud__dialog__header">
  370. <span class="el-dialog__title">
  371. <span
  372. style="
  373. display: inline-block;
  374. width: 3px;
  375. height: 20px;
  376. margin-right: 5px;
  377. float: left;
  378. margin-top: 2px;
  379. "
  380. ></span>
  381. </span>
  382. <div class="avue-crud__dialog__menu enlarge" @click="full">
  383. <i
  384. style="
  385. cursor: pointer;
  386. display: block;
  387. width: 12px;
  388. height: 12px;
  389. border: 1px solid #909399;
  390. border-top: 3px solid #909399;
  391. margin-top: -3px;
  392. "
  393. ></i>
  394. </div>
  395. </div>
  396. </template>
  397. <el-form
  398. ref="form"
  399. :model="form"
  400. :rules="rules"
  401. label-width="80px"
  402. style="display: flex; flex-wrap: wrap"
  403. >
  404. <el-form-item label="客户名称" prop="fCorpid">
  405. <el-select
  406. v-model="form.fCorpid"
  407. filterable
  408. remote
  409. clearable
  410. :disabled="browseStatus"
  411. style="width: 200px"
  412. @keyup.enter.native="handleQuery"
  413. :remote-method="corpsRemoteMethod"
  414. placeholder="请输入客户名称"
  415. >
  416. <el-option
  417. v-for="(dict, index) in fMblnoOptions"
  418. :key="index.fId"
  419. :label="dict.fName"
  420. :value="dict.fId"
  421. ></el-option>
  422. </el-select>
  423. </el-form-item>
  424. <el-form-item label="制单部门">
  425. <el-input
  426. v-model="deptName"
  427. :disabled="true"
  428. placeholder="请输入制单部门"
  429. style="width: 200px"
  430. />
  431. </el-form-item>
  432. <el-form-item label="有效期起" prop="fBegindate">
  433. <el-date-picker
  434. clearable
  435. size="small"
  436. style="width: 200px"
  437. v-model="form.fBegindate"
  438. type="date"
  439. :disabled="browseStatus"
  440. value-format="timestamp"
  441. placeholder="选择有效期起"
  442. >
  443. </el-date-picker>
  444. </el-form-item>
  445. <el-form-item label="有效期至" prop="fEnddate">
  446. <el-date-picker
  447. clearable
  448. size="small"
  449. style="width: 200px"
  450. v-model="form.fEnddate"
  451. type="date"
  452. :disabled="browseStatus"
  453. value-format="timestamp"
  454. placeholder="选择有效期至"
  455. >
  456. </el-date-picker>
  457. </el-form-item>
  458. <el-form-item label="协议编号" prop="fContractno">
  459. <el-input
  460. v-model="form.fContractno"
  461. placeholder="请输入协议编号"
  462. :disabled="browseStatus"
  463. style="width: 200px"
  464. />
  465. </el-form-item>
  466. <el-form-item label="商品类别" prop="tPackages">
  467. <el-select
  468. v-model="form.tPackages"
  469. placeholder="请选择商品类别"
  470. :disabled="browseStatus"
  471. >
  472. <el-option
  473. v-for="(dict, index) in fTypeidOptions"
  474. :key="index.dictValue"
  475. :label="dict.dictLabel"
  476. :value="dict.dictValue"
  477. style="width: 210px"
  478. ></el-option>
  479. </el-select>
  480. </el-form-item>
  481. <el-form-item label="作业费类型" prop="fTaskType" label-width="90px">
  482. <el-select
  483. v-model="form.fTaskType"
  484. placeholder="请选择作业费类型"
  485. :disabled="browseStatus"
  486. >
  487. <el-option label="车队作业费" value="1" />
  488. <el-option label="劳务作业费" value="2" />
  489. </el-select>
  490. </el-form-item>
  491. <el-form-item label="费用类型" prop="fDc">
  492. <el-select
  493. v-model="form.fDc"
  494. @change="changefDc"
  495. placeholder="请选择费用类型"
  496. :disabled="browseStatus"
  497. >
  498. <el-option label="收" value="D"></el-option>
  499. <el-option label="付" value="C"></el-option>
  500. </el-select>
  501. </el-form-item>
  502. <el-form-item label="业务类型" prop="fBilltype">
  503. <el-select
  504. v-model="form.fBilltype"
  505. placeholder="请选择业务类型"
  506. clearable
  507. :disabled="browseStatus"
  508. style="width: 200px"
  509. size="small"
  510. multiple
  511. @keyup.enter.native="handleQuery"
  512. >
  513. <el-option
  514. v-for="(dict, index) in options"
  515. :key="index.key"
  516. :label="dict.name"
  517. :value="dict.key"
  518. />
  519. </el-select>
  520. </el-form-item>
  521. </el-form>
  522. <el-button
  523. @click="confirmCharge"
  524. :disabled="stop"
  525. v-if="form.fBillstatus < 4"
  526. type="primary"
  527. >请 核</el-button
  528. >
  529. <el-button
  530. @click="revokeCharge"
  531. v-if="form.fBillstatus === '6'"
  532. type="danger"
  533. >撤销请核</el-button
  534. >
  535. <el-button
  536. @click="revocationApproval('f_billstatus')"
  537. :disabled="tablefilter"
  538. v-if="form.fBillstatus === '4' && operator === lander"
  539. type="danger"
  540. >撤销审批</el-button
  541. >
  542. <div class="dialogTableTitle flex a-center jlr">
  543. <h2>作业费明细</h2>
  544. <el-button @click="getList_s" :disabled="browseStatus">新增</el-button>
  545. </div>
  546. <el-table v-loading="loading_s" :data="agreementitemsList">
  547. <el-table-column label="行号" align="center" type="index" />
  548. <el-table-column
  549. prop="fFeeid"
  550. header-align="center"
  551. align="center"
  552. width="180px"
  553. label="费用名称"
  554. >
  555. <template slot-scope="scope">
  556. <el-select
  557. v-model="scope.row.fFeeid"
  558. filterable
  559. :disabled="browseStatus"
  560. remote
  561. :remote-method="fWRemoteMethod"
  562. placeholder="费用名称"
  563. >
  564. <el-option
  565. v-for="(dict, index) in fWbuOptions"
  566. :key="index.fId"
  567. :label="dict.fName"
  568. :value="dict.fId"
  569. ></el-option>
  570. </el-select>
  571. </template>
  572. </el-table-column>
  573. <el-table-column
  574. prop="fFeeunitid"
  575. header-align="center"
  576. align="center"
  577. width="180px"
  578. label="计价单位"
  579. >
  580. <template slot-scope="scope">
  581. <el-select
  582. v-model="scope.row.fFeeunitid"
  583. placeholder="请选择计价单位"
  584. @change="changeFeeUnit(scope.row)"
  585. clearable
  586. :disabled="browseStatus"
  587. >
  588. <el-option
  589. v-for="(dict, index) in jFeetunitOptions"
  590. :key="index.dictValue"
  591. :label="dict.dictLabel"
  592. :value="dict.dictValue"
  593. />
  594. </el-select>
  595. </template>
  596. </el-table-column>
  597. <el-table-column label="单价" align="center">
  598. <el-input
  599. slot-scope="scope"
  600. v-model="scope.row.fPrice"
  601. placeholder="请输入单价"
  602. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  603. :disabled="browseStatus"
  604. clearable
  605. size="small"
  606. />
  607. </el-table-column>
  608. <el-table-column label="录入人" align="center">
  609. <el-input
  610. slot-scope="scope"
  611. v-model="scope.row.createBy"
  612. :disabled="true"
  613. placeholder="默认录入人"
  614. clearable
  615. size="small"
  616. />
  617. </el-table-column>
  618. <el-table-column label="录入时间" align="center">
  619. <el-input
  620. slot-scope="scope"
  621. v-model="scope.row.createTime"
  622. placeholder="默认录入时间"
  623. :disabled="true"
  624. clearable
  625. size="small"
  626. />
  627. </el-table-column>
  628. <el-table-column label="备注" align="center">
  629. <el-input
  630. slot-scope="scope"
  631. v-model="scope.row.remark"
  632. placeholder="请输入备注"
  633. :disabled="browseStatus"
  634. clearable
  635. size="small"
  636. />
  637. </el-table-column>
  638. <el-table-column
  639. label="操作"
  640. align="center"
  641. class-name="small-padding fixed-width"
  642. >
  643. <template slot-scope="scope">
  644. <el-button
  645. size="mini"
  646. type="text"
  647. icon="el-icon-delete"
  648. :disabled="browseStatus"
  649. @click.native.prevent="
  650. deleteRow(scope.$index, agreementitemsList)
  651. "
  652. >删除
  653. </el-button>
  654. </template>
  655. </el-table-column>
  656. </el-table>
  657. <div slot="footer" class="dialog-footer">
  658. <el-button
  659. v-if="approvalProhibit"
  660. @click="immediateApproval('f_billstatus')"
  661. >审批</el-button
  662. >
  663. <el-button
  664. v-if="form.fBillstatus > 2"
  665. @click="viewAudit('f_billstatus')"
  666. >查看审批</el-button
  667. >
  668. <el-button
  669. type="primary"
  670. @click="submitForm"
  671. :disabled="determine || browseStatus"
  672. >保 存</el-button
  673. >
  674. <el-button v-if="cancelButton === true" @click="cancel"
  675. >取 消</el-button
  676. >
  677. <el-button v-if="cancelButton === false" @click="homePage"
  678. >取 消</el-button
  679. >
  680. <add-or-update
  681. v-if="addOrUpdateVisible"
  682. ref="addOrUpdate"
  683. @refreshDataList="getDataList"
  684. ></add-or-update>
  685. <approval-comments
  686. v-if="addOrUpdateVisib"
  687. ref="ApprovalComments"
  688. @refreshDataList="returnData"
  689. ></approval-comments>
  690. </div>
  691. </el-dialog>
  692. </div>
  693. </template>
  694. <script>
  695. import moment from "moment";
  696. import {
  697. listAgreement,
  698. getAgreement,
  699. delAgreement,
  700. addAgreement,
  701. exportAgreement,
  702. listAgreementitems,
  703. queryUserVal,
  704. updateAgreements,
  705. collecTask,
  706. backCharge,
  707. revocation,
  708. } from "@/api/agreement/agreement";
  709. import { listCorps } from "@/api/basicdata/corps";
  710. import { listGoods } from "@/api/basicdata/goods";
  711. import { listFees } from "@/api/basicdata/fees";
  712. import AddOrUpdate from "@/views/viewApproval";
  713. import ApprovalComments from "@/views/startApproval";
  714. import Global from "@/layout/components/global.js";
  715. import Vue from "vue";
  716. Vue.directive("dialogDrag", {
  717. bind(el, binding, vnode, oldVnode) {
  718. const dialogHeaderEl = el.querySelector(".el-dialog__header");
  719. const dragDom = el.querySelector(".el-dialog");
  720. const enlarge = el.querySelector(".enlarge");
  721. dialogHeaderEl.style.cursor = "move";
  722. // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
  723. const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null);
  724. if (enlarge) {
  725. enlarge.onclick = (e) => {
  726. dragDom.style.top = "0px";
  727. dragDom.style.left = "0px";
  728. };
  729. }
  730. dialogHeaderEl.onmousedown = (e) => {
  731. // 鼠标按下,计算当前元素距离可视区的距离
  732. const disX = e.clientX - dialogHeaderEl.offsetLeft;
  733. const disY = e.clientY - dialogHeaderEl.offsetTop;
  734. // 获取到的值带px 正则匹配替换
  735. let styL, styT;
  736. // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
  737. if (sty.left.includes("%")) {
  738. styL =
  739. +document.body.clientWidth * (+sty.left.replace(/\%/g, "") / 100);
  740. styT =
  741. +document.body.clientHeight * (+sty.top.replace(/\%/g, "") / 100);
  742. } else {
  743. styL = +sty.left.replace(/\px/g, "");
  744. styT = +sty.top.replace(/\px/g, "");
  745. }
  746. document.onmousemove = function (e) {
  747. // 通过事件委托,计算移动的距离
  748. const l = e.clientX - disX;
  749. const t = e.clientY - disY;
  750. // 移动当前元素
  751. if (t + styT >= 0) {
  752. dragDom.style.top = `${t + styT}px`;
  753. }
  754. dragDom.style.left = `${l + styL}px`;
  755. // 将此时的位置传出去
  756. // binding.value({x:e.pageX,y:e.pageY})
  757. };
  758. document.onmouseup = function (e) {
  759. document.onmousemove = null;
  760. document.onmouseup = null;
  761. };
  762. };
  763. },
  764. });
  765. export default {
  766. name: "Agreement",
  767. components: {
  768. AddOrUpdate,
  769. ApprovalComments,
  770. },
  771. data() {
  772. return {
  773. options: [
  774. {
  775. name: "出库",
  776. key: "SJCK",
  777. },
  778. {
  779. name: "入库",
  780. key: "SJRK",
  781. },
  782. {
  783. name: "调拨",
  784. key: "CKDB",
  785. },
  786. ],
  787. //全屏放大
  788. dialogFull: false,
  789. addOrEdid: 1,
  790. idCopy: "",
  791. stop: false,
  792. lander: "",
  793. operator: "",
  794. dataList: "",
  795. // 遮罩层
  796. loading: true,
  797. determine: false,
  798. cancelButton: true,
  799. approvalProhibit: false,
  800. loading_s: false,
  801. Xbutton: true,
  802. browseStatus: false,
  803. addOrUpdateVisible: false,
  804. addOrUpdateVisib: false,
  805. tablefilter: false,
  806. // 计价单位
  807. jFeetunitOptions: [
  808. /*{ dictLabel: "件数", dictValue: "1" },
  809. { dictLabel: "毛重", dictValue: "2" },
  810. { dictLabel: "净重", dictValue: "3" },
  811. { dictLabel: "尺码", dictValue: "4" },
  812. { dictLabel: "固定", dictValue: "5" },*/
  813. ],
  814. goodsOptions: [],
  815. fTypeidOptions: [],
  816. // 选中数组
  817. ids: [],
  818. deptName: "",
  819. // 客户(客户数据)
  820. fMblnoOptions: [],
  821. fFeeunitidOptions: [],
  822. fWbuOptions: [],
  823. // 非单个禁用
  824. single: true,
  825. // 非多个禁用
  826. multiple: true,
  827. // 显示搜索条件
  828. showSearch: true,
  829. // 总条数
  830. total: 0,
  831. // 仓储费表格数据
  832. agreementList: [],
  833. // 弹出层标题
  834. title: "",
  835. // 是否显示弹出层
  836. open: false,
  837. // 结算方式,也可以从表t_stltypes中下拉选择,存储id,显示name字典
  838. fStltypeidOptions: [],
  839. // 货物类别,存储t_packages,f_id 显示名称,可以多选t_packages 中的no或 name,模糊查找选择后,存储f_id,显示name字典
  840. tPackagesOptions: [],
  841. // 贸易方式,对应t_trademodels 字典
  842. fTrademodeidOptions: [],
  843. // 仓储费明细表表格数据
  844. agreementitemsList: [],
  845. // 查询参数
  846. queryParams: {
  847. pageNum: 1,
  848. pageSize: 10,
  849. fBillno: null,
  850. fDeptid: null,
  851. fContractno: null,
  852. fCorpid: null,
  853. fStltypeid: null,
  854. fGoodsid: null,
  855. fFeetypeid: null,
  856. tPackages: null,
  857. fTrademodeid: null,
  858. fFreedays: null,
  859. fBegindate: null,
  860. fEnddate: null,
  861. fBillstatus: null,
  862. fTaskType: null,
  863. fDc: null,
  864. },
  865. // 表单参数
  866. form: {
  867. fTaskType: "1",
  868. fDc: "D",
  869. fBilltype: "",
  870. },
  871. // 表单校验
  872. rules: {
  873. fBillno: [
  874. {
  875. required: true,
  876. message: " ",
  877. trigger: "blur",
  878. },
  879. ],
  880. fCorpid: [{ required: true, message: " ", trigger: "blur" }],
  881. tPackages: [{ required: true, message: " ", trigger: "blur" }],
  882. fBegindate: [{ required: true, message: " ", trigger: "blur" }],
  883. fEnddate: [{ required: true, message: " ", trigger: "blur" }],
  884. },
  885. };
  886. },
  887. created() {
  888. this.getList();
  889. this.getDicts("data_settlement_method").then((response) => {
  890. this.fStltypeidOptions = response.data;
  891. });
  892. this.getDicts("data_package_unit").then((response) => {
  893. this.tPackagesOptions = response.data;
  894. });
  895. this.getDicts("data_trademodes").then((response) => {
  896. this.fTrademodeidOptions = response.data;
  897. });
  898. this.getDicts("data_goods_category").then((response) => {
  899. this.fTypeidOptions = response.data;
  900. });
  901. this.getDicts("data_unitfees").then((response) => {
  902. this.jFeetunitOptions = response.data;
  903. });
  904. let queryParams = { pageNum: 1, type: 1 };
  905. listCorps(queryParams).then((response) => {
  906. this.fMblnoOptions = response.rows;
  907. });
  908. this.register();
  909. },
  910. activated() {
  911. this.adoPt();
  912. },
  913. methods: {
  914. full() {
  915. this.dialogFull = !this.dialogFull;
  916. },
  917. changefDc() {
  918. if (this.form.fDc === "D") {
  919. let queryParams = { pageNum: 1, pageSize: 10, fDc: "D" };
  920. listFees(queryParams).then((response) => {
  921. this.fWbuOptions = response.rows;
  922. });
  923. } else if (this.form.fDc === "C") {
  924. let queryParams = { pageNum: 1, pageSize: 10, fDc: "C" };
  925. listFees(queryParams).then((response) => {
  926. this.fWbuOptions = response.rows;
  927. });
  928. }
  929. if (this.agreementitemsList.length) {
  930. this.$message.error("请重新选择费用名称");
  931. for (let item in this.agreementitemsList) {
  932. this.agreementitemsList[item].fFeeid = "";
  933. }
  934. }
  935. },
  936. // 默认录入人
  937. register() {
  938. queryUserVal().then((response) => {
  939. this.lander = response.user.userName;
  940. });
  941. },
  942. immediateApproval(status) {
  943. this.addOrUpdateVisib = true;
  944. this.$nextTick(() => {
  945. this.$refs.ApprovalComments.init(this.approval.billId, status, 320);
  946. });
  947. },
  948. adoPt() {
  949. this.tablefilter = true;
  950. this.approval = this.$route.query.data;
  951. if (this.approval) {
  952. this.cancelButton = false;
  953. this.determine = true;
  954. this.Xbutton = false;
  955. this.tablefilter = true;
  956. this.browseStatus = true;
  957. this.approval = JSON.parse(this.approval);
  958. this.approvalProhibit = true;
  959. this.pass = {
  960. fAmtdr: "", //应收合计
  961. fAmtcr: "", //应付合计
  962. fMblno: "", //提单号
  963. fName: "", //货权方
  964. fFeesName: "", //结算单位
  965. fCorpid: "", //结算单位ID
  966. };
  967. getAgreement(this.approval.billId).then((response) => {
  968. if (response.data.dept) {
  969. this.deptName = response.data.dept.deptName
  970. ? response.data.dept.deptName
  971. : null;
  972. }
  973. this.form = response.data.tWarehouseAgreement;
  974. this.$set(this.form, "fEnddate", Date.parse(this.form.fEnddate));
  975. this.$set(this.form, "fBegindate", Date.parse(this.form.fBegindate));
  976. this.agreementitemsList = response.data.tWarehouseAgreementitems;
  977. for (let item in this.agreementitemsList) {
  978. this.$set(
  979. this.agreementitemsList[item],
  980. "fFeeunitid",
  981. this.agreementitemsList[item].fFeeunitid + ""
  982. );
  983. }
  984. this.fWbuOptions = response.data.feesList;
  985. this.open = true;
  986. this.title = "修改作业费";
  987. });
  988. }
  989. },
  990. viewAudit(status) {
  991. this.addOrUpdateVisible = true;
  992. this.addOrUpdateVisib = false;
  993. let id = "448";
  994. let actId = "110";
  995. this.$nextTick(() => {
  996. this.$refs.addOrUpdate.init(this.form.fId, 320, status);
  997. });
  998. },
  999. returnData() {
  1000. this.open = false;
  1001. this.addOrUpdateVisib = false;
  1002. this.homePage();
  1003. },
  1004. getDataList() {
  1005. this.addOrUpdateVisible = false;
  1006. },
  1007. homePage() {
  1008. let view = {
  1009. fullPath: "/agreement/agreementTask",
  1010. hash: "",
  1011. matched: Array(2),
  1012. meta: Object,
  1013. name: "AgreementTask",
  1014. params: Object,
  1015. path: "/agreement/agreementTask",
  1016. query: Object,
  1017. title: "作业费协议",
  1018. };
  1019. this.$router.push({ path: "/index" });
  1020. this.$store
  1021. .dispatch("tagsView/delView", view)
  1022. .then(({ visitedViews }) => {
  1023. if (this.isActive(view)) {
  1024. this.toLastView(visitedViews, view);
  1025. }
  1026. });
  1027. Global.$emit("removeCache", "closeSelectedTag", view);
  1028. },
  1029. /** 创建仓储费明细表列表 */
  1030. getList_s() {
  1031. queryUserVal().then((response) => {
  1032. this.agreementitemsList.push({
  1033. //行号
  1034. fLineno: "",
  1035. //计价单位
  1036. fFeeunitid: "",
  1037. //费用名称
  1038. fFeeid: "",
  1039. //开始天数
  1040. fFromdays: "",
  1041. //结束天数
  1042. fEndays: "",
  1043. //单价
  1044. fPrice: "",
  1045. //录入人
  1046. createBy: response.user.userName,
  1047. //创建时间
  1048. createTime: moment(Date.parse(new Date())).format(
  1049. "YYYY-MM-DD HH:mm:ss"
  1050. ),
  1051. });
  1052. if (response.dept) {
  1053. this.deptName = response.dept.deptName
  1054. ? response.dept.deptName
  1055. : null;
  1056. }
  1057. this.form.fDeptid = response.dept.deptId;
  1058. this.agreementitemsList.createBy = response.user.userName;
  1059. });
  1060. },
  1061. speed_s(row, res) {
  1062. this.stop = true;
  1063. this.determine = true;
  1064. this.tablefilter = true;
  1065. this.browseStatus = true;
  1066. this.approvalProhibit = false;
  1067. const fId = row.fId || this.ids;
  1068. getAgreement(fId).then((response) => {
  1069. if (response.data.dept) {
  1070. this.deptName = response.data.dept.deptName
  1071. ? response.data.dept.deptName
  1072. : null;
  1073. }
  1074. this.form = response.data.tWarehouseAgreement;
  1075. this.$set(this.form, "fTaskType", this.form.fTaskType + "");
  1076. this.$set(this.form, "fEnddate", Date.parse(this.form.fEnddate));
  1077. this.$set(this.form, "fBegindate", Date.parse(this.form.fBegindate));
  1078. this.operator = this.form.createBy;
  1079. this.agreementitemsList = response.data.tWarehouseAgreementitems;
  1080. if (response.data.tWarehouseAgreement.fBilltype) {
  1081. this.form.fBilltype = response.data.tWarehouseAgreement.fBilltype
  1082. .replace(/\[|]/g, "")
  1083. .replace(/\"/g, "")
  1084. .split(",");
  1085. }
  1086. for (let item in this.agreementitemsList) {
  1087. this.$set(
  1088. this.agreementitemsList[item],
  1089. "fFeeunitid",
  1090. this.agreementitemsList[item].fFeeunitid + ""
  1091. );
  1092. }
  1093. this.fWbuOptions = response.data.feesList;
  1094. this.open = true;
  1095. this.title = "查看作业费";
  1096. });
  1097. },
  1098. speed(row, res) {
  1099. this.register();
  1100. if (res === 1) {
  1101. this.tablefilter = false;
  1102. }
  1103. this.determine = true;
  1104. this.browseStatus = true;
  1105. this.approvalProhibit = false;
  1106. const fId = row.fId || this.ids;
  1107. getAgreement(fId).then((response) => {
  1108. if (response.data.dept) {
  1109. this.deptName = response.data.dept.deptName
  1110. ? response.data.dept.deptName
  1111. : null;
  1112. }
  1113. this.form = response.data.tWarehouseAgreement;
  1114. this.$set(this.form, "fEnddate", Date.parse(this.form.fEnddate));
  1115. this.$set(this.form, "fBegindate", Date.parse(this.form.fBegindate));
  1116. this.operator = this.form.createBy;
  1117. this.agreementitemsList = response.data.tWarehouseAgreementitems;
  1118. for (let item in this.agreementitemsList) {
  1119. this.$set(
  1120. this.agreementitemsList[item],
  1121. "fFeeunitid",
  1122. this.agreementitemsList[item].fFeeunitid + ""
  1123. );
  1124. }
  1125. this.fWbuOptions = response.data.feesList;
  1126. this.open = true;
  1127. this.title = "查看作业费";
  1128. });
  1129. },
  1130. revocationApproval(status) {
  1131. let data = {
  1132. id: this.form.fId,
  1133. actId: 320,
  1134. billId: this.form.fId,
  1135. fidStatus: status,
  1136. };
  1137. revocation(data).then((data) => {
  1138. if (data.code === 200) {
  1139. this.$message.success("撤销成功");
  1140. this.open = false;
  1141. this.getList();
  1142. }
  1143. });
  1144. },
  1145. // 请核
  1146. confirmCharge() {
  1147. if (this.agreementitemsList.length <= 0) {
  1148. this.$message.error("作业费明细为空无法操作");
  1149. return false;
  1150. }
  1151. for (let agr = 0; agr < this.agreementitemsList.length; agr++) {
  1152. if (!this.agreementitemsList[agr].fFeeid) {
  1153. this.$message.error("请维护费用名称");
  1154. return false;
  1155. }
  1156. if (!this.agreementitemsList[agr].fFeeunitid) {
  1157. this.$message.error("请维计价单位");
  1158. return false;
  1159. }
  1160. if (!this.agreementitemsList[agr].fPrice) {
  1161. this.$message.error("请维单价");
  1162. return false;
  1163. }
  1164. }
  1165. this.$refs["form"].validate((valid) => {
  1166. if (valid) {
  1167. let formData = new window.FormData();
  1168. formData.append("agreement", JSON.stringify(this.form));
  1169. formData.append(
  1170. "agreementitems",
  1171. JSON.stringify(this.agreementitemsList)
  1172. );
  1173. collecTask(formData).then((response) => {
  1174. this.msgSuccess("请核成功");
  1175. this.open = false;
  1176. this.agreementitemsList = [];
  1177. this.getList();
  1178. });
  1179. }
  1180. });
  1181. },
  1182. // 撤销作业费
  1183. revokeCharge() {
  1184. this.form.fBillstatus = "1";
  1185. let formDate = new window.FormData();
  1186. formDate.append("agreement", JSON.stringify(this.form));
  1187. formDate.append(
  1188. "agreementitems",
  1189. JSON.stringify(this.agreementitemsList)
  1190. );
  1191. backCharge(formDate).then((response) => {
  1192. this.open = false;
  1193. this.msgSuccess("操作成功");
  1194. this.getList();
  1195. });
  1196. },
  1197. /* 远程模糊查询商品 */
  1198. goodsRemoteMethod(name) {
  1199. if (name == null || name === "") {
  1200. return false;
  1201. }
  1202. let queryParams = { pageNum: 1, pageSize: 10, fName: name };
  1203. listGoods(queryParams).then((response) => {
  1204. this.goodsOptions = response.rows;
  1205. });
  1206. },
  1207. // 计价单位
  1208. fFeeunitidFormat(row, column) {
  1209. return this.selectDictLabel(this.fFeeunitidOptions, row.fFeeunitid);
  1210. },
  1211. /** 查询作业费列表 */
  1212. getList() {
  1213. this.loading = true;
  1214. listAgreement(this.queryParams).then((response) => {
  1215. this.agreementList = response.rows;
  1216. this.total = response.total;
  1217. this.loading = false;
  1218. });
  1219. },
  1220. // 结算方式,也可以从表t_stltypes中下拉选择,存储id,显示name字典翻译
  1221. fStltypeidFormat(row, column) {
  1222. return this.selectDictLabel(this.fStltypeidOptions, row.fStltypeid);
  1223. },
  1224. // 货物类别,存储t_packages,f_id 显示名称,可以多选t_packages 中的no或 name,模糊查找选择后,存储f_id,显示name字典翻译
  1225. tPackagesFormat(row, column) {
  1226. return this.selectDictLabel(this.fTypeidOptions, row.tPackages);
  1227. },
  1228. // 贸易方式,对应t_trademodels 字典翻译
  1229. fTrademodeidFormat(row, column) {
  1230. return this.selectDictLabel(this.fTrademodeidOptions, row.fTrademodeid);
  1231. },
  1232. // 取消按钮
  1233. cancel() {
  1234. this.idCopy = null;
  1235. this.reset();
  1236. this.getList();
  1237. this.open = false;
  1238. },
  1239. handleClose() {
  1240. this.reset();
  1241. this.getList();
  1242. this.open = false;
  1243. },
  1244. // 表单重置
  1245. reset() {
  1246. this.determine = false;
  1247. this.browseStatus = false;
  1248. this.agreementitemsList = [];
  1249. this.form = {
  1250. fId: null,
  1251. fBillno: null,
  1252. fDeptid: null,
  1253. fContractno: null,
  1254. fCorpid: null,
  1255. fStltypeid: null,
  1256. fGoodsid: null,
  1257. fFeetypeid: null,
  1258. tPackages: null,
  1259. fTrademodeid: null,
  1260. fFreedays: null,
  1261. fBegindate: null,
  1262. fEnddate: null,
  1263. fBillstatus: "0",
  1264. delFlag: null,
  1265. createBy: null,
  1266. createTime: null,
  1267. updateBy: null,
  1268. updateTime: null,
  1269. remark: null,
  1270. };
  1271. this.resetForm("form");
  1272. },
  1273. /** 搜索按钮操作 */
  1274. handleQuery() {
  1275. this.queryParams.pageNum = 1;
  1276. this.getList();
  1277. },
  1278. // 变更计价单位
  1279. changeFeeUnit(row) {
  1280. if (!row.fFeeUnitid) {
  1281. return false;
  1282. }
  1283. if (row.fFeeUnitid === "0") {
  1284. this.$set(row, "fQty", this.fCntqty);
  1285. } else if (row.fFeeUnitid === "1") {
  1286. this.$set(row, "fQty", this.fGrossweight);
  1287. }
  1288. if (row.fUnitprice) {
  1289. this.$set(
  1290. row,
  1291. "fAmount",
  1292. parseFloat(Number(row.fUnitprice) * Number(row.fQty)).toFixed(2)
  1293. );
  1294. }
  1295. },
  1296. /** 重置按钮操作 */
  1297. resetQuery() {
  1298. this.resetForm("queryForm");
  1299. this.handleQuery();
  1300. },
  1301. // 多选框选中数据
  1302. handleSelectionChange(selection) {
  1303. this.ids = selection.map((item) => item.fId);
  1304. this.idCopy = this.ids[0];
  1305. this.single = selection.length !== 1;
  1306. this.multiple = !selection.length;
  1307. },
  1308. // 远程模糊查询费用名称
  1309. fWRemoteMethod(name) {
  1310. this.fWbuOptions = [];
  1311. if (name == null || name === "") {
  1312. return false;
  1313. }
  1314. let fDc = this.form.fDc;
  1315. let queryParams = { pageNum: 1, pageSize: 10, fName: name, fDc: fDc };
  1316. listFees(queryParams).then((response) => {
  1317. console.log(response);
  1318. this.fWbuOptions = response.rows;
  1319. });
  1320. },
  1321. // 作业费状态修改
  1322. handleStatusChange(row) {
  1323. if (row.fBillstatus == "6") {
  1324. let text = row.fStatus === "0" ? "启用" : "停用";
  1325. this.$confirm(
  1326. '确认要"' + text + '""' + row.fCorpid + '"用户吗?',
  1327. "警告",
  1328. {
  1329. confirmButtonText: "确定",
  1330. cancelButtonText: "取消",
  1331. type: "warning",
  1332. }
  1333. )
  1334. .then(function () {
  1335. return updateAgreements(row.fId, row.fStatus);
  1336. })
  1337. .then(() => {
  1338. this.msgSuccess(text + "成功");
  1339. })
  1340. .catch(function () {
  1341. row.fStatus = row.fStatus === "0" ? "1" : "0";
  1342. });
  1343. } else {
  1344. row.fStatus = 0;
  1345. this.$message.error("审核完成时才能启用");
  1346. }
  1347. },
  1348. /** 新增按钮操作 */
  1349. handleAdd() {
  1350. this.stop = false;
  1351. this.determine = false;
  1352. this.browseStatus = false;
  1353. this.reset();
  1354. this.open = true;
  1355. this.title = "添加作业费";
  1356. this.form = {
  1357. fTaskType: "1",
  1358. fDc: "D",
  1359. };
  1360. queryUserVal().then((response) => {
  1361. if (response.dept) {
  1362. this.deptName = response.dept.deptName
  1363. ? response.dept.deptName
  1364. : null;
  1365. }
  1366. this.form.fDeptid = response.dept.deptId ? response.dept.deptId : null;
  1367. });
  1368. },
  1369. /** 修改按钮操作 */
  1370. handleUpdate(row, num) {
  1371. if (num === 2) {
  1372. console.log("111");
  1373. getAgreement(this.idCopy).then((response) => {
  1374. this.register();
  1375. if (response.data.dept) {
  1376. this.deptName = response.data.dept.deptName
  1377. ? response.data.dept.deptName
  1378. : null;
  1379. }
  1380. this.form = response.data.tWarehouseAgreement;
  1381. this.form.fId = null;
  1382. this.form.fBillstatus = "";
  1383. this.$set(this.form, "fTaskType", this.form.fTaskType + "");
  1384. this.$set(this.form, "fEnddate", Date.parse(this.form.fEnddate));
  1385. this.$set(this.form, "fBegindate", Date.parse(this.form.fBegindate));
  1386. this.operator = this.form.createBy;
  1387. this.agreementitemsList = response.data.tWarehouseAgreementitems;
  1388. for (let item in this.agreementitemsList) {
  1389. this.$set(
  1390. this.agreementitemsList[item],
  1391. "fFeeunitid",
  1392. this.agreementitemsList[item].fFeeunitid + ""
  1393. );
  1394. }
  1395. if (response.data.tWarehouseAgreement.fBilltype) {
  1396. this.form.fBilltype = response.data.tWarehouseAgreement.fBilltype
  1397. .replace(/\[|]/g, "")
  1398. .replace(/\"/g, "")
  1399. .split(",");
  1400. }
  1401. this.fWbuOptions = response.data.feesList;
  1402. this.open = true;
  1403. this.title = "修改作业费";
  1404. });
  1405. } else {
  1406. this.stop = false;
  1407. this.browseStatus = false;
  1408. this.determine = false;
  1409. this.reset();
  1410. this.cancelButton = true;
  1411. const fId = row.fId || this.ids;
  1412. getAgreement(fId).then((response) => {
  1413. this.register();
  1414. if (response.data.dept) {
  1415. this.deptName = response.data.dept.deptName
  1416. ? response.data.dept.deptName
  1417. : null;
  1418. }
  1419. this.form = response.data.tWarehouseAgreement;
  1420. this.$set(this.form, "fTaskType", this.form.fTaskType + "");
  1421. this.$set(this.form, "fEnddate", Date.parse(this.form.fEnddate));
  1422. this.$set(this.form, "fBegindate", Date.parse(this.form.fBegindate));
  1423. this.operator = this.form.createBy;
  1424. this.agreementitemsList = response.data.tWarehouseAgreementitems;
  1425. for (let item in this.agreementitemsList) {
  1426. this.$set(
  1427. this.agreementitemsList[item],
  1428. "fFeeunitid",
  1429. this.agreementitemsList[item].fFeeunitid + ""
  1430. );
  1431. }
  1432. if (response.data.tWarehouseAgreement.fBilltype) {
  1433. this.form.fBilltype = response.data.tWarehouseAgreement.fBilltype
  1434. .replace(/\[|]/g, "")
  1435. .replace(/\"/g, "")
  1436. .split(",");
  1437. }
  1438. this.fWbuOptions = response.data.feesList;
  1439. this.open = true;
  1440. this.title = "修改作业费";
  1441. });
  1442. }
  1443. },
  1444. /** 远程模糊查询用户 */
  1445. corpsRemoteMethod(name) {
  1446. if (name == null || name === "") {
  1447. return false;
  1448. }
  1449. let queryParams = { pageNum: 1, fName: name, type: 1 };
  1450. listCorps(queryParams).then((response) => {
  1451. this.fMblnoOptions = response.rows;
  1452. this.KHblnoOptions = response.rows;
  1453. });
  1454. },
  1455. /** 提交按钮 */
  1456. submitForm() {
  1457. this.form.fBilltypeName = "";
  1458. if (this.addOrEdid == 2) {
  1459. this.$set(this.form, "fId", null);
  1460. }
  1461. this.$refs["form"].validate((valid) => {
  1462. if (valid) {
  1463. let formData = new window.FormData();
  1464. for (let index in this.options) {
  1465. for (let item in this.form.fBilltype) {
  1466. console.log(this.options[index].key, this.form.fBilltype[item]);
  1467. if (this.options[index].key == this.form.fBilltype[item]) {
  1468. this.form.fBilltypeName += this.options[index].name + ",";
  1469. }
  1470. }
  1471. }
  1472. this.form.fBilltypeName = this.form.fBilltypeName.substring(
  1473. 0,
  1474. this.form.fBilltypeName.length - 1
  1475. );
  1476. formData.append("agreement", JSON.stringify(this.form));
  1477. formData.append(
  1478. "agreementitems",
  1479. JSON.stringify(this.agreementitemsList)
  1480. );
  1481. addAgreement(formData).then((response) => {
  1482. this.msgSuccess("操作成功");
  1483. this.form = response.data.tWarehouseAgreement;
  1484. this.$set(this.form, "fTaskType", this.form.fTaskType + "");
  1485. this.$set(this.form, "fEnddate", Date.parse(this.form.fEnddate));
  1486. this.$set(
  1487. this.form,
  1488. "fBegindate",
  1489. Date.parse(this.form.fBegindate)
  1490. );
  1491. // this.form.fBilltype = response.data.tWarehouseAgreement.fBilltype.replace(/\[|]/g, '').replace(/\"/g, "").split(",")
  1492. });
  1493. }
  1494. });
  1495. },
  1496. /** 删除按钮操作 */
  1497. handleDelete(row) {
  1498. const fIds = row.fId || this.ids;
  1499. this.$confirm('是否确认删除作业费编号为"' + fIds + '"的数据项?', "警告", {
  1500. confirmButtonText: "确定",
  1501. cancelButtonText: "取消",
  1502. type: "warning",
  1503. })
  1504. .then(function () {
  1505. return delAgreement(fIds);
  1506. })
  1507. .then(() => {
  1508. this.getList();
  1509. this.msgSuccess("删除成功");
  1510. });
  1511. },
  1512. /** 导出按钮操作 */
  1513. handleExport() {
  1514. const queryParams = this.queryParams;
  1515. this.$confirm("是否确认导出所有作业费数据项?", "警告", {
  1516. confirmButtonText: "确定",
  1517. cancelButtonText: "取消",
  1518. type: "warning",
  1519. })
  1520. .then(function () {
  1521. return exportAgreement(queryParams);
  1522. })
  1523. .then((response) => {
  1524. this.download(response.msg);
  1525. });
  1526. },
  1527. deleteRow(index, rows) {
  1528. rows.splice(index, 1);
  1529. },
  1530. },
  1531. };
  1532. </script>
  1533. <style lang="scss">
  1534. .avue-crud__dialog__header {
  1535. display: -webkit-box;
  1536. display: -ms-flexbox;
  1537. display: flex;
  1538. -webkit-box-align: center;
  1539. -ms-flex-align: center;
  1540. align-items: center;
  1541. -webkit-box-pack: justify;
  1542. -ms-flex-pack: justify;
  1543. justify-content: space-between;
  1544. }
  1545. .el-dialog__title {
  1546. color: rgba(0, 0, 0, 0.85);
  1547. font-weight: 500;
  1548. word-wrap: break-word;
  1549. }
  1550. .avue-crud__dialog__menu {
  1551. padding-right: 20px;
  1552. float: left;
  1553. }
  1554. .avue-crud__dialog__menu i {
  1555. color: #909399;
  1556. font-size: 15px;
  1557. }
  1558. .el-icon-full-screen {
  1559. cursor: pointer;
  1560. }
  1561. .el-icon-full-screen:before {
  1562. content: "\e719";
  1563. }
  1564. </style>