| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- <template>
- <j-modal
- :title="title"
- :width="700"
- :visible="visible"
- :mask-closable="false"
- cancel-text="关闭"
- @close="close"
- >
- <a-form-model ref="form" :label-col="labelCol" :wrapper-col="wrapperCol" :rules="validatorRules" :model="model">
- <a-form-model-item label="支柱号" prop="zzh">
- <a-input v-model="model.zzh" />
- </a-form-model-item>
- <a-form-model-item label="所属部门" prop="bm">
- </a-form-model-item>
- <a-form-model-item label="线别" prop="xb">
- <j-dict-select-tag
- v-model="model.xb"
- dict-code="word_type"
- />
- </a-form-model-item>
- <a-form-model-item label="站场区间" prop="qj">
- <j-dict-select-tag
- v-model="model.qj"
- dict-code="word_type"
- />
- </a-form-model-item>
- <a-form-model-item label="行别" prop="hb">
- <j-dict-select-tag
- type="radioButton"
- v-model="model.hb"
- dict-code="word_type"
- />
- </a-form-model-item>
- <a-form-model-item label="公里标" prop="glb">
- <a-input v-model="model.glb" />
- </a-form-model-item>
- <a-form-model-item label="支柱类型" prop="zzlx">
- <j-dict-select-tag
- v-model="model.zzlx"
- dict-code="word_type"
- />
- </a-form-model-item>
- <a-form-model-item label="支柱型号" prop="zzxh">
- <j-dict-select-tag
- v-model="model.zzxh"
- dict-code="word_type"
- />
- </a-form-model-item>
- <a-form-model-item label="支柱用途" prop="zzyt">
- <j-dict-select-tag
- v-model="model.zzyt"
- dict-code="word_type"
- />
- </a-form-model-item>
- <a-form-model-item label="材质" prop="cz">
- <j-dict-select-tag
- v-model="model.cz"
- dict-code="word_type"
- />
- </a-form-model-item>
- <a-form-model-item label="直线/曲外/曲内" prop="zxqwqn">
- <j-dict-select-tag
- type="radioButton"
- v-model="model.zxqwqn"
- dict-code="word_type"
- />
- </a-form-model-item>
- </a-form-model>
- </j-modal>
- </template>
- <script>
- import { httpAction } from '@/api/request'
- import JModal from '@/components/JModal'
- export default {
- name: 'CheckAndEditModel',
- components: {
- JModal
- },
- data() {
- return {
- labelCol: { span: 4 },
- wrapperCol: { span: 19 },
- dataSource: [],
- title: '',
- visible: false,
- isCheck: false,
- model: {},
- validatorRules: {
- name: [{ required: true, message: '请输入' }],
- type: [{ required: true, message: '请选择' }]
- },
- url: {
- add: '/business/catenary/bus/zzdzxx/add',
- edit: '/business/catenary/bus/zzdzxx/update'
- }
- }
- },
- created() {
- },
- methods: {
- add() {
- this.model = {}
- this.visible = true
- },
- edit(record) {
- debugger
- this.model = Object.assign({}, record)
- this.visible = true
- },
- close(isSubmit) {
- if (isSubmit) {
- this.checkData()
- } else {
- this.visible = false
- }
- },
- checkData() {
- this.$refs.form.validate(valid => {
- if (valid) {
- this.saveData()
- } else {
- return false
- }
- })
- },
- saveData() {
- let url, type
- if (!this.model.id) {
- url = this.url.add
- type = 'post'
- } else {
- debugger
- url = this.url.edit
- type = 'put'
- }
- httpAction(url, this.model, type).then((res) => {
- if (res.code === 200) {
- this.$message.success(res.msg)
- this.$emit('ok')
- this.visible = false
- } else {
- console.log(res)
- }
- })
- }
- }
- }
- </script>
|