acceptance.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686
  1. <template>
  2. <div>
  3. <div class="container">
  4. <el-form
  5. :model="infolist"
  6. ref="infolist"
  7. :rules="rules"
  8. class="container-box"
  9. label-width="80px"
  10. >
  11. <div>
  12. <div class="section2">
  13. <a
  14. href="#"
  15. style="margin: 20px 0;margin-right: 20px;"
  16. @click="dialogApplication(1)"
  17. >验收清单</a
  18. >
  19. <a
  20. href="#"
  21. style="margin: 20px 0;margin-right: 20px;"
  22. @click="dialogApplication(2)"
  23. >发货回执</a
  24. >
  25. </div>
  26. <div>
  27. <el-form-item class="info-line online">
  28. <span>验收说明</span>
  29. <el-input
  30. v-model="examDescription"
  31. type="textarea"
  32. :rows="4"
  33. ></el-input>
  34. </el-form-item>
  35. </div>
  36. <div>
  37. <el-form-item class="info-line online">
  38. <span>验收证明</span>
  39. <myUpload
  40. @uploadBack="uploadBack"
  41. :fileInfo="fileInfo"
  42. :fileList="fileInfo.fileList"
  43. >
  44. </myUpload>
  45. </el-form-item>
  46. </div>
  47. </div>
  48. <div class="t-footer t-footer1">
  49. <el-button
  50. type="primary"
  51. style="width: 120px"
  52. @click="dialogCli(1)"
  53. >完 成</el-button
  54. >
  55. <el-button @click="dialogCli(2)" style="width: 120px"
  56. >取 消</el-button
  57. >
  58. </div>
  59. </el-form>
  60. </div>
  61. <el-dialog
  62. title="验收清单"
  63. :visible.sync="ysListDialogStatus"
  64. width="50%"
  65. :destroy-on-close="true"
  66. :modal-append-to-body="false"
  67. :close-on-click-modal="false"
  68. >
  69. <el-form
  70. :model="infolist"
  71. ref="infolist"
  72. :rules="rules"
  73. style="height: 50vh;overflow-y: scroll; width:100%"
  74. :fullscreen="true"
  75. >
  76. <div class="info-line">
  77. <el-table
  78. :data="tableData"
  79. style="width: 100%;"
  80. border
  81. size="large"
  82. >
  83. <el-table-column prop="id" label="物料ID">
  84. </el-table-column>
  85. <el-table-column prop="regionName" label="地市公司">
  86. </el-table-column>
  87. <el-table-column prop="countyName" label="区县名称">
  88. </el-table-column>
  89. <el-table-column prop="channelCode" label="渠道编码">
  90. </el-table-column>
  91. <el-table-column prop="channelName" label="渠道名称">
  92. </el-table-column>
  93. <el-table-column prop="sceneName" label="场景">
  94. </el-table-column>
  95. <el-table-column prop="metirialType" label="物料类别">
  96. </el-table-column>
  97. <el-table-column prop="metirialCode" label="物料编码">
  98. </el-table-column>
  99. <el-table-column prop="metirialName" label="物料名称">
  100. </el-table-column>
  101. <el-table-column prop="unit" label="物料单位">
  102. </el-table-column>
  103. <el-table-column prop="size" label="规格尺寸">
  104. </el-table-column>
  105. <el-table-column prop="length" label="长">
  106. </el-table-column>
  107. <el-table-column prop="width" label="宽">
  108. </el-table-column>
  109. <el-table-column prop="direction" label="横竖">
  110. </el-table-column>
  111. <el-table-column prop="coefficient" label="系数">
  112. </el-table-column>
  113. <el-table-column prop="price" label="单价">
  114. </el-table-column>
  115. <el-table-column
  116. prop="quantity"
  117. label="数量"
  118. width="100"
  119. >
  120. </el-table-column>
  121. <el-table-column prop="priority" label="优先级">
  122. </el-table-column>
  123. <el-table-column label="结算金额" width="140px" prop="settlementAmount">
  124. <template slot-scope="scope">
  125. <div>
  126. {{
  127. scope.row.quantity *
  128. scope.row.price *
  129. scope.row.coefficient
  130. }}
  131. </div>
  132. </template>
  133. </el-table-column>
  134. </el-table>
  135. </div>
  136. </el-form>
  137. <div class="t-footer">
  138. <el-button type="primary" @click="downloadExcel">下载</el-button
  139. >
  140. <el-button @click="ysListDialogStatus = false">取 消</el-button>
  141. </div>
  142. </el-dialog>
  143. <el-dialog
  144. title="发货回执"
  145. :visible.sync="feedbackListDialogStatus"
  146. width="30%"
  147. :destroy-on-close="true"
  148. :modal-append-to-body="false"
  149. :close-on-click-modal="false"
  150. >
  151. <el-form
  152. :model="infolist"
  153. ref="infolist"
  154. :rules="rules"
  155. style="height: 20vh;"
  156. >
  157. <div class="info-line">
  158. <!-- <a :href="feedbackList">{{ feedbackList }}</a> -->
  159. {{ feedbackList }}
  160. </div>
  161. </el-form>
  162. <div class="t-footer">
  163. <!-- <el-button type="primary" @click="dialogSubmit()"
  164. >确 定</el-button
  165. > -->
  166. <el-button @click="feedbackListDialogStatus = false"
  167. >取 消</el-button
  168. >
  169. </div>
  170. </el-dialog>
  171. <myMessage
  172. :messTit="messTit"
  173. @closeMessage="closeMessage(1)"
  174. :centerDialogVisible="centerDialogVisible"
  175. v-if="centerDialogVisible"
  176. ></myMessage>
  177. </div>
  178. </template>
  179. <script>
  180. import mySearch from "../../../components/search.vue";
  181. import myUpload from "../../../components/upload.vue";
  182. import deptTreeOnly from "../../../components/deptTreeOnly.vue";
  183. export default {
  184. components: {
  185. mySearch,
  186. myUpload,
  187. deptTreeOnly
  188. },
  189. data() {
  190. const terminalTypeName = (rule, value, callback) => {
  191. if (!this.infolist.tit) {
  192. callback(new Error("不能为空"));
  193. } else {
  194. callback();
  195. }
  196. };
  197. return {
  198. rules: {
  199. terminalTypeName: [
  200. {
  201. required: true,
  202. trigger: "blur",
  203. validator: terminalTypeName
  204. }
  205. ]
  206. },
  207. fullscreen: false,
  208. tableData: [],
  209. disableStatus: false,
  210. infolist: {},
  211. terminal: "758639528378826752",
  212. userInfo: {},
  213. params: {},
  214. attList: [],
  215. loadinged: false,
  216. options: [],
  217. materType: "",
  218. scene: "",
  219. fileInfo: {
  220. // type: "img",
  221. limit: 50,
  222. url: "/market/cknowledgeatt/upload",
  223. fileList: []
  224. },
  225. infomaterType: [],
  226. // metirialName: "",
  227. regionsts: false,
  228. multipleSelection: [],
  229. centerDialogVisible: false,
  230. delid: "",
  231. uploadstatus: false,
  232. userListOpt: [],
  233. ysListDialogStatus: false,
  234. feedbackListDialogStatus: false,
  235. examDescription: "",
  236. examList: {},
  237. feedbackList: ""
  238. };
  239. },
  240. methods: {
  241. dialogApplication(v) {
  242. if (v === 1) {
  243. //验收清单
  244. this.ysListDialogStatus = true;
  245. this.$http({
  246. url: "/market/advSubtask/getYsqd",
  247. method: "post",
  248. headers: {
  249. "Content-Type": "application/json"
  250. },
  251. data: {
  252. woId: this.params.woId,
  253. cityWoId: this.params.cityWoId,
  254. countryWoId: this.params.countyWoId
  255. }
  256. }).then(res => {
  257. this.tableData = res.data;
  258. // this.feedbackList = res.data.receipt;
  259. });
  260. } else if (v === 2) {
  261. this.feedbackListDialogStatus = true;
  262. this.$http({
  263. url: "/market/advSubtask/getReceipt",
  264. method: "post",
  265. headers: {
  266. "Content-Type": "application/json"
  267. },
  268. data: { id: this.params.cityWoId }
  269. }).then(res => {
  270. this.feedbackList = res.data.receipt;
  271. });
  272. }
  273. },
  274. //添加
  275. dialogCli(v) {
  276. if (v === 1) {
  277. let fileList = [];
  278. this.attList.forEach(item => {
  279. fileList.push({
  280. id: item.fileCode,
  281. fileCode: item.fileCode,
  282. fileName: item.fileName
  283. });
  284. });
  285. // this.examList.id = "1";
  286. // this.examList.woCityId = this.params.cityWoId;
  287. // this.examList.id = this.params.countyWoId;
  288. // this.examList.woId = this.params.woId;
  289. this.examList.woId = this.params.woId,
  290. this.examList.woCityId = this.params.cityWoId,
  291. this.examList.id = this.params.countyWoId
  292. this.examList.attList = JSON.stringify(fileList);
  293. this.examList.remark = this.examDescription;
  294. this.submitInfo(
  295. "/market/cadvBusiMetirialWo/acceptance",
  296. this.examList
  297. );
  298. } else if (v === 2) {
  299. this.fileInfo.fileList = [];
  300. this.infolist = {};
  301. this.attList = [];
  302. return;
  303. }
  304. },
  305. submitInfo(u, v) {
  306. let _this = this;
  307. this.$refs.infolist.validate(valid => {
  308. if (valid) {
  309. this.loadinged = true;
  310. this.$http({
  311. url: u,
  312. method: "post",
  313. headers: {
  314. "Content-Type": "application/json"
  315. },
  316. data: v
  317. }).then(res => {
  318. this.loadinged = false;
  319. if (res.data.result === 2) {
  320. _this.$message({
  321. message: res.data.desc,
  322. type: "error"
  323. });
  324. } else if (res.data.result === 1) {
  325. _this.$message({
  326. message: res.data.desc,
  327. type: "error"
  328. });
  329. } else {
  330. _this.$message({
  331. message: "成功",
  332. type: "success"
  333. });
  334. // _this.getList();
  335. this.attList = [];
  336. this.fileInfo.fileList = [];
  337. this.examDescription = "";
  338. this.$router.push("/materialApplication");
  339. }
  340. });
  341. }
  342. });
  343. },
  344. downloadExcel(){
  345. this.$http({
  346. url: "/market/cadvBusiMetirialWo/export",
  347. method: "post",
  348. headers: {
  349. "Content-Type": "application/json"
  350. },
  351. responseType: "blob",
  352. data: { id: this.params.woId }
  353. }).then(res => {
  354. if (window.navigator && window.navigator.msSaveOrOpenBlob) {
  355. let blob = new Blob([res.data], {
  356. type: "application/vnd.ms-excel"
  357. });
  358. window.navigator.msSaveOrOpenBlob(
  359. blob,
  360. // this.wo.bizName + ".xlsx"
  361. "验收清单" + ".xlsx"
  362. );
  363. } else {
  364. /* 火狐谷歌的文件下载方式 */
  365. var blob = new Blob([res.data]);
  366. var downloadElement = document.createElement("a");
  367. var href = window.URL.createObjectURL(blob);
  368. downloadElement.href = href;
  369. downloadElement.download = "验收清单" + ".xlsx";
  370. document.body.appendChild(downloadElement);
  371. downloadElement.click();
  372. document.body.removeChild(downloadElement);
  373. window.URL.revokeObjectURL(href);
  374. }
  375. });
  376. },
  377. closedia() {
  378. this.infolist = {};
  379. this.ysListDialogStatus = false;
  380. this.feedbackListDialogStatus = false;
  381. },
  382. getUser() {
  383. this.userInfo = JSON.parse(window.sessionStorage.userInfo);
  384. },
  385. uploadBack(v) {
  386. this.attList = v;
  387. },
  388. // getList() {
  389. // this.$http({
  390. // url: "/market/cadvBusiMetirialWo/getInitiateInitialization",
  391. // method: "post",
  392. // headers: {
  393. // "Content-Type": "application/json"
  394. // },
  395. // data: {}
  396. // }).then(res => {
  397. // });
  398. // }
  399. },
  400. mounted() {
  401. if (JSON.stringify(this.$route.query) != "{}") {
  402. this.params.cityWoId = this.$route.query.cityWoId;
  403. this.params.countyWoId = this.$route.query.countyWoId;
  404. this.params.woId = this.$route.query.woId;
  405. }
  406. // this.getList(this.params);
  407. this.getUser();
  408. },
  409. watch: {
  410. $route() {
  411. // this.getList(this.params);
  412. }
  413. },
  414. created() {}
  415. };
  416. </script>
  417. <style scoped lang="scss">
  418. a {
  419. text-decoration: none;
  420. color: #169bd5;
  421. cursor: pointer;
  422. }
  423. .img-box {
  424. height: calc(100vh - 240px);
  425. overflow-y: scroll;
  426. .boximg {
  427. display: flex;
  428. flex-wrap: wrap;
  429. margin-top: 20px;
  430. div {
  431. display: inline-block;
  432. width: 18%;
  433. margin-right: 2%;
  434. margin-bottom: 20px;
  435. overflow: hidden;
  436. border: 1px solid #ddd;
  437. border-radius: 3px;
  438. background: #fff;
  439. position: relative;
  440. height: 100px;
  441. img {
  442. width: 100%;
  443. position: absolute;
  444. top: 0;
  445. bottom: 0;
  446. margin: auto;
  447. // height: 100%;
  448. }
  449. }
  450. }
  451. }
  452. .boximgc {
  453. display: flex;
  454. flex-wrap: wrap;
  455. width: calc(100% - 80px) !important;
  456. margin-left: 80px;
  457. div {
  458. display: inline-block;
  459. width: 18% !important;
  460. margin-right: 2%;
  461. margin-bottom: 20px;
  462. overflow: hidden;
  463. border: 1px solid #ddd;
  464. border-radius: 3px;
  465. background: #fff;
  466. position: relative;
  467. height: 100px;
  468. img {
  469. width: 100%;
  470. position: absolute;
  471. top: 0;
  472. bottom: 0;
  473. margin: auto;
  474. // height: 100%;
  475. }
  476. }
  477. }
  478. .typebox {
  479. div {
  480. border: 1px solid #ddd;
  481. border-top: transparent;
  482. span {
  483. display: inline-block;
  484. width: 20%;
  485. line-height: 30px;
  486. padding: 10px;
  487. vertical-align: top;
  488. }
  489. .big {
  490. width: 35%;
  491. // background: #f4f4f4;
  492. }
  493. .small {
  494. width: 5%;
  495. text-align: center;
  496. // border-right: 1px solid #ddd;
  497. }
  498. .gys {
  499. width: 40%;
  500. }
  501. }
  502. }
  503. .t-footer {
  504. text-align: center;
  505. padding-right: 20px;
  506. margin-top: 20px;
  507. }
  508. .t-footer1 {
  509. padding-right: 0;
  510. margin-top: 80px;
  511. }
  512. .onetab {
  513. padding: 20px;
  514. height: calc(100% - 180px);
  515. }
  516. .titbox {
  517. div {
  518. float: right;
  519. i {
  520. font-size: 22px;
  521. margin-left: 20px;
  522. cursor: pointer;
  523. }
  524. }
  525. }
  526. .tabbox {
  527. margin-top: 15px;
  528. }
  529. .pageBox {
  530. text-align: right;
  531. margin-top: 10px;
  532. }
  533. .info-line {
  534. width: 100%;
  535. display: block;
  536. // padding-left: 20px;
  537. div {
  538. width: 60%;
  539. display: inline-block;
  540. }
  541. span {
  542. width: 80px;
  543. display: inline-block;
  544. text-align: left;
  545. i {
  546. color: red;
  547. display: inline-block;
  548. padding-right: 5px;
  549. }
  550. }
  551. .el-select,
  552. .el-input {
  553. width: calc(100% - 100px);
  554. }
  555. .el-checkbox-group {
  556. border: 1px solid #ddd;
  557. padding-left: 20px;
  558. height: 40px;
  559. width: calc(100% - 100px);
  560. border-radius: 5px;
  561. }
  562. }
  563. .online {
  564. width: 100%;
  565. .el-select {
  566. width: calc(100% - 100px);
  567. }
  568. span {
  569. vertical-align: top;
  570. }
  571. .el-textarea {
  572. width: 60%;
  573. }
  574. }
  575. .section2 {
  576. display: flex;
  577. align-items: center;
  578. margin-bottom: 20px;
  579. button {
  580. margin-bottom: 0 !important;
  581. }
  582. h3 {
  583. margin-right: 40px;
  584. }
  585. }
  586. /deep/.online .el-form-item__content {
  587. width: 100%;
  588. margin-left: 0 !important;
  589. }
  590. /deep/.el-upload {
  591. width: 100% !important;
  592. padding: 0 !important;
  593. }
  594. .el-row {
  595. margin: 0 !important;
  596. }
  597. .tree {
  598. width: calc(50% - 60px) !important;
  599. display: inline-block;
  600. margin-right: 20px;
  601. height: 300px;
  602. overflow-y: scroll;
  603. .el-icon-error {
  604. float: right;
  605. font-size: 20px;
  606. margin-top: 9px;
  607. cursor: pointer;
  608. }
  609. }
  610. .treeUser {
  611. margin: 0;
  612. border: 1px solid #ddd;
  613. p {
  614. background: #f4f4f4;
  615. padding: 0 20px;
  616. margin-bottom: 5px;
  617. }
  618. }
  619. .treeUserb {
  620. width: calc(100% - 100px);
  621. border: 1px solid #ddd;
  622. background: #f4f4f4;
  623. border-radius: 3px;
  624. height: auto;
  625. overflow: hidden;
  626. p {
  627. display: inline-block;
  628. padding: 0 20px;
  629. margin-bottom: 5px;
  630. }
  631. }
  632. /deep/.container .el-upload-dragger {
  633. height: 120px !important;
  634. }
  635. .upload-demo {
  636. width: 60% !important;
  637. }
  638. </style>