|
@@ -9,7 +9,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="" style="float: right;margin: 5px;">
|
|
<div class="" style="float: right;margin: 5px;">
|
|
|
- <el-button size="mini" @click="getPayStatus()" >同步支付状态</el-button>
|
|
|
|
|
|
|
+ <el-button size="mini" @click="openSyncDialog" >同步支付状态</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="" v-if="item.status>=0" style="float: right; margin: 5px;" v-hasPermi="['his:storePayment:refund']" >
|
|
<div class="" v-if="item.status>=0" style="float: right; margin: 5px;" v-hasPermi="['his:storePayment:refund']" >
|
|
|
<el-button size="mini" @click="payRefund()" >退款</el-button>
|
|
<el-button size="mini" @click="payRefund()" >退款</el-button>
|
|
@@ -71,7 +71,34 @@
|
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
|
</el-descriptions>
|
|
</el-descriptions>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <!-- 同步支付状态弹窗 -->
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ title="同步支付状态"
|
|
|
|
|
+ :visible.sync="syncDialogVisible"
|
|
|
|
|
+ width="450px"
|
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
|
+ append-to-body>
|
|
|
|
|
+
|
|
|
|
|
+ <el-form :model="syncForm" :rules="syncRules" ref="syncForm" label-width="100px">
|
|
|
|
|
+ <el-form-item label="退款日期" prop="refundDate">
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ v-model="syncForm.refundDate"
|
|
|
|
|
+ type="date"
|
|
|
|
|
+ placeholder="请选择退款日期"
|
|
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
|
|
+ style="width: 100%">
|
|
|
|
|
+ </el-date-picker>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+
|
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button @click="syncDialogVisible = false" size="small">取 消</el-button>
|
|
|
|
|
+ <el-button type="primary" :loading="syncLoading" @click="getPayStatus()" size="small">
|
|
|
|
|
+ 开始同步
|
|
|
|
|
+ </el-button>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
@@ -81,6 +108,18 @@ import { refund,listStorePayment,getStatus, getStorePayment, delStorePayment, ad
|
|
|
props:["data"],
|
|
props:["data"],
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ // 弹窗显示控制
|
|
|
|
|
+ syncDialogVisible: false,
|
|
|
|
|
+ // 加载状态
|
|
|
|
|
+ syncLoading: false,
|
|
|
|
|
+ syncForm: {
|
|
|
|
|
+ refundDate: '',
|
|
|
|
|
+ },
|
|
|
|
|
+ syncRules: {
|
|
|
|
|
+ refundDate: [
|
|
|
|
|
+ { required: true, message: '请选择退款日期', trigger: 'change' }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
statusOptions: [],
|
|
statusOptions: [],
|
|
|
busineOptions: [],
|
|
busineOptions: [],
|
|
|
item:null,
|
|
item:null,
|
|
@@ -88,16 +127,29 @@ import { refund,listStorePayment,getStatus, getStorePayment, delStorePayment, ad
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
- this.getDicts("sys_store_payment_status").then(response => {
|
|
|
|
|
- this.statusOptions = response.data;
|
|
|
|
|
- });
|
|
|
|
|
- this.getDicts("sys_store_payment_business_type").then(response => {
|
|
|
|
|
- this.busineOptions = response.data;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ this.getDicts("sys_store_payment_status").then(response => {
|
|
|
|
|
+ this.statusOptions = response.data;
|
|
|
|
|
+ });
|
|
|
|
|
+ this.getDicts("sys_store_payment_business_type").then(response => {
|
|
|
|
|
+ this.busineOptions = response.data;
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ // 打开同步弹窗
|
|
|
|
|
+ openSyncDialog() {
|
|
|
|
|
+ if (this.item.status==0){
|
|
|
|
|
+ return this.getPayStatus();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.syncDialogVisible = true;
|
|
|
|
|
+ // 重置表单
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.$refs.syncForm && this.$refs.syncForm.resetFields();
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
getDetails(orderId) {
|
|
getDetails(orderId) {
|
|
|
this.item=null;
|
|
this.item=null;
|
|
|
getStorePayment(orderId).then(response => {
|
|
getStorePayment(orderId).then(response => {
|
|
@@ -105,19 +157,45 @@ import { refund,listStorePayment,getStatus, getStorePayment, delStorePayment, ad
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
getPayStatus(){
|
|
getPayStatus(){
|
|
|
- var that=this;
|
|
|
|
|
- this.$confirm('是否确认同步支付状态?', "警告", {
|
|
|
|
|
- confirmButtonText: "确定",
|
|
|
|
|
- cancelButtonText: "取消",
|
|
|
|
|
- type: "warning"
|
|
|
|
|
- }).then(function() {
|
|
|
|
|
- return getStatus(that.item.paymentId);
|
|
|
|
|
- }).then(() => {
|
|
|
|
|
- getStorePayment(that.item.paymentId).then(response => {
|
|
|
|
|
- that.item = response.data;
|
|
|
|
|
|
|
+ this.$confirm('是否确认同步支付状态?', "警告", {
|
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
|
+ type: "warning"
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ console.log("this.item.status", this.item.status);
|
|
|
|
|
+ console.log("this.item.status", this.syncForm.refundDate);
|
|
|
|
|
+
|
|
|
|
|
+ if (this.item.status === 1) {
|
|
|
|
|
+ // 先验证表单
|
|
|
|
|
+ this.$refs.syncForm.validate(valid => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ this.syncLoading = true;
|
|
|
|
|
+ getStatus(this.item.paymentId, this.syncForm.refundDate)
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ this.$message.success('同步成功');
|
|
|
|
|
+ this.syncDialogVisible = false;
|
|
|
|
|
+ getStorePayment(that.item.paymentId).then(response => {
|
|
|
|
|
+ that.item = response.data;
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(err => {
|
|
|
|
|
+ this.$message.error(err.msg || '同步失败');
|
|
|
|
|
+ })
|
|
|
|
|
+ .finally(() => {
|
|
|
|
|
+ this.syncLoading = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
- this.msgSuccess("操作成功");
|
|
|
|
|
- }).catch(function() {});
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // status 不为 1 时直接调用,不传日期
|
|
|
|
|
+ getStatus(this.item.paymentId, null)
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ getStorePayment(that.item.paymentId).then(response => {
|
|
|
|
|
+ that.item = response.data;
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(() => {});
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
|