detail.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. <template>
  2. <div class="zixunOrderDetail">
  3. <div
  4. class="zixunOrderDetail-main"
  5. v-if="powers && powers.length > 0 && powers.some((item) => item == '007')"
  6. >
  7. <show-data-table
  8. style="padding: 10px 0 5px 0"
  9. :newTime="newTime"
  10. border
  11. v-if="newTime !== '' && queryType === 'view'"
  12. :sitem="sitem"
  13. :columns="editColumns"
  14. >
  15. <template slot="status">
  16. <el-tag
  17. :size="tablebtnSize"
  18. v-text="
  19. (options.find((item) => item.id == sitem.status) || {}).label ||
  20. '--'
  21. "
  22. ></el-tag>
  23. <el-tooltip
  24. effect="dark"
  25. content="停止招标任务"
  26. placement="top"
  27. v-if="sitem.status === '1' && powers.some((item) => item == '066')"
  28. >
  29. <i
  30. class="el-icon-video-pause hover"
  31. style="margin: 0 0 0 10px"
  32. @click="changeStatus('7')"
  33. ></i>
  34. </el-tooltip>
  35. <el-tooltip
  36. effect="dark"
  37. content="启动招标任务"
  38. placement="top"
  39. v-if="
  40. (sitem.status === '7' || sitem.status === '2') &&
  41. powers.some((item) => item == '067')
  42. "
  43. >
  44. <i
  45. class="el-icon-video-play hover"
  46. style="margin: 0 0 0 10px"
  47. @click="changeStatus('1')"
  48. ></i>
  49. </el-tooltip>
  50. </template>
  51. <template slot="departinfo">
  52. <span>{{ sitem.salesman }}--</span>
  53. <span v-for="(si, sii) in sitem.departinfo" :key="si + sii"
  54. ><span v-if="sii !== 0">/</span>{{ si.name }}</span
  55. >
  56. </template>
  57. </show-data-table>
  58. <el-tabs v-model="projectTabs">
  59. <el-tab-pane label="新建竞价单" name="0" v-if="queryType === 'add'">
  60. <add-form
  61. v-if="newTime !== ''"
  62. :newTime="newTime"
  63. :id="queryId"
  64. :type="queryType"
  65. :sitem="sitem"
  66. @refresh="refresh"
  67. />
  68. </el-tab-pane>
  69. <el-tab-pane label="竞价单详情" name="1" v-if="queryType !== 'add'">
  70. <edit-form
  71. v-if="newTime !== ''"
  72. :newTime="newTime"
  73. :id="queryId"
  74. :type="queryType"
  75. :sitem="sitem"
  76. @refresh="refresh"
  77. />
  78. </el-tab-pane>
  79. <el-tab-pane label="反馈情况" name="2" v-if="queryType == 'view'">
  80. <feedback-list
  81. v-if="newTime !== ''"
  82. :newTime="newTime"
  83. :sitem="sitem"
  84. :id="queryId"
  85. @resGoodOk="initForm()"
  86. />
  87. </el-tab-pane>
  88. <!-- <el-tab-pane label="审批记录" name="3" v-if="queryType == 'view'">
  89. <process-time-line
  90. v-if="newTime !== ''"
  91. :newTime="newTime"
  92. :type="'ZXD'"
  93. :orderCode="queryId"
  94. />
  95. </el-tab-pane> -->
  96. </el-tabs>
  97. </div>
  98. <div v-else>
  99. <no-auth></no-auth>
  100. </div>
  101. </div>
  102. </template>
  103. <script>
  104. import asyncRequest from "@/apis/service/sellOut/zixunOrder";
  105. import resToken from "@/mixins/resToken";
  106. import { mapGetters } from "vuex";
  107. import addForm from "./components/addEditForm";
  108. import editForm from "./components/editForm";
  109. import feedbackList from "./components/feedbackList";
  110. import { editColumns } from "./components/ShowDataTableColumns";
  111. export default {
  112. name: "zixunOrderDetail",
  113. mixins: [resToken],
  114. components: {
  115. addForm,
  116. editForm,
  117. feedbackList,
  118. },
  119. computed: {
  120. ...mapGetters(["tablebtnSize", "searchSize", "size"]),
  121. powers() {
  122. let tran =
  123. this.$store.getters.btnList.find(
  124. (item) => item.menu_route == "zixunOrderDetail"
  125. ) || {};
  126. if (tran && tran.action && tran.action.length > 0) {
  127. return tran.action;
  128. } else {
  129. return [];
  130. }
  131. },
  132. },
  133. data() {
  134. return {
  135. statusList: [],
  136. size: "small",
  137. editColumns: editColumns,
  138. projectTabs: "1",
  139. projectNames: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
  140. newTime: "",
  141. loading: false,
  142. queryType: "",
  143. queryId: "",
  144. status: "",
  145. sitem: null,
  146. options: [
  147. { id: "0", label: "待发布竞标" },
  148. { id: "1", label: "招标进行中" },
  149. { id: "2", label: "招标已结束" },
  150. { id: "3", label: "待选择商品" },
  151. { id: "4", label: "已选商品待下单" },
  152. { id: "5", label: "已成功转单" },
  153. { id: "6", label: "已取消转单" },
  154. { id: "7", label: "招标已暂停" },
  155. ],
  156. };
  157. },
  158. mounted() {
  159. this.initForm();
  160. },
  161. methods: {
  162. async initForm() {
  163. const { id, type } = this.$route.query;
  164. this.queryId = id;
  165. this.queryType = type;
  166. this.projectTabs = type === "add" ? "0" : "1";
  167. this.loading = true;
  168. if (this.queryType === "add") {
  169. this.sitem = {};
  170. this.getNewTime();
  171. } else {
  172. await this.initData();
  173. }
  174. this.loading = false;
  175. },
  176. handleClick(row) {
  177. console.log(row);
  178. },
  179. async refresh() {
  180. this.routeReGoto("zixunOrder", {});
  181. },
  182. async initData() {
  183. this.loading = true;
  184. const { code, message, data } = await asyncRequest.detail({
  185. infoNo: this.queryId,
  186. });
  187. this.loading = false;
  188. console.log(data);
  189. if (code === 0) {
  190. this.sitem = JSON.parse(JSON.stringify(data));
  191. const { status, can } = this.sitem;
  192. if (can && can.length > 0) {
  193. let cat_id = [];
  194. can.forEach((e) => {
  195. cat_id.push(e.id);
  196. });
  197. this.sitem.cat_id = cat_id;
  198. } else {
  199. this.sitem.cat_id = [];
  200. }
  201. this.status = status;
  202. this.getNewTime();
  203. } else if (code >= 100 && code <= 104) {
  204. await this.logout();
  205. } else {
  206. this.$message.warning(message);
  207. }
  208. },
  209. getNewTime() {
  210. this.newTime = new Date().valueOf();
  211. },
  212. /**
  213. * 停止招标任务
  214. * @param {String} id id
  215. * @param {String} status 0-禁用 1-启用
  216. */
  217. async changeStatus(status) {
  218. await this.$confirm(
  219. status === "7" ? `确定要停止招标任务么?` : "确定要重启招标任务么?",
  220. status === "7" ? "" : "重启需要重新编辑竞价信息",
  221. {
  222. confirmButtonText: "确定",
  223. cancelButtonText: "取消",
  224. type: "warning",
  225. }
  226. )
  227. .then(async () => {
  228. if (status === "7") {
  229. this.loading = true;
  230. let model = {
  231. infoNo: this.queryId,
  232. status: status,
  233. };
  234. const res = await asyncRequest.status(model);
  235. console.log(res);
  236. this.loading = false;
  237. if (res && res.code === 0) {
  238. this.$notify.success({
  239. title: "招标任务已结束!",
  240. message: "",
  241. });
  242. await this.initForm();
  243. } else if (res && res.code >= 100 && res.code <= 104) {
  244. await this.logout();
  245. } else {
  246. this.$message.warning(res.message);
  247. }
  248. } else {
  249. let model = {
  250. id: this.queryId,
  251. type: "edit",
  252. };
  253. this.routeReGoto("zixunOrderDetail", model);
  254. location.reload();
  255. }
  256. })
  257. .catch(() => {
  258. console.log("取消");
  259. });
  260. },
  261. // 点击业务审核的保存按钮
  262. async examForm(e) {
  263. console.log(e);
  264. if (!this.loading) {
  265. let model = {
  266. activity_code: this.queryId,
  267. status: e.state === "1" ? "1" : "8",
  268. remark: e.remark,
  269. };
  270. await this.setstatus("提交产品部门审核", model);
  271. }
  272. },
  273. async setstatus(detail, model) {
  274. await this.$confirm(`确定要${detail}?`, {
  275. confirmButtonText: "确定",
  276. cancelButtonText: "取消",
  277. type: "warning",
  278. })
  279. .then(async () => {
  280. let res = await asyncRequest.actstatus(model);
  281. if (res && res.code === 0) {
  282. this.$notify.success({
  283. title: "提交成功!",
  284. message: "",
  285. });
  286. await this.initForm();
  287. } else if (res && res.code >= 100 && res.code <= 104) {
  288. await this.logout();
  289. } else {
  290. this.$message.warning(res.message);
  291. }
  292. })
  293. .catch(() => {
  294. console.log("取消");
  295. });
  296. },
  297. },
  298. };
  299. </script>
  300. <style lang="scss" scoped>
  301. .zixunOrderDetail {
  302. position: relative;
  303. height: 100%;
  304. width: 100%;
  305. box-sizing: border-box;
  306. .zixunOrderDetail-main {
  307. position: relative;
  308. padding: 10px;
  309. height: 100%;
  310. width: 100%;
  311. }
  312. .zixunOrderDetail-title {
  313. border-top: 1px solid #ebeef5;
  314. span {
  315. height: 50px;
  316. line-height: 50px;
  317. font-family: "微软雅黑", sans-serif;
  318. font-weight: 400;
  319. font-style: normal;
  320. font-size: 16fpx;
  321. text-align: left;
  322. }
  323. }
  324. /deep/ .ddiv {
  325. border-top: 1px solid #dcdfe6;
  326. }
  327. /deep/ .dtitle {
  328. width: 40px;
  329. text-align: center;
  330. height: 100%;
  331. min-height: 100%;
  332. ul {
  333. padding: 12px 0 0 0;
  334. }
  335. }
  336. /deep/ .dmain {
  337. padding: 20px 0 0 0;
  338. width: calc(100% - 40px);
  339. border-left: 1px solid #dcdfe6;
  340. }
  341. }
  342. </style>