detail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. <template>
  2. <div class="sellAfterApplyDetail pagePadding">
  3. <div style="width: 100%" v-if="powers.some((i) => i == '007')">
  4. <el-tabs v-model="activeTabs">
  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. :newTime="newTime"
  10. v-if="newTime !== ''"
  11. :sitem="sitem"
  12. :columns="sellshowColumns"
  13. >
  14. <template slot="status">
  15. <el-tag
  16. :size="'mini'"
  17. :type="sitem.status == '0' ? 'warning' : ''"
  18. v-text="
  19. (
  20. (sitem.is_receive + ''=== '0' ? status2Options : status1Options).find(
  21. (item) => String(item.id) === String( sitem.status)
  22. ) || {}
  23. ).label || '--'
  24. "
  25. ></el-tag>
  26. </template>
  27. <template slot="order_type">
  28. <el-tag
  29. :size="'mini'"
  30. v-text="
  31. (
  32. xs_order_type_options.find(
  33. (item) => item.id == sitem.order_type
  34. ) || {}
  35. ).label || '--'
  36. "
  37. ></el-tag>
  38. </template>
  39. <template slot="is_receive">
  40. <el-tag :size="'mini'" :type="''">{{
  41. sitem.is_receive + '' === "1"
  42. ? "销售订单退货,采购订单也退货"
  43. : sitem.is_receive + '' === "0"
  44. ? "未收到"
  45. : "--"
  46. }}</el-tag>
  47. </template>
  48. <template slot="except_code">
  49. <el-tag
  50. :size="'mini'"
  51. v-text="
  52. (
  53. expect_options.find((item) => item.value == sitem.except_code) ||
  54. {}
  55. ).label || '--'
  56. "
  57. ></el-tag>
  58. </template>
  59. <template slot="error_img">
  60. <img
  61. class="fl hover"
  62. style="width: 23px; height: 23px; margin: 0 5px 0 0"
  63. v-viewer
  64. v-for="(si, i) in sitem.error_img"
  65. :src="si"
  66. :key="si + i"
  67. />
  68. </template>
  69. </show-data-table>
  70. </el-collapse-item>
  71. <el-collapse-item title="商品信息" name="2">
  72. <show-goods-data-table
  73. :newTime="newTime"
  74. v-if="newTime !== '' && sitem"
  75. :type="sitem.order_type"
  76. :skucode="sitem.skuCode"
  77. :spucode="sitem.good_code"
  78. />
  79. </el-collapse-item>
  80. <!-- <el-collapse-item
  81. title="业务审核"
  82. name="3"
  83. v-if="isSupertube && String(sitem.status) === '1' && this.ppowers.includes('1')"
  84. >
  85. <exam-form
  86. :statusList="statusList"
  87. :newTime="newTime"
  88. :disabled="false"
  89. :isMust="false"
  90. @searchChange="examForm"
  91. />
  92. </el-collapse-item> -->
  93. <!-- <el-collapse-item name="4" title="供应商驳回,待采购审核" v-if="isSupertube && String(sitem.status) === '2' && this.ppowers.includes('2')">
  94. <purchase-exam :sitem="sitem" @changeStatus="handlePurchaseConfirm" />
  95. </el-collapse-item> -->
  96. <el-collapse-item name="5" title="供应商审核" v-if="!isSupertube && String(sitem.status) === '9' && this.ppowers.includes('9')">
  97. <supplier-exam :sitem="sitem" @changeStatus="handleSupplierExam" />
  98. </el-collapse-item>
  99. <!-- <el-collapse-item name="6" title="待客户退货" v-if="isSupertube && String(sitem.status) === '4' && this.ppowers.includes('4')">
  100. <wait-return :sitem="sitem" @changeStatus="handleExpress" />
  101. </el-collapse-item> -->
  102. <el-collapse-item name="7" title="业务公司修改待供应商确认" v-if="!isSupertube && String(sitem.status) === '10' && this.ppowers.includes('10')">
  103. <supplier-confrim :sitem="sitem" @changeStatus="handleSupplierConfirm"/>
  104. </el-collapse-item>
  105. <!-- <el-collapse-item
  106. title="设置退货仓库"
  107. name="4"
  108. v-if="
  109. sitem &&
  110. sitem.is_receive === '1' &&
  111. (status == '3' || status == '4' || status == '5')
  112. "
  113. >
  114. <express-feedback
  115. :sitem="sitem"
  116. :newTime="newTime"
  117. v-if="newTime != ''"
  118. @refresh="initData"
  119. ></express-feedback>
  120. </el-collapse-item> -->
  121. </el-collapse>
  122. </el-tab-pane>
  123. <el-tab-pane label="审批记录" name="2">
  124. <process-time-line
  125. v-if="newTime !== ''"
  126. :newTime="newTime"
  127. :type="'SHD'"
  128. :orderCode="orderCode"
  129. />
  130. </el-tab-pane>
  131. <el-tab-pane label="流程图" name="4" v-if="newTime !== ''">
  132. <flow-chart process_id="6" type="SHD" :orderCode="orderCode" />
  133. </el-tab-pane>
  134. </el-tabs>
  135. </div>
  136. <div v-else>
  137. <no-auth></no-auth>
  138. </div>
  139. </div>
  140. </template>
  141. <script>
  142. import mixinPage from "@/mixins/elPaginationHandle";
  143. import resToken from "@/mixins/resToken";
  144. import asyncRequest from "@/apis/service/sellOut/sellAfterApply";
  145. import ExpressFeedback from "./components/express_feedback";
  146. import { sellshowColumns } from "./columns";
  147. import purchaseExam from "./components/purchase_exam";
  148. import SupplierExam from "./components/supplier_exam.vue";
  149. import { xs_order_type_options } from "@/assets/js/statusList";
  150. import WaitReturn from "./components/wait-return.vue";
  151. import SupplierConfrim from "./components/supplier-confirm.vue";
  152. import { mapGetters } from "vuex";
  153. export default {
  154. name: "sellAfterApplyDetail",
  155. mixins: [mixinPage, resToken],
  156. components: {
  157. WaitReturn,
  158. SupplierExam,
  159. purchaseExam,
  160. ExpressFeedback,
  161. SupplierConfrim
  162. },
  163. computed: {
  164. ...mapGetters(['isSuppertube']),
  165. powers() {
  166. const tran = this.$store.getters.btnList.find(
  167. (item) => item.menu_route == "supplierSellAfterApplyDetail"
  168. ) || {};
  169. const { action } = tran ?? {};
  170. return action ?? [];
  171. },
  172. ppowers() {
  173. const tran =
  174. this.$store.getters.roleProcess.find((i) => i.process_type === "SHD") || {};
  175. const { action } = tran ?? {};
  176. return action ?? [];
  177. },
  178. },
  179. data() {
  180. return {
  181. xs_order_type_options,
  182. activeTabs: "1",
  183. expect_options: [],
  184. expect_options1: [
  185. {
  186. value: "1",
  187. label: "退货",
  188. },
  189. {
  190. value: "2",
  191. label: "换货",
  192. },
  193. ],
  194. expect_options0: [
  195. {
  196. value: "1",
  197. label: "退货",
  198. },
  199. {
  200. value: "2",
  201. label: "补发",
  202. },
  203. ],
  204. activeNames: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
  205. status: "", //存储详情接口状态
  206. statusList: [],
  207. sellshowColumns: sellshowColumns,
  208. sitem: null,
  209. newTime: "",
  210. loading: false,
  211. // 收到货状态
  212. status1Options: [
  213. { id: "1", label: "待业务审核" },
  214. { id: "2", label: "供应商驳回,待采购审核" },
  215. // { id: "3", label: "待设置仓库" }, // 废弃
  216. { id: "4", label: "待客户退货" },
  217. { id: "5", label: "售后已完成" },
  218. { id: "6", label: "业务已驳回" },
  219. // { id: "7", label: "采购已驳回" }, // 废弃
  220. { id: "8", label: "申请已取消" },
  221. { id: "9", label: "供应商审核" },
  222. { id: "10", label: "业务公司修改,待供应商确认" }
  223. ],
  224. // 未收到货状态
  225. status2Options: [
  226. { id: "1", label: "待业务审核" },
  227. { id: "2", label: "供应商驳回,待采购审核" },
  228. // { id: "3", label: "待设置仓库" }, // 废弃
  229. { id: "4", label: "待客户退货" },
  230. { id: "5", label: "售后已完成" },
  231. { id: "6", label: "业务已驳回" },
  232. // { id: "7", label: "采购已驳回" }, // 废弃
  233. { id: "8", label: "申请已取消" },
  234. { id: "9", label: "供应商审核" },
  235. { id: "10", label: "业务公司修改,待供应商确认" }
  236. ],
  237. orderCode: "",
  238. return_code: "",
  239. code: "",
  240. };
  241. },
  242. mounted() {
  243. this.code = this.$route.query.id;
  244. this.initData();
  245. },
  246. methods: {
  247. async handleExpress(data){
  248. let res = await asyncRequest.express({
  249. ...data,
  250. returnCode: this.code
  251. });
  252. if (res && res.code === 0) {
  253. this.$notify.success({
  254. title: "修改成功!",
  255. message: "",
  256. });
  257. await this.initData();
  258. } else if (res && res.code >= 100 && res.code <= 104) {
  259. await this.logout();
  260. } else {
  261. this.$message.warning(res.message);
  262. }
  263. },
  264. async handleSupplierConfirm(data){
  265. let res = await asyncRequest.status({
  266. ...data,
  267. returnCode: this.code
  268. });
  269. if (res && res.code === 0) {
  270. this.$notify.success({
  271. title: "修改成功!",
  272. message: "",
  273. });
  274. await this.initData();
  275. } else if (res && res.code >= 100 && res.code <= 104) {
  276. await this.logout();
  277. } else {
  278. this.$message.warning(res.message);
  279. }
  280. },
  281. async handleSupplierExam(data){
  282. let res = await asyncRequest.status({
  283. ...data,
  284. returnCode: this.code
  285. });
  286. if (res && res.code === 0) {
  287. this.$notify.success({
  288. title: "修改成功!",
  289. message: "",
  290. });
  291. await this.initData();
  292. } else if (res && res.code >= 100 && res.code <= 104) {
  293. await this.logout();
  294. } else {
  295. this.$message.warning(res.message);
  296. }
  297. },
  298. getNewTime() {
  299. this.newTime = new Date().valueOf();
  300. },
  301. async handlePurchaseConfirm(data){
  302. const model = {
  303. returnCode: this.code,
  304. ...data
  305. };
  306. let res = await asyncRequest.status(model);
  307. if (res && res.code === 0) {
  308. this.$notify.success({
  309. title: "修改成功!",
  310. message: "",
  311. });
  312. await this.initData();
  313. } else if (res && res.code >= 100 && res.code <= 104) {
  314. await this.logout();
  315. } else {
  316. this.$message.warning(res.message);
  317. }
  318. },
  319. async statusConfirm(status, message, remark = "") {
  320. this.$confirm(`确定要${message}?`, {
  321. confirmButtonText: "确定",
  322. cancelButtonText: "取消",
  323. type: "warning",
  324. })
  325. .then(async () => {
  326. if (status + '' === "-1") {
  327. await this.deleteById(message);
  328. } else {
  329. await this.setstatus(status, message, remark);
  330. }
  331. })
  332. .catch(() => {
  333. console.log("取消");
  334. });
  335. },
  336. // 点击业务审核的保存按钮
  337. async examForm(e) {
  338. console.log(e);
  339. if (!this.loading) {
  340. //通过为9「待供应商审核」,不通过为6「业务已驳回」
  341. let type = e.state + '' === "1" ? "9" : "6";
  342. let message = e.state + '' === "1" ? "提交业务审核" : "提交业务审核";
  343. await this.statusConfirm(type, message, e.remark);
  344. }
  345. },
  346. //
  347. async setstatus(type, detail, remark = "") {
  348. const model = {
  349. remark,
  350. returnCode: this.code,
  351. status: type,
  352. };
  353. let res = await asyncRequest.status(model);
  354. if (res && res.code === 0) {
  355. this.$notify.success({
  356. title: "修改成功!",
  357. message: "",
  358. });
  359. await this.initData();
  360. } else if (res && res.code >= 100 && res.code <= 104) {
  361. await this.logout();
  362. } else {
  363. this.$message.warning(res.message);
  364. }
  365. },
  366. hasPermission({status, process}){
  367. console.log(this.sitem)
  368. return !this.isSupertube && String(this.sitem.status) === status && this.ppowers.includes(process)
  369. },
  370. async initData() {
  371. let model = {
  372. returnCode: this.code,
  373. };
  374. const res = await asyncRequest.detail(model);
  375. if (res && res.code === 0 && res.data) {
  376. this.sitem = res.data;
  377. const { status, can, returnCode } = this.sitem;
  378. this.status = status;
  379. this.orderCode = returnCode;
  380. this.sitem.error_img = this.sitem.error_img.split(",");
  381. this.expect_options = JSON.parse(
  382. JSON.stringify(
  383. this.sitem.is_receive + '' === "1" ? this.expect_options1 : this.expect_options0
  384. )
  385. );
  386. this.getNewTime();
  387. } else if (res && res.code >= 100 && res.code <= 104) {
  388. await this.logout();
  389. } else {
  390. this.$message.warning(res.message);
  391. }
  392. },
  393. },
  394. };
  395. </script>