feedbackList.vue 11 KB

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