table.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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.merOrder.list
  115. },
  116. dataSelect:[],
  117. dataSelectFull:[],
  118. searchKey:{}
  119. }
  120. },
  121. methods: {
  122. table_passwd(row){
  123. return this.$message.success("暂未开放");
  124. this.$nextTick(() => {
  125. this.$refs.formMain.open("edit").setData(row)
  126. })
  127. },
  128. table_end(data){
  129. return this.$message.success("暂未开放");
  130. this.$confirm(`核销后该笔订单即为完成,如客户需退款只能通过来客后台进行操作,当前后台不支持核销后退款操作,确定要执行吗?`, '提示', {
  131. type: 'warning'
  132. }).then(async () => {
  133. var loading = this.$loading();
  134. var resp = await this.$API.order.end.post({"order_id":data.order_id});
  135. loading.close();
  136. if (resp.code !== 1) {
  137. return this.$message.error(resp.msg);
  138. }
  139. this.$message.success(resp.msg);
  140. this.$refs.table.refresh()
  141. }).catch(() => {
  142. })
  143. },
  144. table_express(data){
  145. return this.$message.success("暂未开放");
  146. this.$confirm(`呼叫快递成功后,可进入【待核销】栏目进行打印快递面单,如已接通云打印可忽略`, '提示', {
  147. type: 'warning'
  148. }).then(async ()=>{
  149. var loading = this.$loading();
  150. var resp = await this.$API.merOrder.express.post({"id":data.id});
  151. loading.close();
  152. if (resp.code == 0) {
  153. return this.$message.warning(resp.msg);
  154. }
  155. this.$message.success(resp.msg);
  156. this.$refs.table.refresh()
  157. }).catch(()=>{})
  158. },
  159. table_log(data){
  160. this.$nextTick(() => {
  161. this.$refs.logMain.open("edit").setData(data)
  162. })
  163. },
  164. refresh(){
  165. this.$refs.table.refresh()
  166. },
  167. upData(data){
  168. this.$refs.table.upData(data)
  169. },
  170. handleSuccess(){
  171. this.$refs.table.refresh()
  172. },
  173. sortChange(event){
  174. if (event.order) {
  175. var data = {
  176. "field":event.prop,
  177. "order":event.order
  178. }
  179. this.$refs.table.upData(data)
  180. } else {
  181. this.$refs.table.reload(this.searchKey)
  182. }
  183. return ;
  184. },
  185. selectionChange(event){
  186. this.dataSelect = [];
  187. var arr = [];
  188. var arrCompany = [];
  189. event.forEach(function(val,index){
  190. arr[index] = val.id;
  191. arrCompany[index] = val;
  192. });
  193. this.dataSelectFull = arrCompany;
  194. this.dataSelect = arr;
  195. this.$emit("success",this.dataSelect);
  196. this.$emit("successFull",this.dataSelectFull);
  197. },
  198. }
  199. }
  200. </script>
  201. <style>
  202. .desc{
  203. color: #999;
  204. font-size: 12px;
  205. }
  206. .flex-btn{
  207. display: flex;
  208. flex-wrap: wrap;
  209. gap: 5px;
  210. }
  211. .flex-tags {
  212. display: flex;
  213. gap: 2px;
  214. flex-wrap: wrap;
  215. }
  216. .flex-btn .el-button.is-text{
  217. margin-left: 0;
  218. }
  219. .flex-tags-size{
  220. font-size: 12px;
  221. }
  222. .flex-tags-size span{
  223. display: block;
  224. margin-bottom: 5px;
  225. color: #999;
  226. }
  227. </style>