This commit is contained in:
faiz 2024-04-29 17:12:33 +08:00
parent 61b0c2a8d9
commit f64ab85e63
2 changed files with 31 additions and 7 deletions

View File

@ -212,6 +212,10 @@ export default {
componentKey: {
type: Number,
default: 0
},
tempType:{
type: String,
default: 'msgbox'
}
},
data() {
@ -300,7 +304,8 @@ export default {
},
methods: {
resetForm(formName) {
this.$msgbox.close()
this.tempType=='msgbox'&&this.$msgbox.close()
this.$emit('resetForm')
this.$refs[formName].resetFields()
},
onClose(formName) {
@ -439,10 +444,11 @@ export default {
this.tempId === 0 ? templateCreateApi(data).then(res => {
this.$message.success(res.message)
setTimeout(() => {
this.$msgbox.close()
this.tempType=='msgbox'&&this.$msgbox.close()
}, 500)
setTimeout(() => {
this.$emit('getList')
this.$emit('onsubmit')
this.$refs[formName].resetFields()
}, 600)
}).catch(res => {
@ -450,10 +456,11 @@ export default {
}) : templateUpdateApi(this.tempId, data).then(res => {
this.$message.success(res.message)
setTimeout(() => {
this.$msgbox.close()
this.tempType=='msgbox'&&this.$msgbox.close()
}, 500)
setTimeout(() => {
this.$emit('getList')
this.$emit('onsubmit')
this.$refs[formName].resetFields()
}, 600)
}).catch(res => {

View File

@ -2047,6 +2047,14 @@
@close="closeRecommend"
/>
</el-dialog>
<el-dialog
title="运费模板"
top="4vh"
:visible.sync="dialogVisible"
width="80%"
>
<templatesFrom tempType='dialog' :tempId='0' @onsubmit='onsubmit' @resetForm="resetForm" @getList='getShippingList'/>
</el-dialog>
</div>
</template>
@ -2541,6 +2549,7 @@ export default {
width: 95
},
product_id: '',
dialogVisible:false,
goodList: [],
unitList: [],
recommendVisible: false,
@ -2648,6 +2657,13 @@ export default {
// console.log(!!this.$route.params.id);
// return !!this.$route.params.id
// },
onsubmit(){
this.dialogVisible = false
},
resetForm(){
this.dialogVisible = false
},
//
handleCost(val,i,e,type){
if(type == 'batchAdd'){
i=='price'?val.cost = (val.price * 0.6).toFixed(2):''
@ -3219,10 +3235,11 @@ export default {
},
//
addTem() {
const _this = this
this.$modalTemplates(0, function() {
_this.getShippingList()
})
// const _this = this
// this.$modalTemplates(0, function() {
// _this.getShippingList()
// })
this.dialogVisible = true
},
//
addServiceTem() {