detail.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. <template>
  2. <div class="workbenchdetail">
  3. <div
  4. class="page-main clear"
  5. v-if=" powers.some((i) => i == '007')"
  6. >
  7. <div v-if="status !== '1'">
  8. <search-not :placeholder="'招标任务已结束!'" />
  9. </div>
  10. <div v-else>
  11. <div class="left">
  12. <div class="left-main">
  13. <div class="left-card" v-if="sitem">
  14. <div class="page-main-title">招标任务信息</div>
  15. <ul class="page-main-ul clear">
  16. <li>任务单号:</li>
  17. <li>{{ queryId }}</li>
  18. <li>截止时间:</li>
  19. <li>{{ sitem.endtime }}</li>
  20. <!-- <li>剩余时间:</li>
  21. <li>2020-09-20 17:00:00</li> -->
  22. <li>购买数量:</li>
  23. <li>{{ sitem.num }}{{ sitem.unit_name }}</li>
  24. <li>预算单价:</li>
  25. <li>{{ sitem.original_price }}元</li>
  26. <li>竞价人:</li>
  27. <li>{{ sitem.salesman }}</li>
  28. <li>到货时间:</li>
  29. <li>{{ sitem.arrival_time }}</li>
  30. <li>公司编号:</li>
  31. <li>{{ sitem.companyNo }}</li>
  32. <li>公司编码:</li>
  33. <li>{{ sitem.company }}</li>
  34. <li>客户名称:</li>
  35. <li>{{ sitem.khname }}</li>
  36. </ul>
  37. </div>
  38. <div class="left-card" v-if="sitem">
  39. <div class="page-main-title">商品要求</div>
  40. <ul class="page-main-ul clear">
  41. <li>商品名称:</li>
  42. <li>{{ sitem.good_name }}</li>
  43. <li v-if="sitem.good_img">商品图片:</li>
  44. <li v-if="sitem.good_img">
  45. <img
  46. v-viewer
  47. :src="sitem.good_img"
  48. class="hover"
  49. style="width: 20px; height: 20px; display: inline-block"
  50. />
  51. </li>
  52. <li>商品分类:</li>
  53. <li>{{ sitem.can_name }}</li>
  54. <li>商品品牌:</li>
  55. <li>{{ sitem.brand ? sitem.brand : "无要求" }}</li>
  56. <li>商品规格:</li>
  57. <li>
  58. <el-table
  59. :data="sitem.specinfo"
  60. border
  61. stripe
  62. :size="'mini'"
  63. style="width: 100%"
  64. >
  65. <el-table-column
  66. prop="spec_name"
  67. label="类型:值"
  68. show-overflow-tooltip
  69. >
  70. <template slot-scope="scope">
  71. {{ scope.row.spec_name }}:{{
  72. scope.row.spec_value_name
  73. }}
  74. </template></el-table-column
  75. >
  76. </el-table>
  77. </li>
  78. <li>总重量:</li>
  79. <li>{{ sitem.total_weight }}g</li>
  80. <li>是否多地:</li>
  81. <li>{{ sitem.is_addrs + '' === "1" ? "多地" : "一地" }}</li>
  82. <li>是否定制:</li>
  83. <li>{{ sitem.is_custom + '' === "1" ? "定制" : "非定制" }}</li>
  84. <li v-if="sitem.is_metal">启用金价:</li>
  85. <li v-if="sitem.is_metal">
  86. {{ sitem.is_gold_price + '' === "1" ? "启用" : "不启用" }}
  87. </li>
  88. <li v-if="sitem.is_metal">配置要求:</li>
  89. <li v-if="sitem.is_metal">{{ sitem.config }}</li>
  90. <li v-if="sitem.is_metal">金属克重:</li>
  91. <li v-if="sitem.is_metal">{{ sitem.specs_weight }}g</li>
  92. <li v-if="sitem.is_metal">其他要求:</li>
  93. <li v-if="sitem.is_metal">
  94. {{ sitem.other_config }}
  95. </li>
  96. <li v-if="sitem.is_metal">金属种类:</li>
  97. <li v-if="sitem.is_metal">
  98. {{ sitem.metal_name }}
  99. </li>
  100. <li v-if="sitem && sitem.cost_desc">工艺说明:</li>
  101. <li v-if="sitem && sitem.cost_desc">{{ sitem.cost_desc }}</li>
  102. <li>产品用途:</li>
  103. <li>{{ sitem.use_desc }}</li>
  104. <li>商品备注:</li>
  105. <li>{{ sitem.remark }}</li>
  106. <li>商品附件:</li>
  107. <li v-if="sitem && sitem.enclosure_file">
  108. <a :href="sitem.enclosure_file" download="附件" class="fl"
  109. >点击下载附件</a
  110. >
  111. </li>
  112. </ul>
  113. </div>
  114. </div>
  115. </div>
  116. <div class="p-right">
  117. <div
  118. v-if="editType == '' || editType == 'wait'"
  119. class="right-mian-wait"
  120. >
  121. <div class="title">采返工作台</div>
  122. <div class="main">暂无工作数据!</div>
  123. </div>
  124. <template v-else>
  125. <base-form
  126. :id="queryId"
  127. :editId="editId"
  128. :type="editType"
  129. :askItem="sitem"
  130. :sitem="baseSitem"
  131. :newTime="newTime"
  132. @refresh="(editType = 'wait'), searchList()"
  133. @cancel="editType = 'wait'"
  134. v-if="newTime !== ''"
  135. />
  136. </template>
  137. </div>
  138. <div class="bottom">
  139. <el-table
  140. :data="tableData"
  141. border
  142. stripe
  143. :size="'mini'"
  144. style="width: 100%"
  145. >
  146. <!-- <el-table-column
  147. prop="good_img"
  148. label="图片"
  149. width="48"
  150. show-overflow-tooltip
  151. >
  152. <template slot-scope="scope">
  153. <div
  154. v-if="scope.row.good_img"
  155. style="width: 20px; height: 20px"
  156. class="hover"
  157. v-viewer
  158. >
  159. <img
  160. :src="scope.row.good_img"
  161. style="display: inline-block; width: 100%; height: 100%"
  162. alt=""
  163. />
  164. </div>
  165. </template>
  166. </el-table-column> -->
  167. <el-table-column
  168. prop="good_name"
  169. label="商品名称"
  170. min-width="120"
  171. show-overflow-tooltip
  172. />
  173. <el-table-column
  174. prop="total_fee"
  175. label="成本合计"
  176. width="110"
  177. show-overflow-tooltip
  178. />
  179. <el-table-column
  180. prop="bargain_status"
  181. label="采返信息状态"
  182. width="100"
  183. show-overflow-tooltip
  184. >
  185. <template slot-scope="scope">
  186. <el-tag
  187. type="''"
  188. :size="'mini'"
  189. v-if="
  190. scope.row.bargain_status + '' === '0' && scope.row.status == '1'
  191. "
  192. >新建信息</el-tag
  193. >
  194. <el-tag type="danger" :size="'mini'" v-else>待确认</el-tag>
  195. </template></el-table-column
  196. >
  197. <el-table-column
  198. prop="specinfo"
  199. label="规格"
  200. width="100"
  201. show-overflow-tooltip
  202. >
  203. <template slot-scope="scope">
  204. <span v-for="(item, ii) in scope.row.specinfo" :key="item + ii"
  205. ><span v-if="ii !== 0">--</span>{{ item.spec_name }}[{{
  206. item.spec_value_name
  207. }}]</span
  208. >
  209. </template></el-table-column
  210. >
  211. <el-table-column
  212. prop="unit"
  213. label="单位"
  214. width="45"
  215. show-overflow-tooltip
  216. />
  217. <el-table-column
  218. prop="brand_name"
  219. label="品牌"
  220. width="80"
  221. show-overflow-tooltip
  222. />
  223. <el-table-column
  224. prop="supplierName"
  225. label="供应商"
  226. show-overflow-tooltip
  227. />
  228. <el-table-column fixed="right" label="操作" width="80">
  229. <template slot="header" slot-scope="scope">
  230. <span>操作</span>
  231. <el-tooltip
  232. effect="dark"
  233. content="添加反馈商品"
  234. placement="top"
  235. >
  236. <i
  237. class="el-icon-circle-plus-outline tb-icon fr"
  238. @click="openModal('add', 'add')"
  239. ></i>
  240. </el-tooltip>
  241. </template>
  242. <template slot-scope="scope">
  243. <el-tooltip
  244. v-if="powers.some((i) => i == '007')"
  245. effect="dark"
  246. content="详情"
  247. placement="top"
  248. >
  249. <i
  250. class="el-icon-view tb-icon"
  251. @click="openModal(scope.row.bidNo, 'view')"
  252. ></i>
  253. </el-tooltip>
  254. <el-tooltip effect="dark" content="修改" placement="top">
  255. <i
  256. class="el-icon-edit tb-icon"
  257. @click="openModal(scope.row.bidNo, 'edit')"
  258. ></i>
  259. </el-tooltip>
  260. </template>
  261. </el-table-column>
  262. </el-table>
  263. </div>
  264. </div>
  265. </div>
  266. <div v-else>
  267. <no-auth></no-auth>
  268. </div>
  269. </div>
  270. </template>
  271. <script>
  272. import asyncRequest from "@/apis/service/purchaseIn/workbench";
  273. import resToken from "@/mixins/resToken";
  274. import { mapGetters } from "vuex";
  275. import baseForm from "./components/baseForm";
  276. export default {
  277. name: "workbenchDetail",
  278. components: {
  279. baseForm,
  280. },
  281. mixins: [resToken],
  282. computed: {
  283. ...mapGetters(["tablebtnSize", "searchSize", "size"]),
  284. powers() {
  285. const tran =
  286. this.$store.getters.btnList.find(
  287. (item) => item.menu_route == "supplierWorkbenchDetail"
  288. ) || {};
  289. const { action } = tran ?? {};
  290. return action ?? [];
  291. },
  292. },
  293. data() {
  294. return {
  295. num: 60,
  296. timer: null,
  297. loading: false,
  298. showModel: false,
  299. tableData: [],
  300. baseSitem: {},
  301. isDetail: false,
  302. modelId: 0,
  303. queryId: "",
  304. status: "",
  305. sitem: {},
  306. newTime: "",
  307. editId: "add",
  308. editType: "wait",
  309. parmValue: {
  310. page: 1,
  311. size: 100,
  312. zxNo: "",
  313. infoNo: "",
  314. bidNo: "",
  315. projectNo: "",
  316. is_own: "1",
  317. },
  318. };
  319. },
  320. mounted() {
  321. this.initForm();
  322. },
  323. beforeDestroy() {
  324. if (this.timer) {
  325. clearInterval(this.timer);
  326. }
  327. },
  328. methods: {
  329. async initForm() {
  330. this.editType = "wait";
  331. const { id } = this.$route.query;
  332. this.queryId = id;
  333. console.log(this.queryId);
  334. this.loading = true;
  335. await this.initData();
  336. await this.searchList();
  337. this.loading = false;
  338. },
  339. async initData() {
  340. const { code, message, data } = await asyncRequest.detail({
  341. infoNo: this.queryId,
  342. });
  343. if (code === 0) {
  344. const { status } = data;
  345. this.status = status;
  346. this.sitem = JSON.parse(JSON.stringify(data));
  347. const { can } = this.sitem;
  348. this.sitem.is_metal = "";
  349. this.sitem.can_id_arr = [];
  350. this.sitem.can_name = "";
  351. let can_name = "",
  352. can_id_arr = [],
  353. is_metal = false;
  354. can.forEach((e, i) => {
  355. can_name += i == 0 ? e.name : `_${e.name}`;
  356. can_id_arr.push(e.id);
  357. if (e.id === "6") {
  358. is_metal = true;
  359. }
  360. });
  361. this.sitem.is_metal = is_metal;
  362. this.sitem.can_id_arr = can_id_arr;
  363. this.sitem.can_name = can_name;
  364. this.getNewTime();
  365. await this.well_timer();
  366. } else if (code >= 100 && code <= 104) {
  367. await this.logout();
  368. } else {
  369. this.$message.warning(message);
  370. }
  371. },
  372. async well_timer() {
  373. this.timer = setInterval(async () => {
  374. if (this.num !== 0) {
  375. this.num--;
  376. } else {
  377. if (this.timer) {
  378. const { code, status, message } = await this.repeat_initData();
  379. if (code === 0 && status + '' === "1") {
  380. this.num = 60;
  381. } else if (code === 0 && status !== "1") {
  382. this.status = status;
  383. this.clearTime();
  384. } else if (code >= 100 && code <= 104) {
  385. this.clearTime();
  386. await this.logout();
  387. } else {
  388. this.clearTime();
  389. this.$message.warning(message);
  390. }
  391. }
  392. }
  393. }, 1000);
  394. },
  395. clearTime() {
  396. if (this.timer) {
  397. clearInterval(this.timer);
  398. this.num = 0;
  399. }
  400. },
  401. async repeat_initData() {
  402. const { code, message, data } = await asyncRequest.detail({
  403. infoNo: this.queryId,
  404. });
  405. const { status } = data;
  406. const res = { code, status, message };
  407. return res;
  408. },
  409. getNewTime() {
  410. this.newTime = new Date().valueOf();
  411. },
  412. openModal(bidNo, type) {
  413. const { id } = this.$route.query;
  414. this.queryId = id;
  415. this.editId = bidNo;
  416. this.editType = type;
  417. this.getNewTime();
  418. },
  419. // 刷新表格
  420. async searchList() {
  421. this.loading = true;
  422. this.parmValue.infoNo = this.queryId;
  423. const { code, data, message } = await asyncRequest.good_list(
  424. this.parmValue
  425. );
  426. if (code === 0) {
  427. const { list } = data;
  428. this.tableData = list;
  429. } else if (code >= 100 && code <= 104) {
  430. await this.logout();
  431. } else {
  432. this.tableData = [];
  433. }
  434. this.loading = false;
  435. },
  436. },
  437. };
  438. </script>
  439. <style lang="scss" scoped>
  440. @import "~@/styles/mixin.scss";
  441. .workbenchdetail {
  442. //
  443. position: relative;
  444. width: 100%;
  445. height: calc(100vh - 50px);
  446. box-sizing: border-box;
  447. overflow: hidden;
  448. .page-main {
  449. position: relative;
  450. background: #f2f2f2;
  451. width: 100%;
  452. height: calc(100vh - 50px);
  453. box-sizing: border-box;
  454. // padding:16px;
  455. .left {
  456. position: absolute;
  457. top: 16px;
  458. left: 16px;
  459. width: 220px;
  460. overflow: hidden;
  461. height: calc(100vh - 82px);
  462. .left-main {
  463. background: rgba(242, 242, 242, 1);
  464. width: 100%;
  465. overflow-y: scroll;
  466. overflow-x: hidden;
  467. // background: #fff;
  468. height: calc(100vh - 82px);
  469. @include scrollBar();
  470. }
  471. }
  472. .p-right {
  473. top: 16px;
  474. right: 16px;
  475. width: calc(100% - 258px);
  476. height: calc(100vh - 276px);
  477. overflow-y: scroll;
  478. background: #fff;
  479. overflow-x: hidden;
  480. position: absolute;
  481. @include scrollBar();
  482. .right-mian-wait {
  483. .title {
  484. height: 45px;
  485. font-size: 17px;
  486. line-height: 45px;
  487. box-sizing: border-box;
  488. padding: 0 16px;
  489. border-bottom: 1px solid rgba(242, 242, 242, 1);
  490. }
  491. .main {
  492. text-align: center;
  493. line-height: 180px;
  494. }
  495. }
  496. }
  497. .bottom {
  498. position: absolute;
  499. bottom: 16px;
  500. right: 16px;
  501. background: #fff;
  502. width: calc(100% - 258px);
  503. height: 180px;
  504. min-height: 180px;
  505. overflow-y: scroll;
  506. overflow-x: hidden;
  507. @include scrollBar();
  508. padding: 16px;
  509. }
  510. .left-card,
  511. .right-card,
  512. .bottom-card {
  513. background: #fff;
  514. font-size: 12px;
  515. // padding:16px;
  516. line-height: 18px;
  517. margin: 8px 0 0 0;
  518. &:first-child {
  519. margin: 0;
  520. }
  521. .page-main-title {
  522. height: 45px;
  523. font-size: 17px;
  524. line-height: 45px;
  525. box-sizing: border-box;
  526. padding: 0 16px;
  527. border-bottom: 1px solid rgba(242, 242, 242, 1);
  528. }
  529. .page-main-ul {
  530. padding: 10px 16px 16px 16px;
  531. li {
  532. float: left;
  533. font-size: 12px;
  534. line-height: 25px;
  535. &:nth-child(2n + 1) {
  536. width: 60px;
  537. text-align: right;
  538. }
  539. &:nth-child(2n + 2) {
  540. width: calc(100% - 60px);
  541. }
  542. }
  543. }
  544. }
  545. }
  546. }
  547. </style>