wang-hao-jie
2022-06-06 818d4458d77505b25ea057b49b409b1868ea8cff
src/views/your/area-manage/areaManage.vue
@@ -66,10 +66,16 @@
        <FormItem label="片区描述" prop="description">
          <Input v-model="areaForm.description" />
        </FormItem>
        <FormItem label="配送员" prop="userId">
          <Select v-model="areaForm.userId" filterable>
            <Option :value="0" :key="0" selected>请选择</Option>
            <Option v-for="item in userList" :value="item.id">{{ item.nickname }}</Option>
        <!--<FormItem label="配送员" prop="userId">-->
          <!--<Select v-model="areaForm.userId" filterable>-->
            <!--<Option :value="0" :key="0" selected>请选择</Option>-->
            <!--<Option v-for="item in userList" :value="item.id">{{ item.nickname }}</Option>-->
          <!--</Select>-->
        <!--</FormItem>-->
        <FormItem label="配送车辆" prop="carId">
          <Select v-model="areaForm.carId" filterable>
            <Option value="" key="" selected>请选择</Option>
            <Option v-for="item in carList" :value="item.id">{{ item.carNo }}</Option>
          </Select>
        </FormItem>
      </Form>
@@ -130,9 +136,9 @@
        <FormItem label="商户名称" prop="name">
          <Input v-model="customerForm.name" />
        </FormItem>
        <FormItem label="商户编号" prop="code">
          <Input v-model="customerForm.code" />
        </FormItem>
        <!--<FormItem label="商户编号" prop="code">-->
          <!--<Input v-model="customerForm.code" />-->
        <!--</FormItem>-->
        <Row :gutter="0">
          <Col span="12">
@@ -147,15 +153,15 @@
          </Col>
        </Row>
        <Row :gutter="0">
          <Col span="12">
            <Form-item label="上次配送日期" prop="lastTime">
              <Row>
                <Col>
                  <Date-picker @on-change="change1" type="date" value="yyyy-MM-dd" placeholder="选择日期" v-model="customerForm.lastTime"></Date-picker>
                </Col>
              </Row>
            </Form-item>
          </Col>
          <!--<Col span="12">-->
            <!--<Form-item label="上次配送日期" prop="lastTime">-->
              <!--<Row>-->
                <!--<Col>-->
                  <!--<Date-picker @on-change="change1" type="date" value="yyyy-MM-dd" placeholder="选择日期" v-model="customerForm.lastTime"></Date-picker>-->
                <!--</Col>-->
              <!--</Row>-->
            <!--</Form-item>-->
          <!--</Col>-->
          <Col span="12">
            <FormItem label="联系方式" prop="phone">
              <Input v-model="customerForm.phone"/>
@@ -316,6 +322,7 @@
      modalTitle: "",
      modalTitle2: "",
      modalTitle3: "",
      carList:[],
      searchForm: {
        // 搜索框初始化对象
        pageNumber: 1, // 当前页数
@@ -327,7 +334,6 @@
      areaForm: {
      },
      customerForm: {
        kstatus : 1
      },
      areaSectionForm: {
      },
@@ -366,8 +372,8 @@
          }
        },
        {
          title: "配送人",
          key: "nickName",
          title: "配送车辆",
          key: "carNo",
          width: 200,
        },
        {
@@ -519,33 +525,33 @@
          key: "phone",
          width: 135,
        },
        {
          title: "状态",
          key: "status",
          width:100,
          render: (h, params) => {
            let re = "";
            if (params.row.status == 0) {
              return h("div", [
                h("Badge", {
                  props: {
                    status: "success",
                    text: "正常",
                  },
                }),
              ]);
            } else if (params.row.status == 1) {
              return h("div", [
                h("Badge", {
                  props: {
                    status: "error",
                    text: "不活跃",
                  },
                }),
              ]);
            }
          },
        },
        // {
        //   title: "状态",
        //   key: "status",
        //   width:100,
        //   render: (h, params) => {
        //     let re = "";
        //     if (params.row.status == 0) {
        //       return h("div", [
        //         h("Badge", {
        //           props: {
        //             status: "success",
        //             text: "正常",
        //           },
        //         }),
        //       ]);
        //     } else if (params.row.status == 1) {
        //       return h("div", [
        //         h("Badge", {
        //           props: {
        //             status: "error",
        //             text: "不活跃",
        //           },
        //         }),
        //       ]);
        //     }
        //   },
        // },
        {
          title: "联系人",
          key: "linker",
@@ -713,6 +719,13 @@
        }
      });
    },
    getAllCar(){
      getAll().then((res)=>{
        if (res.success){
          this.carList=res.result;
        }
      });
    },
    getAreaSectionList(areaId) {
      this.loading = true;
      this.searchForm.areaId=areaId;
@@ -800,14 +813,16 @@
    },
    submitCustomer() {
      this.$refs.areaSectionForm.validate((valid) => {
        this.customerForm.lastTime = this.lastTime;
        //this.customerForm.lastTime = this.lastTime;
        this.customerForm.areaSectionId = this.areaSectionId;
        this.customerForm.areaId = this.areaId;
        this.customerForm.kstatus = 1;
        if (valid) {
            this.$delete(this.customerForm,'receives')
          if (this.modalType == 0) {
            // 添加
            this.submitLoading = true;
            this.customerForm.kstatus = 0;
            addCustomer(this.customerForm).then((res) => {
              this.submitLoading = false;
              if (res.success) {
@@ -896,7 +911,8 @@
      console.log(this.areaSectionId);
    },
    addCar() {
      this.getAllUser();
      //this.getAllUser();
      this.getAllCar();
      this.modalType = 0;
      this.modalTitle = "添加";
      this.$refs.areaForm.resetFields();
@@ -920,7 +936,8 @@
      this.addCustomerVisible = true;
    },
    edit(v) {
      this.getAllUser();
      //this.getAllUser();
      this.getAllCar()
      this.modalType = 1;
      this.modalTitle = "编辑";
      this.$refs.areaForm.resetFields();