kongdeqiang
2023-03-14 a0654f2c21511a0e16b977427a563a3ccdfd1fba
src/views/your/addOil-manage/addOilManage.vue
@@ -13,9 +13,9 @@
          openTip ? "关闭提示" : "开启提示"
          }}</Button>
        <Input
                v-model="searchForm.carNo"
                v-model="searchForm2.carNo"
                suffix="ios-search"
                @on-change="getDataList"
                @on-change="getDataList2"
                placeholder="输入车牌号搜索"
                clearable
                style="width: 250px"
@@ -82,24 +82,32 @@
        <Row :gutter="0">
          <Col span="12">
            <FormItem label="加油量" prop="amount">
              <Input v-model="addOilForm.amount" type="number"/>
              <Input v-model="addOilForm.amount" type="number">
                <span slot="append">升</span>
              </Input>
            </FormItem>
          </Col>
          <Col span="12">
            <FormItem label="单价" prop="unitPrice">
              <Input v-model="addOilForm.unitPrice" type="number"/>
              <Input v-model="addOilForm.unitPrice" type="number">
                <span slot="append">元</span>
              </Input>
            </FormItem>
          </Col>
        </Row>
        <Row :gutter="0">
          <Col span="12">
            <FormItem label="加油金额" prop="money">
              <Input v-model="addOilForm.money" type="number"/>
              <Input v-model="addOilForm.money" type="number">
                <span slot="append">元</span>
              </Input>
            </FormItem>
          </Col>
          <Col span="12">
            <FormItem label="里程" prop="mileage">
              <Input v-model="addOilForm.mileage" type="number"/>
              <Input v-model="addOilForm.mileage" type="number">
                <span slot="append">公里</span>
              </Input>
            </FormItem>
          </Col>
        </Row>
@@ -247,6 +255,14 @@
          order: "desc", // 默认排序方式
          key: "",
        },
        searchForm2: {
          // 搜索框初始化对象
          pageNumber: 1, // 当前页数
          pageSize: 10, // 页面大小
          sort: "createTime", // 默认排序字段
          order: "desc", // 默认排序方式
          key: "",
        },
        addOilForm: {
          status : 0
        },
@@ -274,19 +290,18 @@
          {
            title: "车牌号",
            key: "carNo",
            width: 100,
            width: 120,
            sortable: true,
          },
          {
            title: "加油卡号",
            key: "addOilCode",
            width: 100,
            sortable: true,
            width: 140,
          },
          {
            title: "加油日期",
            key: "addDate",
            width: 150,
            width: 120,
            sortable: true,
          },
          {
@@ -304,19 +319,22 @@
          {
            title: "加油金额",
            key: "money",
            minWidth: 100,
            minWidth: 120,
            sortable: true,
          },
          {
            title: "加油时里程",
            key: "mileage",
            minWidth: 100,
            minWidth: 130,
            sortable: true,
          },
          {
            title: "备注",
            key: "remarks",
            minWidth: 150,
            width: 150,
            render: (h, params) => {
              return h("div",params.row.remarks=="undefined" ? '':params.row.remarks);
            }
          },
          {
            title: "操作",
@@ -326,15 +344,15 @@
            render: (h, params) => {
              return h("div", [
                h(
                        "a",
                        {
                          on: {
                            click: () => {
                              this.edit(params.row);
                            },
                          },
                        },
                        "编辑"
                  "a",
                  {
                    on: {
                      click: () => {
                        this.edit(params.row);
                      },
                    },
                  },
                  "编辑"
                ),
                h("Divider", {
                  props: {
@@ -446,7 +464,17 @@
          this.loading = false;
          if (res.success) {
            this.data = res.result.records;
            this.total = res.result.length;
            this.total = res.result.total;
          }
        });
      },
      getDataList2() {
        this.loading = true;
        getAddOilList(this.searchForm2).then((res) => {
          this.loading = false;
          if (res.success) {
            this.data = res.result.records;
            this.total = res.result.total;
          }
        });
      },
@@ -868,4 +896,4 @@
      this.init();
    },
  };
</script>
</script>