thirdAfterSales.vue 15 KB

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