allen 2 лет назад
Родитель
Сommit
2aca779d7c

+ 10 - 6
src/views/home/index.vue

@@ -3,16 +3,18 @@
     <el-card>
       <el-select
         placeholder="区域选择"
+        v-model="areaId"
       >
         <el-option
           label=""
-          value=""
+          :value="area"
         ></el-option>
       </el-select>
       
       <el-select
         style="margin-left:10px"
         placeholder="年份"
+        v-model="year"
       >
       <el-option
         label="2023"
@@ -22,12 +24,12 @@
     </el-card>
     <el-card style="margin: 16px 0">
       <el-row :gutter="20"
-        v-for="item in list"
-        :key="item"
+        v-for="(item,index) in list"
+        :key="index"
       >
       <el-col :span="4"
-        v-for="i in item"
-        :key="i"
+        v-for="(i,index) in item"
+        :key="index"
       >
         <div class="card">
           <img :src="i.imageSrc"/>
@@ -91,7 +93,9 @@ export default {
     echartsGradient
   },
   data() {
-    return{
+    return {
+      areaId: '',
+      area:'',
       areaSelect: '',
       year: '2023',
       list: [[{

+ 1 - 57
src/views/monitoringMamage/components/IrrigationRecord.vue

@@ -79,7 +79,6 @@
 
 <script>
 import { assign, omit } from 'lodash-es';
-import { UPLOAD_TYPE_MAP } from '@/utils/constants';
 import LeftImg from '../assets/img.svg'
 import BTable from '@/components/Table'
 export default {
@@ -98,7 +97,6 @@ export default {
   data() {
     return {
       LeftImg: LeftImg,
-      imageUploadType: UPLOAD_TYPE_MAP.FARMING_RECORD,
       columns: [
         {
           label: '行政区',
@@ -168,23 +166,14 @@ export default {
       form: {
         productName: ''
       },
-      dialogSubmitLoading: false,
       dialogVisible: false,
       baseForm: {
-        productValue: '',
         productName: '',
         stockAmount: '',
-        goodsUnit: '',
         goodsSpecValue: '',
-        imageArr1: [],
         supplierId: '',
-        imageArr2: []
       },
-      productList: [],
-      syinfoList: [],
-      processList: [],
       hasFetched: false,
-      landList: [], //基地列表
       rules: {
         stockAmount: [
           { required: true, message: '请选择负责人', trigger: 'blur' }
@@ -214,9 +203,6 @@ export default {
         if (val) {
           assign(this.baseForm, this.data);
           if (!this.hasFetched) {
-            this.getProductList();
-            this.getSyinfoList();
-            this.getProcessList();
             this.hasFetched = true;
           }
         }
@@ -225,20 +211,17 @@ export default {
     data: {
       deep: true,
       handler(val) {
-        // console.log(val)
         assign(this.baseForm, val);
-        // console.log(this.baseForm)
       }
     }
   },
-  created() {},
-  mounted() {},
   methods: {
     loadData(parameter) {
       const queryform = this.form;
       const payload = omit(assign({}, parameter, queryform, {orderByColumn:'tarcecodeapplyCreateddate',isAsc:'desc'}), []);
       return this.getTableData(payload);
     },
+    handleSearch() { },
     getTableData(payload) {
       return Promise.resolve({
         data: [{
@@ -268,35 +251,6 @@ export default {
           }]
       })
     },
-    getProductList() {
-    },
-    getSyinfoList() {
-    },
-    getProcessList() {
-    },
-    goProductsPage() {
-      this.handleClose();
-      this.$router.push({
-        path: '/Products',
-        query: {}
-      });
-    },
-    goSourceInfoPage() {
-      this.handleClose();
-      this.$router.push({
-        path: '/sourceInfo',
-        query: {
-          type: 'add'
-        }
-      });
-    },
-    goProcessPage() {
-      this.handleClose();
-      this.$router.push({
-        path: '/basicsettings/process',
-        query: {}
-      });
-    },
     resetForm(formName) {
       this.dialogVisible = false;
     },
@@ -313,16 +267,6 @@ export default {
       this.$emit('update:visible', false);
       this.resetForm('baseForm');
     },
-    handleSuccess() {
-      this.resetForm('baseForm');
-      this.$emit('update:visible', false);
-      this.$emit('success');
-    },
-    handleKeyUp(target, key) {
-      target[key] = target[key].match(/\d+(\.\d{0,2})?/)
-        ? target[key].match(/\d+(\.\d{0,2})?/)[0]
-        : '';
-    }
   }
 };
 </script>

+ 1 - 28
src/views/monitoringMamage/index.vue

@@ -107,7 +107,6 @@
         </div>
       </el-col>
       <el-col :span="24" class="elrow-main__col-bottom">
-        <img v-if="imgUrl" :src="imgUrl" />
         <b-table
           ref="tableRef"
           :args="{ 'highlight-current-row': true }"
@@ -115,37 +114,12 @@
           :columns="columns"
           isShowIndex
         >
-          <template #styleImg="scope">
-            <el-image
-              :src="scope.row.imgPreview"
-              :preview-src-list="[scope.row.imgPreview]"
-              slot="error"
-              class="image-slot"
-              style="width: 100px; height: 50px"
-            >
-              <div slot="error" class="image-slot"></div>
-            </el-image>
-          </template>
-          <template #codeNo="scope">           
-            <el-link
-              type="primary"
-              :underline="false"
-              @click="goDetail(scope.row)"
-              >{{ scope.row.traceCodeApplyConcat }}</el-link
-            >
-          </template>
           <template #status="scope">
             <span style="display:flex;align-items:center;justify-content:center">
               <span class="status"></span>
               {{ scope.row.name }}
             </span>
           </template>
-          <template #useNumber="scope">
-            {{ scope.row.useNumber + '/' + scope.row.totalNumber }}
-          </template>
-          <template #finishGoodName="scope">
-            {{ scope.row.finishGoodName&&scope.row.finishgoodNo?scope.row.finishGoodName + '-' + scope.row.finishgoodNo:'' }}
-          </template>
 
           <template #operate="scope">
             <el-link
@@ -187,7 +161,7 @@ export default {
   components: { BTable,DataReportLeft,EchartsPie,realTimeMonitor,IrrigationRecord },
   data() {
     return {
-      imgUrl: '',
+      dateValue:'',
       form: {
         productName: ''
       },
@@ -214,7 +188,6 @@ export default {
       }],
       treeData: [],
       loading: false,
-      associationManageShow: false,
       realTimeShow: false,
       irrigationShow: false,
       columns: [

+ 66 - 230
src/views/peasantHouseholdManage/components/IrrigationRecord.vue

@@ -5,28 +5,22 @@
     :close-on-click-modal="false"
     :close-on-press-escape="false"
     @close="handleClose"
-    width="1200px"
+    width="1400px"
   >
   <div style="margin-bottom: 20px">
-    <span>农户姓名:</span>
-    <el-input
-      v-model="form.tarcecodeapplyno"
-      style="width: 250px;margin:0 15px;"
-      placeholder="请i输入农户编号/姓名/电话"
-      @keyup.enter.native="handleSearch"
+    <el-date-picker
+      v-model="dateValue"
       clearable
-    />
-    <span>时间:</span>
-    <el-input
-      v-model="form.tarcecodeapplyno"
-      style="width: 250px;margin:0 15px;"
-      placeholder="请i输入农户编号/姓名/电话"
-      @keyup.enter.native="handleSearch"
-      clearable
-    />
+      value-format="yyyy-MM-dd HH:MM:SS"
+      type="daterange"
+      range-separator="至"
+      start-placeholder="开始日期"
+      end-placeholder="结束日期">
+    </el-date-picker>
     <el-button
       type="primary"
       size="small"
+      style="margin-left: 16px;"
       @click="handleSearch"
       >查询</el-button
     >
@@ -36,172 +30,96 @@
     :args="{ 'highlight-current-row': true }"
     :data="loadData"
     :columns="columns"
+    showIndex
   >
-    <template #styleImg="scope">
-      <el-image
-        :src="scope.row.imgPreview"
-        :preview-src-list="[scope.row.imgPreview]"
-        slot="error"
-        class="image-slot"
-        style="width: 100px; height: 50px"
-      >
-        <div slot="error" class="image-slot"></div>
-      </el-image>
-    </template>
-    <template #number="scope">
-      <div>1</div>
-      <div>2</div>
-      {{ scope.row.finishGoodName&&scope.row.finishgoodNo?scope.row.finishGoodName + '-' + scope.row.finishgoodNo:'' }}
-    </template>
-    <template #codeNo="scope">           
-      <el-link
-        type="primary"
-        :underline="false"
-        @click="goDetail(scope.row)"
-        >{{ scope.row.traceCodeApplyConcat }}</el-link
-      >
-    </template>
-    <template #status="scope">
-      <span style="display:flex;align-items:center;justify-content:center">
-        <span class="status"></span>
-        {{ scope.row.name }}
-      </span>
-    </template>
-    <template #useNumber="scope">
-      {{ scope.row.useNumber + '/' + scope.row.totalNumber }}
-    </template>
-    <template #finishGoodName="scope">
-      {{ scope.row.finishGoodName&&scope.row.finishgoodNo?scope.row.finishGoodName + '-' + scope.row.finishgoodNo:'' }}
-    </template>
   </b-table>
   </el-dialog>
 </template>
 
 <script>
+import { getCardusercdList } from '@/api/card/index.js'
 import { assign, omit } from 'lodash-es';
-import { UPLOAD_TYPE_MAP } from '@/utils/constants';
 import LeftImg from '../assets/img.svg'
 import BTable from '@/components/Table'
 export default {
   name: 'IrrigationRecord',
   props: {
-    data: {
-      default() {
-        return {};
-      }
-    },
     visible: {
       type: Boolean,
       default: false
+    },
+    irrigationDetail: {
+      type: Object,
+      default: () => { }
     }
   },
   data() {
     return {
       LeftImg: LeftImg,
-      imageUploadType: UPLOAD_TYPE_MAP.FARMING_RECORD,
+      dateValue: '',
       columns: [
         {
-          label: '行政区',
-          prop: 'person',
+          label: '水源编号',
+          prop: 'waterNum',
           customRender: '',
-          align: 'center'
+          align: 'center',
         },
         {
-          label: '农户',
-          prop: 'area',
+          label: '水源名称',
+          prop: 'waterName',
           customRender: '',
           align: 'center'
         },
         {
-          label: '手机号',
-          prop: 'name',
+          label: '本次耗水量(m³)',
+          prop: 'cardusercdWaternum',
           customRender: '',
           align: 'center'
         },
         {
-          label: '计量模式',
-          prop: 'phone',
-          customRender: 'number',
-          align: 'center'
-        },{
-          label: '总金额',
-          prop: 'phone',
-          customRender: '',
-          align: 'center'
-        },{
-          label: '用水量',
-          prop: 'phone',
+          label: '本次用水量(°)',
+          prop: 'cardusercdWaternum',
           customRender: '',
           align: 'center'
-        },{
-          label: '用水金额',
-          prop: 'phone',
+        },
+        {
+          label: '开始时间',
+          prop: 'cardusercdStarttime',
           customRender: '',
           align: 'center'
-        },{
-          label: '用电量',
-          prop: 'phone',
+        },
+        {
+          label: '结束时间',
+          prop: 'cardusercdEndtime',
           customRender: '',
           align: 'center'
-        },{
-          label: '用电金额',
-          prop: 'phone',
+        },
+        {
+          label: '使用时长',
+          prop: 'cardusercdDuration',
           customRender: '',
           align: 'center'
-        },{
-          label: '开泵时间',
-          prop: 'phone',
+        },
+        {
+          label: '计费方式',
+          prop: 'cardusercdBillingtype',
           customRender: '',
           align: 'center'
-        },{
-          label: '关泵时间',
-          prop: 'phone',
+        },
+        {
+          label: '计费标准',
+          prop: 'cardusercdPriceinfo',
           customRender: '',
           align: 'center'
-        },{
-          label: '灌溉时长',
-          prop: 'phone',
+        },
+        {
+          label: '扣除金额',
+          prop: 'cardusercdUsemoney',
           customRender: '',
           align: 'center'
         }
       ],
-      form: {
-        productName: ''
-      },
-      dialogSubmitLoading: false,
       dialogVisible: false,
-      baseForm: {
-        productValue: '',
-        productName: '',
-        stockAmount: '',
-        goodsUnit: '',
-        goodsSpecValue: '',
-        imageArr1: [],
-        supplierId: '',
-        imageArr2: []
-      },
-      productList: [],
-      syinfoList: [],
-      processList: [],
-      hasFetched: false,
-      landList: [], //基地列表
-      rules: {
-        stockAmount: [
-          { required: true, message: '请选择负责人', trigger: 'blur' }
-        ],
-        sourceinfoId: [
-          { required: true, message: '请选择管辖范围', trigger: 'blur' }
-        ],
-        productName: [
-          { required: true, message: '请输入协会名称', trigger: 'blur' }
-        ],
-        supplierId: [
-          { required: false, message: '请输入协会介绍', trigger: 'blur' }
-        ],
-        goodsSpecValue: [
-          { required: true, message: '请选择规格', trigger: 'blur' }
-        ]
-      }
     };
   },
   components:{
@@ -211,119 +129,37 @@ export default {
     visible(val) {
       if (val !== this.dialogVisible) {
         this.dialogVisible = val;
-        if (val) {
-          assign(this.baseForm, this.data);
-          if (!this.hasFetched) {
-            this.getProductList();
-            this.getSyinfoList();
-            this.getProcessList();
-            this.hasFetched = true;
-          }
-        }
       }
     },
-    data: {
-      deep: true,
+    irrigationDetail: {
       handler(val) {
-        // console.log(val)
-        assign(this.baseForm, val);
-        // console.log(this.baseForm)
-      }
+        console.log(val,'valvalval')
+        const farmerId  = val?.farmerId
+        this.farmerId = farmerId
+        this.handleSearch()
+       },
+      deep: true
     }
   },
-  created() {},
-  mounted() {},
   methods: {
     loadData(parameter) {
-      const queryform = this.form;
-      const payload = omit(assign({}, parameter, queryform, {orderByColumn:'tarcecodeapplyCreateddate',isAsc:'desc'}), []);
+      const payload = omit(assign({}, parameter), []);
       return this.getTableData(payload);
     },
-    handleSearch() {},
-    getTableData(payload) {
-      return Promise.resolve({
-        data: [{
-            person:"王大虎",
-            area: '2016-05-02',
-            name: '王小虎',
-            phone: 1588888888,
-            address: '上海市普陀区金沙<br>江路 1518 弄'
-          }, {
-            person:"王大虎",
-            area: '2016-05-04',
-            name: '王小虎',
-            phone: 1588888888,
-            address: '上海市普陀区金沙江路 1517 弄'
-          }, {
-            person:"王大虎",
-            area: '2016-05-01',
-            name: '王小虎',
-            phone: 1588888888,
-            address: '上海市普陀区金沙江路 1519 弄'
-          }, {
-            person:"王大虎",
-            area: '2016-05-03',
-            name: '王小虎',
-            phone: 1588888888,
-            address: '上海市普陀区金沙江路 1516 弄'
-          }]
-      })
-    },
-    getProductList() {
-    },
-    getSyinfoList() {
-    },
-    getProcessList() {
-    },
-    goProductsPage() {
-      this.handleClose();
-      this.$router.push({
-        path: '/Products',
-        query: {}
-      });
+    handleSearch() {
+      this.$refs.tableRef && this.$refs.tableRef.refresh(true);
     },
-    goSourceInfoPage() {
-      this.handleClose();
-      this.$router.push({
-        path: '/sourceInfo',
-        query: {
-          type: 'add'
-        }
-      });
-    },
-    goProcessPage() {
-      this.handleClose();
-      this.$router.push({
-        path: '/basicsettings/process',
-        query: {}
-      });
-    },
-    resetForm(formName) {
-      this.dialogVisible = false;
-    },
-    resetFormData() {
-      this.baseForm = {};
-    },
-    submitForm(formName) {
-      this.$refs[formName].validate((valid) => {
-        console.log(valid)
+    getTableData() {
+      const [startTime,endTime] = this.dateValue
+      return getCardusercdList({
+        farmerId: this.farmerId,
+        startTime,
+        endTime
       })
     },
-
     handleClose() {
       this.$emit('update:visible', false);
-      this.resetForm('baseForm');
-    },
-    handleSuccess() {
-      this.resetForm('baseForm');
-      this.$emit('update:visible', false);
-      this.$emit('success');
     },
-    handleKeyUp(target, key) {
-      target[key] = target[key].match(/\d+(\.\d{0,2})?/)
-        ? target[key].match(/\d+(\.\d{0,2})?/)[0]
-        : '';
-    }
   }
 };
 </script>

+ 7 - 17
src/views/peasantHouseholdManage/index.vue

@@ -102,7 +102,10 @@
     :visible.sync="farmerManageShow"
     :detailsData="detailsData"
   />
-  <irrigation-record :visible.sync="irrigationShow" />
+  <irrigation-record
+    :visible.sync="irrigationShow"
+    :irrigationDetail="irrigationDetail"
+  />
   </el-row>
 </template>
 
@@ -127,12 +130,7 @@ export default {
       detailsData: {},
       treeData: [],
       currentClick:{},
-      dateValue:"",
-      imgUrl: '',
-      baseImageUrl: process.env.VUE_APP_BASE_RESOURCE_PREFIX,
-      form: {
-        productName: ''
-      },
+      irrigationDetail: {},
       isEdit: false,
       loading: false,
       associationManageShow: false,
@@ -221,10 +219,8 @@ export default {
       this.currentClickId = areaId
       this.$refs.tableRef.refresh(false);
     },
-    closePopOver(flag) {
-      this.visible = flag
-    },
-    irrigationShowHistory() {
+    irrigationShowHistory(row) {
+      this.irrigationDetail = row
       this.irrigationShow = true
     },
     // 详情
@@ -241,12 +237,6 @@ export default {
     handleSearch() {
       this.$refs.tableRef.refresh(true);
     },
-    goDetail(row) {
-      this.$refs.sourceCodeDetail.open(row.tarcecodeapplyBatchno)
-    },
-    download(row) {
-      this.visibles = true
-    },
     deleteRow(row) {
       this.$modal
       .confirm(`是否确认删除农户${row.farmerName}`)

+ 26 - 10
src/views/waterCardManage/dataDetail.vue

@@ -29,7 +29,7 @@
         <el-col :span="5">
           <span class="label"><span>总用电量:</span>{{baseForm.electricNumTotal || 0}} m³</span></el-col>
       </el-row>
-      <div style="text-align:right;position:relative;z-index:1000">
+      <div class="dateType">
         <el-date-picker
           v-model="dateValue"
           clearable
@@ -41,8 +41,11 @@
         </el-date-picker>
         <el-button type="primary" style="margin-left:10px;" @click="handleSearch">查询</el-button>
       </div>
-      <el-tabs @tab-click="handleClick" style="margin-top:-30px;">
-        <el-tab-pane label="灌溉记录">
+      <el-tabs v-model="activeName">
+        <el-tab-pane 
+          label="灌溉记录"
+          name="irrigation"
+        >
           <b-table
             ref="tableRef"
             :args="{ 'highlight-current-row': true }"
@@ -52,7 +55,10 @@
           >
           </b-table>
         </el-tab-pane>
-        <el-tab-pane label="充值记录">
+        <el-tab-pane 
+          label="充值记录"
+          name="recharge"
+        >
           <b-table
             ref="tableRechargercd"
             :args="{ 'highlight-current-row': true }"
@@ -63,7 +69,6 @@
             <template #ICCard="scope">
               {{ scope }}
               <b-table
-                ref="tableRef"
                 :args="{ 'highlight-current-row': true }"
                 :data="loadData"
                 :columns="scope.columns"
@@ -103,6 +108,7 @@ export default {
   },
   data() {
     return {
+      activeName: 'irrigation',
       baseForm: {},
       dateValue: '',
       columns1: [
@@ -196,7 +202,6 @@ export default {
     };
   },
   methods: {
-    handleClick(){},
     async rechargercdList() {
       const res = await getCardDetail({
         cardId:this.detailCardId
@@ -204,7 +209,7 @@ export default {
       this.baseForm = res.data
       return this.getRechargercdData(res.data);
     },
-    async cardusercdList() { 
+    async cardusercdList() {
       const res = await getCardDetail({
         cardId: this.detailCardId
       })
@@ -213,7 +218,7 @@ export default {
     },
     getCardusercdListHandler(payload) { 
       const { cardId } = payload
-      const [startTime, endTime] = this.dateValue ??= []
+      const [startTime, endTime] = this.dateValue || []
       return getCardusercdList({
         cardId,
         startTime,
@@ -222,7 +227,7 @@ export default {
     },
     getRechargercdData(payload) {
       const {farmerId,cardNo,cardId} = payload
-      const [startTime, endTime] = this.dateValue ??= []
+      const [startTime, endTime] = this.dateValue || []
       return getRechargercdList({
         farmerId,
         cardNo,
@@ -244,7 +249,7 @@ export default {
     },
     
     handleSearch() {
-      this.$refs.tableRechargercd.refresh(true);
+      this.activeName === 'recharge' ?  this.$refs.tableRechargercd.refresh(true) : this.$refs.tableRef.refresh(true) 
     },
     submitForm(formName) {
       this.$refs[formName].validate((valid) => {
@@ -271,6 +276,17 @@ export default {
     text-align: left;
   }
 }
+::v-deep .el-card__body{
+  position: relative;
+}
+.dateType{
+  position: absolute;
+  right: 20px;
+  margin-top: -5px;
+  width: 500px;
+  text-align: right;
+  z-index:1000;
+}
 ::v-deep.el-dialog__title{
   color: #333333;
   font-size: 16px;

+ 0 - 3
src/views/waterCardManage/index.vue

@@ -356,9 +356,6 @@ export default {
     handleSearch() {
       this.$refs.tableRef.refresh(true);
     },
-    goDetail(row) {
-      this.$refs.sourceCodeDetail.open(row.tarcecodeapplyBatchno)
-    },
     rechargeCardHandler(row) {
       this.rechargeCardData = row
       this.rechargeShow = true