refund_list-detail.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678
  1. <template>
  2. <div>
  3. <div class="sty">
  4. <el-page-header @back="goBack" :content="title"> </el-page-header>
  5. </div>
  6. <el-divider></el-divider>
  7. <h3>工程项目信息</h3>
  8. <el-divider></el-divider>
  9. <div class="diy-table-1">
  10. <el-row :gutter="0">
  11. <el-col :xs="12" :sm="24" :lg="8" class="item">
  12. <div class="label">工程登录编号</div>
  13. <div class="value">{{ detailList.refEnginRecordNo }}</div>
  14. </el-col>
  15. <el-col :xs="12" :sm="24" :lg="8" class="item">
  16. <div class="label">项目类别</div>
  17. <div class="value">{{ detailList.refProjectName }}</div>
  18. </el-col>
  19. <el-col :xs="12" :sm="24" :lg="8" class="item">
  20. <div class="label">行业类别</div>
  21. <div class="value">
  22. {{ detailList.refProjectNo == "HOME" ? "家用" : "商用" }}
  23. </div>
  24. </el-col>
  25. <el-col :xs="24" :sm="24" :lg="8" class="item">
  26. <div class="label">跨区厂编号</div>
  27. <div class="value">{{ detailList.refFactoryNo }}</div>
  28. </el-col>
  29. <el-col :xs="24" :sm="24" :lg="8" class="item">
  30. <div class="label">使用单位</div>
  31. <div class="value">{{ detailList.refUseUnit }}</div>
  32. </el-col>
  33. <!-- <el-col :xs="24" :sm="24" :lg="8" class="item">
  34. <div class="label">经销商二级代码</div>
  35. <div class="value">{{detailList.}}</div>
  36. </el-col> -->
  37. <el-col :xs="24" :sm="24" :lg="8" class="item">
  38. <div class="label">业务员</div>
  39. <div class="value">{{ detailList.serviceName }}</div>
  40. </el-col>
  41. <el-col :xs="24" :sm="24" :lg="8" class="item">
  42. <div class="label">联系人</div>
  43. <div class="value">{{ detailList.refLinkman }}</div>
  44. </el-col>
  45. <el-col :xs="24" :sm="24" :lg="8" class="item">
  46. <div class="label">固定电话</div>
  47. <div class="value">{{ detailList.refTel }}</div>
  48. </el-col>
  49. <el-col :xs="24" :sm="24" :lg="8" class="item">
  50. <div class="label">移动电话</div>
  51. <div class="value">{{ detailList.refPhone }}</div>
  52. </el-col>
  53. <!-- <el-col :xs="24" :sm="24" :lg="8" class="item">
  54. <div class="label">移动电话</div>
  55. <div class="value">
  56. <el-input
  57. :disabled="title == '详情'"
  58. placeholder="请输入"
  59. v-model="detailList.refPhone"
  60. ></el-input>
  61. </div>
  62. </el-col> -->
  63. <!-- <el-col :xs="24" :sm="24" :lg="8" class="item">
  64. <div class="label">押金比例</div>
  65. <div class="value">{{detailList.}}</div>
  66. </el-col> -->
  67. <el-col :xs="24" :sm="24" :lg="8" class="item">
  68. <div class="label">安装地址</div>
  69. <div class="value">{{ detailList.refInstallAddress }}</div>
  70. </el-col>
  71. <el-col :xs="24" :sm="24" :lg="8" class="item">
  72. <div class="label">第几次申报</div>
  73. <div class="value">{{ detailList.refDeclareNo }}</div>
  74. </el-col>
  75. <el-col :xs="24" :sm="24" :lg="8" class="item">
  76. <div class="label">项目说明</div>
  77. <div class="value">{{ detailList.refProjectNote }}</div>
  78. </el-col>
  79. <el-col :xs="24" :sm="24" :lg="8" class="item">
  80. <div class="label">项目类型</div>
  81. <div class="value">{{ detailList.refProjectName }}</div>
  82. </el-col>
  83. <!-- <el-col :xs="24" :sm="24" :lg="8" class="item">
  84. <div class="label">寄厂日期</div>
  85. <div class="value">
  86. <el-date-picker
  87. :disabled="title == '详情'"
  88. class="selectStyle"
  89. v-model="detailList.sendFactoryDate"
  90. type="datetime"
  91. prefix-icon="''"
  92. placeholder="请选择寄厂日期"
  93. default-time="00:00:00"
  94. value-format="yyyy-MM-dd HH:mm:ss"
  95. >
  96. </el-date-picker>
  97. </div>
  98. </el-col> -->
  99. <!-- <el-col :xs="24" :sm="24" :lg="8" class="item">
  100. <div class="label">提货日期</div>
  101. <div class="value">{{detailList.}}</div>
  102. </el-col> -->
  103. <!-- <el-col :xs="24" :sm="24" :lg="8" class="item">
  104. <div class="label">安装时间</div>
  105. <div class="value">
  106. <el-date-picker
  107. prefix-icon="''"
  108. placeholder="请选择安装时间"
  109. :disabled="title == '详情'"
  110. class="selectStyle"
  111. v-model="detailList.installDate"
  112. type="datetime"
  113. default-time="00:00:00"
  114. value-format="yyyy-MM-dd HH:mm:ss"
  115. >
  116. </el-date-picker>
  117. </div>
  118. </el-col> -->
  119. </el-row>
  120. </div>
  121. <h3>货品信息</h3>
  122. <el-divider></el-divider>
  123. <!-- 列表 -->
  124. <div class="mymain-container">
  125. <div class="table">
  126. <el-table
  127. v-loading="listLoading"
  128. :data="detailList.items"
  129. element-loading-text="Loading"
  130. border
  131. fit
  132. highlight-current-row
  133. stripe
  134. show-summary
  135. :summary-method="$getSummaries"
  136. >
  137. <el-table-column
  138. align="center"
  139. label="厂产品编码"
  140. prop="materialOldNumber"
  141. min-width="160"
  142. show-overflow-tooltip
  143. ></el-table-column>
  144. <el-table-column
  145. align="center"
  146. label="产品编码"
  147. prop="materialNumber"
  148. min-width="160"
  149. show-overflow-tooltip
  150. ></el-table-column>
  151. <el-table-column
  152. align="center"
  153. label="产品名称"
  154. prop="materialName"
  155. min-width="160"
  156. show-overflow-tooltip
  157. ></el-table-column>
  158. <el-table-column
  159. align="center"
  160. label="规格型号"
  161. prop="specification"
  162. min-width="160"
  163. show-overflow-tooltip
  164. ></el-table-column>
  165. <el-table-column
  166. align="right"
  167. label="单价"
  168. prop="price"
  169. min-width="160"
  170. show-overflow-tooltip
  171. >
  172. <template slot-scope="scope">
  173. {{ scope.row.price | numToFixed }}
  174. </template>
  175. </el-table-column>
  176. <el-table-column
  177. align="right"
  178. label="数量"
  179. prop="qty"
  180. min-width="160"
  181. show-overflow-tooltip
  182. ></el-table-column>
  183. <el-table-column
  184. align="right"
  185. label="金额"
  186. prop="totalAmount"
  187. min-width="160"
  188. show-overflow-tooltip
  189. >
  190. <template slot-scope="scope">
  191. {{ scope.row.totalAmount | numToFixed }}
  192. </template>
  193. </el-table-column>
  194. <el-table-column
  195. align="right"
  196. label="发货数量"
  197. prop="hasSendQty"
  198. min-width="160"
  199. show-overflow-tooltip
  200. ></el-table-column>
  201. <el-table-column
  202. align="right"
  203. label="上传资料"
  204. prop="dataQty"
  205. min-width="160"
  206. show-overflow-tooltip
  207. v-if="detailList.examineStatus !== 'WAIT'"
  208. >
  209. </el-table-column>
  210. <el-table-column
  211. align="right"
  212. label="上传资料"
  213. prop="dataQty"
  214. min-width="160"
  215. show-overflow-tooltip
  216. v-if="detailList.examineStatus == 'WAIT'"
  217. >
  218. <template slot-scope="scope">
  219. <el-input v-model="scope.row.dataQty"></el-input>
  220. </template>
  221. </el-table-column>
  222. <el-table-column
  223. align="right"
  224. label="收差金额"
  225. prop="diffAmount"
  226. min-width="160"
  227. show-overflow-tooltip
  228. v-if="detailList.examineStatus !== 'WAIT'"
  229. >
  230. <template slot-scope="scope">
  231. {{ scope.row.diffAmount | numToFixed }}
  232. </template>
  233. </el-table-column>
  234. <el-table-column
  235. align="right"
  236. label="收差金额"
  237. prop="diffAmount"
  238. min-width="160"
  239. show-overflow-tooltip
  240. v-if="detailList.examineStatus == 'WAIT'"
  241. >
  242. <template slot-scope="scope">
  243. <el-input v-model="scope.row.diffAmount"></el-input>
  244. </template>
  245. </el-table-column>
  246. </el-table>
  247. </div>
  248. </div>
  249. <h3 class="gdzl">工程资料</h3>
  250. <el-button
  251. class="batchDownload"
  252. type="primary"
  253. size="small"
  254. @click="batchDownloadFn"
  255. >批量下载</el-button
  256. >
  257. <el-divider></el-divider>
  258. <!-- 列表 -->
  259. <div class="mymain-container">
  260. <div class="table">
  261. <el-table
  262. v-loading="listLoading"
  263. :data="detailList.dataList"
  264. element-loading-text="Loading"
  265. border
  266. fit
  267. highlight-current-row
  268. stripe
  269. >
  270. <el-table-column
  271. align="center"
  272. label="资料描述"
  273. prop="dataDescribe"
  274. min-width="160"
  275. show-overflow-tooltip
  276. ></el-table-column>
  277. <el-table-column
  278. align="center"
  279. label="原文件名"
  280. prop="fileName"
  281. min-width="160"
  282. show-overflow-tooltip
  283. ></el-table-column>
  284. <el-table-column
  285. align="center"
  286. label="缩略图"
  287. prop="fileUrl"
  288. min-width="160"
  289. show-overflow-tooltip
  290. >
  291. <template slot-scope="scope">
  292. <el-image
  293. ref="img"
  294. :src="imageURL + scope.row.fileUrl"
  295. v-if="checkFileType(scope.row.fileUrl) == 'image'"
  296. style="width: 120px; height: 120px"
  297. fit="cover"
  298. >
  299. </el-image>
  300. <img
  301. class="file"
  302. src="@/assets/common/word.png"
  303. v-if="checkFileType(scope.row.fileUrl) == 'word'"
  304. />
  305. <img
  306. class="file"
  307. src="@/assets/common/excel.png"
  308. v-if="checkFileType(scope.row.fileUrl) == 'excel'"
  309. />
  310. <img
  311. class="file"
  312. src="@/assets/common/ppt.png"
  313. v-if="checkFileType(scope.row.fileUrl) == 'ppt'"
  314. />
  315. <img
  316. class="file"
  317. src="@/assets/common/pdf.png"
  318. v-if="checkFileType(scope.row.fileUrl) == 'pdf'"
  319. />
  320. </template>
  321. </el-table-column>
  322. <el-table-column
  323. align="center"
  324. label="下载文件名称"
  325. prop="fileName"
  326. min-width="160"
  327. show-overflow-tooltip
  328. >
  329. <template slot-scope="scope">
  330. {{ "资料_" + scope.row.fileName }}
  331. </template>
  332. </el-table-column>
  333. <el-table-column
  334. align="center"
  335. label="操作"
  336. min-width="160"
  337. show-overflow-tooltip
  338. >
  339. <template slot-scope="scope">
  340. <el-button
  341. type="text"
  342. class="textColor"
  343. @click="downLoadFn(scope.row.fileUrl)"
  344. >下载</el-button
  345. >
  346. </template>
  347. </el-table-column>
  348. </el-table>
  349. </div>
  350. </div>
  351. <el-divider></el-divider>
  352. <div class="diy-table-1">
  353. <el-row :gutter="0">
  354. <el-col :xs="12" :sm="12" :lg="12" class="item">
  355. <div class="label">申请人</div>
  356. <div class="value">{{ detailList.createBy }}</div>
  357. </el-col>
  358. <el-col :xs="12" :sm="12" :lg="12" class="item">
  359. <div class="label">申请日期</div>
  360. <div class="value">{{ detailList.createTime }}</div>
  361. </el-col>
  362. <el-col :xs="12" :sm="24" :lg="24" class="item">
  363. <div class="label">申请退押金</div>
  364. <div class="value">{{ detailList.applyNote }}</div>
  365. </el-col>
  366. </el-row>
  367. </div>
  368. <h3
  369. v-if="
  370. detailList.examineStatus == 'WAIT' ||
  371. detailList.examineStatus == 'FAIL' ||
  372. detailList.examineStatus == 'OK'
  373. "
  374. >
  375. 审批
  376. </h3>
  377. <el-divider
  378. v-if="
  379. detailList.examineStatus == 'WAIT' ||
  380. detailList.examineStatus == 'FAIL' ||
  381. detailList.examineStatus == 'OK'
  382. "
  383. ></el-divider>
  384. <div v-if="detailList.examineStatus == 'WAIT'" class="diy-table-1">
  385. <el-row :gutter="0">
  386. <el-col :xs="12" :sm="12" :lg="12" class="item">
  387. <div class="label">验收人</div>
  388. <div class="value">{{ this.checkBy }}</div>
  389. </el-col>
  390. <el-col :xs="12" :sm="12" :lg="12" class="item dateS">
  391. <div class="label">验收日期</div>
  392. <div class="value">
  393. <el-date-picker
  394. disabled
  395. prefix-icon="''"
  396. class="selectStyle"
  397. type="datetime"
  398. placeholder="系统自动生成"
  399. default-time="00:00:00"
  400. value-format="yyyy-MM-dd HH:mm:ss"
  401. >
  402. </el-date-picker>
  403. </div>
  404. </el-col>
  405. <el-col :xs="12" :sm="24" :lg="24" class="item">
  406. <div class="label">是否退押</div>
  407. <div class="value">
  408. <el-radio-group v-model="isRefundDeposit">
  409. <el-radio :label="true">是</el-radio>
  410. <el-radio :label="false">否</el-radio>
  411. </el-radio-group>
  412. </div>
  413. </el-col>
  414. <el-col :xs="12" :sm="24" :lg="24" class="item">
  415. <div class="label">验收说明</div>
  416. <div class="value">
  417. <el-input v-model="checkNote" placeholder="请输入内容"></el-input>
  418. </div>
  419. </el-col>
  420. </el-row>
  421. </div>
  422. <div
  423. v-if="
  424. detailList.examineStatus == 'OK' || detailList.examineStatus == 'FAIL'
  425. "
  426. class="diy-table-1"
  427. >
  428. <el-row :gutter="0">
  429. <el-col :xs="12" :sm="12" :lg="12" class="item">
  430. <div class="label">验收人</div>
  431. <div class="value">{{ detailList.checkBy }}</div>
  432. </el-col>
  433. <el-col :xs="12" :sm="12" :lg="12" class="item dateS">
  434. <div class="label">验收日期</div>
  435. <div class="value">
  436. <el-date-picker
  437. disabled
  438. prefix-icon="''"
  439. class="selectStyle"
  440. v-model="detailList.checkDate"
  441. type="datetime"
  442. placeholder=""
  443. default-time="00:00:00"
  444. value-format="yyyy-MM-dd HH:mm:ss"
  445. >
  446. </el-date-picker>
  447. </div>
  448. </el-col>
  449. <el-col :xs="12" :sm="24" :lg="24" class="item">
  450. <div class="label">是否退押</div>
  451. <div class="value">
  452. <el-radio-group v-model="detailList.isRefundDeposit">
  453. <el-radio disabled :label="true">是</el-radio>
  454. <el-radio disabled :label="false">否</el-radio>
  455. </el-radio-group>
  456. </div>
  457. </el-col>
  458. <el-col :xs="12" :sm="24" :lg="24" class="item dateS">
  459. <div class="label">验收说明</div>
  460. <div class="value">
  461. <el-input
  462. disabled
  463. v-model="detailList.checkNote"
  464. placeholder="请输入内容"
  465. ></el-input>
  466. </div>
  467. </el-col>
  468. <el-col :xs="12" :sm="24" :lg="24" class="item dateS">
  469. <div class="label">审批通过后备注</div>
  470. <div class="value">
  471. <el-input
  472. v-model="detailList.examineAfterRemark"
  473. placeholder="请输入内容"
  474. ></el-input>
  475. </div>
  476. </el-col>
  477. </el-row>
  478. </div>
  479. <br />
  480. <!-- 按钮 -->
  481. <!-- detailList.examineStatus != 'OK' || detailList.examineStatus != 'FAIL' -->
  482. <div class="btn-group clearfix">
  483. <div class="fl">
  484. <el-button
  485. v-if="detailList.examineStatus == 'WAIT'"
  486. type="primary"
  487. size="small"
  488. @click="adoptFn"
  489. >审批通过</el-button
  490. >
  491. <el-button
  492. v-if="detailList.examineStatus == 'WAIT'"
  493. type="primary"
  494. size="small"
  495. @click="rejectFn"
  496. >审批驳回</el-button
  497. >
  498. <el-button
  499. v-if="detailList.examineStatus == 'OK'"
  500. type="primary"
  501. size="small"
  502. @click="saveFn"
  503. >保存</el-button
  504. >
  505. </div>
  506. </div>
  507. </div>
  508. </template>
  509. <script>
  510. import { downloadFiles } from "@/utils/util";
  511. import IMAGEUPLOAD from "@/components/Common/image-upload.vue";
  512. import { mapGetters } from "vuex";
  513. import {
  514. getDepositManageDetail,
  515. getDepositManageExamine,
  516. getDepositManageDownZip,
  517. getDepositManageEdit,
  518. } from "@/api/engin_deposit/refund_list";
  519. export default {
  520. props: {
  521. detailId: {
  522. type: String,
  523. required: true,
  524. },
  525. },
  526. components: { IMAGEUPLOAD },
  527. computed: {
  528. ...mapGetters(["name"]),
  529. },
  530. data() {
  531. return {
  532. imageURL: this.$imageUrl,
  533. title: "审批",
  534. imageURL: this.$imageUrl,
  535. listLoading: false, // 列表加载loading
  536. dataList: [], // 列表数据
  537. detailList: {},
  538. checkBy: "",
  539. checkDate: "",
  540. isRefundDeposit: true,
  541. checkNote: "",
  542. };
  543. },
  544. created() {
  545. console.log(this.$imageUrl, 8888);
  546. this.checkBy = this.name;
  547. this.getData({ id: this.detailId });
  548. },
  549. methods: {
  550. //审批通过后可以编辑
  551. async saveFn() {
  552. console.log(this.detailList);
  553. await getDepositManageEdit(this.detailList);
  554. this.$message.success("保存成功");
  555. this.goBack();
  556. this.$emit("updateList");
  557. },
  558. //批量下载
  559. async batchDownloadFn() {
  560. downloadFiles("/deposit-manage/downZip", { parentId: this.detailId });
  561. },
  562. //下载
  563. downLoadFn(v) {
  564. window.open(this.imageURL + v);
  565. },
  566. // 检查文件类型
  567. checkFileType(url) {
  568. if (!url) return "";
  569. const fileSuffix = url.substring(url.lastIndexOf(".") + 1);
  570. if (["jpg", "jpeg", "png"].includes(fileSuffix)) {
  571. return "image";
  572. } else if (["doc", "docx", "dot", "wps", "wpt"].includes(fileSuffix)) {
  573. return "word";
  574. } else if (["xls", "xlsx", "xlt", "et", "ett"].includes(fileSuffix)) {
  575. return "excel";
  576. } else if (
  577. ["ppt", "pptx", "dps", "dpt", "pot", "pps"].includes(fileSuffix)
  578. ) {
  579. return "ppt";
  580. } else if (["pdf"].includes(fileSuffix)) {
  581. return "pdf";
  582. } else {
  583. return "";
  584. }
  585. },
  586. //审批驳回
  587. async rejectFn() {
  588. if (!this.detailList.installDate) {
  589. this.$message.error("请选择安装时间");
  590. return;
  591. }
  592. let data = {
  593. ...this.detailList,
  594. checkBy: this.checkBy,
  595. // checkDate: this.checkDate,
  596. isRefundDeposit: this.isRefundDeposit,
  597. checkNote: this.checkNote,
  598. examineResult: 0,
  599. };
  600. await getDepositManageExamine(data);
  601. this.$message.success("审批驳回");
  602. this.goBack();
  603. this.$emit("updateList");
  604. },
  605. //审批通过
  606. async adoptFn() {
  607. if (!this.detailList.installDate) {
  608. this.$message.error("请选择安装时间");
  609. return;
  610. }
  611. let data = {
  612. ...this.detailList,
  613. checkBy: this.checkBy,
  614. // checkDate: this.checkDate,
  615. isRefundDeposit: this.isRefundDeposit,
  616. checkNote: this.checkNote,
  617. examineResult: 1,
  618. };
  619. await getDepositManageExamine(data);
  620. this.$message.success("审批通过");
  621. this.goBack();
  622. this.$emit("updateList");
  623. },
  624. async getData(data) {
  625. const res = await getDepositManageDetail(data);
  626. console.log(res);
  627. res.data.items.forEach((item) => {
  628. // item.number = (item.qty*100 - item.directTransferQty*100 - item.retiredQty*100) / 100;
  629. item.sums1 = ["hasSendQty", "dataQty", "qty"];
  630. item.sums2 = ["totalAmount", "diffAmount", "price"];
  631. });
  632. this.detailList = res.data;
  633. if (
  634. res.data.examineStatus == "SAVE" ||
  635. res.data.examineStatus == "OK" ||
  636. res.data.examineStatus == "FAIL"
  637. ) {
  638. this.title = "详情";
  639. }
  640. },
  641. goBack() {
  642. this.$parent.showSurrender = true;
  643. },
  644. },
  645. };
  646. </script>
  647. <style lang="scss" scoped>
  648. .dateS {
  649. .value {
  650. padding: 0;
  651. }
  652. }
  653. .batchDownload {
  654. float: right;
  655. margin-top: 9px;
  656. }
  657. .gdzl {
  658. display: inline-block;
  659. }
  660. .dateStyle {
  661. width: 100%;
  662. }
  663. .label {
  664. width: 150px !important;
  665. }
  666. .selectStyle {
  667. width: 100%;
  668. }
  669. </style>