From 2306b92243bb4a409c0e7735fbe0b6c647502737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=A3=95=E8=B4=A2?= Date: Tue, 16 Jan 2024 10:36:43 +0800 Subject: [PATCH 01/27] =?UTF-8?q?=E5=B8=A6=E4=BB=A3=E7=A0=81=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0-=E6=9B=B4=E6=96=B0readme=E5=90=88=E4=BD=9C=E6=96=B9?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/mdp-ui/mdp-table/README.md | 179 ++++++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 src/components/mdp-ui/mdp-table/README.md diff --git a/src/components/mdp-ui/mdp-table/README.md b/src/components/mdp-ui/mdp-table/README.md new file mode 100644 index 00000000..aa010e97 --- /dev/null +++ b/src/components/mdp-ui/mdp-table/README.md @@ -0,0 +1,179 @@ +### mdp-table +该组件相对于el-table,进行了以下优化: +内置了增、删、改、查、高级查询、重置查询、导出、列配置、分页、批量编辑等功能、内置了对按钮权限的控制机制,功能非常强大 + +- 综合管理 +![综合管理表格](/docs/images/ui-components/table-mng.jpg) +- 可编辑表格 +![可编辑表格](/docs/images/ui-components/edit-table.jpg) +- 可编辑-树状表格 +![可编辑-树状表格](/docs/images/ui-components/left-right-tree-table.jpg) + +### 用法 + +#### 基本用法,根el-table保持一致,直接定义表头,mdp框架将解析出表头内容,用于配置显示列,排序,高级查询等 +```html + + + + + + + + +``` +```js + +``` + + +#### 通过属性columnCfgs传入表格字段列表,mdp框架将解析出表头内容,用于配置显示列,排序,高级查询等 +```html + + +``` +```js + +``` + +#### 多选、单选模式、可编辑表格 +```html + + +``` +```js + +``` + +### Attributes +|参数|说明|类型|可选值|默认值| +|--------|------|--------|-----------------|----------------| +|crud-apis|增删改查的接口函数|object|-| - +|multiple|是否多选|boolean|—|false +|show-hi-query|是否显示高级查询|boolean|—|true +|show-common-query|是否显示常规查询|boolean|—|true +|edit|是否可编辑|boolean|—|false +|column-cfgs|表头列配置项列表|Array|-|- + + + +### Events +|事件名称|说明|回调参数| +|--------|------|--------| +change2|选中值发生变化时触发,在需要获取值以外更多信息时使用|目前的选中的整个对象,如果multiple=false,返回一个对象,否则返回对象数组 +change|选中值发生变化时触发|目前的选中值,如果multiple=false,返回一个值,否则返回值数组,如果split有则,则返回以split分割的字符串,如1,2,3,4,5 +visible-change|下拉框出现/隐藏时触发|出现则为 true,隐藏则为 false +remove-tag|多选模式下移除tag时触发|移除的tag值 +clear|可清空的单选模式下用户点击清空按钮时触发|— +blur|当 input 失去焦点时触发|(event: Event) +focus|当 input 获得焦点时触发|(event: Event) + +### slot +|name|说明| +|--------|------| +—|Option 组件列表 +info|鼠标未进入时展示的内容,showStyle=tag\x时有效 +oper|鼠标进入后展示的内容,showStyle=tag\x时有效 +~~prefix|Select 组件头部内容~~ +empty|无选项时的列表 + +### column-cfgs 表头字段配置 + +|参数|说明|类型|可选值|默认值| +|--------|------|--------|-----------------|----------------| +label|列名|string|—|— +property|属性名,驼峰命名,用于反解析出表字段|string|—|— +sortNo|前端显示排序,排序从0-999,越小越靠前,在表头、常规查询、高级查询的显示顺序|Number|—|— +isCommon|是否常用,用于常规查询是否显示|Boolean|true/false|false +colType|数据库字段类型| string/int/date/datatime/|—|— +showHq|是否在高级查询中显示|true|—|— +label|列名|string|—|— +label|列名|string|—|— +label|列名|string|—|— +label|列名|string|—|— +label|列名|string|—|— +label|列名|string|—|— +label|列名|string|—|— + +### crud-apis api列表 + +|参数|说明|类型|可选值|默认值| +|--------|------|--------|-----------------|----------------| +list|查询api|Promise|—|— +add|新增api|Promise|—|— +edit|修改api|Promise|—|— +del|删除api|Promise|—|— +editSomeFields|批量修改部分字段|Promise|—|— +### Methods + +|方法名|说明|参数| +|--------|------|--------| +focus|使 input 获取焦点|- +blur|使 input 失去焦点,并隐藏下拉框|- \ No newline at end of file -- Gitee From 188993161ff6397c95c36ded6fdbecdb87410f50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=A3=95=E8=B4=A2?= Date: Sat, 20 Jan 2024 22:29:04 +0800 Subject: [PATCH 02/27] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mdp/pay/pay.js | 6 +- src/views/mdp/mo/moOrder/Form.vue | 151 ++++++++++++++++++++++++----- src/views/mdp/mo/moOrder/Index.vue | 48 ++++----- src/views/order/createOrder.vue | 8 +- 4 files changed, 159 insertions(+), 54 deletions(-) diff --git a/src/api/mdp/pay/pay.js b/src/api/mdp/pay/pay.js index 94cf3477..087e6022 100644 --- a/src/api/mdp/pay/pay.js +++ b/src/api/mdp/pay/pay.js @@ -2,6 +2,6 @@ import axios from '@/utils/request' import config from '@/api/mdp_pub/mdp_config' let base = config.getPayContext(); -export const aliPay = params => { return axios.post(`${base}/alipay/uniOrder`, params) } -export const weixinPay = params => { return axios.post(`${base}/wxpay/uniOrder/native`, params) } -export const checkWxPayStatus = params => { return axios.get(`${base}/wxpay/uniOrder/checkOrderStatus`, {params}) } +export const aliPay = params => { return axios.post(`${base}/pay/alipay/uniOrder`, params) } +export const weixinPay = params => { return axios.post(`${base}/pay/wxpay/uniOrder/native`, params) } +export const checkWxPayStatus = params => { return axios.get(`${base}/pay/wxpay/uniOrder/checkOrderStatus`, {params}) } diff --git a/src/views/mdp/mo/moOrder/Form.vue b/src/views/mdp/mo/moOrder/Form.vue index aa46477a..55e2212f 100644 --- a/src/views/mdp/mo/moOrder/Form.vue +++ b/src/views/mdp/mo/moOrder/Form.vue @@ -6,7 +6,9 @@ {{editForm.id}} {{editForm.obranchName}} - ¥{{editForm.ofinalFee}}元 + ¥{{editForm.moFinalFee}}元 + {{editForm.odisRate}}% + ¥{{editForm.ofinalFee}}元 @@ -126,27 +128,37 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + + + + +
+ + + + + + + + + + + + +
+
+ + 创建微信收款码 + + + + 创建支付宝收款码 + +
@@ -164,9 +176,10 @@ - - % - + + % + 确认修改折扣率 + @@ -190,6 +203,9 @@ import * as MoOrderApi from '@/api/mdp/mo/moOrder'; import { mapGetters } from 'vuex' import { MdpFormMixin } from '@/components/mdp-ui/mixin/MdpFormMixin.js'; +import {createOrder} from '@/api/mdp/sys/order' +import {aliPay, weixinPay, checkWxPayStatus} from '@/api/mdp/pay/pay' + import MoOrderModuleIndex from '../moOrderModule/Index.vue'; export default { name:'moOrderForm', @@ -217,6 +233,9 @@ export default { editForm: { id:'',name:'',obranchId:'',ouserid:'',ousername:'',moFinalFee:'',status:'',sstatus:'',ctime:'',payTime:'',payCtime:'',moOrginFee:'',ousers:'',ocates:'',omodules:'',poid:'',startTime:'',endTime:'',payType:'',payId:'',prepayId:'',topenId:'',pbankId:'',pbankName:'',pbankCardNo:'',pbankUsername:'',remark:'',finishTime:'',closeTime:'',setTime:'',odays:'',ofinalFee:'',odisRate:'',othFee:'',otype:'',osource:'',memType:'',atype:'',saleUserid:'',saleUsername:'',custPhone:'',custAddress:'',payAt:'',obranchName:'',ooper:'',tranId:'',invoice:'',invoiceTime:'',invoiceId:'' }, + odisRate:null, + codeUrl:null, + timer:0, //增删改查(含批量)接口 apis:{ queryById: MoOrderApi.queryMoOrderById, @@ -258,6 +277,88 @@ export default { params[fieldName]=$event return true; }, + odisRateConfirm(){ + var params={$pks:[this.editForm.id],odisRate:this.odisRate} + this.apis.editSomeFields(params).then(res=>{ + var tips = res.data.tips + if(tips.isOk){ + Object.assign(this.editForm,res.data.data) + } + this.$notify({ message: tips.msg, type: tips.isOk?'success':'error' }); + }) + }, + + createOrder() { + let orderId = this.editForm.id; + if(this.editForm.payType == '2') { + this.toAliPay(orderId); + return; + }else if(this.editForm.payType == '1') { + this.toWeixinPay(orderId); + return; + }else{ + this.$notify({ message: "请选则支付方式", type:'error' }); + return; + } + }, + + toAliPay(orderId) { + let params = { + id: orderId, + otype: 1, + returnUrl: `${window.location.protocol+"//"+window.location.host}/${process.env.CONTEXT}/${process.env.VERSION}/#/my/order/paySuccess` + } + aliPay(params).then(res => { + if(res.data.tips.isOk) { + const div = document.createElement("divform"); + div.innerHTML = res.data.data.htmlStr; + document.body.appendChild(div); + document.forms[0].submit(); + }else { + this.$notify.error(res.data.tips.msg); + } + }).finally(() => { + setTimeout(() => { + this.load.add = false; + }, 2000); + }) + }, + + toWeixinPay(orderId) { + let params = { + id: orderId, + otype: 1, + returnUrl: "" + } + weixinPay(params).then(res => { + if(res.data.tips.isOk) { + this.codeUrl = res.data.data.codeUrl; + this.timer = setInterval(() => { + this.queryOrderStatus(orderId,res.data.data.payId) + }, 3000) + }else { + this.$notify.error(res.data.tips.msg); + } + }).finally(() => { + setTimeout(() => { + this.load.add = false; + }, 2000); + }) + }, + + //查询订单支付状态 + queryOrderStatus(orderId,payId) { + console.log("查询订单"); + checkWxPayStatus({'orderId': orderId, "otype": "1","payId":payId}).then(res => { + if(res.data.tips.isOk) { + this.$router.push({path:'/my/order/paySuccess', query:{total_amount: this.editForm.ofinalFee, out_trade_no: orderId,pay_id:payId}}); + clearInterval(this.timer); + }else { + } + }).finally(() => { + + }) + }, }, mounted() { diff --git a/src/views/mdp/mo/moOrder/Index.vue b/src/views/mdp/mo/moOrder/Index.vue index 1cc1ac33..11a73ef6 100644 --- a/src/views/mdp/mo/moOrder/Index.vue +++ b/src/views/mdp/mo/moOrder/Index.vue @@ -1,8 +1,12 @@ - + @@ -71,9 +75,19 @@ - + + + + + + + @@ -106,7 +120,7 @@ - + @@ -171,21 +185,6 @@ - - - - - - - - - + + +