feedbackList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  1. <template>
  2. <div class="zixunOrder pagePadding">
  3. <!-- <div>{{ powers }}---{{ is_project }}</div> -->
  4. <ex-table
  5. v-loading="loading"
  6. :table="table"
  7. :data="tableData"
  8. :columns="columns"
  9. :page="pageInfo"
  10. :size="size"
  11. @page-curr-change="handlePageChange"
  12. @page-size-change="handleSizeChange"
  13. @screen-reset="
  14. pageInfo.curr = 1;
  15. parmValue.page = 1;
  16. searchList();
  17. "
  18. @screen-submit="
  19. pageInfo.curr = 1;
  20. parmValue.page = 1;
  21. searchList();
  22. "
  23. >
  24. <template #good_img="{ scope }">
  25. <div
  26. v-if="scope.row.good_img"
  27. style="width: 20px; height: 20px"
  28. class="hover"
  29. v-viewer
  30. >
  31. <img
  32. :src="scope.row.good_img"
  33. style="display: inline-block; width: 100%; height: 100%"
  34. alt=""
  35. />
  36. </div>
  37. </template>
  38. <template #status="{ scope }">
  39. <el-tag
  40. :size="tablebtnSize"
  41. :type="
  42. (statusOptions.find((item) => item.id == scope.row.status) || {})
  43. .type || ''
  44. "
  45. v-text="
  46. (statusOptions.find((item) => item.id == scope.row.status) || {})
  47. .label || '--'
  48. "
  49. ></el-tag>
  50. </template>
  51. <template #specinfo="{ scope }">
  52. <span v-for="(si, sii) in scope.row.specinfo" :key="si.specid + sii">
  53. <span v-if="sii !== 0"></span>{{ si.spec_name }}[{{
  54. si.spec_value_name
  55. }}]</span
  56. >
  57. </template>
  58. <template #operation="{ scope }">
  59. <!-- 状态 -->
  60. <el-tooltip
  61. v-if="powers.some((item) => item == '007')"
  62. effect="dark"
  63. content="详情"
  64. placement="top"
  65. >
  66. <i class="el-icon-view tb-icon" @click="show_view(scope.row)"></i>
  67. </el-tooltip>
  68. <!-- {{ status }}-- {{ scope.row.status }} -->
  69. <el-tooltip
  70. v-if="
  71. powers &&
  72. powers.length > 0 &&
  73. powers.some((item) => item == '068') &&
  74. is_project === '0' &&
  75. (status === '2' ||
  76. status === '7' ||
  77. (status === '3' &&
  78. scope.row.status !== '3' &&
  79. scope.row.status !== '4' &&
  80. scope.row.status !== '6'))
  81. "
  82. effect="dark"
  83. content="发起议价流程"
  84. placement="top"
  85. >
  86. <i
  87. class="el-icon-s-flag tb-icon"
  88. @click="wantBargaining(scope.row)"
  89. ></i>
  90. </el-tooltip>
  91. <el-tooltip
  92. v-if="
  93. powers &&
  94. powers.length > 0 &&
  95. powers.some((item) => item == '069') &&
  96. is_project === '0' &&
  97. scope.row.status !== '6' &&
  98. (status == '3' || status == '2' || status == '7')
  99. "
  100. effect="dark"
  101. content="选择该商品"
  102. placement="top"
  103. >
  104. <i
  105. class="el-icon-s-check tb-icon"
  106. @click="change_goods(scope.row.bidNo)"
  107. ></i>
  108. </el-tooltip>
  109. <el-tooltip
  110. v-if="
  111. powers &&
  112. powers.length > 0 &&
  113. powers.some((item) => item == '070') &&
  114. is_project === '0' &&
  115. scope.row.status === '6' &&
  116. status == '4'
  117. "
  118. effect="dark"
  119. content="下单"
  120. placement="top"
  121. >
  122. <i
  123. class="el-icon-shopping-cart-2 tb-icon"
  124. @click="buy_goods(scope.row)"
  125. ></i>
  126. </el-tooltip>
  127. </template>
  128. </ex-table>
  129. <add-edit-bargain
  130. :showModel="wantBmodel"
  131. :sitem="wantBsitem"
  132. @cancel="wantBmodel = false"
  133. @refresh="(wantBmodel = false), $emit('resGoodOk')"
  134. />
  135. <buy-good-modal
  136. :showModel="bayGoodShowModel"
  137. :sitem="bayGoodItem"
  138. @cancel="bayGoodShowModel = false"
  139. @refresh="(bayGoodShowModel = false), $emit('resGoodOk')"
  140. />
  141. </div>
  142. </template>
  143. <script>
  144. import mixinPage from "@/mixins/elPaginationHandle";
  145. import resToken from "@/mixins/resToken";
  146. import asyncRequest from "@/apis/service/sellOut/zixunOrder";
  147. import { feedbackListCol } from "../columns";
  148. import { mapGetters } from "vuex";
  149. import addEditBargain from "./addEditBargain";
  150. import buyGoodModal from "./buyGoodModal";
  151. export default {
  152. name: "zixunOrder",
  153. mixins: [mixinPage, resToken],
  154. props: ["id", "newTime", "sitem"],
  155. components: {
  156. addEditBargain,
  157. buyGoodModal,
  158. },
  159. computed: {
  160. ...mapGetters(["tablebtnSize", "searchSize", "size"]),
  161. powers() {
  162. let tran =
  163. this.$store.getters.btnList.find(
  164. (item) => item.menu_route == "zixunOrderDetail"
  165. ) || {};
  166. if (tran && tran.action && tran.action.length > 0) {
  167. return tran.action;
  168. } else {
  169. return [];
  170. }
  171. },
  172. },
  173. watch: {
  174. newTime: function (val) {
  175. if (val) {
  176. const { is_project, status } = this.sitem;
  177. this.is_project = is_project;
  178. this.status = status;
  179. this.searchList();
  180. }
  181. },
  182. },
  183. data() {
  184. return {
  185. view_spuCode: "",
  186. view_show: false,
  187. wantBmodel: false,
  188. wantBsitem: "",
  189. select: "1",
  190. s_input: "",
  191. status: "",
  192. bayGoodShowModel: false,
  193. bayGoodItem: {},
  194. is_project: false,
  195. customerCode: [], //客户公司code
  196. options: [
  197. { id: "0", label: "待发布竞标" },
  198. { id: "1", label: "招标进行中" },
  199. { id: "2", label: "招标已结束" },
  200. { id: "3", label: "待选择商品" },
  201. { id: "4", label: "已选商品待下单" },
  202. { id: "5", label: "已成功转单" },
  203. { id: "6", label: "已取消转单" },
  204. { id: "7", label: "招标已暂停" },
  205. ],
  206. sitem: null,
  207. // 状态
  208. statusOptions: [
  209. { id: "0", label: "采返已结束", type: "info" },
  210. { id: "1", label: "采返已结束", type: "info" },
  211. { id: "2", label: "采返已结束", type: "info" },
  212. { id: "3", label: "等待议价结果", type: "warning" },
  213. { id: "4", label: "等待议价结果", type: "warning" },
  214. { id: "5", label: "议价已结束", type: "" },
  215. { id: "6", label: "已选择该商品", type: "success" },
  216. // 0待提交1待任务结束 2 待咨询确认 3议价待财务定价4 待主管确认5 待咨询确认定价6 咨询确认
  217. ],
  218. loading: true,
  219. showModel: false,
  220. isDetail: false,
  221. modelId: 0,
  222. parmValue: {
  223. zxNo: "",
  224. infoNo: "",
  225. bidNo: "",
  226. projectNo: "",
  227. page: 1, // 页码
  228. size: 15, // 每页显示条数
  229. },
  230. // 表格 - 数据
  231. tableData: [],
  232. // 表格 - 参数
  233. table: {
  234. stripe: true,
  235. border: true,
  236. // _defaultHeader_: ["setcol"],
  237. },
  238. // 表格 - 分页
  239. pageInfo: {
  240. size: 15,
  241. curr: 1,
  242. total: 0,
  243. },
  244. // 表格 - 列参数
  245. columns: feedbackListCol,
  246. };
  247. },
  248. mounted() {
  249. console.log(this.sitem);
  250. const { is_project, status } = this.sitem;
  251. this.is_project = is_project;
  252. this.status = status;
  253. this.searchList();
  254. },
  255. methods: {
  256. restSearch() {
  257. this.parmValue = {
  258. zxNo: "",
  259. infoNo: "",
  260. bidNo: "",
  261. projectNo: "",
  262. page: 1, // 页码
  263. size: 15, // 每页显示条数
  264. };
  265. // 表格 - 分页
  266. this.pageInfo = {
  267. size: 15,
  268. curr: 1,
  269. total: 0,
  270. };
  271. this.searchList();
  272. },
  273. wantBargaining(row) {
  274. this.wantBsitem = row;
  275. this.wantBmodel = true;
  276. },
  277. openModal(id, isDetail, sitem) {
  278. this.showModel = true;
  279. this.modelId = id;
  280. this.isDetail = isDetail;
  281. this.sitem = sitem;
  282. },
  283. // 列表搜索
  284. async searchList() {
  285. this.loading = true;
  286. this.parmValue.infoNo = this.id;
  287. const res = await asyncRequest.feedList(this.parmValue);
  288. if (res && res.code === 0 && res.data) {
  289. this.tableData = res.data.list;
  290. this.pageInfo.total = Number(res.data.count);
  291. } else if (res && res.code >= 100 && res.code <= 104) {
  292. await this.logout();
  293. } else {
  294. this.tableData = [];
  295. this.pageInfo.total = 0;
  296. }
  297. this.loading = false;
  298. },
  299. async change_goods(bidNo) {
  300. await this.$confirm("确定要选择该商品下单?", {
  301. confirmButtonText: "确定",
  302. cancelButtonText: "取消",
  303. type: "warning",
  304. })
  305. .then(async () => {
  306. this.loading = true;
  307. const model = {
  308. bidNo: bidNo,
  309. };
  310. const res = await asyncRequest.bidscheck(model);
  311. if (res && res.code === 0) {
  312. this.loading = false;
  313. this.$notify.success({
  314. title: "选择商品成功!",
  315. message: "",
  316. });
  317. this.$emit("resGoodOk");
  318. } else if (res && res.code >= 100 && res.code <= 104) {
  319. await this.logout();
  320. } else {
  321. this.$message.warning(res.message);
  322. }
  323. })
  324. .catch(() => {
  325. console.log("取消");
  326. });
  327. },
  328. async statusConfirm(id, status) {
  329. let str = status === "1" ? "禁用" : "启用";
  330. await this.$confirm("确定要改为" + str + "?", {
  331. confirmButtonText: "确定",
  332. cancelButtonText: "取消",
  333. type: "warning",
  334. })
  335. .then(async () => {
  336. this.loading = true;
  337. const model = {
  338. id: id,
  339. status: status === "1" ? "0" : "1",
  340. };
  341. const res = await asyncRequest.status(model);
  342. if (res && res.code === 0) {
  343. this.loading = false;
  344. this.$notify.success({
  345. title: "状态修改成功!",
  346. message: "",
  347. });
  348. await this.searchList();
  349. } else if (res && res.code >= 100 && res.code <= 104) {
  350. await this.logout();
  351. } else {
  352. this.$message.warning(res.message);
  353. }
  354. })
  355. .catch(() => {
  356. console.log("取消");
  357. });
  358. },
  359. buy_goods(row) {
  360. const { company, khname, platform_name, arrival_time, num } = this.sitem;
  361. this.bayGoodItem = JSON.parse(JSON.stringify(row));
  362. this.bayGoodItem.in_company = company;
  363. this.bayGoodItem.in_khname = khname;
  364. this.bayGoodItem.in_platform_name = platform_name;
  365. this.bayGoodItem.in_arrival_time = arrival_time;
  366. this.bayGoodItem.in_num = num;
  367. this.bayGoodShowModel = true;
  368. // console.log(row);
  369. },
  370. // 时间选择事件
  371. async handleTime(e) {
  372. if (e.startTime !== "") {
  373. this.parmValue.start = e.startTime;
  374. } else {
  375. this.parmValue.start = "";
  376. }
  377. if (e.endTime !== "") {
  378. this.parmValue.end = e.endTime;
  379. } else {
  380. this.parmValue.end = "";
  381. }
  382. if (this.parmValue.start !== "" && this.parmValue.end !== "") {
  383. this.pageInfo.curr = 1;
  384. this.parmValue.page = 1;
  385. await this.searchList();
  386. }
  387. },
  388. async customerChange(e) {
  389. if (e && e.id) {
  390. this.customerCode = [e.code];
  391. this.parmValue.customer_code = e.code;
  392. } else {
  393. this.customerCode = [];
  394. this.parmValue.customer_code = "";
  395. }
  396. this.pageInfo.curr = 1;
  397. this.parmValue.page = 1;
  398. await this.searchList();
  399. },
  400. },
  401. };
  402. </script>
  403. <style lang="scss" scoped>
  404. .zixunOrder {
  405. }
  406. </style>