| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312 |
- <template>
- <el-dialog
- title="基础信息"
- :visible.sync="dialogVisible"
- :close-on-click-modal="false"
- :close-on-press-escape="false"
- @close="handleClose"
- width="1200px"
- >
- <el-row>
- <el-col :span="5">
- <span class="label"><span>IC卡卡号:</span>654155444</span>
- </el-col>
- <el-col :span="5">
- <span class="label"><span>农户姓名:</span>张三</span></el-col>
- <el-col :span="5">
- <span class="label"><span>卡状态:</span>正常</span></el-col>
- <el-col :span="4">
- <span class="label"><span>办卡时间:</span>2022-02-15</span></el-col>
- <el-col :span="5">
- <span class="label"><span>所属区域:</span>2022-02-15 </span></el-col>
- </el-row>
- <el-row style="margin: 20px 0">
- <el-col :span="5">
- <span class="label"><span>总用水量:</span>65444 m³</span>
- </el-col>
- <el-col :span="5">
- <span class="label"><span>总用电量:</span>65444 m³</span></el-col>
- </el-row>
- <div style="text-align:right;position:relative">
- <el-date-picker
- v-model="value1"
- type="daterange"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期">
- </el-date-picker>
- <el-button type="primary" style="margin-left:10px;">查询</el-button>
- </div>
- <el-tabs @tab-click="handleClick" style="margin-top:-30px;">
- <el-tab-pane label="灌溉记录">
- <b-table
- ref="tableRef"
- :args="{ 'highlight-current-row': true }"
- :data="loadData"
- :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">
- {{ 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-tab-pane>
- <el-tab-pane label="充值记录">
- <b-table
- ref="tableRef"
- :args="{ 'highlight-current-row': true }"
- :data="loadData"
- :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">
- {{ 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-tab-pane>
- </el-tabs>
- </el-dialog>
- </template>
- <script>
- import BTable from '@/components/Table/index.vue';
- import { assign } from 'lodash-es';
- import { UPLOAD_TYPE_MAP } from '@/utils/constants';
- export default {
- props: {
- data: {
- default() {
- return {};
- }
- },
- visible: {
- type: Boolean,
- default: false
- }
- },
- components:{
- BTable
- },
- data() {
- return {
- imageUploadType: UPLOAD_TYPE_MAP.FARMING_RECORD,
- dialogSubmitLoading: false,
- dialogVisible: false,
- baseForm: {
- productValue: '',
- productName: '',
- stockAmount: '',
- goodsUnit: '',
- goodsSpecValue: '',
- imageArr1: [],
- supplierId: '',
- imageArr2: []
- },
- productList: [],
- syinfoList: [],
- processList: [],
- hasFetched: false,
- landList: [], //基地列表
- columns: [
- {
- label: 'IC卡号',
- prop: 'person',
- customRender: '',
- align: 'center'
- },
- {
- label: '充值金额(元)',
- prop: 'area',
- customRender: '',
- align: 'center'
- },
- {
- label: '充值后金额(元)',
- prop: 'name',
- customRender: '',
- align: 'center'
- },
- {
- label: '充值时间',
- prop: 'phone',
- customRender: 'status',
- align: 'center'
- }
- ]
- };
- },
- computed: {
- goodsUnitLable: function () {
- }
- },
- watch: {
- 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,
- handler(val) {
- // console.log(val)
- assign(this.baseForm, val);
- // console.log(this.baseForm)
- }
- }
- },
- created() {},
- mounted() {},
- methods: {
- 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.$refs[formName].resetFields();
- this.resetFormData();
- this.dialogVisible = false;
- },
- resetFormData() {
- this.baseForm = {};
- },
- submitForm(formName) {
- this.$refs[formName].validate((valid) => {
- console.log(valid)
- })
- },
- 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>
- <style lang="scss" scoped>
- ::v-deep.el-dialog__title{
- color: #333333;
- font-size: 16px;
- font-weight: 700;
- }
- .input-number {
- width: 100%;
- }
- .base-form {
- max-height: 70vh;
- overflow-y: auto;
- overflow-x: hidden;
- padding: 0 20px;
- }
- .label{
- color: #333;
- span{
- color: #999;
- font-size: 14px;
- font-style: normal;
- }
- }
- </style>
- <style lang="css" scoped>
- ::v-deep .el-dialog__header {
- border-bottom: 1px solid #ebeef5;
- }
- </style>
|