Selaa lähdekoodia

feat:样式修改,设备管理的参数设置的修改和查询详情

allen 2 vuotta sitten
vanhempi
commit
cfc81abb94

BIN
public/static/template.xlsx


+ 16 - 0
src/api/tmn/index.js

@@ -32,3 +32,19 @@ export const getBaseStatInfo = (query) => {
     params: query
   });
 };
+// 获取设备配置信息
+export const getTmnconfigInfo = (query) => {
+  return request({
+    url: '/wpr/tmnconfig/info',
+    method: 'get',
+    params: query
+  });
+};
+// 更新设备配置信息
+export const addTmnconfig = (data) => {
+  return request({
+    url: '/wpr/tmnconfig/add',
+    method: 'post',
+    data
+  });
+};

+ 1 - 2
src/utils/request.js

@@ -10,7 +10,7 @@ import { saveAs } from 'file-saver';
 let downloadLoadingInstance;
 // 是否显示重新登录
 export const isRelogin = { show: false };
-
+console.log(process.env.VUE_APP_BASE_API, 'process.env.VUE_APP_BASE_API');
 axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8';
 // 创建axios实例
 const service = axios.create({
@@ -98,7 +98,6 @@ service.interceptors.response.use(
       res.request.responseType === 'blob' ||
       res.request.responseType === 'arraybuffer'
     ) {
-      
       return res.data;
     }
     // if (code === '200001' || code === '300002') {

+ 48 - 51
src/views/infrastructure/components/setPreferenc.vue

@@ -20,18 +20,18 @@
         <el-col :span="24">
           <el-row>
             <el-col :span="12">
-              <el-form-item label="电表品牌型号:" prop="productName">
+              <el-form-item label="电表品牌型号:" prop="tmnconfigElecmetermodel">
                 <el-input
                   placeholder="请输入"
-                  v-model="tmnBizcode1">
+                  v-model="baseForm.tmnconfigElecmetermodel">
                 </el-input>
               </el-form-item>
             </el-col>
             <el-col :span="12">
-              <el-form-item label="电表品牌型号:" prop="productName">
+              <el-form-item label="水表品牌型号:" prop="tmnconfigWatermetermodel">
                 <el-input
                   placeholder="请输入"
-                  v-model="tmnBizcode2">
+                  v-model="baseForm.tmnconfigWatermetermodel">
                 </el-input>
               </el-form-item>
             </el-col>
@@ -40,18 +40,18 @@
         <el-col :span="24">
           <el-row>
             <el-col :span="12">
-              <el-form-item label="计算模式:" prop="productName">
+              <el-form-item label="计算模式:" prop="tmnconfigMeteredmodel">
                 <el-input
                   placeholder="请输入"
-                  v-model="textarea">
+                  v-model="baseForm.tmnconfigMeteredmodel">
                 </el-input>
               </el-form-item>
             </el-col>
             <el-col :span="12">
-              <el-form-item label="以电折水系数:" prop="productName">
+              <el-form-item label="以电折水系数:" prop="tmnconfigCoefficient">
                 <el-input
                   placeholder="请输入"
-                  v-model="textarea">
+                  v-model="baseForm.tmnconfigCoefficient">
                 </el-input>
               </el-form-item>
             </el-col>
@@ -77,84 +77,81 @@
 </template>
 
 <script>
-import { assign } from 'lodash-es';
+import { getTmnconfigInfo, addTmnconfig } from '@/api/tmn/index.js'
 export default {
   name: 'setPreferenc',
   props: {
-    data: {
-      default() {
-        return {};
-      }
-    },
     visible: {
       type: Boolean,
       default: false
-    }
+    },
+    tmnId: {
+      type: String,
+      default: ''
+     }
   },
   data() {
     return {
-      tmnBizcode1: '',
-      tmnBizcode2: '',
-      textarea:'',
       dialogSubmitLoading: false,
       dialogVisible: false,
       baseForm: {
-        productName: '',
-        stockAmount: '',
-        goodsSpecValue: '',
-        supplierId: '',
+        tmnconfigElecmetermodel: '',//电表品牌型号
+        tmnconfigWatermetermodel: '',//水表品牌型号
+        tmnconfigMeteredmodel: '', //计量模式
+        tmnconfigCoefficient: '',//以电折水系数
       },
-      hasFetched: false,
+      
       rules: {
-        stockAmount: [
-          { required: true, message: '请选择负责人', trigger: 'blur' }
-        ],
-        sourceinfoId: [
-          { required: true, message: '请选择管辖范围', trigger: 'blur' }
+        tmnconfigElecmetermodel: [
+          { required: true, message: '电表品牌型号', trigger: 'blur' }
         ],
-        productName: [
-          { required: true, message: '请输入协会名称', trigger: 'blur' }
+        tmnconfigWatermetermodel: [
+          { required: true, message: '水表品牌型号', trigger: 'blur' }
         ],
-        supplierId: [
-          { required: false, message: '请输入协会介绍', trigger: 'blur' }
+        tmnconfigMeteredmodel: [
+          { required: true, message: '计量模式', trigger: 'blur' }
         ],
-        goodsSpecValue: [
-          { required: true, message: '请选择规格', trigger: 'blur' }
+        tmnconfigCoefficient: [
+          { required: true, message: '以电折水系数', trigger: 'blur' }
         ]
       }
     };
   },
   watch: {
     visible(val) {
+      val && this.getTmnconfigInfoHandler(this.tmnId)
       if (val !== this.dialogVisible) {
         this.dialogVisible = val;
-        if (val) {
-          assign(this.baseForm, this.data);
-          if (!this.hasFetched) {
-            this.hasFetched = true;
-          }
-        }
       }
     },
-    data: {
-      deep: true,
-      handler(val) {
-        assign(this.baseForm, val);
-      }
-    }
   },
   methods: {
+    async getTmnconfigInfoHandler(tmnId) {
+      const response = await getTmnconfigInfo({tmnId})
+      const responseData = response?.data
+      this.baseForm = {
+        tmnconfigElecmetermodel: responseData?.tmnconfigElecmetermodel || '',
+        tmnconfigWatermetermodel: responseData?.tmnconfigWatermetermodel || '',
+        tmnconfigMeteredmodel: responseData?.tmnconfigMeteredmodel || '',
+        tmnconfigCoefficient: responseData?.tmnconfigCoefficient || '',
+      }
+    },
+    async addTmnconfigHandler() {
+      const params = {
+        tmnId: this.tmnId,
+        ...this.baseForm
+      }
+      await addTmnconfig(params)
+      this.handleClose()
+      this.$emit('refresh')
+     },
     resetForm(formName) {
       this.$refs[formName].resetFields();
-      this.resetFormData();
       this.dialogVisible = false;
     },
-    resetFormData() {
-      this.baseForm = {};
-    },
     submitForm(formName) {
       this.$refs[formName].validate((valid) => {
-        console.log(valid)
+        valid && this.addTmnconfigHandler()
       })
     },
 

+ 12 - 6
src/views/infrastructure/deviceSetup.vue

@@ -76,7 +76,7 @@
                 :underline="false"
                 type="primary"
                 style="margin-right: 10px"
-                @click="download(scope.row)"
+                @click="editHandler(scope.row)"
               >修改</el-link> -->
             </template>
           </b-table>
@@ -85,12 +85,14 @@
     </el-col>
     <set-preferencs
       :visible.sync="associationManageShow"
+      :tmnId="tmnId"
+      @refresh="handleSearch"
     />
   </el-row>
 </template>
 
 <script>
-import { getBaseList } from '@/api/tmn/index.js'
+import { getBaseList, getTmnconfigInfo, addTmnconfig } from '@/api/tmn/index.js'
 import { getTree } from '@/api/tree.js'
 import BTable from '@/components/Table/index.vue';
 import DataReportLeft from '@/components/DataReportLeft/index.vue'
@@ -117,7 +119,8 @@ export default {
       }, {
         label: '离线',
         value: 'O'
-      }],
+        }],
+      tmnId: '',
       loading: false,
       associationManageShow: false,
       currentClickId: '',
@@ -162,6 +165,11 @@ export default {
           prop: 'tmnstatusUpdateddate',
           customRender: '',
           align: 'center'
+        },
+        {
+          label: '操作',
+          customRender: 'operate',
+          align: 'center'
         }
       ]
     };
@@ -180,7 +188,7 @@ export default {
       this.$refs.tableRef.refresh(false);
     },
     irrigationShowHistory(row) {
-      this.setEdit = row
+      this.tmnId = row?.tmnId
       this.associationManageShow = true
      },
     async loadData(parameter) {
@@ -215,8 +223,6 @@ export default {
     goDetail(row) {
       this.$refs.sourceCodeDetail.open(row.tarcecodeapplyBatchno)
     },
-    download(row) {
-    }
   }
 };
 </script>

+ 4 - 0
src/views/infrastructure/waterElectricityPriceSetting.vue

@@ -336,6 +336,10 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+.el-row-container{
+  height: 100%;
+  min-height: 100%;
+}
 .pricestepNum{
   border-bottom: 1px solid #EBEEF5;
 }

+ 3 - 1
src/views/peasantHouseholdManage/index.vue

@@ -168,6 +168,7 @@ export default {
       editFarmerData: {},
       farmerId: '',
       requestData: {},
+      currentClickId:'',
       columns: [
         {
           label: '农户姓名',
@@ -230,8 +231,9 @@ export default {
       }
     },
     downloadExcel() {
+      const href = process.env.NODE_ENV === 'production' ? "../../../wpr/static/template.xlsx" : "../../../static/template.xlsx"
       let a = document.createElement("a");
-      a.href = "./assets/template.xlsx";
+      a.href = href;
       a.download = "农户信息统计表.xlsx";
       a.style.display = "none";
       document.body.appendChild(a);