table.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <scTable ref="table" :apiObj="list.apiObj" :params="searchKey" @selectionChange="selectionChange" row-key="id">
  3. <el-table-column type="selection" width="50" fixed="left"></el-table-column>
  4. <el-table-column label="订单编号" prop="order_id" width="220" fixed="left">
  5. <template #default="scope">
  6. <span v-if="scope.row.order_id">{{ scope.row.order_id }}</span>
  7. <span class="status-danger" v-else>未设置</span>
  8. </template>
  9. </el-table-column>
  10. <el-table-column label="订单类型" prop="status" width="120">
  11. <template #default="scope">
  12. <div class="status-danger" v-if="scope.row.service_type==1"><sc-status-indicator type="danger"></sc-status-indicator> 预约</div>
  13. <div class="status-success" v-if="scope.row.service_type==2"><sc-status-indicator type="success"></sc-status-indicator> 快递</div>
  14. </template>
  15. </el-table-column>
  16. <el-table-column label="收货地址" prop="company_id" width="120">
  17. <template #default="scope">
  18. <el-popover :width="200" placement="top-start" v-if="scope.row.service_type==2">
  19. <template #reference>
  20. <div class="el-text">
  21. {{ scope.row.mobile }}
  22. <div class="desc" v-copy="'联系人:'+scope.row.username+'联系电话:'+scope.row.mobile+'联系地址:'+scope.row.region+scope.row.address"><span>一键复制</span></div>
  23. </div>
  24. </template>
  25. <div class="flex-tags-size">
  26. <span>联系人</span>{{scope.row.username?scope.row.username:'-'}}<br><br>
  27. <span>联系电话</span>{{scope.row.mobile?scope.row.mobile:'-'}}<br><br>
  28. <span>联系地址</span>{{scope.row.region?scope.row.region:'-'}}{{scope.row.address?scope.row.address:'-'}}
  29. </div>
  30. </el-popover>
  31. <span v-else>-</span>
  32. </template>
  33. </el-table-column>
  34. <el-table-column label="商品ID" prop="out_id" width="150">
  35. <template #default="scope">
  36. <span v-if="scope.row.product_id">{{ scope.row.product_id }}</span>
  37. <span class="status-danger" v-else>未设置</span>
  38. </template>
  39. </el-table-column>
  40. <el-table-column label="商品信息" prop="product_name" width="220">
  41. <template #default="scope">
  42. <div class="el-text" v-if="scope.row.product_name">
  43. {{ scope.row.product_name }}
  44. <div class="desc"><span>{{ scope.row.sku }}</span></div>
  45. </div>
  46. <span class="status-danger" v-else>未设置</span>
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="数量" prop="count" width="100">
  50. <template #default="scope">
  51. <span>{{ scope.row.parent.count }}件</span>
  52. </template>
  53. </el-table-column>
  54. <el-table-column label="订单金额" prop="order_amount" width="150">
  55. <template #default="scope">
  56. <span v-if="scope.row.parent.order_amount">¥{{ scope.row.parent.order_amount }}</span>
  57. <span class="status-danger" v-else>未设置</span>
  58. </template>
  59. </el-table-column>
  60. <el-table-column label="支付金额" prop="pay_amount" width="150">
  61. <template #default="scope">
  62. <span v-if="scope.row.parent.pay_amount">¥{{ scope.row.parent.pay_amount }}</span>
  63. <span class="status-danger" v-else>未设置</span>
  64. </template>
  65. </el-table-column>
  66. <el-table-column label="状态" prop="status" width="180">
  67. <template #default="scope">
  68. <div class="status-danger" v-if="scope.row.express_status==0"><sc-status-indicator type="danger"></sc-status-indicator> 待发货</div>
  69. <div class="status-success" v-if="scope.row.express_status==1"><sc-status-indicator type="success"></sc-status-indicator> 待核销</div>
  70. <div class="status-danger" v-if="scope.row.express_status==2"><sc-status-indicator type="danger"></sc-status-indicator> 已完成</div>
  71. <div class="status-info" v-if="scope.row.express_status==3"><sc-status-indicator type="info"></sc-status-indicator> 已取消</div>
  72. <div class="status-info" v-if="scope.row.express_status==4"><sc-status-indicator type="info"></sc-status-indicator> 退款审核</div>
  73. <div class="status-info" v-if="scope.row.express_status==5"><sc-status-indicator type="info"></sc-status-indicator> 拒绝退款</div>
  74. <div v-if="scope.row.status==5 && scope.row.remark">{{ scope.row.remark }}</div>
  75. </template>
  76. </el-table-column>
  77. <el-table-column label="创建时间" prop="create_at" width="180"></el-table-column>
  78. <el-table-column label="操作" width="200" align="right" fixed="right">
  79. <template #default="scope">
  80. <el-button-group>
  81. <el-button text type="warning" size="small" @click="table_log(scope.row)">订单记录</el-button>
  82. <el-button text type="warning" size="small" @click="table_express(scope.row)" v-if="scope.row.express_status==0">呼叫快递</el-button>
  83. <el-button text type="warning" size="small" v-if="scope.row.express_status==1" @click="table_print(scope.row)">打印面单</el-button>
  84. <el-button text type="success" size="small" @click="table_end(scope.row)" v-if="scope.row.express_status==1">手动核销</el-button>
  85. <el-button text type="success" size="small" @click="table_passwd(scope.row)" v-if="scope.row.express_status==0 && scope.row.service_type==2">更新地址</el-button>
  86. </el-button-group>
  87. </template>
  88. </el-table-column>
  89. </scTable>
  90. <addMain ref="addMain" @success="handleSuccess"></addMain>
  91. <logMain ref="logMain" @success="handleSuccess"></logMain>
  92. </template>
  93. <script>
  94. import addMain from "@/views/manage/components/send";
  95. import logMain from '@/views/store/order/components/log'
  96. export default {
  97. components: {
  98. addMain,logMain
  99. },
  100. props: {
  101. status: { type: String, default: "1" }
  102. },
  103. data(){
  104. return {
  105. list: {
  106. apiObj: this.$API.storeOrder.list
  107. },
  108. dataSelect:[],
  109. dataSelectFull:[],
  110. searchKey:{
  111. ex_status:this.status
  112. }
  113. }
  114. },
  115. methods: {
  116. async table_print(data){
  117. var resp = await this.$API.store.hook.get();
  118. var url = resp.data.url+"print/view?order="+data.order_id
  119. window.open(url,"_blank")
  120. },
  121. table_passwd(row){
  122. return this.$message.success("暂未开放");
  123. this.$nextTick(() => {
  124. this.$refs.formMain.open("edit").setData(row)
  125. })
  126. },
  127. table_end(data){
  128. return this.$message.success("暂未开放");
  129. this.$confirm(`核销后该笔订单即为完成,如客户需退款只能通过来客后台进行操作,当前后台不支持核销后退款操作,确定要执行吗?`, '提示', {
  130. type: 'warning'
  131. }).then(async () => {
  132. var loading = this.$loading();
  133. var resp = await this.$API.order.end.post({"order_id":data.order_id});
  134. loading.close();
  135. if (resp.code !== 1) {
  136. return this.$message.error(resp.msg);
  137. }
  138. this.$message.success(resp.msg);
  139. this.$refs.table.refresh()
  140. }).catch(() => {
  141. })
  142. },
  143. table_express(data){
  144. return this.$message.success("暂未开放");
  145. this.$confirm(`呼叫快递成功后,可进入【待核销】栏目进行打印快递面单,如已接通云打印可忽略`, '提示', {
  146. type: 'warning'
  147. }).then(async ()=>{
  148. var loading = this.$loading();
  149. var resp = await this.$API.merOrder.express.post({"id":data.id});
  150. loading.close();
  151. if (resp.code == 0) {
  152. return this.$message.warning(resp.msg);
  153. }
  154. this.$message.success(resp.msg);
  155. this.$refs.table.refresh()
  156. }).catch(()=>{})
  157. },
  158. table_log(data){
  159. this.$nextTick(() => {
  160. this.$refs.logMain.open("edit").setData(data)
  161. })
  162. },
  163. refresh(){
  164. this.$refs.table.refresh()
  165. },
  166. upData(data){
  167. this.$refs.table.upData(data)
  168. },
  169. handleSuccess(){
  170. this.$refs.table.refresh()
  171. },
  172. sortChange(event){
  173. if (event.order) {
  174. var data = {
  175. "field":event.prop,
  176. "order":event.order
  177. }
  178. this.$refs.table.upData(data)
  179. } else {
  180. this.$refs.table.reload(this.searchKey)
  181. }
  182. return ;
  183. },
  184. selectionChange(event){
  185. this.dataSelect = [];
  186. var arr = [];
  187. var arrCompany = [];
  188. event.forEach(function(val,index){
  189. arr[index] = val.id;
  190. arrCompany[index] = val;
  191. });
  192. this.dataSelectFull = arrCompany;
  193. this.dataSelect = arr;
  194. this.$emit("success",this.dataSelect);
  195. this.$emit("successFull",this.dataSelectFull);
  196. },
  197. }
  198. }
  199. </script>
  200. <style>
  201. .desc{
  202. color: #999;
  203. font-size: 12px;
  204. }
  205. .flex-btn{
  206. display: flex;
  207. flex-wrap: wrap;
  208. gap: 5px;
  209. }
  210. .flex-tags {
  211. display: flex;
  212. gap: 2px;
  213. flex-wrap: wrap;
  214. }
  215. .flex-btn .el-button.is-text{
  216. margin-left: 0;
  217. }
  218. .flex-tags-size{
  219. font-size: 12px;
  220. }
  221. .flex-tags-size span{
  222. display: block;
  223. margin-bottom: 5px;
  224. color: #999;
  225. }
  226. </style>