detail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  1. <template>
  2. <div class="bargainListDetail">
  3. <div class="bargainListDetail-main" v-if="powers.some((i) => i == '007')">
  4. <el-tabs v-model="projectTabs" v-loading="loading">
  5. <el-tab-pane label="议价单详情" name="1">
  6. <el-collapse v-model="activeNames" style="margin: -18px 0 0 0">
  7. <el-collapse-item :title="'议价详情'" name="1">
  8. <show-data-table
  9. style="padding: -5px 0 10px 0"
  10. :newTime="newTime"
  11. v-if="newTime !== ''"
  12. :sitem="sitem"
  13. :columns="editColumns"
  14. >
  15. <template slot="status">
  16. <el-tag
  17. :size="tablebtnSize"
  18. :type="
  19. (statusList.find((item) => item.id == sitem.status) || {}).type ||
  20. ''
  21. "
  22. v-text="
  23. (statusList.find((item) => item.id == sitem.status) || {}).label ||
  24. '--'
  25. "
  26. ></el-tag>
  27. </template>
  28. <template slot="is_addrs">
  29. <el-tag
  30. :size="'mini'"
  31. v-text="
  32. (options12.find((item) => item.id == sitem.is_addrs) || {}).name ||
  33. '--'
  34. "
  35. ></el-tag>
  36. </template>
  37. <template slot="is_custom">
  38. <el-tag
  39. :size="'mini'"
  40. v-text="
  41. (options1.find((item) => item.id == sitem.is_custom) || {}).name ||
  42. '--'
  43. "
  44. ></el-tag>
  45. </template>
  46. <template slot="good_num">
  47. <span>{{ sitem.good_num ? sitem.good_num : "0" }}{{ sitem.unit }}</span>
  48. </template>
  49. <template slot="rate_status">
  50. <el-tag
  51. :size="'mini'"
  52. v-text="
  53. (
  54. rate_status_options.find(
  55. (item) => item.id == sitem.rate_status + ''
  56. ) || {}
  57. ).label || '--'
  58. "
  59. ></el-tag>
  60. </template>
  61. </show-data-table>
  62. </el-collapse-item>
  63. <el-collapse-item title="商品信息" name="20">
  64. <show-goods-data-table
  65. :newTime="newTime"
  66. v-if="newTime !== ''"
  67. :type="'3'"
  68. :skucode="''"
  69. :spucode="sitem.spuCode"
  70. :iscgd="true"
  71. />
  72. </el-collapse-item>
  73. <el-collapse-item
  74. title="商品成本信息"
  75. name="6"
  76. v-if="
  77. newTime !== '' &&
  78. private_field &&
  79. private_field.length > 0 &&
  80. private_field.some((item) => item == '1')
  81. "
  82. >
  83. <show-data-table
  84. :newTime="newTime"
  85. v-if="newTime !== ''"
  86. :sitem="sitem"
  87. :columns="costArr"
  88. >
  89. </show-data-table>
  90. </el-collapse-item>
  91. <el-collapse-item
  92. title="商品毛利信息"
  93. name="7"
  94. v-if="
  95. newTime !== '' &&
  96. private_field &&
  97. private_field.length > 0 &&
  98. private_field.some((item) => item == '3')
  99. "
  100. >
  101. <show-data-table
  102. :newTime="newTime"
  103. v-if="newTime !== ''"
  104. :sitem="sitem"
  105. :columns="bargainingArr"
  106. >
  107. </show-data-table>
  108. </el-collapse-item>
  109. <el-collapse-item
  110. title="业务部门审批"
  111. name="2"
  112. v-if="
  113. (eaxmList.some((item) => item.info_status + '' == '0') ||
  114. (status == '0' && ppowers.some((i) => i == '0'))) &&
  115. !isSupertube
  116. "
  117. >
  118. <exam-formss
  119. :newTime="newTime"
  120. v-if="newTime !== ''"
  121. :disabled="!(status == '0' && ppowers.some((i) => i == '0'))"
  122. :sitem="orderItem"
  123. @searchChange="examFormSubmit($event, '业务主管')"
  124. />
  125. </el-collapse-item>
  126. </el-collapse>
  127. </el-tab-pane>
  128. <el-tab-pane label="审批记录" name="3">
  129. <process-time-line
  130. v-if="newTime !== ''"
  131. :newTime="newTime"
  132. :type="'YJD'"
  133. :orderCode="queryId"
  134. />
  135. </el-tab-pane>
  136. <el-tab-pane label="流程图" name="5">
  137. <flow-chart process_id="13" :orderCode="queryId" />
  138. </el-tab-pane>
  139. </el-tabs>
  140. </div>
  141. <div v-else>
  142. <no-auth></no-auth>
  143. </div>
  144. </div>
  145. </template>
  146. <script>
  147. import examFormss from "./exam-form.vue";
  148. import asyncRequest from "@/apis/service/sellOut/bargainList";
  149. import resToken from "@/mixins/resToken";
  150. import { mapGetters } from "vuex";
  151. import {
  152. editColumns,
  153. costArr,
  154. bargainingArr,
  155. options1,
  156. options2,
  157. options3,
  158. options4,
  159. options5,
  160. options6,
  161. options7,
  162. options8,
  163. options9,
  164. options10,
  165. options11,
  166. options12,
  167. statusList,
  168. rate_status_options,
  169. } from "./columns";
  170. export default {
  171. components: {
  172. examFormss,
  173. },
  174. name: "bargainListDetail",
  175. mixins: [resToken],
  176. computed: {
  177. ...mapGetters(["tablebtnSize", "searchSize", "size", "private_field", "isSupertube"]),
  178. powers() {
  179. const { btnList } = this.$store.getters;
  180. const tran = btnList.find((item) => item.menu_route == "bargainListDetail") || {};
  181. const { action } = tran ?? {};
  182. return action ?? [];
  183. },
  184. ppowers() {
  185. const { roleProcess } = this.$store.getters;
  186. const tran = roleProcess.find((i) => i.process_type === "YJD") || {};
  187. const { action } = tran ?? {};
  188. return action ?? [];
  189. },
  190. },
  191. data() {
  192. return {
  193. size: "small",
  194. eaxmList: [],
  195. costArr,
  196. bargainingArr,
  197. editColumns,
  198. options1,
  199. options2,
  200. options3,
  201. options4,
  202. options5,
  203. options6,
  204. options7,
  205. options8,
  206. options9,
  207. options10,
  208. options11,
  209. options12,
  210. statusList,
  211. rate_status_options,
  212. projectTabs: "1",
  213. activeNames: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "20"],
  214. newTime: "",
  215. loading: false,
  216. queryType: "",
  217. queryId: "",
  218. status: "",
  219. sitem: null,
  220. orderItem: {},
  221. moneyDirItem: {},
  222. moneyItem: {},
  223. BossItem: {},
  224. };
  225. },
  226. mounted() {
  227. this.initForm();
  228. },
  229. methods: {
  230. async initForm() {
  231. const { id, type } = this.$route.query;
  232. this.queryId = id;
  233. this.queryType = type;
  234. this.projectTabs = "1";
  235. this.loading = true;
  236. await this.initData();
  237. this.loading = false;
  238. },
  239. handleClick(row) {
  240. console.log(row);
  241. },
  242. async refresh() {
  243. this.routeReGoto("bargainList", {});
  244. },
  245. async initData() {
  246. this.loading = true;
  247. const { code, message, data } = await asyncRequest.detail({
  248. bargainNo: this.queryId,
  249. });
  250. this.eaxmList = [];
  251. this.loading = false;
  252. if (code === 0) {
  253. this.sitem = JSON.parse(JSON.stringify(data));
  254. const { status, exam_info } = this.sitem;
  255. this.orderItem = {};
  256. this.moneyDirItem = {};
  257. this.moneyItem = {};
  258. this.BossItem = {};
  259. if (exam_info && exam_info.length > 0) {
  260. exam_info.forEach((e) => {
  261. console.log(e.status);
  262. switch (e.info_status + "") {
  263. case "0":
  264. this.orderItem = JSON.parse(JSON.stringify(e));
  265. break;
  266. case "2":
  267. this.moneyDirItem = JSON.parse(JSON.stringify(e));
  268. break;
  269. case "4":
  270. this.moneyItem = JSON.parse(JSON.stringify(e));
  271. break;
  272. case "7":
  273. this.BossItem = JSON.parse(JSON.stringify(e));
  274. break;
  275. default:
  276. this.orderItem = JSON.parse(JSON.stringify(e));
  277. }
  278. });
  279. this.eaxmList = JSON.parse(JSON.stringify(exam_info));
  280. }
  281. this.status = status;
  282. this.getNewTime();
  283. } else if (code >= 100 && code <= 104) {
  284. await this.logout();
  285. } else {
  286. this.$message.warning(message);
  287. }
  288. },
  289. getNewTime() {
  290. this.newTime = new Date().valueOf();
  291. },
  292. // 点击业务审核的保存按钮
  293. async examFormSubmit(e, title) {
  294. if (!this.loading) {
  295. const { state, remark } = e;
  296. let model = {
  297. bargainNo: this.queryId,
  298. status: state,
  299. remark: remark,
  300. };
  301. await this.$confirm(`确定要提交${title}审批结果?`, {
  302. confirmButtonText: "确定",
  303. cancelButtonText: "取消",
  304. type: "warning",
  305. })
  306. .then(async () => {
  307. const { after_price, lower_price } = this.sitem;
  308. if (
  309. this.status + "" === "7" &&
  310. after_price * 1 < lower_price * 1 &&
  311. state + "" + "" === "1"
  312. ) {
  313. this.loading = false;
  314. await this.$confirm(
  315. `当前商品同意议价后,售价已低于系统最低售价${this.sitem.lower_price}元!`,
  316. `最终售价已低于系统最低售价!是否继续?`,
  317. {
  318. confirmButtonText: "确定",
  319. cancelButtonText: "取消",
  320. type: "error",
  321. }
  322. )
  323. .then(async () => {
  324. this.loading = true;
  325. await this.statusSubmit(model, title);
  326. })
  327. .catch(() => {
  328. this.loading = false;
  329. console.log("取消1");
  330. });
  331. } else {
  332. await this.statusSubmit(model, title);
  333. }
  334. })
  335. .catch(() => {
  336. this.loading = false;
  337. console.log("取消");
  338. });
  339. }
  340. },
  341. async statusSubmit(model, title) {
  342. const { code, data, message } = await asyncRequest.status(model);
  343. this.loading = false;
  344. // console.log("res", data);
  345. if (code === 0) {
  346. this.$notify.success({
  347. title: title + "成功!",
  348. message: "",
  349. });
  350. await this.initForm();
  351. } else if (code >= 100 && code <= 104) {
  352. await this.logout();
  353. } else {
  354. this.$message.warning(message);
  355. }
  356. },
  357. },
  358. };
  359. </script>
  360. <style lang="scss" scoped>
  361. .bargainListDetail {
  362. position: relative;
  363. height: 100%;
  364. width: 100%;
  365. box-sizing: border-box;
  366. .bargainListDetail-main {
  367. position: relative;
  368. padding: 10px;
  369. height: 100%;
  370. width: 100%;
  371. }
  372. .bargainListDetail-title {
  373. border-top: 1px solid #ebeef5;
  374. span {
  375. height: 50px;
  376. line-height: 50px;
  377. font-family: "微软雅黑", sans-serif;
  378. font-weight: 400;
  379. font-style: normal;
  380. font-size: 16fpx;
  381. text-align: left;
  382. }
  383. }
  384. /deep/ .ddiv {
  385. border-top: 1px solid #dcdfe6;
  386. }
  387. /deep/ .dtitle {
  388. width: 40px;
  389. text-align: center;
  390. height: 100%;
  391. min-height: 100%;
  392. ul {
  393. padding: 12px 0 0 0;
  394. }
  395. }
  396. /deep/ .dmain {
  397. padding: 20px 0 0 0;
  398. width: calc(100% - 40px);
  399. border-left: 1px solid #dcdfe6;
  400. }
  401. }
  402. </style>