userStorerDetails.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. <template>
  2. <div class="aacontainer">
  3. <el-tabs type="card" v-model="actName" @tab-click="handleClickX">
  4. <el-tab-pane label="全部订单" name="10"></el-tab-pane>
  5. <el-tab-pane v-for="(item,index) in orderOptions" :label="item.dictLabel" :name="item.dictValue"></el-tab-pane>
  6. </el-tabs>
  7. <el-table v-loading="loading" :data="orderList" >
  8. <el-table-column label="订单号" align="center" prop="orderCode" width="180px"/>
  9. <el-table-column label="所属店铺" align="center" prop="storeName" width="180px"/>
  10. <el-table-column label="用户昵称" align="center" prop="nickName" show-overflow-tooltip width="100px"/>
  11. <el-table-column label="收货人" align="center" prop="userName" />
  12. <el-table-column label="医生姓名" align="center" prop="doctorName" />
  13. <el-table-column label="患者姓名" align="center" prop="patientName" />
  14. <el-table-column label="订单总价" align="center" prop="totalPrice" />
  15. <el-table-column label="应付金额" align="center" prop="payPrice" />
  16. <el-table-column label="实付金额" align="center" prop="payMoney" />
  17. <el-table-column label="订单状态" align="center" prop="status" >
  18. <template slot-scope="scope">
  19. <dict-tag :options="orderOptions" :value="scope.row.status"/>
  20. </template>
  21. </el-table-column>
  22. <el-table-column label="支付状态 " align="center" prop="isPay" >
  23. <template slot-scope="scope">
  24. <dict-tag :options="payStatusOptions" :value="scope.row.isPay"/>
  25. </template>
  26. </el-table-column>
  27. <el-table-column label="支付时间" align="center" prop="payTime" width="180" />
  28. <el-table-column label="支付方式" align="center" prop="payType" >
  29. <template slot-scope="scope">
  30. <dict-tag :options="PayOptions" :value="scope.row.payType"/>
  31. </template>
  32. </el-table-column>
  33. <el-table-column label="订单类型" align="center" prop="orderType" >
  34. <template slot-scope="scope">
  35. <dict-tag :options="orderTypeOptions" :value="scope.row.orderType"/>
  36. </template>
  37. </el-table-column>
  38. <el-table-column label="退款状态" align="center" prop="refundStatus" >
  39. <template slot-scope="scope">
  40. <dict-tag :options="refundOptions" :value="scope.row.refundStatus"/>
  41. </template>
  42. </el-table-column>
  43. <el-table-column label="快递名称" align="center" prop="deliveryName" />
  44. <el-table-column label="快递单号" align="center" prop="deliverySn" />
  45. <el-table-column label="是否开处方" align="center" prop="isPrescribe" >
  46. <template slot-scope="scope">
  47. <dict-tag :options="orOptions" :value="scope.row.isPrescribe"/>
  48. </template>
  49. </el-table-column>
  50. <el-table-column label="处方编号" align="center" prop="prescribeCode" width="170px"/>
  51. <el-table-column label="发货时间" align="center" prop="deliveryTime" />
  52. <el-table-column label="推广佣金" align="center" prop="tuiMoney" />
  53. <el-table-column label="推广佣金状态" align="center" prop="tuiMoneyStatus" >
  54. <template slot-scope="scope">
  55. <dict-tag :options="tuiOptions" :value="scope.row.tuiMoneyStatus"/>
  56. </template>
  57. </el-table-column>
  58. <el-table-column label="创建时间" align="center" prop="createTime" width="150px"/>
  59. <el-table-column label="修改时间" align="center" prop="updateTime" width="150px"/>
  60. </el-table>
  61. <pagination
  62. v-show="total>0"
  63. :total="total"
  64. :page.sync="queryParams.pageNum"
  65. :limit.sync="queryParams.pageSize"
  66. @pagination="getList"
  67. />
  68. </div>
  69. </template>
  70. <script>
  71. import { listOrder, getOrder, delOrder, addOrder, updateOrder, exportOrder,importTemplate } from "@/api/his/storeOrder";
  72. import { getToken } from "@/utils/auth";
  73. import {listStore} from "@/api/his/storeProduct";
  74. export default {
  75. name: "userInquir",
  76. props:["data"],
  77. data() {
  78. return {
  79. actName:"10",
  80. show:{
  81. title:"订单详情",
  82. open:false,
  83. },
  84. upload: {
  85. // 是否显示弹出层
  86. open: false,
  87. // 弹出层标题
  88. title: "",
  89. // 是否禁用上传
  90. isUploading: false,
  91. // 是否更新已经存在的用户数据
  92. updateSupport: 0,
  93. // 设置上传的请求头部
  94. headers: { Authorization: "Bearer " + getToken() },
  95. // 上传的地址
  96. url: process.env.VUE_APP_BASE_API + "/his/order/importData"
  97. },
  98. // 遮罩层
  99. loading: true,
  100. // 导出遮罩层
  101. exportLoading: false,
  102. // 选中数组
  103. ids: [],
  104. // 非单个禁用
  105. single: true,
  106. // 非多个禁用
  107. multiple: true,
  108. // 显示搜索条件
  109. showSearch: true,
  110. // 总条数
  111. total: 0,
  112. // 订单表格数据
  113. orderList: [],
  114. // 弹出层标题
  115. title: "",
  116. createTime:null,
  117. payTime:null,
  118. // 是否显示弹出层
  119. open: false,
  120. // 查询参数
  121. queryParams: {
  122. pageNum: 1,
  123. pageSize: 10,
  124. storeId: null,
  125. orderCode: null,
  126. userId: null,
  127. userName: null,
  128. userPhone: null,
  129. userAddress: null,
  130. cartId: null,
  131. totalNum: null,
  132. totalPrice: null,
  133. payPrice: null,
  134. payMoney: null,
  135. isPay: null,
  136. payTime: null,
  137. payType: null,
  138. status: null,
  139. refundStatus: null,
  140. refundImg: null,
  141. refundExplain: null,
  142. refundTime: null,
  143. refundReason: null,
  144. refundMoney: null,
  145. deliveryCode: null,
  146. deliveryName: null,
  147. deliverySn: null,
  148. isDel: null,
  149. costPrice: null,
  150. verifyCode: null,
  151. shippingType: null,
  152. isChannel: null,
  153. isPrescribe: null,
  154. prescribeId: null,
  155. finishTime: null,
  156. patientName: null,
  157. doctorName: null,
  158. sTime:null,
  159. eTime:null,
  160. paysTime:null,
  161. payeTime:null,
  162. deliveryTime: null,
  163. tuiMoney: null,
  164. tuiMoneyStatus: null,
  165. tuiUserId: null,
  166. orderCreateType: null
  167. },
  168. // 表单参数
  169. form: {},
  170. // 表单校验
  171. rules: {
  172. },
  173. PayOptions:[],
  174. orderOptions:[],
  175. payStatusOptions:[],
  176. refundOptions:[],
  177. channelOptions:[],
  178. orderTypeOptions:[],
  179. tuiOptions:[],
  180. orOptions:[],
  181. storeOPtions:[],
  182. };
  183. },
  184. created() {
  185. this.getDicts("sys_inquiry_pay").then(response => {
  186. this.PayOptions = response.data;
  187. });
  188. this.getDicts("store_order_type").then(response => {
  189. this.orderTypeOptions = response.data;
  190. });
  191. this.getDicts("sys_order_status").then(response => {
  192. this.orderOptions = response.data;
  193. });
  194. this.getDicts("sys_order_pay").then(response => {
  195. this.payStatusOptions = response.data;
  196. });
  197. this.getDicts("sys_refund_status").then(response => {
  198. this.refundOptions = response.data;
  199. });
  200. this.getDicts("sys_channel").then(response => {
  201. this.channelOptions = response.data;
  202. });
  203. this.getDicts("sys_tui_money_status").then(response => {
  204. this.tuiOptions = response.data;
  205. });
  206. this.getDicts("sys_company_or").then(response => {
  207. this.orOptions = response.data;
  208. });
  209. },
  210. methods: {
  211. getUserDetails(id){
  212. this.queryParams.userId=id
  213. this.getList();
  214. },
  215. /** 查询订单列表 */
  216. getList() {
  217. this.loading = true;
  218. listOrder(this.queryParams).then(response => {
  219. this.orderList = response.rows;
  220. this.total = response.total;
  221. this.loading = false;
  222. });
  223. },
  224. // 取消按钮
  225. cancel() {
  226. this.open = false;
  227. this.reset();
  228. },
  229. // 表单重置
  230. reset() {
  231. this.form = {
  232. orderId: null,
  233. storeId: null,
  234. orderCode: null,
  235. userId: null,
  236. userName: null,
  237. userPhone: null,
  238. userAddress: null,
  239. cartId: null,
  240. totalNum: null,
  241. totalPrice: null,
  242. payPrice: null,
  243. payMoney: null,
  244. isPay: null,
  245. payTime: null,
  246. payType: null,
  247. createTime: null,
  248. updateTime: null,
  249. status: null,
  250. refundStatus: "0",
  251. refundImg: null,
  252. refundExplain: null,
  253. refundTime: null,
  254. refundReason: null,
  255. refundMoney: null,
  256. deliveryCode: null,
  257. deliveryName: null,
  258. deliverySn: null,
  259. remark: null,
  260. isDel: null,
  261. costPrice: null,
  262. verifyCode: null,
  263. shippingType: null,
  264. isChannel: null,
  265. isPrescribe: null,
  266. prescribeId: null,
  267. finishTime: null,
  268. deliveryTime: null,
  269. tuiMoney: null,
  270. tuiMoneyStatus: 0,
  271. tuiUserId: null,
  272. orderCreateType: null
  273. };
  274. this.resetForm("form");
  275. },
  276. /** 搜索按钮操作 */
  277. handleQuery() {
  278. this.queryParams.pageNum = 1;
  279. this.getList();
  280. },
  281. handleClickX(tab, event) {
  282. if(tab.name=="10"){
  283. this.queryParams.status=null;
  284. }else{
  285. this.queryParams.status=tab.name;
  286. }
  287. this.handleQuery();
  288. },
  289. changeTime(){
  290. if(this.createTime!=null){
  291. this.queryParams.sTime=this.createTime[0];
  292. this.queryParams.eTime=this.createTime[1];
  293. }else{
  294. this.queryParams.sTime=null;
  295. this.queryParams.eTime=null;
  296. }
  297. },
  298. changePayTime(){
  299. if(this.payTime!=null){
  300. this.queryParams.sTime=this.payTime[0];
  301. this.queryParams.eTime=this.payTime[1];
  302. }else{
  303. this.queryParams.paysTime=null;
  304. this.queryParams.payeTime=null;
  305. }
  306. },
  307. /** 重置按钮操作 */
  308. resetQuery() {
  309. this.resetForm("queryForm");
  310. this.createTime=null;
  311. this.queryParams.sTime=null;
  312. this.queryParams.eTime=null;
  313. this.payTime=null;
  314. this.queryParams.paysTime=null;
  315. this.queryParams.payeTime=null;
  316. this.handleQuery();
  317. },
  318. // 多选框选中数据
  319. handleSelectionChange(selection) {
  320. this.ids = selection.map(item => item.orderId)
  321. this.single = selection.length!==1
  322. this.multiple = !selection.length
  323. },
  324. /** 新增按钮操作 */
  325. handleAdd() {
  326. this.reset();
  327. this.open = true;
  328. this.title = "添加订单";
  329. },
  330. /** 修改按钮操作 */
  331. handleUpdate(row) {
  332. this.reset();
  333. const orderId = row.orderId || this.ids
  334. getOrder(orderId).then(response => {
  335. this.form = response.data;
  336. this.open = true;
  337. this.title = "修改订单";
  338. });
  339. },
  340. /** 提交按钮 */
  341. submitForm() {
  342. this.$refs["form"].validate(valid => {
  343. if (valid) {
  344. if (this.form.orderId != null) {
  345. updateOrder(this.form).then(response => {
  346. this.msgSuccess("修改成功");
  347. this.open = false;
  348. this.getList();
  349. });
  350. } else {
  351. addOrder(this.form).then(response => {
  352. this.msgSuccess("新增成功");
  353. this.open = false;
  354. this.getList();
  355. });
  356. }
  357. }
  358. });
  359. },
  360. /** 删除按钮操作 */
  361. handleDelete(row) {
  362. const orderIds = row.orderId || this.ids;
  363. this.$confirm('是否确认删除订单编号为"' + orderIds + '"的数据项?', "警告", {
  364. confirmButtonText: "确定",
  365. cancelButtonText: "取消",
  366. type: "warning"
  367. }).then(function() {
  368. return delOrder(orderIds);
  369. }).then(() => {
  370. this.getList();
  371. this.msgSuccess("删除成功");
  372. }).catch(() => {});
  373. },
  374. /** 导出按钮操作 */
  375. handleExport() {
  376. const queryParams = this.queryParams;
  377. this.$confirm('是否确认导出所有订单数据项?', "警告", {
  378. confirmButtonText: "确定",
  379. cancelButtonText: "取消",
  380. type: "warning"
  381. }).then(() => {
  382. this.exportLoading = true;
  383. return exportOrder(queryParams);
  384. }).then(response => {
  385. this.download(response.msg);
  386. this.exportLoading = false;
  387. }).catch(() => {});
  388. }
  389. }
  390. };
  391. </script>