From 2fbf3247052e795dfbc3a30a02ce704dc5488c7a Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Fri, 24 May 2024 08:41:32 +0800
Subject: [PATCH] E呼即办页面优化

---
 src/views/cGovernance/taskECallTwo/index.vue |   95 ++++++++++++++++++++++++++++++++++-------------
 1 files changed, 69 insertions(+), 26 deletions(-)

diff --git a/src/views/cGovernance/taskECallTwo/index.vue b/src/views/cGovernance/taskECallTwo/index.vue
index 32086d8..65c077d 100644
--- a/src/views/cGovernance/taskECallTwo/index.vue
+++ b/src/views/cGovernance/taskECallTwo/index.vue
@@ -5,9 +5,12 @@
       v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen"
       @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
       @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
-      <template slot="menuLeft">
-        <el-button size="small" icon="el-icon-delete" plain v-if="permission.article_delete" @click="handleDelete">删
-          除
+
+      <template slot-scope="{row, size}" slot="menu">
+        <el-button size="small" type="text" icon="el-icon-edit" plain @click="handleEdit(row)">编辑
+        </el-button>
+
+        <el-button size="small" type="text" icon="el-icon-delete" plain @click="rowDel(row)">删除
         </el-button>
       </template>
 
@@ -31,6 +34,21 @@
       </template>
 
     </avue-crud>
+
+    <el-dialog title="编辑" append-to-body :visible.sync="editPopup" center @close="editClose">
+      <avue-form ref="formRef" :option="option" v-model="editForm" @submit="rowUpdate">
+
+        <template slot-scope="{type, disabled}" slot="sceneGeo">
+          <el-button type="primary" style="font-size: 14px;  border: none;" icon="el-icon-map-location"
+            @click="openMapTwo()">获取位置</el-button>
+
+          <avue-input-map style="position: fixed; top: -11111111111111px;" ref="avueInputMapTwo"
+            :params="editForm.params" placeholder="请选择地图" v-model="editForm.sceneGeo"></avue-input-map>
+        </template>
+
+      </avue-form>
+
+    </el-dialog>
 
     <el-dialog title="分享" append-to-body :visible.sync="sharePopup" center @close="popupClose">
       <div style="display: flex; justify-content: center; ">
@@ -83,7 +101,9 @@
       }
 
       return {
+        editPopup: false,
         form: {},
+        editForm: {},
         query: {},
         loading: true,
         page: {
@@ -102,6 +122,8 @@
           searchShow: true,
           searchMenuSpan: 3,
           menuWidth: 310,
+          delBtn: false,
+          editBtn: false,
 
           height: "auto",
           calcHeight: 54,
@@ -307,16 +329,16 @@
               label: "归口类型",
               prop: "issueClazz",
               type: "tree",
-              dicUrl: "/api/blade-issueClazz/issueClazz/tree",
-              props: {
-                label: "title",
-                value: "id"
-              },
-              rules: [{
-                required: true,
-                message: "请选择归口类型",
-                trigger: "blur",
-              }, ],
+              // dicUrl: "/api/blade-issueClazz/issueClazz/tree",
+              // props: {
+              //   label: "title",
+              //   value: "id"
+              // },
+              // rules: [{
+              //   required: true,
+              //   message: "请选择归口类型",
+              //   trigger: "blur",
+              // }, ],
               span: 12,
             },
             {
@@ -435,13 +457,34 @@
       "form.sceneGeo": {
         // form是表单或者表格绑定的数据集,v-model='form'
         handler(val) {
-          console.log("*****123**********" + val)
-          console.log("*****456**********" + typeof(val))
           if (typeof val == "object") {
+            if (!val) {
+              return
+            }
+            console.log("*****789**********" + val)
+
             var arr = val
             //经纬度替换
             this.form.sceneGeoLat = arr[1]
             this.form.sceneGeoLng = arr[0]
+          }
+        },
+        immediate: true,
+      },
+
+      "editForm.sceneGeo": {
+        // form是表单或者表格绑定的数据集,v-model='form'
+        handler(val) {
+          if (typeof val == "object") {
+            if (!val) {
+              return
+            }
+            console.log("*****789**********" + val)
+
+            var arr = val
+            //经纬度替换
+            this.editForm.sceneGeoLat = arr[1]
+            this.editForm.sceneGeoLng = arr[0]
           }
         },
         immediate: true,
@@ -483,6 +526,10 @@
         this.$refs.avueInputMap.box = true
         console.log(this.$refs.avueInputMap)
       },
+      openMapTwo() {
+        this.$refs.avueInputMapTwo.box = true
+        console.log(this.$refs.avueInputMap)
+      },
 
       showStringDispose(row, type) {
         row[type] = !row[type]
@@ -520,15 +567,7 @@
         )
       },
       rowUpdate(row, index, done, loading) {
-        if (row.imageUrls.length > 0) {
-          var urls = []
-          var split = row.imageUrls.split(",")
-          split.forEach(url => {
-            var names = url.split("jczz/")
-            urls.push(names[1])
-          })
-          row.imageUrls = urls.join(",")
-        }
+
         update(row).then(
           () => {
             this.onLoad(this.page)
@@ -551,7 +590,7 @@
             type: "warning",
           })
           .then(() => {
-            return remove(row.id)
+            return remove(row.orderId)
           })
           .then(() => {
             this.onLoad(this.page)
@@ -613,6 +652,10 @@
       popupClose() {
         this.sharePopup = false
       },
+      handleEdit(row) {
+        this.editForm = row
+        this.editPopup = true
+      },
       handleDelete() {
         if (this.selectionList.length === 0) {
           this.$message.warning("请选择至少一条数据")
@@ -639,7 +682,7 @@
         if (["edit", "view"].includes(type)) {
           getDetail(this.form.orderId).then((res) => {
             this.form = res.data.data
-            this.form.sceneAddr = [this.form.sceneGeoLng, this.form.sceneGeoLat, this.form.sceneAddr].join(',')
+            // this.form.sceneAddr = [this.form.sceneGeoLng, this.form.sceneGeoLat, this.form.sceneAddr].join(',')
             // if (this.form.imageUrls.length > 0) {
             //   var urls = []
             //   var names = this.form.imageUrls.split(",")

--
Gitblit v1.9.3