wang-hao-jie
2022-01-05 ac5603d127ea37513055a2ef87d960902c3993b8
src/views/your/area-manage/areaManage.vue
@@ -84,12 +84,10 @@
        <Button @click="addEquipment" type="primary" icon="md-add">添加片区段</Button>
        <Button @click="init" icon="md-refresh">刷新</Button>
      </Row>
      <Table :loading="loading" border :columns="columns2" :data="data2" ref="table"
             sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect">
      <Table :loading="loading" border :columns="columns2" :data="data2" ref="table" style="height: 400px" >
             sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect" >
      </Table>
    </Modal>05
    </Modal>
    <Modal :title="modalTitle3" v-model="customerVisible" :mask-closable="false" :width="1050">
      <Row class="operation" style="padding-bottom: 20px">
        <Button @click="addCustomer" type="primary" icon="md-add">添加</Button>
@@ -97,7 +95,7 @@
        <Input v-model="searchForm.name" suffix="ios-search" @on-change="getCustList" placeholder="输入商户名称搜索" clearable style="width: 250px"
        />
      </Row>
      <Table :loading="loading" border :columns="columns3" :data="data3" ref="table"
      <Table :loading="loading" border :columns="columns3" :data="data3" ref="table" style="height: 350px"
             sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect">
      </Table>
      <Row type="flex" justify="end" class="page">
@@ -113,10 +111,10 @@
        ></Page>
      </Row>
    </Modal>
    <Modal :title="modalTitle" v-model="addEquipmentVisible" :mask-closable="false" :width="500">
    <Modal :title="modalTitle" v-model="addEquipmentVisible" :mask-closable="false" :width="500" >
      <Form ref="areaSectionForm" :model="areaSectionForm" :label-width="80" :rules="areaSectionFormValidate">
        <FormItem label="片区名称" prop="code">
          <Input v-model="areaSectionForm.code" />
          <Input v-model="areaSectionForm.name" />
        </FormItem>
      </Form>
@@ -128,36 +126,50 @@
      </div>
    </Modal>
    <Modal :title="modalTitle" v-model="addCustomerVisible" :mask-closable="false" :width="550">
      <Form ref="customerForm" :model="customerForm" :label-width="80" :rules="areaSectionFormValidate">
      <Form ref="customerForm" :model="customerForm" :label-width="120" :rules="areaSectionFormValidate">
        <FormItem label="商户名称" prop="name">
          <Input v-model="customerForm.name" />
        </FormItem>
        <FormItem label="商户编号" prop="code">
          <Input v-model="customerForm.code" />
        </FormItem>
        <FormItem label="联系方式" prop="phone">
          <Input v-model="customerForm.phone" />
        </FormItem>
        <FormItem label="经度" prop="lng">
          <Input v-model="customerForm.lng" />
        </FormItem>
        <FormItem label="纬度" prop="lat">
          <Input v-model="customerForm.lat" />
        </FormItem>
        <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>
        <Row :gutter="0">
          <Col span="12">
            <FormItem label="经度" prop="lng">
              <Input v-model="customerForm.lng" />
            </FormItem>
          </Col>
          <Col span="12">
            <FormItem label="纬度" prop="lat">
              <Input v-model="customerForm.lat" />
            </FormItem>
          </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">
            <FormItem label="联系方式" prop="phone">
              <Input v-model="customerForm.phone" type="number"/>
            </FormItem>
          </Col>
        </Row>
        <FormItem label="商户注册地址" prop="registeredAddress">
          <Input v-model="customerForm.registeredAddress" />
        </FormItem>
        <FormItem label="联系人" prop="linker">
          <Input v-model="customerForm.linker" />
        </FormItem>
        <FormItem label="零售许可证信息" prop="licence">
        <FormItem label="零售许可证信息" prop="licence" >
          <Input v-model="customerForm.licence" />
        </FormItem>
      </Form>
@@ -265,6 +277,7 @@
  addCar,
  getCarList,
  getUser,
  getDriver,
  addArea,
  deleteArea,
  getAreaSection,
@@ -273,6 +286,7 @@
  deleteAreaSection,
  addCustomer,
  deleteCustomer,
} from "@/api/open";
import util from "@/libs/util.js";
export default {
@@ -313,7 +327,7 @@
      areaForm: {
      },
      customerForm: {
        kstatus : 1
      },
      areaSectionForm: {
      },
@@ -419,8 +433,8 @@
          align: "center",
        },
        {
          title: "分段编号或名称",
          key: "code",
          title: "分段名称",
          key: "name",
        },
        {
          title: "操作",
@@ -587,7 +601,9 @@
      data2: [],
      data3: [],
      total: 0,
      type: {
        type : 1
      },
      total2: 0,
      permData: [],
      editRolePermId: "",
@@ -693,7 +709,7 @@
      });
    },
    getAllUser(){
      getUser().then((res)=>{
      getDriver({type:1}).then((res)=>{
        if (res.success){
          this.userList=res.result;
        }
@@ -759,16 +775,19 @@
                this.$Message.success("操作成功");
                this.getDataList();
                this.roleModalVisible = false;
                this.areaForm={};
              }
            });
          } else {
            this.submitLoading = true;
            this.$delete(this.areaForm,'children')
            addArea(this.areaForm).then((res) => {
              this.submitLoading = false;
              if (res.success) {
                this.$Message.success("操作成功");
                this.getDataList();
                this.roleModalVisible = false;
                this.areaForm={};
              }
            });
          }
@@ -779,6 +798,8 @@
      this.$refs.areaSectionForm.validate((valid) => {
        this.customerForm.lastTime = this.lastTime;
        this.customerForm.areaSectionId = this.areaSectionId;
        this.customerForm.areaId = this.areaId;
        this.customerForm.kstatus = 1;
        if (valid) {
          if (this.modalType == 0) {
            // 添加