thirdAfterSales.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <template>
  2. <div class="mod-print-thirdAfterSales">
  3. <!-- 搜索相关区域 -->
  4. <div class="search-bar">
  5. <el-form :inline="true" class="search-form" ref="searchForm" :model="searchForm" label-width="auto" size="small">
  6. <div class="input-row">
  7. <el-form-item label="售后渠道" class="search-form-item">
  8. <el-select v-model="searchForm.printChannel" clearable>
  9. <el-option label="广森" value="GSART"></el-option>
  10. <el-option label="快印" value="KuaiYin"></el-option>
  11. <el-option label="蜗牛" value="WoNiu"></el-option>
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item label="订单编号" class="search-form-item">
  15. <el-input type="text" clearable v-model="searchForm.orderNumber" placeholder="请输入订单编号"></el-input>
  16. </el-form-item>
  17. <el-form-item label="售后类型" class="search-form-item">
  18. <el-select v-model="searchForm.type" clearable>
  19. <el-option label="瑕疵" value="瑕疵"></el-option>
  20. <el-option label="裁切" value="裁切"></el-option>
  21. <el-option label="翘边" value="翘边"></el-option>
  22. <el-option label="错发" value="错发"></el-option>
  23. <el-option label="少发" value="少发"></el-option>
  24. <el-option label="漏发" value="漏发"></el-option>
  25. <el-option label="退件" value="退件"></el-option>
  26. <el-option label="补发" value="补发"></el-option>
  27. <el-option label="物流" value="物流"></el-option>
  28. <el-option label="其他" value="其他"></el-option>
  29. </el-select>
  30. </el-form-item>
  31. <el-form-item label="售后状态">
  32. <el-select
  33. v-model="searchForm.status"
  34. clearable
  35. placeholder="请选择售后状态"
  36. size="small">
  37. <el-option key="0" label="待处理" value="0"></el-option>
  38. <el-option key="1" label="已处理" value="1"></el-option>
  39. </el-select>
  40. </el-form-item>
  41. <el-form-item label="下单时间" clearable>
  42. <el-date-picker
  43. :default-time="['00:00:00', '23:59:59']"
  44. size="small"
  45. v-model="orderTimeDateRange"
  46. type="datetimerange"
  47. :range-separator="this.$i18n.t('time.tip')"
  48. value-format="yyyy-MM-dd HH:mm:ss"
  49. :start-placeholder="this.$i18n.t('time.start')"
  50. :end-placeholder="this.$i18n.t('time.end')">
  51. </el-date-picker>
  52. </el-form-item>
  53. <el-form-item label="售后时间" clearable>
  54. <el-date-picker
  55. :default-time="['00:00:00', '23:59:59']"
  56. size="small"
  57. v-model="afterSalesDateRange"
  58. type="datetimerange"
  59. :range-separator="this.$i18n.t('time.tip')"
  60. value-format="yyyy-MM-dd HH:mm:ss"
  61. :start-placeholder="this.$i18n.t('time.start')"
  62. :end-placeholder="this.$i18n.t('time.end')">
  63. </el-date-picker>
  64. </el-form-item>
  65. <el-form-item>
  66. <div class="default-btn primary-btn" @click="searchChange()">{{$t('crud.searchBtn')}}</div>
  67. <div class="default-btn" @click="resetSearchForm('searchForm')">{{$t('shop.resetMap')}}</div>
  68. </el-form-item>
  69. </div>
  70. </el-form>
  71. </div>
  72. <!-- 列表相关区域 -->
  73. <div class="main-container">
  74. <div class="operation-bar">
  75. <div class="default-btn primary-btn" @click="addOrUpdateHandle()">新增售后</div>
  76. <div class="default-btn primary-btn" @click.stop="getUpload()">导入售后数据</div>
  77. </div>
  78. <div class="table-con spec-table">
  79. <el-table
  80. ref="specListTable"
  81. :data="dataList"
  82. header-cell-class-name="table-header"
  83. row-class-name="table-row"
  84. style="width: 100%">
  85. <!-- 售后渠道 -->
  86. <el-table-column label="售后渠道" prop="printChannel" align="center">
  87. <template slot-scope="scope">
  88. <span>{{scope.row.printChannel}}</span>
  89. </template>
  90. </el-table-column>
  91. <!-- 订单编号 -->
  92. <el-table-column label="订单编号" prop="orderNumber" align="center" width="200px">
  93. <template slot-scope="scope">
  94. <span>{{ scope.row.orderNumber}}</span>
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="产品名称" prop="prodName" align="center">
  98. <template slot-scope="scope">
  99. <span>{{ scope.row.prodName}}</span>
  100. </template>
  101. </el-table-column>
  102. <!-- 售后类型,比如瑕疵问题,裁剪问题 -->
  103. <el-table-column label="售后类型" prop="type" align="center">
  104. <template slot-scope="scope">
  105. <span>{{scope.row.type}}</span>
  106. </template>
  107. </el-table-column>
  108. <!-- 订单时间 -->
  109. <el-table-column label="下单时间" prop="orderTime" align="center">
  110. <template slot-scope="scope">
  111. <span>{{ scope.row.orderTime}}</span>
  112. </template>
  113. </el-table-column>
  114. <!-- 售后时间 -->
  115. <el-table-column label="售后时间" prop="afterSalesTime" align="center">
  116. <template slot-scope="scope">
  117. <span>{{ scope.row.afterSalesTime}}</span>
  118. </template>
  119. </el-table-column>
  120. <!-- 退款金额 -->
  121. <el-table-column label="退款金额(按成本)" prop="refundAmount" align="center">
  122. <template slot-scope="scope">
  123. <span>{{ scope.row.costAmount}}</span>
  124. </template>
  125. </el-table-column>
  126. <el-table-column label="退款金额" prop="refundAmount" align="center" v-if="shopId === 1">
  127. <template slot-scope="scope">
  128. <span>{{ scope.row.refundAmount}}</span>
  129. </template>
  130. </el-table-column>
  131. <!-- 退款方式 -->
  132. <el-table-column label="退款方式" prop="refundType" align="center">
  133. <template slot-scope="scope">
  134. <span v-if="scope.row.refundType === 0">余额</span>
  135. <span v-if="scope.row.refundType === 1">微信</span>
  136. </template>
  137. </el-table-column>
  138. <!-- 进度,待处理,已处理, -->
  139. <el-table-column label="售后状态" prop="progress" align="center">
  140. <template slot-scope="scope">
  141. <el-tag effect="dark" type="danger" v-if="scope.row.status === 0">待处理</el-tag>
  142. <el-tag effect="dark" type="success" v-if="scope.row.status === 1">已处理</el-tag>
  143. </template>
  144. </el-table-column>
  145. <el-table-column align="center" fixed="right" :label="$t('publics.operating')" width="auto">
  146. <template slot-scope="scope">
  147. <div class="text-btn-con">
  148. <div class="default-btn text-btn" @click="addOrUpdateHandle(scope.row.id, true)">详情</div>
  149. <div class="default-btn text-btn" @click="addOrUpdateHandle(scope.row.id, false)">{{$t("crud.updateBtn")}}</div>
  150. <div class="default-btn text-btn" @click.stop="deleteHandle(scope.row.id)">{{$t("text.delBtn")}}</div>
  151. </div>
  152. </template>
  153. </el-table-column>
  154. </el-table>
  155. </div>
  156. <el-pagination
  157. v-if="dataList.length"
  158. @size-change="handleSizeChange"
  159. @current-change="handleCurrentChange"
  160. :current-page="page.currentPage"
  161. :page-sizes="[10, 20, 50, 100]"
  162. :page-size="page.pageSize"
  163. layout="total, sizes, prev, pager, next, jumper"
  164. :total="page.total">
  165. </el-pagination>
  166. </div>
  167. <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="refreshChange"></add-or-update>
  168. <el-dialog
  169. :modal="false"
  170. title="导入售后数据"
  171. :close-on-click-modal="false"
  172. :visible.sync="importDialogVisible"
  173. @close="handleImportClose"
  174. width="38%">
  175. <el-upload
  176. class="upload-demo"
  177. ref="upload"
  178. :action="$http.adornUrl('/print/thirdAfterSales/importAfterSales')"
  179. :headers="{ Authorization: $cookie.get('Authorization_vs'),locale:lang }"
  180. :limit="1"
  181. name="file"
  182. :file-list="files"
  183. :on-success="handleUploadSuccess"
  184. :on-error="handleUploadError"
  185. :auto-upload="false">
  186. <div slot="tip" class="el-upload__tip"></div>
  187. <el-button slot="trigger" size="small" icon="el-icon-upload2" style="margin-right: 20px">上传</el-button>
  188. <el-button size="small" type="primary" @click="submitUpload" :loading="uploading">提 交</el-button>
  189. </el-upload>
  190. </el-dialog>
  191. </div>
  192. </template>
  193. <script>
  194. import AddOrUpdate from './thirdAfterSales-add-or-update'
  195. export default {
  196. data () {
  197. return {
  198. dataList: [],
  199. lang: localStorage.getItem('lang') || 'zh_CN',
  200. page: {
  201. total: 0, // 总页数
  202. currentPage: 1, // 当前页数
  203. pageSize: 10 // 每页显示多少条
  204. },
  205. shopId: this.$store.state.user.shopId,
  206. searchForm: {
  207. printChannel: null,
  208. status: null,
  209. type: null,
  210. orderTime: null,
  211. orderNumber: null,
  212. }, // 搜索
  213. dataListLoading: false,
  214. addOrUpdateVisible: false,
  215. orderTimeDateRange: [],
  216. afterSalesDateRange: [],
  217. resourcesUrl: process.env.VUE_APP_RESOURCES_URL,
  218. importDialogVisible: false,
  219. uploading: false,
  220. files:[]
  221. }
  222. },
  223. components: {
  224. AddOrUpdate
  225. },
  226. created () {
  227. this.getDataList(this.page);
  228. },
  229. mounted () {
  230. },
  231. methods: {
  232. getDataList (page) {
  233. this.dataListLoading = true
  234. this.$http({
  235. url: this.$http.adornUrl('/print/thirdAfterSales/page'),
  236. method: 'get',
  237. params: this.$http.adornParams(
  238. Object.assign({
  239. current: page == null ? this.page.currentPage : page.currentPage,
  240. size: page == null ? this.page.pageSize : page.pageSize,
  241. 'afterSalesStartTime': this.afterSalesDateRange == null ? null : this.afterSalesDateRange[0],
  242. 'afterSalesEndTime': this.afterSalesDateRange == null ? null : this.afterSalesDateRange[1],
  243. 'orderStartTime': this.orderTimeDateRange == null ? null : this.orderTimeDateRange[0],
  244. 'orderEndTime': this.orderTimeDateRange == null ? null : this.orderTimeDateRange[1],
  245. 'orderNumber': this.searchForm.orderNumber,
  246. 'printChannel': this.searchForm.printChannel,
  247. 'type': this.searchForm.type,
  248. 'status': this.searchForm.status
  249. },
  250. )
  251. )
  252. }).then(({data}) => {
  253. this.dataList = data.records
  254. this.page.total = data.total
  255. this.dataListLoading = false
  256. })
  257. },
  258. // 新增 / 修改
  259. addOrUpdateHandle (id, isView) {
  260. this.addOrUpdateVisible = true
  261. this.$nextTick(() => {
  262. this.$refs.addOrUpdate.init(id, isView)
  263. })
  264. },
  265. deleteHandle (id) {
  266. this.$confirm(this.$i18n.t('admin.isDeleOper') + '?', this.$i18n.t('text.tips'), {
  267. confirmButtonText: this.$i18n.t('crud.filter.submitBtn'),
  268. cancelButtonText: this.$i18n.t('crud.filter.cancelBtn'),
  269. type: 'warning'
  270. }).then(() => {
  271. this.$http({
  272. url: this.$http.adornUrl('/print/thirdAfterSales/' + id),
  273. method: 'delete',
  274. data: this.$http.adornData({})
  275. }).then(({ data }) => {
  276. this.$message({
  277. message: this.$i18n.t('publics.operation'),
  278. type: 'success',
  279. duration: 1500,
  280. onClose: () => {
  281. this.refreshChange()
  282. }
  283. })
  284. })
  285. }).catch(() => { })
  286. },
  287. getUpload(){
  288. this.importDialogVisible = true;
  289. },
  290. submitUpload () {
  291. this.$refs.upload.submit();
  292. },
  293. handleUploadSuccess (response, file, fileList) {
  294. this.importDialogVisible = false;
  295. this.uploading = false;
  296. this.getDataList(this.page, null, false)
  297. },
  298. handleUploadError (error, file, fileList) {
  299. this.importDialogVisible = false;
  300. this.uploading = false;
  301. },
  302. handleImportClose(){
  303. this.importDialogVisible = false;
  304. this.files = [];
  305. },
  306. // 刷新回调
  307. refreshChange () {
  308. this.page.currentPage = 1
  309. this.getDataList(this.page)
  310. },
  311. searchChange (params) {
  312. // this.searchForm = params
  313. this.getDataList(this.page)
  314. },
  315. handleSizeChange (val) {
  316. this.page.pageSize = val
  317. this.getDataList()
  318. },
  319. handleCurrentChange (val) {
  320. this.page.currentPage = val
  321. this.getDataList()
  322. },
  323. /**
  324. * 重置表单
  325. * @param {String} formName 表单名称
  326. */
  327. resetSearchForm (formName) {
  328. this.$refs[formName].resetFields()
  329. this.searchForm = {}
  330. },
  331. }
  332. }
  333. </script>
  334. <style lang="scss">
  335. .mod-print-thirdAfterSales {
  336. }
  337. </style>