index.vue 50 KB

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