Commit 90059ccf by cwq0219

编辑退出

1 parent ffc47f6f
......@@ -61,6 +61,7 @@ export default {
addOrEdit: 1,
id: ''
},
editStatus: false,
// 商品-多选
isMutiSelectVisible: false,
searchProForm: {},
......@@ -115,6 +116,15 @@ export default {
}
},
watch: {
editForm: {
handler(val) {
this.editStatus = true
},
deep: true
}
},
mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
......@@ -135,6 +145,9 @@ export default {
goodsImage: item.goods.goodsImage
})
})
this.$nextTick(()=>{
this.editStatus = false
})
})
},
handleMutiProClose(targetItem) {
......@@ -183,16 +196,30 @@ export default {
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleCancel()
this.cancelJump()
}
})
}
})
},
handleCancel() {
cancelJump() {
this.$router.push({
path: '/classifyList/index'
})
},
handleCancel() {
if (this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.cancelJump()
})
.catch(() => {})
} else {
this.cancelJump()
}
}
}
}
......
......@@ -117,6 +117,7 @@ export default {
addOrEdit: 1,
id: ''
},
editStatus: false,
apear: '',
minPirce: '',
//全部商品时最低价
......@@ -266,6 +267,12 @@ export default {
},
watch: {
editForm: {
handler(val) {
this.editStatus = true
},
deep: true
},
'editForm.effectiveDays'(newValue, oldValue) {
this.editForm.effectiveDays = limitPrice(newValue, oldValue, 3, 0)
},
......@@ -466,6 +473,9 @@ export default {
})
}
this.tableParams.tableOption = false //去掉操作栏
this.$nextTick(()=>{
this.editStatus = false
})
})
},
......@@ -587,16 +597,30 @@ export default {
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleCancel()
this.cancelJump()
}
})
}
})
},
handleCancel() {
cancelJump() {
this.$router.push({
path: '/couponManage/index'
})
},
handleCancel() {
if (this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.cancelJump()
})
.catch(() => {})
} else {
this.cancelJump()
}
}
}
}
......
......@@ -99,6 +99,7 @@ export default {
// return time.getTime() > Date.now() - 8.64e6
// }
// },
editStatus: false,
routeInfo: {
// 1-新增;2-编辑;3-查看
addOrEdit: 1,
......@@ -186,6 +187,12 @@ export default {
},
watch: {
editForm: {
handler(val) {
this.editStatus = true
},
deep: true
},
'editForm.effectiveDays'(newValue, oldValue) {
this.editForm.effectiveDays = limitPrice(newValue, oldValue, 3, 0)
},
......@@ -224,6 +231,9 @@ export default {
if (this.editForm.effectiveType == 2) {
this.editForm.effectiveTime = [this.editForm.effectiveStartTime, this.editForm.effectiveEndTime]
}
this.$nextTick(()=>{
this.editStatus = false
})
})
},
......@@ -300,16 +310,30 @@ export default {
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleCancel()
this.cancelJump()
}
})
}
})
},
handleCancel() {
cancelJump() {
this.$router.push({
path: '/couponManage/index'
})
},
handleCancel() {
if (this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.cancelJump()
})
.catch(() => {})
} else {
this.cancelJump()
}
}
}
}
......
......@@ -70,6 +70,7 @@ export default {
footerLeft: '0',
footerWidth: '0',
editChildRef: 'editChildRef',
editStatus: false,
// pickerOptions: {
// disabledDate(v) {//禁用当前之前的日期
// return v.getTime() < new Date().getTime() - 86400000;
......@@ -165,6 +166,12 @@ export default {
},
watch: {
editForm: {
handler(val) {
this.editStatus = true
},
deep: true
},
'editForm.effectiveDays'(newValue, oldValue) {
this.editForm.effectiveDays = limitPrice(newValue, oldValue, 3, 0)
},
......@@ -203,6 +210,9 @@ export default {
if (this.editForm.effectiveType == 2) {
this.editForm.effectiveTime = [this.editForm.effectiveStartTime, this.editForm.effectiveEndTime]
}
this.$nextTick(()=>{
this.editStatus = false
})
})
},
......@@ -279,16 +289,30 @@ export default {
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleCancel()
this.cancelJump()
}
})
}
})
},
handleCancel() {
cancelJump() {
this.$router.push({
path: '/couponManage/index'
})
},
handleCancel() {
if (this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.cancelJump()
})
.catch(() => {})
} else {
this.cancelJump()
}
}
}
}
......
......@@ -318,7 +318,7 @@
</div>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" @click="handleConfirm">确定</el-button>
<el-button v-if="routeInfo.addOrEdit != '3'" type="primary" @click="handleConfirm">确定</el-button>
<el-button type="default" @click="handleCancel">取消</el-button>
</div>
<el-dialog :visible.sync="isImgVisible">
......@@ -421,6 +421,7 @@ export default {
groupOrStore: '',
id: ''
},
editStatus: false,
// 选择门店
relateStoreVisible: false,
storeApi: this.$apis.common.getMerchantList,
......@@ -775,6 +776,12 @@ export default {
},
watch: {
editForm: {
handler(val) {
this.editStatus = true
},
deep: true
},
// 零售价
'editForm.retailPrice'(newValue, oldValue) {
this.editForm.retailPrice = limitPrice(newValue, oldValue, 5, 2)
......@@ -1182,6 +1189,9 @@ export default {
this.handleTypeChange(this.editForm.deliveryType)
this.getWechatImgList()
// console.log(this.editForm)
this.$nextTick(()=>{
this.editStatus = false
})
})
},
getOptionsList(idx, formName, hasAll = true, refreshSigle) {
......@@ -1352,14 +1362,28 @@ export default {
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleCancel()
this.cancelJump()
}
})
},
handleCancel() {
cancelJump() {
this.$router.push({
path: this.routeInfo.groupOrStore == 1 ? '/productGroup/index' : '/productStore/index'
})
},
handleCancel() {
if (this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.cancelJump()
})
.catch(() => {})
} else {
this.cancelJump()
}
}
}
}
......
......@@ -76,7 +76,7 @@
</div>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" @click="handleConfirm">确定</el-button>
<el-button v-if="routeInfo.addOrEdit != '3'" type="primary" @click="handleConfirm">确定</el-button>
<el-button type="default" @click="handleCancel">取消</el-button>
</div>
</div>
......@@ -108,6 +108,7 @@ export default {
priceReg: /^\d[\d\.]*$/,
numReg: /^[1-9]\d*$/
},
editStatus: false,
/* eslint-enable */
routeInfo: {
// 1-新增;2-编辑;3-查看
......@@ -154,6 +155,12 @@ export default {
},
watch: {
editForm: {
handler(val) {
this.editStatus = true
},
deep: true
},
'editForm.retailPrice'(newValue, oldValue) {
this.editForm.retailPrice = limitPrice(newValue, oldValue, 5, 2)
}
......@@ -188,6 +195,9 @@ export default {
}
this.mainImgUrl = this.editForm.goodsDetailImageList[0].content
this.moveNum = this.editForm.goodsDetailImageList.length > 4 ? this.editForm.goodsDetailImageList.length - 4 : 0
this.$nextTick(()=>{
this.editStatus = false
})
})
},
// 规格值解构
......@@ -351,14 +361,28 @@ export default {
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleCancel()
this.cancelJump()
}
})
},
handleCancel() {
cancelJump() {
this.$router.push({
path: '/productStore/index'
})
},
handleCancel() {
if (this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.cancelJump()
})
.catch(() => {})
} else {
this.cancelJump()
}
}
}
}
......
......@@ -57,6 +57,7 @@ export default {
addOrEdit: 1,
id: ''
},
editStatus: false,
labelWidth: '144px',
editForm: {
// 专区类型(1发现频道,2商城专区)
......@@ -128,6 +129,15 @@ export default {
}
},
watch: {
editForm: {
handler(val) {
this.editStatus = true
},
deep: true
}
},
mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
......@@ -145,6 +155,9 @@ export default {
this.editForm.merchantList.forEach(item => {
item.merchantNo = item.merchantId
})
this.$nextTick(()=>{
this.editStatus = false
})
})
},
// 选择门店
......@@ -198,16 +211,30 @@ export default {
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleCancel()
this.cancelJump()
}
})
}
})
},
handleCancel() {
cancelJump() {
this.$router.push({
path: '/zoneList/index'
})
},
handleCancel() {
if (this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.cancelJump()
})
.catch(() => {})
} else {
this.cancelJump()
}
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!