Commit 90059ccf by cwq0219

编辑退出

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