detail.vue 15 KB

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