detail.vue 16 KB

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