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="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. <span v-if="scope.row.product_name">{{ scope.row.product_name }}</span>
  52. <span class="status-danger" v-else>未设置</span>
  53. </template>
  54. </el-table-column>
  55. <el-table-column label="数量" prop="count" width="100">
  56. <template #default="scope">
  57. <span>{{ scope.row.parent.count }}件</span>
  58. </template>
  59. </el-table-column>
  60. <el-table-column label="订单金额" prop="order_amount" width="150">
  61. <template #default="scope">
  62. <span v-if="scope.row.parent.order_amount">¥{{ scope.row.parent.order_amount }}</span>
  63. <span class="status-danger" v-else>未设置</span>
  64. </template>
  65. </el-table-column>
  66. <el-table-column label="支付金额" prop="pay_amount" width="150">
  67. <template #default="scope">
  68. <span v-if="scope.row.parent.pay_amount">¥{{ scope.row.parent.pay_amount }}</span>
  69. <span class="status-danger" v-else>未设置</span>
  70. </template>
  71. </el-table-column>
  72. <el-table-column label="状态" prop="status" width="180">
  73. <template #default="scope">
  74. <div class="status-danger" v-if="scope.row.express_status==0"><sc-status-indicator type="danger"></sc-status-indicator> 待发货</div>
  75. <div class="status-success" v-if="scope.row.express_status==1"><sc-status-indicator type="success"></sc-status-indicator> 待核销</div>
  76. <div class="status-danger" v-if="scope.row.express_status==2"><sc-status-indicator type="danger"></sc-status-indicator> 已完成</div>
  77. <div class="status-info" v-if="scope.row.express_status==3"><sc-status-indicator type="info"></sc-status-indicator> 已取消</div>
  78. <div class="status-info" v-if="scope.row.express_status==4"><sc-status-indicator type="info"></sc-status-indicator> 退款审核</div>
  79. <div class="status-info" v-if="scope.row.express_status==5"><sc-status-indicator type="info"></sc-status-indicator> 拒绝退款</div>
  80. <div v-if="scope.row.status==5 && scope.row.remark">{{ scope.row.remark }}</div>
  81. </template>
  82. </el-table-column>
  83. <el-table-column label="创建时间" prop="create_at" width="180"></el-table-column>
  84. <el-table-column label="操作" width="200" align="right" fixed="right">
  85. <template #default="scope">
  86. <el-button-group>
  87. <el-button text type="warning" size="small" @click="table_log(scope.row)">订单记录</el-button>
  88. <el-button text type="warning" size="small" @click="table_express(scope.row)" v-if="scope.row.express_status==0">呼叫快递</el-button>
  89. <el-button text type="warning" size="small" v-if="scope.row.express_status==1" @click="table_print(scope.row)">打印面单</el-button>
  90. <el-button text type="success" size="small" @click="table_end(scope.row)" v-if="scope.row.express_status==1">手动核销</el-button>
  91. <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>
  92. </el-button-group>
  93. </template>
  94. </el-table-column>
  95. </scTable>
  96. <formMain ref="formMain" @success="handleSuccess"></formMain>
  97. <addMain ref="addMain" @success="handleSuccess"></addMain>
  98. <logMain ref="logMain" @success="handleSuccess"></logMain>
  99. </template>
  100. <script>
  101. import formMain from './form';
  102. import addMain from "@/views/manage/components/send";
  103. import logMain from '@/views/manage/order/components/log'
  104. export default {
  105. components: {
  106. formMain,addMain,logMain
  107. },
  108. data(){
  109. return {
  110. list: {
  111. apiObj: this.$API.order.list
  112. },
  113. dataSelect:[],
  114. dataSelectFull:[],
  115. searchKey:{
  116. ex_status:2
  117. }
  118. }
  119. },
  120. methods: {
  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>