From ff95e73d12418ee4b1e400eaceac3d4d623f85b6 Mon Sep 17 00:00:00 2001
From: nidapeng <jp@doumee.com>
Date: 星期五, 29 三月 2024 18:44:04 +0800
Subject: [PATCH] 提交一把
---
company/src/components/business/OperaShopWindow.vue | 50 ++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 42 insertions(+), 8 deletions(-)
diff --git a/company/src/components/business/OperaShopWindow.vue b/company/src/components/business/OperaShopWindow.vue
index ced1965..e90e15b 100644
--- a/company/src/components/business/OperaShopWindow.vue
+++ b/company/src/components/business/OperaShopWindow.vue
@@ -4,7 +4,7 @@
width="60%"
:visible.sync="visible"
:confirm-working="isWorking"
- @confirm="confirm"
+ @confirm="confirmShop"
>
<el-form :model="form" ref="form" :rules="rules" style="width: 50%;">
<el-form-item label="鍟嗘埛鍚嶇О" prop="name">
@@ -78,6 +78,7 @@
import UploadAvatarImage from '@/components/common/UploadAvatarImage'
import { all } from '@/api/business/solutions'
import { sendSms } from '@/api/business/smsEmail'
+import {updateById} from "@/api/business/company";
export default {
name: 'OperaCompanyWindow',
extends: BaseOpera,
@@ -85,7 +86,7 @@
data () {
return {
// 琛ㄥ崟鏁版嵁
- initParam:{
+ initParam: {
id: null,
name: '',
code: '',
@@ -133,7 +134,7 @@
file3: {
imgurl: '',
imgurlfull: ''
- },
+ }
},
form: {},
timer: null,
@@ -195,9 +196,42 @@
}
},
methods: {
- changeSolution(row,index){
- this.form.solutionList[index].solution=row
- // console.log(this.form.solutionList)
+ confirmShop () {
+ this.$refs.form.validate((valid) => {
+ // debugger
+ if (!valid) {
+ return
+ }
+ // 璋冪敤鏂板缓鎺ュ彛
+ this.isWorking = true
+ if (this.form.id == null || this.form.id === '') {
+ this.api.createShop(this.form)
+ .then(() => {
+ this.visible = false
+ this.$tip.apiSuccess('鏂板缓鎴愬姛')
+ this.$emit('success')
+ })
+ .catch(e => {
+ this.$tip.apiFailed(e)
+ })
+ .finally(() => {
+ this.isWorking = false
+ })
+ } else {
+ this.api.updateById(this.form)
+ .then(() => {
+ this.visible = false
+ this.$tip.apiSuccess('鏂板缓鎴愬姛')
+ this.$emit('success')
+ })
+ .catch(e => {
+ this.$tip.apiFailed(e)
+ })
+ .finally(() => {
+ this.isWorking = false
+ })
+ }
+ })
},
send () {
if (!this.form.phone) {
@@ -219,7 +253,7 @@
}
}, 1000)
},
- open (title, target,type) {
+ open (title, target, type) {
this.title = title
this.visible = true
this.form = this.initParam
@@ -255,7 +289,7 @@
},
add () {
this.form.solutionList.push({
- solutionId:null,
+ solutionId: null,
solution: {},
canAdd: '',
canReduce: ''
--
Gitblit v1.9.3