123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <template>
- <a-modal
- :title="modalTitle"
- :width="800"
- :visible="visible"
- :confirmLoading="confirmLoading"
- @cancel="handleCancel"
- >
- <div style='text-align: center;'>
- <h1>数字工厂巡检记录填报</h1>
- </div>
- <a-form :form="form">
- <row-list :col="1">
- <row-item v-for="(item, index) in data" :key="index">
- <a-form-item
- :label="item.name"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input v-if="item.type === 1" :placeholder='item.remark' />
- <a-select
- v-if="item.type === 2"
- style="width: 120px"
- >
- <a-select-option
- v-for="option in item.selectValue"
- :key="option.value"
- :label="option.value"
- :value="option.value">{{ option.value }}</a-select-option>
- </a-select>
- <a-span v-if="item.type === 2" style='padding-left: 15%;'>填报备注:{{ item.remark }}</a-span>
- </a-form-item>
- </row-item>
- </row-list>
- </a-form>
- <template slot="footer">
- <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">返回</a-button>
- </template>
- </a-modal>
- </template>
- <script>
- export default {
- name: 'PreviewForm',
- data () {
- return {
- confirmLoading: false,
- modalTitle: null,
- form: this.$form.createForm(this),
- isDictType: false,
- visible: false,
- selectFlag: false,
- // 下拉框map
- useTypeMap: {},
- typeMap: {},
- codeValueMap: {},
- natureMap: {},
- data: []
- }
- },
- props: {},
- created () {
- },
- methods: {
- base (record) {
- this.visible = true
- this.data = []
- for (let i = 0; i < record.length; i++) {
- if (record[i].type === 2) {
- if (typeof record[i].selectValue !== 'object') {
- record[i].selectValue = JSON.parse(record[i].selectValue)
- }
- }
- this.data.push(record[i])
- }
- },
- handleCancel (values) {
- this.visible = false
- this.confirmLoading = false
- this.form.resetFields()
- if (this.BaseTool.Object.isNotBlank(values)) {
- this.$emit('ok', values)
- }
- }
- }
- }
- </script>
|