table.vue 10 KB

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