| | |
| | | return { |
| | | title: "编辑地块", |
| | | form: {}, |
| | | isFarmNameCk:false, |
| | | option: { |
| | | emptyBtn: false, |
| | | submitText: "保存", |
| | | gutter: 30, |
| | | farmName:'', |
| | | column: [ |
| | | { |
| | | label: "地块名称", |
| | |
| | | value: "id" |
| | | }, |
| | | slot: true, |
| | | click:function (value){ |
| | | this.isFarmNameCk = true |
| | | }, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择所属农场", |
| | |
| | | }, |
| | | methods: { |
| | | initData (tenantId) { |
| | | // getDeptTree(tenantId).then(res => { console.log(res) |
| | | |
| | | // const column = this.findObject(this.option.column, "deptId"); |
| | | // column.dicData = res.data.data; |
| | | // }); |
| | | const data = { |
| | | deptId: this.userInfo.dept_id |
| | | } |
| | |
| | | this.$store.commit('clear_polygon') |
| | | //计算当前时间 |
| | | this.visible = true |
| | | console.log('land1111111111111:',this.$route.query) |
| | | this.form.landName = this.$route.query.landName |
| | | this.form.id = this.$route.query.id |
| | | this.form.landArea = this.$route.query.landArea |
| | | this.form.farmId = this.$route.query.farmId |
| | | this.form.$farmId = this.$route.query.deptname |
| | | this.form.landUnit = this.$route.query.landUnit |
| | | this.form.landType = this.$route.query.landType |
| | | this.form.landRange = this.$route.query.landRange |
| | | |
| | | |
| | | this.form.landRange = this.form.landRange.replace(/POLYGON\(\(/g, '') |
| | | this.form.landRange = this.form.landRange.replace(/\)\)/g, '') |
| | | this.form.landRange = this.form.landRange.split(',') |
| | | this.form.landRange = this.form.landRange.replace(/POLYGON\(\(/g, '') |
| | | this.form.landRange = this.form.landRange.replace(/\)\)/g, '') |
| | | this.form.landRange = this.form.landRange.split(',') |
| | | |
| | | }, |
| | | // 表单提交 |
| | |
| | | } |
| | | |
| | | update(row).then(() => { |
| | | that.$emit("refreshOnLoad") |
| | | that.$refs.form.resetFields() |
| | | that.visible = false |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | done() |
| | | that.$emit("refreshOnLoad") |
| | | that.$refs.form.validate((vaild,done)=>{ |
| | | if (vaild) { |
| | | that.visible = false |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | done() |
| | | this.form.landRange = this.$route.query.landRange |
| | | this.form.dica = row.$landUnit |
| | | this.form.dic = row.$landType |
| | | this.form.deptname = row.$farmId |
| | | |
| | | var arr = []; |
| | | this.$store.state.tags.tagList.forEach((item) => { |
| | | if (item.label != "地块详情") { |
| | | arr.push(item); |
| | | } |
| | | }); |
| | | this.$store.state.tags.tagList = arr; |
| | | this.$router.replace({ path: `/LandDetail`, query: this.form }); |
| | | } |
| | | |
| | | }) |
| | | |
| | | }, error => { |
| | | loading() |
| | | window.console.log(error) |