option.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <div class="op-header-no">
  3. <div class="left-panel">
  4. <template v-if="trade==2">
  5. <sc-file-import :apiObj="$API.common.importFile" title="导入快递单号" :data="{otherData:'demo'}" templateUrl="http://www.scuiadmin/file.xlsx" accept=".xls, .xlsx" :maxSize="30" tip="请上传小于或等于 30M 的 .xls, .xlsx 格式文件" @success="success">
  6. <template #default="{open}">
  7. <el-button type="primary" icon="sc-icon-upload" @click="open">导入快递单号</el-button>
  8. </template>
  9. <template #uploader>
  10. <el-icon class="el-icon--upload"><sc-icon-file-excel /></el-icon>
  11. <div class="el-upload__text">
  12. 将文件拖到此处或 <em>点击选择文件上传</em>
  13. </div>
  14. </template>
  15. </sc-file-import>
  16. </template>
  17. <sc-file-export :apiObj="$API.system.tasks.export" :data="searchKey" :fileName="'订单列表_'+(new Date().getTime())" async>
  18. <template #default="{open}">
  19. <el-button type="danger" icon="sc-icon-download" @click="open">导出</el-button>
  20. </template>
  21. </sc-file-export>
  22. </div>
  23. </div>
  24. </template>
  25. <script>
  26. import scFileExport from '@/components/scFileExport'
  27. import scFileImport from '@/components/scFileImport'
  28. export default {
  29. components: {
  30. scFileExport,scFileImport
  31. },
  32. props: {
  33. dataSelect: { type: Array, default: () => [] },
  34. dataSelectFull: { type: Array, default: () => [] },
  35. trade: { type: String, default: "0" },
  36. searchKey: { type: Object, default: () => {} },
  37. },
  38. data(){
  39. return {
  40. }
  41. },
  42. methods: {
  43. table_add(){
  44. this.$router.push('/merchant/goods/add')
  45. },
  46. table_sync(){
  47. this.$confirm(`发起同步后,请耐心等待1-2分钟后再刷新当前数据列表`, '提示', {
  48. type: 'warning'
  49. }).then(async () => {
  50. var resp = await this.$API.category.sync.get();
  51. if (resp.code == 0) {
  52. return this.$message.error(resp.msg);
  53. }
  54. this.$message.success(resp.msg);
  55. this.$emit("success");
  56. }).catch(() => {
  57. })
  58. },
  59. table_batch_status(status){
  60. if (this.dataSelect.length == 0) {
  61. return this.$message.error("请选择修改数据")
  62. }
  63. this.$confirm(`审核中的商品不支持该操作,请确认是否有勾选审核中的商品`, '提示', {
  64. type: 'warning'
  65. }).then(async () => {
  66. var loading = this.$loading()
  67. let submitData = {"id":this.dataSelect,"value":status,"field":"status","type":"batch"};
  68. loading.close()
  69. var resp = await this.$API.merGoods.batch.post(submitData);
  70. if (resp.code == 0) {
  71. return this.$message.error(resp.msg);
  72. }
  73. this.$message.success(resp.msg);
  74. this.$emit("success");
  75. }).catch(() => {
  76. })
  77. },
  78. handleSuccess(){
  79. this.$emit("success");
  80. }
  81. }
  82. }
  83. </script>