123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227 |
- <template>
- <ele-form-dialog
- v-bind="formConfig"
- v-model="formFieldsData"
- v-dialogDrag
- :title="title"
- :request-fn="handleFormSubmit"
- :visible.sync="DialogVisible"
- width="450px"
- custom-class="abow_dialog"
- label-width="100px"
- label-position="left"
- :dialogAttrs="{ 'close-on-click-modal': false,'top':'8vh'}"
- />
- </template>
- <script>
- export default {
- props: ["formModelVisible", "title"],
- data() {
- return {
- formData: {},
- formFieldsData: {
- is_used:"",
- department_id: "",
- number: "",
- name: "",
- model: "",
- outside:"",
- torque:"",
- stress:"",
- bolt_size:"",
- bolt_number:"",
- install_position:"",
- brand:"",
- supplier:"",
- out_date:"",
- remark: "",
- },
- url: "flange",
- formConfig: {
- formDesc: {
- is_used: {
- type: "select",
- label: "使用状态",
- isOptions: true,
- options: [
- {
- text: "使用",
- value: 1
- },
- {
- text: "未使用",
- value: -1
- },
- {
- text: "已废弃",
- value: -2
- }
- ]
- },
-
- department_id: {
- type: "cascader",
- label: "所属部门",
- isOptions: true,
- options: [],
- required: true,
- attrs: {
- props: {
- label: "department_name",
- value: "id",
- emitPath: false,
- checkStrictly: true
- }
- }
- },
- //风场id
- fan_id:{
- type: "cascader",
- label: "风机编号",
- isOptions: true,
- options: [],
- required: true,
- attrs: {
- //查询
- filterable:true,
- props: {
- label: "text",
- value: "value",
- emitPath: false,
- checkStrictly: false,
- multiple:false
- }
- }
- },
- number: {
- type: "input",
- label: "编号",
-
- },
- name: {
- type: "input",
- label: "名称",
- required:true
- },
- model: {
- type: "select",
- label: "型号",
- required:true,
- isOptions: true,
- options:[]
- },
- outside:{
- type: "input",
- label: "外径"
- },
- torque:{
- type: "number",
- label: "扭矩",
- required:true,
- rules: [
- {
- type: "number",
- trigger: "blur",
- }
- ]
- },
- stress:{
- type: "number",
- label: "压力",
- rules: [
- {
- type: "number",
- trigger: "blur",
- message: "必须是数字"
- }
- ]
- },
- bolt_size: {
- type: "number",
- label: "螺栓尺寸",
- rules: [
- {
- type: "number",
- trigger: "blur",
- message: "必须是数字"
- }
- ]
- },
- bolt_number: {
- type: "number",
- label: "螺栓数量",
- rules: [
- {
- type: "number",
- trigger: "blur",
- message: "必须是数字"
- }
- ]
- },
- install_position:{
- type: "input",
- label: "安装位置"
- },
- brand: {
- type: "input",
- label: "品牌"
- },
- supplier: {
- type: "input",
- label: "供应商"
- },
- out_date: {
- type: "date",
- label: "出厂日期"
- },
- remark: {
- type: "textarea",
- label: "备注"
- }
- },
- order: ["is_used","department_id","fan_id","number", "name", "model","outside","torque","stress","bolt_size","bolt_number","install_position","brand","supplier","out_date","remark"]
- }
- };
- },
- created() {
- this.$http.get("departments").then(response => {
- this.formConfig.formDesc.department_id.options = response.data;
- });
-
- this.$http.get("getwindfan").then(response => {
- this.formConfig.formDesc.fan_id.options = response.data;
- });
- this.$http.get("devicetype").then(response => {
- this.formConfig.formDesc.model.options = response.data;
- });
- },
- methods: {
- handleFormSubmit(data) {
- this.$parent.handleSubmit();
- },
- handleRequest(data) {
- return Promise.resolve();
- },
- handleRequestSuccess() {
- this.$message.success("发送成功");
- }
- },
- computed: {
- DialogVisible: {
- set(val) {
- this.$emit("sendVal", val); // 表示将子组件改变的值传递给父组件
- },
- get() {
- return this.formModelVisible; // 表示获取父组件的值
- }
- }
- }
- };
- </script>
|