feedbackList.vue 14 KB

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