detail.vue 16 KB

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