index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  1. <template>
  2. <div class="goodsService pagePadding">
  3. <div
  4. v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
  5. >
  6. <!-- v-loading="loading" -->
  7. <ex-table
  8. v-loading="false"
  9. :table="table"
  10. :data="tableData"
  11. :columns="columns"
  12. :page="pageInfo"
  13. :size="size"
  14. @page-curr-change="handlePageChange"
  15. @page-size-change="handleSizeChange"
  16. @screen-reset="
  17. pageInfo.curr = 1;
  18. parmValue.page = 1;
  19. searchList();
  20. "
  21. @screen-submit="
  22. pageInfo.curr = 1;
  23. parmValue.page = 1;
  24. searchList();
  25. "
  26. >
  27. <template #table-header="{}">
  28. <div style="width: 100%">
  29. <el-row style="padding: 0 0 0 80px">
  30. <el-col :span="24">
  31. <!-- 时间选择 -->
  32. <el-col :span="4" style="width: 291px">
  33. <period-date-picker
  34. :width="'134px'"
  35. :size="searchSize"
  36. @timeReturned="handleTime"
  37. />
  38. </el-col>
  39. <!-- 处理状态 -->
  40. <el-col :span="4" style="width: 140px; padding-left: 10px">
  41. <el-select
  42. :size="searchSize"
  43. v-model="serviceValue"
  44. clearable
  45. placeholder="处理状态"
  46. @change="serviceChange"
  47. >
  48. <el-option
  49. v-for="item in serviceOptions"
  50. :key="item.value"
  51. :label="item.label"
  52. :value="item.value"
  53. >
  54. </el-option>
  55. </el-select>
  56. </el-col>
  57. <!-- 期望意愿 -->
  58. <el-col :span="4" style="width: 130px; padding-left: 10px">
  59. <el-select
  60. :size="searchSize"
  61. v-model="expectValue"
  62. clearable
  63. placeholder="期望意愿"
  64. @change="expectChange"
  65. >
  66. <el-option
  67. v-for="item in expectOptions"
  68. :key="item.value"
  69. :label="item.label"
  70. :value="item.value"
  71. >
  72. </el-option>
  73. </el-select>
  74. </el-col>
  75. <!-- 申请人 -->
  76. <el-col :span="4" style="width: 120px; padding: 0 0 0 10px">
  77. <el-input
  78. :size="searchSize"
  79. v-model="parmValue.apply_name"
  80. placeholder="申请人"
  81. ></el-input>
  82. </el-col>
  83. <!-- <el-col :span="4" style="width: 140px; padding-left: 10px">
  84. <el-select
  85. :size="searchSize"
  86. v-model="resultValue"
  87. clearable
  88. placeholder="处理结果"
  89. @change="resultChange"
  90. >
  91. <el-option
  92. v-for="item in resultOptions"
  93. :key="item.value"
  94. :label="item.label"
  95. :value="item.value"
  96. >
  97. </el-option>
  98. </el-select>
  99. </el-col> -->
  100. <!-- <el-col :span="3" style="width: 66px; float: right">
  101. <el-button
  102. :size="searchSize"
  103. type="primary"
  104. style="float: right; margin-left: 5px"
  105. @click="openModal('add', false)"
  106. >
  107. 新建
  108. </el-button>
  109. </el-col> -->
  110. <el-col :span="3" style="width: 66px; float: right">
  111. <el-button
  112. :size="searchSize"
  113. type="primary"
  114. style="float: right; margin-left: 5px"
  115. @click="searchList"
  116. >
  117. 刷新
  118. </el-button>
  119. </el-col>
  120. </el-col>
  121. </el-row>
  122. <el-row style="padding-top: 10px">
  123. <!-- 客户公司 -->
  124. <el-col :span="4" style="width: 420px; padding: 0px 0 0 0px">
  125. <search-customer
  126. :value="customerCode"
  127. :size="searchSize"
  128. :placeholder="'客户公司名称'"
  129. @searchChange="customerChange"
  130. />
  131. </el-col>
  132. <!-- 商品名称 -->
  133. <el-col :span="4" style="width: 280px; padding: 0 0 0 10px">
  134. <el-input
  135. clearable
  136. :size="searchSize"
  137. v-model="parmValue.goodsName"
  138. :maxlength="40"
  139. placeholder="商品名称"
  140. />
  141. </el-col>
  142. </el-row>
  143. <el-row style="padding: 10px 0 0 0">
  144. <!-- 商品编码 -->
  145. <el-col :span="4" style="width: 180px; padding: 0 0 0 0px">
  146. <el-input
  147. clearable
  148. :size="searchSize"
  149. v-model="parmValue.goodsNumber"
  150. placeholder="商品编号"
  151. />
  152. </el-col>
  153. <!-- 确认单号 -->
  154. <el-col :span="4" style="width: 200px; padding: 0 0 0 10px">
  155. <el-input
  156. clearable
  157. :size="searchSize"
  158. v-model="parmValue.sellNumbers"
  159. placeholder="销售确认单号"
  160. />
  161. </el-col>
  162. <!-- 出库单号 -->
  163. <el-col :span="4" style="width: 200px; padding: 0 0 0 10px">
  164. <el-input
  165. clearable
  166. :size="searchSize"
  167. v-model="parmValue.sellGoStock"
  168. placeholder="销售出库单号"
  169. />
  170. </el-col>
  171. <el-col :span="4" style="width: 54px">
  172. <el-button
  173. :size="searchSize"
  174. type="primary"
  175. class="fr"
  176. icon="el-icon-search"
  177. @click="searchList"
  178. /></el-col>
  179. <el-col :span="4" style="width: 66px">
  180. <el-button
  181. type="warning"
  182. class="fr"
  183. :size="searchSize"
  184. @click="restSearch"
  185. >
  186. 重置
  187. </el-button>
  188. </el-col>
  189. </el-row>
  190. </div>
  191. </template>
  192. <template #status="{ scope }">
  193. <el-tag
  194. :size="tablebtnSize"
  195. :type="scope.row.status == '0' ? 'warning' : ''"
  196. v-text="
  197. (statusOptions.find((item) => item.id == scope.row.status) || {})
  198. .label || '--'
  199. "
  200. ></el-tag>
  201. </template>
  202. <!-- 费用承担方 -->
  203. <template #post_own="{ scope }">
  204. <el-tag
  205. :size="tablebtnSize"
  206. :type="scope.row.status == '0' ? 'warning' : ''"
  207. v-text="
  208. (
  209. post_ownOptions.find((item) => item.id == scope.row.post_own) ||
  210. {}
  211. ).label || '--'
  212. "
  213. ></el-tag>
  214. </template>
  215. <!-- 期望意愿 -->
  216. <template #except_code="{ scope }">
  217. <el-tag
  218. :size="tablebtnSize"
  219. :type="scope.row.status == '0' ? 'warning' : ''"
  220. v-text="
  221. (
  222. except_codeOptions.find(
  223. (item) => item.id == scope.row.except_code
  224. ) || {}
  225. ).label || '--'
  226. "
  227. ></el-tag>
  228. </template>
  229. <template #operation="{ scope }">
  230. <el-tooltip
  231. v-if="powers.some((item) => item == '002')"
  232. effect="dark"
  233. content="重置密码"
  234. placement="top"
  235. >
  236. <i
  237. class="el-icon-refresh-left tb-icon"
  238. @click="openPasswordModal(scope.row.id, false)"
  239. ></i>
  240. </el-tooltip>
  241. <el-tooltip
  242. v-if="powers.some((item) => item == '007')"
  243. effect="dark"
  244. content="详情"
  245. placement="top"
  246. >
  247. <i
  248. class="el-icon-view tb-icon"
  249. @click="routeGoto('serviceDetail', { id: scope.row.returnCode })"
  250. ></i>
  251. </el-tooltip>
  252. </template>
  253. </ex-table>
  254. <add-edit
  255. :id="modelId"
  256. :sitem="sitem"
  257. :show-model="showModel"
  258. :is-detail="isDetail"
  259. @refresh="searchList"
  260. @cancel="showModel = false"
  261. />
  262. </div>
  263. <div v-else>
  264. <no-auth></no-auth>
  265. </div>
  266. </div>
  267. </template>
  268. <script>
  269. import mixinPage from "@/mixins/elPaginationHandle";
  270. import resToken from "@/mixins/resToken";
  271. import statusList from "@/assets/js/statusList";
  272. import asyncRequest from "@/apis/service/goodsService";
  273. import addEdit from "./components/addEdit.vue";
  274. import columns from "./columns";
  275. import { mapGetters } from "vuex";
  276. export default {
  277. name: "goodsService",
  278. mixins: [mixinPage, resToken],
  279. components: {
  280. addEdit,
  281. },
  282. computed: {
  283. ...mapGetters(["tablebtnSize", "searchSize", "size"]),
  284. powers() {
  285. let tran =
  286. this.$store.getters.btnList.find(
  287. (item) => item.menu_route == "goodsService"
  288. ) || {};
  289. if (tran && tran.action && tran.action.length > 0) {
  290. return tran.action;
  291. } else {
  292. return [];
  293. }
  294. },
  295. },
  296. data() {
  297. return {
  298. customerCode: [], //客户公司code
  299. except_codeOptions: [
  300. { id: "1", label: "退货" },
  301. { id: "2", label: "换货" },
  302. { id: "3", label: "改变售价" },
  303. ],
  304. post_ownOptions: [
  305. { id: "1", label: "客户承担" },
  306. { id: "2", label: "公司承担" },
  307. { id: "3", label: "供应商承担" },
  308. ],
  309. sitem: null,
  310. // 状态
  311. statusOptions: [
  312. { id: "0", label: "待审核" },
  313. { id: "1", label: "待物流反馈" },
  314. { id: "3", label: "待退货" },
  315. { id: "4", label: "已退货" },
  316. { id: "5", label: "待客户验收" },
  317. ],
  318. statusList: statusList,
  319. loading: true,
  320. showModel: false,
  321. isDetail: false,
  322. modelId: 0,
  323. parmValue: {
  324. customer_code: "", //客户公司code
  325. start_time: "",
  326. end_time: "",
  327. returnCode: "", //售后单号
  328. apply_name: "", //申请人名称
  329. sellNumbers: "", //销售单号
  330. sellGoStock: "", //销售出库单号,
  331. expressNumber: "", //物流编号
  332. goodsNumber: "", //商品编号
  333. goodsName: "", //商品名称
  334. service_value: "", //售后申请单处理状态
  335. expect_value: "", //期望意愿
  336. result_value: "", //处理结果
  337. page: 1, // 页码
  338. size: 15, // 每页显示条数
  339. },
  340. tableData: [],
  341. // 表格 - 数据
  342. // tableData: [],
  343. // 表格 - 参数
  344. table: {
  345. stripe: true,
  346. border: true,
  347. _defaultHeader_: ["setcol"],
  348. },
  349. // 表格 - 分页
  350. pageInfo: {
  351. size: 15,
  352. curr: 1,
  353. total: 0,
  354. },
  355. // 表格 - 列参数
  356. columns: columns,
  357. serviceOptions: [
  358. //假数据
  359. {
  360. value: "0",
  361. label: "待审核",
  362. },
  363. {
  364. value: "1",
  365. label: "待物流反馈",
  366. },
  367. {
  368. value: "2",
  369. label: "待退货",
  370. },
  371. {
  372. value: "3",
  373. label: "已退货",
  374. },
  375. // {
  376. // value: "选项4",
  377. // label: "待采购审核",
  378. // },
  379. // {
  380. // value: "选项5",
  381. // label: "处理已结束",
  382. // },
  383. // {
  384. // value: "d",
  385. // label: "业务已驳回",
  386. // },
  387. // {
  388. // value: "d",
  389. // label: "采购已驳回",
  390. // },
  391. ],
  392. serviceValue: "", //售后申请处理状态
  393. expectOptions: [
  394. //假数据
  395. {
  396. value: "1",
  397. label: "退货",
  398. },
  399. {
  400. value: "2",
  401. label: "换货",
  402. },
  403. {
  404. value: "3",
  405. label: "改变售价",
  406. },
  407. ],
  408. expectValue: "", //期望意愿
  409. resultOptions: [
  410. //假数据
  411. {
  412. value: "ad",
  413. label: "处理中",
  414. },
  415. {
  416. value: "选项2",
  417. label: "已同意",
  418. },
  419. {
  420. value: "选项2",
  421. label: "已驳回",
  422. },
  423. ],
  424. resultValue: "", //处理结果
  425. };
  426. },
  427. mounted() {
  428. this.searchList();
  429. },
  430. methods: {
  431. restSearch() {
  432. this.customerCode = [];
  433. this.parmValue = {
  434. customer_code: "", //客户公司code
  435. start_time: "",
  436. end_time: "",
  437. returnCode: "", //售后单号
  438. apply_name: "", //申请人名称
  439. sellNumbers: "", //销售单号
  440. sellGoStock: "", //销售出库单号,
  441. expressNumber: "", //物流编号
  442. goodsNumber: "", //商品编号
  443. goodsName: "", //商品名称
  444. service_value: "", //售后申请单处理状态
  445. expect_value: "", //期望意愿
  446. result_value: "", //处理结果
  447. page: 1, // 页码
  448. size: 15, // 每页显示条数
  449. };
  450. // 表格 - 分页
  451. this.pageInfo = {
  452. size: 15,
  453. curr: 1,
  454. total: 0,
  455. };
  456. this.searchList();
  457. },
  458. openModal(id, isDetail, sitem) {
  459. this.showModel = true;
  460. this.modelId = id;
  461. this.isDetail = isDetail;
  462. this.sitem = sitem;
  463. },
  464. async deleteById(id, status) {
  465. await this.$confirm("确定要删除?", {
  466. confirmButtonText: "确定",
  467. cancelButtonText: "取消",
  468. type: "warning",
  469. })
  470. .then(async () => {
  471. const model = {
  472. id: id,
  473. status: status === "1" ? "0" : "1",
  474. };
  475. const res = await asyncRequest.status(model);
  476. if (res && res.code === 0) {
  477. this.$notify.success({
  478. title: "删除成功",
  479. message: "",
  480. });
  481. this.searchList();
  482. } else if (res && res.code >= 100 && res.code <= 104) {
  483. await this.logout();
  484. } else {
  485. this.$message.warning(res.message);
  486. }
  487. })
  488. .catch(() => {
  489. console.log("取消");
  490. });
  491. },
  492. // 列表搜索
  493. async searchList() {
  494. this.loading = true;
  495. console.log(this.parmValue);
  496. let model = JSON.parse(JSON.stringify(this.parmValue));
  497. let _model = {
  498. page: 1,
  499. size: 15,
  500. goods_name: model.goodsName,
  501. returnCode: model.returnCode,
  502. outCode: model.sellGoStock,
  503. status: model.service_value, //售后申请单处理状态
  504. orderCode: model.sellNumbers,
  505. good_code: model.goodsNumber,
  506. except_code: model.expect_value,
  507. apply_name: model.apply_name,
  508. start: model.start_time,
  509. end: model.end_time,
  510. customer_code: model.customer_code, //客户公司code
  511. };
  512. console.log(_model);
  513. const res = await asyncRequest.list(_model);
  514. if (res && res.code === 0 && res.data) {
  515. this.tableData = res.data.list;
  516. this.pageInfo.total = Number(res.data.count);
  517. } else if (res && res.code >= 100 && res.code <= 104) {
  518. await this.logout();
  519. } else {
  520. this.tableData = [];
  521. this.pageInfo.total = 0;
  522. }
  523. this.loading = false;
  524. },
  525. async statusConfirm(id, status) {
  526. let str = status === "1" ? "禁用" : "启用";
  527. await this.$confirm("确定要改为" + str + "?", {
  528. confirmButtonText: "确定",
  529. cancelButtonText: "取消",
  530. type: "warning",
  531. })
  532. .then(async () => {
  533. this.loading = true;
  534. const model = {
  535. id: id,
  536. status: status === "1" ? "0" : "1",
  537. };
  538. const res = await asyncRequest.status(model);
  539. if (res && res.code === 0) {
  540. this.loading = false;
  541. this.$notify.success({
  542. title: "状态修改成功!",
  543. message: "",
  544. });
  545. await this.searchList();
  546. } else if (res && res.code >= 100 && res.code <= 104) {
  547. await this.logout();
  548. } else {
  549. this.$message.warning(res.message);
  550. }
  551. })
  552. .catch(() => {
  553. console.log("取消");
  554. });
  555. },
  556. // 时间选择事件
  557. async handleTime(e) {
  558. console.log(e, "handleTime");
  559. if (e.startTime !== "") {
  560. this.parmValue.start_time = e.startTime;
  561. } else {
  562. this.parmValue.start_time = "";
  563. }
  564. if (e.endTime !== "") {
  565. this.parmValue.end_time = e.endTime;
  566. } else {
  567. this.parmValue.end_time = "";
  568. }
  569. if (this.parmValue.start_time !== "" && this.parmValue.end_time !== "") {
  570. this.parmValue.page = 1;
  571. await this.searchList();
  572. }
  573. },
  574. // 处理状态选择
  575. async serviceChange(e) {
  576. console.log(e, "serviceChange");
  577. this.parmValue.service_value = e;
  578. await this.searchList();
  579. },
  580. // 期望意愿选择
  581. async expectChange(e) {
  582. console.log(e, "expectChange");
  583. this.parmValue.expect_value = e;
  584. await this.searchList();
  585. },
  586. // // 处理结果选择
  587. // resultChange(e) {
  588. // console.log(e, "resultChange");
  589. // this.parmValue.result_value = e;
  590. // },
  591. async customerChange(e) {
  592. if (e && e.id) {
  593. this.customerCode = [e.code];
  594. this.parmValue.customer_code = e.code;
  595. } else {
  596. this.customerCode = [];
  597. this.parmValue.customer_code = "";
  598. }
  599. this.parmValue.page = 1;
  600. await this.searchList();
  601. },
  602. },
  603. };
  604. </script>
  605. <style lang="scss" scoped>
  606. .goodsService {
  607. }
  608. </style>