index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="所属部门" prop="deptId">
  5. <treeselect style="width:220px" v-model="queryParams.deptId" :options="deptOptions" :show-count="true" placeholder="请选择所属部门" />
  6. </el-form-item>
  7. <el-form-item label="订单单号" prop="orderCode">
  8. <el-input
  9. v-model="queryParams.orderCode"
  10. placeholder="请输入订单单号"
  11. clearable
  12. size="small"
  13. @keyup.enter.native="handleQuery"
  14. />
  15. </el-form-item>
  16. <el-form-item label="员工姓名" prop="companyUserNickName">
  17. <el-input
  18. v-model="queryParams.companyUserNickName"
  19. placeholder="请输入员工姓名"
  20. clearable
  21. size="small"
  22. @keyup.enter.native="handleQuery"
  23. />
  24. </el-form-item>
  25. <el-form-item label="手机号" prop="consigneePhone">
  26. <el-input
  27. v-model="queryParams.consigneePhone"
  28. placeholder="请输入手机号"
  29. clearable
  30. size="small"
  31. @keyup.enter.native="handleQuery"
  32. />
  33. </el-form-item>
  34. <el-form-item label="退款类型" prop="serviceType">
  35. <el-select v-model="queryParams.serviceType" placeholder="请选择退款类型" clearable size="small" >
  36. <el-option
  37. v-for="item in serviceTypeOptions"
  38. :key="item.dictValue"
  39. :label="item.dictLabel"
  40. :value="item.dictValue"
  41. />
  42. </el-select>
  43. </el-form-item>
  44. <el-form-item label="状态" prop="status">
  45. <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small" >
  46. <el-option
  47. v-for="item in statusOptions"
  48. :key="item.dictValue"
  49. :label="item.dictLabel"
  50. :value="item.dictValue"
  51. />
  52. </el-select>
  53. </el-form-item>
  54. <el-form-item label="售后状态" prop="salesStatus">
  55. <el-select v-model="queryParams.salesStatus" placeholder="请选择状态" clearable size="small" >
  56. <el-option
  57. v-for="item in salesStatusOptions"
  58. :key="item.dictValue"
  59. :label="item.dictLabel"
  60. :value="item.dictValue"
  61. />
  62. </el-select>
  63. </el-form-item>
  64. <el-form-item label="订单状态" prop="orderStatus">
  65. <el-select v-model="queryParams.orderStatus" placeholder="请选择订单状态" clearable size="small" >
  66. <el-option
  67. v-for="item in orderStatusOptions"
  68. :key="item.dictValue"
  69. :label="item.dictLabel"
  70. :value="item.dictValue"
  71. />
  72. </el-select>
  73. </el-form-item>
  74. <el-form-item label="物流状态" prop="deliveryStatus">
  75. <el-select v-model="queryParams.deliveryStatus" placeholder="请选择物流状态" clearable size="small" >
  76. <el-option
  77. v-for="item in deliveryStatusOptions"
  78. :key="item.dictValue"
  79. :label="item.dictLabel"
  80. :value="item.dictValue"
  81. />
  82. </el-select>
  83. </el-form-item>
  84. <el-form-item label="物流单号" prop="deliverySn">
  85. <el-input
  86. v-model="queryParams.deliverySn"
  87. placeholder="物流/退回物流单号"
  88. clearable
  89. size="small"
  90. @keyup.enter.native="handleQuery"/>
  91. </el-form-item>
  92. <el-form-item label="提交时间" prop="createTime">
  93. <el-date-picker
  94. style="width:205.4px"
  95. clearable size="small"
  96. v-model="dateRange"
  97. type="daterange"
  98. value-format="yyyy-MM-dd"
  99. start-placeholder="开始日期"
  100. end-placeholder="结束日期">
  101. </el-date-picker>
  102. </el-form-item>
  103. <el-form-item>
  104. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  105. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  106. </el-form-item>
  107. </el-form>
  108. <el-row :gutter="10" class="mb8">
  109. <!-- <el-col :span="1.5">-->
  110. <!-- <el-button-->
  111. <!-- type="warning"-->
  112. <!-- icon="el-icon-download"-->
  113. <!-- size="mini"-->
  114. <!-- @click="handleExport"-->
  115. <!-- v-hasPermi="['store:storeAfterSales:export']"-->
  116. <!-- >导出</el-button>-->
  117. <!-- </el-col>-->
  118. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  119. </el-row>
  120. <el-table border v-loading="loading" :data="liveAfteraSalesList" @selection-change="handleSelectionChange">
  121. <el-table-column type="selection" width="55" align="center" />
  122. <el-table-column label="ID" align="center" prop="id" />
  123. <el-table-column label="所属公司" align="center" prop="companyName" />
  124. <el-table-column label="所属员工" align="center" prop="companyUserNickName" />
  125. <el-table-column label="订单单号" align="center" prop="orderCode" />
  126. <el-table-column label="会员手机号" align="center" prop="userPhone" />
  127. <el-table-column label="退款金额" align="center" prop="refundAmount" />
  128. <el-table-column label="退款类型" align="center" prop="serviceType" >
  129. <template slot-scope="scope">
  130. <div prop="serviceType" v-for="(item, index) in serviceTypeOptions" v-if="scope.row.serviceType==item.dictValue">{{item.dictLabel}}</div>
  131. </template>
  132. </el-table-column>
  133. <el-table-column label="申请原因" align="center" prop="reasons" />
  134. <el-table-column label="说明" align="center" prop="explains" />
  135. <el-table-column label="状态" align="center" prop="status" >
  136. <template slot-scope="scope">
  137. <div prop="status" v-for="(item, index) in statusOptions" v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</div>
  138. </template>
  139. </el-table-column>
  140. <el-table-column label="售后状态" align="center" prop="salesStatus" >
  141. <template slot-scope="scope">
  142. <div prop="status" v-for="(item, index) in salesStatusOptions" v-if="scope.row.salesStatus==item.dictValue">{{item.dictLabel}}</div>
  143. </template>
  144. </el-table-column>
  145. <el-table-column label="订单状态" align="center" prop="orderStatus" >
  146. <template slot-scope="scope">
  147. <div prop="status" v-for="(item, index) in orderStatusOptions" v-if="scope.row.orderStatus==item.dictValue">{{item.dictLabel}}</div>
  148. </template>
  149. </el-table-column>
  150. <el-table-column label="物流状态" align="center" prop="deliveryStatus" >
  151. <template slot-scope="scope">
  152. <el-tag prop="status" v-for="(item, index) in deliveryStatusOptions" v-if="scope.row.deliveryStatus==item.dictValue">{{item.dictLabel}}</el-tag>
  153. </template>
  154. </el-table-column>
  155. <el-table-column label="物流单号" align="center" prop="deliveryId" />
  156. <el-table-column label="客户退回物流单号" align="center" prop="deliverySn" />
  157. <el-table-column label="客户退货物流名称" align="center" prop="deliveryName" />
  158. <el-table-column label="提交时间" align="center" prop="createTime" />
  159. <el-table-column label="操作" align="center" fixed="right" width="100px" class-name="small-padding fixed-width">
  160. <template slot-scope="scope">
  161. <el-button
  162. size="mini"
  163. type="text"
  164. @click="handleShow(scope.row)"
  165. v-hasPermi="['store:storeAfterSales:query']"
  166. >查看</el-button>
  167. </template>
  168. </el-table-column>
  169. </el-table>
  170. <pagination
  171. v-show="total>0"
  172. :total="total"
  173. :page.sync="queryParams.pageNum"
  174. :limit.sync="queryParams.pageSize"
  175. @pagination="getList"
  176. />
  177. </div>
  178. </template>
  179. <script>
  180. import { listLiveAfteraSales, getLiveAfteraSales, delLiveAfteraSales, addLiveAfteraSales, updateLiveAfteraSales, exportLiveAfteraSales } from "@/api/live/liveAfteraSales";
  181. import {getCompanyList} from "@/api/company/company";
  182. import Treeselect from "@riophae/vue-treeselect";
  183. import {treeselect} from "@/api/company/companyDept";
  184. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  185. export default {
  186. name: "LiveAfteraSales",
  187. components: {Treeselect},
  188. data() {
  189. return {
  190. dateRange:[],
  191. // 遮罩层
  192. loading: true,
  193. // 导出遮罩层
  194. exportLoading: false,
  195. // 选中数组
  196. ids: [],
  197. // 非单个禁用
  198. single: true,
  199. // 非多个禁用
  200. multiple: true,
  201. // 显示搜索条件
  202. showSearch: true,
  203. // 总条数
  204. total: 0,
  205. // 售后记录表格数据
  206. liveAfteraSalesList: [],
  207. // 弹出层标题
  208. title: "",
  209. // 是否显示弹出层
  210. open: false,
  211. // 查询参数
  212. queryParams: {
  213. pageNum: 1,
  214. pageSize: 10,
  215. orderCode: null,
  216. refundAmount: null,
  217. serviceType: null,
  218. reasons: null,
  219. explains: null,
  220. explainImg: null,
  221. shipperCode: null,
  222. deliverySn: null,
  223. deliveryName: null,
  224. status: null,
  225. salesStatus: null,
  226. isDel: null,
  227. userId: null,
  228. consignee: null,
  229. phoneNumber: null,
  230. address: null
  231. },
  232. // 表单参数
  233. form: {},
  234. // 表单校验
  235. rules: {
  236. },
  237. orderStatusOptions:[],
  238. deliveryStatusOptions:[],
  239. serviceTypeOptions:[],
  240. salesStatusOptions:[],
  241. statusOptions:[],
  242. deptOptions:[],
  243. };
  244. },
  245. watch: {
  246. // 根据名称筛选部门树
  247. deptName(val) {
  248. this.$refs.tree.filter(val);
  249. },
  250. },
  251. created() {
  252. this.getTreeselect();
  253. this.getDicts("store_after_sales_sales_status").then((response) => {
  254. this.salesStatusOptions = response.data;
  255. });
  256. this.getDicts("store_after_sales_status").then((response) => {
  257. this.statusOptions = response.data;
  258. });
  259. this.getDicts("store_after_sales_service_type").then((response) => {
  260. this.serviceTypeOptions = response.data;
  261. });
  262. this.getDicts("store_order_delivery_status").then((response) => {
  263. this.deliveryStatusOptions = response.data;
  264. });
  265. this.getDicts("store_order_status").then((response) => {
  266. this.orderStatusOptions = response.data;
  267. });
  268. this.getList();
  269. },
  270. methods: {
  271. /** 查询售后记录列表 */
  272. getList() {
  273. this.loading = true;
  274. listLiveAfteraSales(this.queryParams).then(response => {
  275. this.liveAfteraSalesList = response.rows;
  276. this.total = response.total;
  277. this.loading = false;
  278. });
  279. },
  280. // 取消按钮
  281. cancel() {
  282. this.open = false;
  283. this.reset();
  284. },
  285. // 表单重置
  286. reset() {
  287. this.form = {
  288. id: null,
  289. liveId: null,
  290. storeId: null,
  291. orderId: null,
  292. refundAmount: null,
  293. refundType: null,
  294. reasons: null,
  295. explains: null,
  296. explainImg: null,
  297. deliveryCode: null,
  298. deliverySn: null,
  299. deliveryName: null,
  300. status: 0,
  301. salesStatus: 0,
  302. orderStatus: 0,
  303. createTime: null,
  304. isDel: null,
  305. userId: null,
  306. consignee: null,
  307. phoneNumber: null,
  308. address: null,
  309. companyId: null,
  310. companyUserId: null,
  311. deptId: null
  312. };
  313. this.resetForm("form");
  314. },
  315. /** 搜索按钮操作 */
  316. handleQuery() {
  317. this.queryParams.pageNum = 1;
  318. this.getList();
  319. },
  320. /** 重置按钮操作 */
  321. resetQuery() {
  322. this.resetForm("queryForm");
  323. this.handleQuery();
  324. },
  325. // 多选框选中数据
  326. handleSelectionChange(selection) {
  327. this.ids = selection.map(item => item.id)
  328. this.single = selection.length!==1
  329. this.multiple = !selection.length
  330. },
  331. /** 新增按钮操作 */
  332. handleAdd() {
  333. this.reset();
  334. this.open = true;
  335. this.title = "添加售后记录";
  336. },
  337. /** 修改按钮操作 */
  338. handleUpdate(row) {
  339. this.reset();
  340. const id = row.id || this.ids
  341. getLiveAfteraSales(id).then(response => {
  342. this.form = response.data;
  343. this.open = true;
  344. this.title = "修改售后记录";
  345. });
  346. },
  347. /** 提交按钮 */
  348. submitForm() {
  349. this.$refs["form"].validate(valid => {
  350. if (valid) {
  351. if (this.form.id != null) {
  352. updateLiveAfteraSales(this.form).then(response => {
  353. this.msgSuccess("修改成功");
  354. this.open = false;
  355. this.getList();
  356. });
  357. } else {
  358. addLiveAfteraSales(this.form).then(response => {
  359. this.msgSuccess("新增成功");
  360. this.open = false;
  361. this.getList();
  362. });
  363. }
  364. }
  365. });
  366. },
  367. /** 删除按钮操作 */
  368. handleDelete(row) {
  369. const ids = row.id || this.ids;
  370. this.$confirm('是否确认删除售后记录编号为"' + ids + '"的数据项?', "警告", {
  371. confirmButtonText: "确定",
  372. cancelButtonText: "取消",
  373. type: "warning"
  374. }).then(function() {
  375. return delLiveAfteraSales(ids);
  376. }).then(() => {
  377. this.getList();
  378. this.msgSuccess("删除成功");
  379. }).catch(() => {});
  380. },
  381. /** 导出按钮操作 */
  382. handleExport() {
  383. const queryParams = this.queryParams;
  384. this.$confirm('是否确认导出所有售后记录数据项?', "警告", {
  385. confirmButtonText: "确定",
  386. cancelButtonText: "取消",
  387. type: "warning"
  388. }).then(() => {
  389. this.exportLoading = true;
  390. return exportLiveAfteraSales(queryParams);
  391. }).then(response => {
  392. this.download(response.msg);
  393. this.exportLoading = false;
  394. }).catch(() => {});
  395. },
  396. getTreeselect() {
  397. var param={companyId:this.companyId}
  398. treeselect(param).then((response) => {
  399. this.deptOptions = response.data;
  400. console.log(this.deptOptions)
  401. if(response.data!=null&&response.data.length>0){
  402. //this.queryParams.deptId=response.data[0].id;
  403. }
  404. });
  405. },
  406. companyChange(val){
  407. console.log(val);
  408. this.companyId=val;
  409. this.getTreeselect();
  410. },
  411. currDeptChange(val){
  412. console.log(val)
  413. this.queryParams.deptId=val;
  414. this.getList();
  415. },
  416. }
  417. };
  418. </script>