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

View File

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