userStorerDetails.vue 11 KB

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