12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <template>
- <el-dialog
- title="新建售后退货"
- :center="true"
- align="left"
- top="22vh"
- width="1000px"
- :close-on-click-modal="false"
- :visible.sync="showModelThis"
- element-loading-text="拼命加载中"
- element-loading-spinner="el-icon-loading"
- element-loading-background="rgba(0, 0, 0, 0.8)"
- @close="showModelThis = false"
- >
- <el-card v-loading="loading" style="margin-top: -20px">
- <add-edit-form
- v-if="showModel"
- :id="id"
- :sitem="sitem"
- :show-model="showModel"
- :is-detail="isDetail"
- @closeModel="handClick"
- @refresh="refresh"
- />
- </el-card>
- </el-dialog>
- </template>
- <script>
- import addEditForm from './addEditForm.vue'
- export default {
- name: 'Handover',
- components: {
- addEditForm
- },
- props: ['showModel', 'id', 'isDetail', 'sitem'],
- data() {
- return {
- sitem: null,
- title: '',
- showModelThis: this.showModel
- }
- },
- watch: {
- showModel: function(val) {
- this.showModelThis = val
- if (val) {
- this.initForm()
- }
- },
- showModelThis(val) {
- if (!val) {
- this.$emit('cancel')
- }
- }
- },
- methods: {
- async initForm() {
- this.loading = true
- if (this.id === 'add') {
- this.title = '新建售后退货'
- this.rulesThis = this.rules
- } else {
- if (this.isDetail) {
- this.rulesThis = {}
- } else {
- this.rulesThis = this.rules
- }
- }
- this.loading = false
- },
- handClick(e) {
- this.showModelThis = e
- },
- refresh(e) {
- console.log(e)
- this.showModelThis = e
- this.$emit('refresh', true)
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- </style>
|