| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <template>
- <el-dialog
- v-if="visible"
- :title="form.id?'编辑文旅岗位目录':'新建文旅岗位目录'"
- :visible.sync="visible"
- width="600px"
- >
- <el-form v-loading="isLoading" :model="form" label-width="100px" label-position="top">
- <el-row :gutter="16">
- <el-col :span="12">
- <el-form-item label="职业名称">
- <el-input v-model="form.name" />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="排序">
- <el-input-number v-model="form.sortNumber" :min="0" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-form-item label="备注说明">
- <el-input v-model="form.remark" type="textarea" rows="5" />
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="visible = false">取 消</el-button>
- <el-button type="primary" @click="handleSubmit">确 定</el-button>
- </div>
- </el-dialog>
- </template>
- <style type="text/css">
- .image {
- width: 100%;
- height: 100%;
- border-radius: 6px;
- }
- </style>
- <script>
- import { save, updateById } from '@/api/category/occupation'
- export default {
- data() {
- return {
- visible: false,
- isLoading: false,
- form: {},
- businessLicense: null,
- legalPersonIdCardA: null,
- legalPersonIdCardB: null,
- lng: null,
- lat: null
- }
- },
- mounted() {
- },
- methods: {
- open(data) {
- this.visible = true
- this.isLoading = false
- this.form = {}
- console.log(data)
- if (data && data.id) {
- this.lat = data.lat
- this.lng = data.lng
- this.businessLicense = data.businessLicense
- this.legalPersonIdCardB = data.legalPersonIdCardB
- this.legalPersonIdCardA = data.legalPersonIdCardA
- }
- this.form = Object.assign({}, data)
- },
- mapClick(e) {
- console.log(e)
- this.lng = e.latLng.lng
- this.lat = e.latLng.lat
- },
- handleSubmit() {
- this.isLoading = true
- const param = {
- ...this.form,
- 'lng': this.lng,
- 'lat': this.lat,
- 'businessLicense': this.businessLicense,
- 'legalPersonIdCardB': this.legalPersonIdCardB,
- 'legalPersonIdCardA': this.legalPersonIdCardA
- }
- console.log(param)
- if (this.form.id) {
- updateById(this.form.id, param).then(() => {
- this.visible = false
- this.$emit('ok')
- }).finally(() => {
- this.isLoading = false
- })
- } else {
- save(param).then(res => {
- this.visible = false
- this.$emit('ok')
- }).finally(() => {
- this.isLoading = false
- })
- }
- }
- }
- }
- </script>
|