戴艳蓉 3 anos atrás
pai
commit
ed3073c7ad

+ 5 - 12
src/apis/service/serviceParam/Invoicing/index.js

@@ -3,23 +3,16 @@ import http from "@/apis/axios";
 const api = "admin/";
 export default {
   // 添加
-  add: (data, params) => http(api + "customeradd", data, "post", params),
+  add: (data, params) => http(api + "titlecreate", data, "post", params),
   // 删除
-  delete: (data, params) => http(api + "gooddel", data, "post", params),
+  delete: (data, params) => http(api + "titledelete", data, "post", params),
   // 分页查询
   list: (data, params) => http(api + "titlelist", data, "post", params),
   // 详情
-  detail: (data, params) => http(api + "customerinfo", data, "post", params),
+  detail: (data, params) => http(api + "titleinfo", data, "post", params),
   // 更改
-  update: (data, params) => http(api + "customersave", data, "post", params),
+  update: (data, params) => http(api + "titleedit", data, "post", params),
   // 更新状态
-  status: (data, params) => http(api + "customerstatus", data, "post", params),
-  // 提交审核申请
-  again: (data, params) => http(api + 'customeragain', data, 'post', params),
-  // 审核人提交审核结果
-  exam: (data, params) => http(api + 'customerexam', data, 'post', params),
-  // 获取全部企业
-  companyall: (data, params) => http(api + "companyall", data, "post", params),
-
+  status: (data, params) => http(api + "titlestatus", data, "post", params),
 
 };

+ 59 - 0
src/utils/validate.js

@@ -9,6 +9,65 @@
 export function isExternal(path) {
   return /^(https?:|mailto:|tel:)/.test(path)
 }
+//区-座-分 
+export function isqzf(s) {
+  let type = true
+  let arr = s.split('-')
+  if (arr.length === 3) {
+    type = setqj(arr[0]) && setzj(arr[1]) && setfj(arr[2])
+  } else {
+    type = false
+  }
+  console.log('console区-座-分 ' + type);
+  return type
+}
+// //区-座 
+export function isqz(s) {
+  let type = true
+  let arr = s.split('-')
+  if (arr.length === 2) {
+    type = setqj(arr[0]) && setzj(arr[1])
+  } else {
+    type = false
+  }
+  console.log('console区-座 ' + type);
+  return type
+}
+//座-分 
+export function iszf(s) {
+  let type = true
+  let arr = s.split('-')
+  if (arr.length === 2) {
+    type = setzj(arr[0]) && setfj(arr[1])
+  } else {
+    type = false
+  }
+  console.log('console座-分' + type);
+  return type
+}
+
+//座
+export function isz(s) {
+  let type = true
+  let arr = s.split('-')
+  if (arr.length === 1) {
+    type = setzj(arr[0])
+  } else {
+    type = false
+  }
+  console.log('console座' + type);
+  return type
+}
+function setqj(s) {
+  return /0\d{2,3}?$/.test(s) && (s.length == 3 || s.length == 4)
+}
+function setzj(s) {
+  return /\d{7,8}$/.test(s) && (s.length == 7 || s.length == 8)
+}
+function setfj(s) {
+  return /\d{1,6}$/.test(s) && (s.length > 0 && s.length < 7)
+}
+
 
 /** 用户名
  * @param {string} str

+ 2 - 2
src/views/biddingWorkbench/workbench/index.vue

@@ -82,8 +82,8 @@ export default {
       },
       // 状态
       statusOptions: [
-        { id: "1", label: "禁用" },
-        { id: "0", label: "启用" },
+        { id: "0", label: "禁用" },
+        { id: "1", label: "启用" },
       ],
       // 表格 - 数据
       tableData: [],

+ 2 - 2
src/views/goodStore/active/index.vue

@@ -262,8 +262,8 @@ export default {
       },
       // 状态
       statusOptions: [
-        { id: "1", label: "禁用" },
-        { id: "0", label: "启用" },
+        { id: "0", label: "禁用" },
+        { id: "1", label: "启用" },
       ],
       // 表格 - 数据
       tableData: [],

+ 2 - 2
src/views/goodStore/activeGood/index.vue

@@ -275,8 +275,8 @@ export default {
       },
       // 状态
       statusOptions: [
-        { id: "1", label: "禁用" },
-        { id: "0", label: "启用" },
+        { id: "0", label: "禁用" },
+        { id: "1", label: "启用" },
       ],
       // 表格 - 数据
       tableData: [],

+ 2 - 2
src/views/goodStore/brand/index.vue

@@ -252,8 +252,8 @@ export default {
       },
       // 状态
       statusOptions: [
-        { id: "1", label: "禁用" },
-        { id: "0", label: "启用" },
+        { id: "0", label: "禁用" },
+        { id: "1", label: "启用" },
       ],
       // 表格 - 数据
       tableData: [],

+ 2 - 2
src/views/goodStore/goldPrice/index.vue

@@ -245,8 +245,8 @@ export default {
       },
       // 状态
       statusOptions: [
-        { id: "1", label: "禁用" },
-        { id: "0", label: "启用" },
+        { id: "0", label: "禁用" },
+        { id: "1", label: "启用" },
       ],
       typeOptions: [
         { id: "1", label: "18K" },

+ 2 - 2
src/views/goodStore/goodsCost/index.vue

@@ -201,8 +201,8 @@ export default {
       },
       // 状态
       statusOptions: [
-        { id: "1", label: "禁用" },
-        { id: "0", label: "启用" },
+        { id: "0", label: "禁用" },
+        { id: "1", label: "启用" },
       ],
       // 表格 - 数据
       tableData: [],

+ 2 - 2
src/views/goodStore/specs/index.vue

@@ -253,8 +253,8 @@ export default {
       },
       // 状态
       statusOptions: [
-        { id: "1", label: "禁用" },
-        { id: "0", label: "启用" },
+        { id: "0", label: "禁用" },
+        { id: "1", label: "启用" },
       ],
       // 表格 - 数据
       tableData: [],

+ 2 - 2
src/views/goodStore/unit/index.vue

@@ -252,8 +252,8 @@ export default {
       },
       // 状态
       statusOptions: [
-        { id: "1", label: "禁用" },
-        { id: "0", label: "启用" },
+        { id: "0", label: "禁用" },
+        { id: "1", label: "启用" },
       ],
       // 表格 - 数据
       tableData: [],

+ 269 - 335
src/views/serviceParam/Invoicing/addEdit.vue

@@ -3,8 +3,8 @@
     :title="title"
     :center="true"
     align="left"
-    top="5vh"
-    width="700px"
+    top="10vh"
+    width="600px"
     @close="closeModel"
     :close-on-click-modal="false"
     :visible.sync="showModelThis"
@@ -13,175 +13,115 @@
     element-loading-spinner="el-icon-loading"
     element-loading-background="rgba(0, 0, 0, 0.8)"
   >
-    <el-card>
+    <el-card style="margin: -20px 0 0 0">
       <el-row :gutter="10">
         <el-col :span="24">
           <el-form
-            v-if="isApproval"
-            :model="cexForm"
-            status-icon
-            :rules="cexRules"
-            ref="cexForm"
-            label-width="80px"
-            class="cexForm-ruleForm"
-            ><el-row>
-              <el-col :span="12">
-                <el-row class="cexForm-div">
-                  <el-col :span="8" class="tr cexForm-label">所属企业:</el-col>
-                  <el-col :span="16" class="cexForm-main">{{
-                    dataInfo.company
-                  }}</el-col>
-                </el-row>
-                <el-row class="cexForm-div">
-                  <el-col :span="8" class="tr cexForm-label">账号:</el-col>
-                  <el-col :span="16" class="cexForm-main">{{
-                    dataInfo.username
-                  }}</el-col>
-                </el-row>
-                <el-row class="cexForm-div">
-                  <el-col :span="8" class="tr cexForm-label">真实姓名:</el-col>
-                  <el-col :span="16" class="cexForm-main">{{
-                    dataInfo.name
-                  }}</el-col>
-                </el-row>
-                <el-row class="cexForm-div">
-                  <el-col :span="8" class="tr cexForm-label">手机号:</el-col>
-                  <el-col :span="16" class="cexForm-main">{{
-                    dataInfo.mobile
-                  }}</el-col>
-                </el-row>
-                <el-row class="cexForm-div">
-                  <el-col :span="8" class="tr cexForm-label">邮箱:</el-col>
-                  <el-col :span="16" class="cexForm-main">{{
-                    dataInfo.email
-                  }}</el-col>
-                </el-row>
-                <el-row class="cexForm-div" v-if="dataInfo.company">
-                  <el-col :span="8" class="tr cexForm-label">备注:</el-col>
-                  <el-col :span="16" class="cexForm-main">{{
-                    dataInfo.remark
-                  }}</el-col>
-                </el-row>
-              </el-col>
-              <el-col :span="12">
-                <el-form-item label="审核状态" prop="status">
-                  <el-select
-                    v-model="cexForm.status"
-                    placeholder="请选择审核状态"
-                    @change="selectChange"
-                  >
-                    <el-option
-                      v-for="item in statusList"
-                      :key="item.code"
-                      :label="item.name"
-                      :value="item.code"
-                    >
-                    </el-option>
-                  </el-select>
-                </el-form-item>
-                <el-form-item label="审核说明" prop="remark">
-                  <el-input
-                    v-model="cexForm.remark"
-                    type="textarea"
-                    placeholder="请输入审核说明"
-                    :rows="5"
-                    maxlength="300"
-                    show-word-limit
-                  ></el-input>
-                </el-form-item>
-                <el-col :span="24" style="text-align: right">
-                  <el-button type="primary" @click="submitCexForm"
-                    >保 存
-                  </el-button>
-                  <el-button @click="showModelThis = false">取 消</el-button>
-                </el-col>
-              </el-col>
-            </el-row></el-form
-          >
-
-          <el-form
-            v-else
             :model="ruleForm"
             status-icon
             :rules="rulesThis"
             ref="ruleForm"
-            label-width="80px"
+            :size="'small'"
+            label-width="108px"
             class="demo-ruleForm"
             ><el-row>
               <el-col :span="24">
-                <el-form-item label="所属企业" prop="company_id">
-                  <el-select
+                <el-form-item label="企业客户" prop="companyNo">
+                  <search-customer
+                    :value="ruleForm.companyNo"
+                    :isDetail="this.id !== 'add'"
+                    :names="companyNoNames"
                     :disabled="isDetail"
-                    v-model="ruleForm.company_id"
-                    filterable
-                    clearable
-                    :size="searchSize"
-                    placeholder="请选择所属企业"
-                    style="width: 100%"
-                  >
-                    <el-option
-                      v-for="item in companyList"
-                      :key="'company' + item.id"
-                      :label="item.company"
-                      :value="item.id"
-                      :disabled="item.status === '0'"
-                    />
-                  </el-select>
-                  <!-- <el-input
-                    v-model="ruleForm.company_id"
+                    @searchChange="companyNo_change"
+                    :placeholder="'企业客户'"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="24">
+                <el-form-item label="发票抬头" prop="invoice_title">
+                  <el-input
                     :disabled="isDetail"
-                  /> -->
+                    placeholder="发票抬头"
+                    maxlength="100"
+                    v-model="ruleForm.invoice_title"
+                  />
                 </el-form-item>
               </el-col>
               <el-col :span="24">
-                <el-form-item
-                  v-if="id === 'add' || isDetail"
-                  label="账号"
-                  prop="username"
-                >
-                  <el-input v-model="ruleForm.username" :disabled="isDetail" />
+                <el-form-item label="纳税登记证号" prop="invoice_code">
+                  <el-input
+                    placeholder="纳税登记证号"
+                    :disabled="isDetail"
+                    maxlength="100"
+                    v-model="ruleForm.invoice_code"
+                  />
                 </el-form-item>
               </el-col>
               <el-col :span="24">
-                <el-form-item label="真实姓名" prop="contact">
-                  <el-input v-model="ruleForm.contact" :disabled="isDetail" />
+                <el-form-item label="开户银行名称" prop="invoice_bank">
+                  <el-input
+                    placeholder="开户银行名称"
+                    :disabled="isDetail"
+                    maxlength="100"
+                    v-model="ruleForm.invoice_bank"
+                  />
                 </el-form-item>
               </el-col>
               <el-col :span="24">
-                <el-form-item label="手机号" prop="mobile">
-                  <el-input v-model="ruleForm.mobile" :disabled="isDetail" />
+                <el-form-item label="开户银行账号" prop="invoice_bankNo">
+                  <el-input
+                    :disabled="isDetail"
+                    placeholder="开户银行账号"
+                    maxlength="100"
+                    v-model="ruleForm.invoice_bankNo"
+                  />
                 </el-form-item>
               </el-col>
               <el-col :span="24">
-                <el-form-item label="邮箱" prop="email">
-                  <el-input v-model="ruleForm.email" :disabled="isDetail" />
+                <el-form-item label="纳税登记地址" prop="invoice_addr">
+                  <el-input
+                    :disabled="isDetail"
+                    placeholder="纳税登记地址"
+                    maxlength="100"
+                    v-model="ruleForm.invoice_addr"
+                  />
                 </el-form-item>
               </el-col>
+              <el-col :span="24">
+                <el-form-item label="联系电话" prop="invoice_mobile">
+                  <el-input
+                    :disabled="isDetail"
+                    placeholder="联系电话"
+                    maxlength="100"
+                    v-model="ruleForm.invoice_mobile"
+                  >
+                    <el-select
+                      v-model="schange"
+                      slot="prepend"
+                      style="width: 110px"
+                      placeholder="电话类型"
+                      @change="selectChangeMobile"
+                    >
+                      <el-option
+                        v-for="item in soptins"
+                        :key="item.code + 'indexs'"
+                        :label="item.name"
+                        :value="item.code"
+                      ></el-option>
+                    </el-select> </el-input
+                ></el-form-item>
+              </el-col>
             </el-row>
-            <el-form-item label="信息备注" prop="remark">
-              <el-input
-                v-model="ruleForm.remark"
-                type="textarea"
-                placeholder="请输入备注"
-                :rows="5"
-                maxlength="300"
-                show-word-limit
-                :disabled="isDetail"
-              ></el-input>
-            </el-form-item>
-            <el-col :span="24" style="text-align: right">
-              <el-tag
-                type="warning"
-                class="fl"
-                style="max-width: 500px"
-                v-if="dataInfo.ex_remark && dataInfo.ex_status === '2'"
-                >审核备注:{{ dataInfo.ex_remark }}</el-tag
-              >
 
-              <el-button type="primary" @click="submitForm" v-if="!isDetail"
+            <el-col :span="24" style="text-align: right">
+              <el-button
+                type="primary"
+                :size="'small'"
+                @click="submitForm"
+                v-if="!isDetail"
                 >保 存
               </el-button>
-              <el-button @click="showModelThis = false">{{
+              <el-button @click="showModelThis = false" :size="'small'">{{
                 isDetail ? "关 闭" : "取 消"
               }}</el-button>
             </el-col>
@@ -193,158 +133,142 @@
 </template>
    <script>
 import asyncRequest from "@/apis/service/serviceParam/Invoicing";
-import {
-  isnumber,
-  isMobile,
-  validEmail,
-  isAlphanumeric,
-  isChinese,
-  isEmoticon,
-  validAlphabets,
-} from "@/utils/validate";
-import statusList from "@/assets/js/cexStatusList";
+import { isLicense, isqzf, isqz, iszf, isz, isMobile } from "@/utils/validate";
 export default {
-  name: "specs",
+  name: "Invoicing",
   props: ["showModel", "id", "isDetail", "isApproval"],
+  watch: {
+    showModel: function (val) {
+      this.showModelThis = val;
+      if (val) {
+        this.initForm();
+      }
+    },
+    showModelThis(val) {
+      if (!val) {
+        this.$emit("cancel");
+      }
+    },
+  },
   data() {
-    const validateusername = (rule, value, callback) => {
-      if (value === "") {
-        callback(new Error("账号不能为空!"));
-      } else {
-        if (value.lenght < 6 || value.lenght > 18) {
-          callback(new Error("账号规则为6~18位数字与字母组合!"));
+    const validateLicense = (rule, value, callback) => {
+      if (value !== "") {
+        if (!isLicense(value)) {
+          callback(new Error("纳税登记证号不正确!"));
         } else {
-          if (isnumber(value)) {
-            callback(new Error("账号规则为6~18位数字与字母组合!"));
-          } else if (validAlphabets(value)) {
-            callback(new Error("账号规则为6~18位数字与字母组合!"));
-          } else if (!isAlphanumeric(value)) {
-            callback(new Error("账号规则为6~18位数字与字母组合!"));
-          } else {
-            callback();
-          }
+          callback();
         }
+      } else {
+        callback(new Error("请输入纳税登记证号!"));
       }
     };
-    const validatecontact = (rule, value, callback) => {
-      if (value === "") {
-        callback(new Error("真实姓名不能为空!"));
-      } else {
-        if (value.lenght < 2 || value.lenght > 12) {
-          callback(new Error("真实姓名规则为2~12位汉字!"));
-        } else {
-          if (!isChinese(value)) {
-            callback(new Error("真实姓名为6~18位数字与字母组合!"));
-          } else if (isEmoticon(value)) {
-            callback(new Error("真实姓名为6~18位数字与字母组合!"));
+
+    const validatemobile = (rule, value, callback) => {
+      if (value !== "") {
+        // 区-固-分
+        if (this.schange === "1") {
+          if (isqzf(value)) {
+            callback();
           } else {
+            callback(
+              new Error("规则为区号[0+2~3位]-固定电话[7~8位]-分机号[1~6位]!")
+            );
+          }
+          //区-固
+        } else if (this.schange === "2") {
+          if (isqz(value)) {
             callback();
+          } else {
+            callback(new Error("规则为区号[0+2~3位]-固定电话[7~8位]!"));
           }
-        }
-      }
-    };
-    const validatemobile = (rule, value, callback) => {
-      if (value === "") {
-        callback(new Error("手机号不能为空!"));
-      } else {
-        if (!isMobile(value)) {
-          callback(new Error("手机号格式不正确!"));
+          //固-分
+        } else if (this.schange === "3") {
+          if (iszf(value)) {
+            callback();
+          } else {
+            callback(new Error("规则为固定电话[7~8位]-分机号[1~6位]!"));
+          }
+          //固
+        } else if (this.schange === "4") {
+          if (isz(value)) {
+            callback();
+          } else {
+            if (value.length > 3) {
+              let a = value.slice(0, 3);
+              let b = value.slice(3);
+              if ((a === "400" || a === "800") && b.length === 7) {
+                callback();
+              } else {
+                callback(new Error("纯固定电话规则为[7~8位]或10位!"));
+              }
+            }
+          }
+          //手机号
         } else {
-          callback();
+          if (!isMobile(value)) {
+            callback(new Error("手机号格式不正确!"));
+          } else {
+            callback();
+          }
         }
-      }
-    };
-
-    const validateEmail = (rule, value, callback) => {
-      if (value === "") {
-        callback(new Error("邮箱不能为空!"));
       } else {
-        if (!validEmail(value)) {
-          callback(new Error("邮箱格式不正确!"));
-        } else {
-          callback();
-        }
+        callback(new Error("请输入联系电话!"));
       }
     };
     return {
-      statusList: statusList,
+      statusList: [],
       loading: false,
       title: "添加企业客户",
       showModelThis: this.showModel,
       dataInfo: {},
-      companyList: [],
-      cexForm: {
-        id: this.id,
-        remark: "",
-        status: "1",
-      },
-      ruleForm: {
-        id: this.id, //企业id
-        company_id: "", //id
-        type: "2",
-        username: "", //账号
-        contact: "", //真实姓名
-        mobile: "", //手机号
-        emailz: "", //邮箱
-        remark: "",
-      },
-      cexRules: {
-        status: {
-          required: true,
-          message: "请选择审核状态",
-          trigger: "change",
+      companyNoNames: "",
+      soptins: [
+        {
+          code: "1",
+          name: "区-固-分",
         },
-        remark: [
-          {
-            required: false,
-            message: "请输入审核说明!",
-            trigger: "blur",
-          },
-        ],
-      },
+        {
+          code: "2",
+          name: "区-固",
+        },
+        {
+          code: "3",
+          name: "固-分",
+        },
+        {
+          code: "4",
+          name: "固",
+        },
+        {
+          code: "5",
+          name: "手机号",
+        },
+      ],
+      companyList: [],
+      schange: "1",
+      ruleForm: {},
       rulesThis: this.rules,
       rules: {
-        company_id: [
-          {
-            required: true,
-            message: "请选择企业!",
-            trigger: "change",
-          },
+        companyNo: [
+          { required: true, message: "请选择申请企业", trigger: "change" },
         ],
-        username: [
-          {
-            required: true,
-            validator: validateusername,
-            trigger: "blur",
-          },
+        invoice_title: [
+          { required: true, message: "请选择发票抬头", trigger: "change" },
         ],
-        contact: [
-          {
-            required: true,
-            validator: validatecontact,
-            trigger: "blur",
-          },
+        invoice_code: [
+          { required: true, validator: validateLicense, trigger: "blur" },
         ],
-        mobile: [
-          {
-            required: true,
-            validator: validatemobile,
-            trigger: "blur",
-          },
+        invoice_bank: [
+          { required: true, message: "请输入开户银行名称", trigger: "blur" },
         ],
-        email: [
-          {
-            required: true,
-            validator: validateEmail,
-            trigger: "blur",
-          },
+        invoice_bankNo: [
+          { required: true, message: "请输入开户银行账号", trigger: "blur" },
         ],
-
-        remark: [
-          {
-            required: false,
-            trigger: "blur",
-          },
+        invoice_addr: [
+          { required: true, message: "请输入纳税登记地址", trigger: "blur" },
+        ],
+        invoice_mobile: [
+          { required: true, validator: validatemobile, trigger: "blur" },
         ],
       },
     };
@@ -361,65 +285,56 @@ export default {
       }
     },
     async initForm() {
-      if (this.isApproval) {
-        this.loading = true;
-        this.title = "企业客户审核";
-        await this.getCompanyList();
-        await this.initData();
-        await this.resetcexForm();
-        this.selectChange();
-        this.loading = false;
+      this.loading = true;
+      this.resetFormData();
+      if (this.id === "add") {
+        this.title = "添加企业客户";
+        this.rulesThis = this.rules;
+        await this.resetForm();
       } else {
-        this.loading = true;
-        await this.getCompanyList();
-        if (this.id === "add") {
-          this.title = "添加企业客户";
-
-          // this.ruleForm.isAdmin = 0;
-          this.rulesThis = this.rules;
-          await this.resetForm();
+        if (this.isDetail) {
+          this.title = "企业客户";
+          this.rulesThis = {};
         } else {
-          if (this.isDetail) {
-            this.title = "企业客户";
-            this.rulesThis = {};
-          } else {
-            this.title = "修改企业客户";
-            this.rulesThis = this.rules;
-          }
-          await this.resetForm();
-          await this.initData();
+          this.title = "修改企业客户";
+          this.rulesThis = this.rules;
         }
-        this.loading = false;
-      }
-    },
-    async resetcexForm() {
-      if (this.$refs.cexForm) {
-        this.$refs.cexForm.resetFields();
-        this.$refs.cexForm.clearValidate();
-        this.cexForm = {
-          id: this.id,
-          remark: "",
-          status: "1",
-        };
+        await this.resetForm();
+        await this.initData();
       }
+      this.loading = false;
     },
     async initData() {
       this.loading = true;
-      let res = await asyncRequest.detail({ id: this.id });
+      const { code, data, message } = await asyncRequest.detail({
+        id: this.id,
+      });
       this.loading = false;
-      if (res.code === 0) {
-        let data = res.data;
-        this.dataInfo = data;
+      if (code === 0) {
+        const {
+          id,
+          companyNo,
+          companyName,
+          invoice_title,
+          invoice_code,
+          invoice_bank,
+          invoice_bankNo,
+          invoice_addr,
+          invoice_mobile,
+        } = data;
+        this.companyNoNames = companyName || "";
         this.ruleForm = {
-          id: this.id, //企业id
-          type: "2",
-          company_id: data.company_id, //企业id
-          username: data.username, //账号
-          contact: data.name, //真实姓名
-          mobile: data.mobile, //手机号
-          email: data.email, //邮箱
-          remark: data.remark,
+          id: id, //企业id
+          companyNo: companyNo ? [companyNo] : [],
+          invoice_title: invoice_title || "",
+          invoice_code: invoice_code || "",
+          invoice_bank: invoice_bank || "",
+          invoice_bankNo: invoice_bankNo || "",
+          invoice_addr: invoice_addr || "",
+          invoice_mobile: invoice_mobile || "",
         };
+        this.setTypeM(invoice_mobile);
+      } else {
       }
     },
     async resetForm() {
@@ -428,19 +343,23 @@ export default {
         if (this.$refs.ruleForm) {
           this.$refs.ruleForm.resetFields();
           this.$refs.ruleForm.clearValidate();
-          this.ruleForm = {
-            id: this.id, //企业id
-            type: "2",
-            company_id: "", //企业id
-            username: "", //账号
-            contact: "", //联系人
-            mobile: "", //手机号
-            emailz: "", //邮箱
-            remark: "",
-          };
+          this.resetFormData();
         }
       });
     },
+
+    resetFormData() {
+      this.ruleForm = {
+        id: "",
+        companyNo: [],
+        invoice_title: "",
+        invoice_code: "",
+        invoice_bank: "",
+        invoice_bankNo: "",
+        invoice_addr: "",
+        invoice_mobile: "",
+      };
+    },
     async submitCexForm() {
       await this.$refs.cexForm.validate(async (valid) => {
         if (valid) {
@@ -469,11 +388,30 @@ export default {
         }
       });
     },
+    selectChangeMobile() {
+      this.$refs.ruleForm.validateField("invoice_mobile");
+    },
+    //判断联系电话类型
+    setTypeM(mobile) {
+      if (isMobile(mobile)) {
+        this.schange = "5";
+      } else if (isqzf(mobile)) {
+        this.schange = "1";
+      } else if (isqz(mobile)) {
+        this.schange = "2";
+      } else if (iszf(mobile)) {
+        this.schange = "3";
+      } else {
+        this.schange = "4";
+      }
+      console.log(this.schange);
+    },
     async submitForm() {
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {
           this.loading = true;
           let obj = JSON.parse(JSON.stringify(this.ruleForm));
+          obj.companyNo = obj.companyNo.toString();
           let res = {};
           if (this.id === "add") {
             delete obj["id"];
@@ -504,18 +442,14 @@ export default {
         this.companyList = res.data;
       }
     },
-  },
-  watch: {
-    showModel: function (val) {
-      this.showModelThis = val;
-      if (val) {
-        this.initForm();
-      }
-    },
-    showModelThis(val) {
-      if (!val) {
-        this.$emit("cancel");
+    //企业客户选择
+    companyNo_change(e) {
+      if (e && e.code) {
+        this.ruleForm.companyNo = [e.code];
+      } else {
+        this.ruleForm.companyNo = [];
       }
+      this.$refs.ruleForm.validateField("companyNo");
     },
   },
 };

+ 139 - 121
src/views/serviceParam/Invoicing/index.vue

@@ -28,88 +28,108 @@
       >
         <template #table-header="{}">
           <div style="width: 100%">
-            <el-row style="padding: 0 0 0 80px">
-              <el-col :span="24">
-                <el-col :span="4" style="width: 120px">
+            <el-row style="padding: 0 0 10px 80px">
+              <el-col :span="6" style="width: 303px">
+                <period-date-picker
+                  :type="1"
+                  :width="'135px'"
+                  :size="searchSize"
+                  :start="parmValue.start"
+                  :end="parmValue.end"
+                  @timeReturned="handleTime"
+                />
+              </el-col>
+              <el-col :span="4" style="width: 160px">
+                <el-select
+                  v-model="parmValue.status"
+                  filterable
+                  clearable
+                  :size="searchSize"
+                  placeholder="规格状态"
+                  style="width: 100%"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option
+                    v-for="item in statusList"
+                    :key="'status' + item.code"
+                    :label="item.name"
+                    :value="item.code"
+                  />
+                </el-select>
+              </el-col>
+
+              <el-col
+                :span="3"
+                class="fr"
+                style="width: 66px; padding: 0 0 0 10px"
+              >
+                <el-button
+                  type="primary"
+                  :size="searchSize"
+                  @click="searchList"
+                >
+                  刷新
+                </el-button>
+              </el-col>
+              <el-col
+                :span="3"
+                class="fr"
+                style="width: 66px; padding: 0 0 0 10px"
+              >
+                <el-button
+                  type="warning"
+                  :size="searchSize"
+                  @click="restSearch"
+                >
+                  重置
+                </el-button>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="4" style="width: 543px">
+                <el-input
+                  :size="searchSize"
+                  v-model="sinput"
+                  :maxlength="50"
+                  @blur="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                  placeholder="关键字"
+                >
                   <el-select
-                    :size="searchSize"
-                    v-model="parmValue.status"
-                    filterable
-                    clearable
-                    placeholder="账号状态"
-                    style="width: 100%"
-                    @change="
-                      pageInfo.curr = 1;
-                      parmValue.page = 1;
-                      searchList();
-                    "
+                    v-model="select"
+                    slot="prepend"
+                    style="width: 125px"
+                    placeholder="请选择"
                   >
-                    <el-option
-                      v-for="item in statusList"
-                      :key="'status' + item.code"
-                      :label="item.name"
-                      :value="item.code"
-                    />
+                    <el-option label="纳税登记证号" value="invoice_code" />
+                    <el-option label="联系方式" value="invoice_mobile" />
+                    <el-option label="发票抬头" value="invoice_title" />
+                    <el-option label="企业客户名称" value="companyName" />
+                    <el-option label="创建人" value="creater" />
                   </el-select>
-                </el-col>
-                <el-col :span="4" style="width: 150px; padding: 0 0 0 10px">
-                  <el-input
-                    :size="searchSize"
-                    v-model="parmValue.name"
-                    :maxlength="40"
-                    placeholder="业务员姓名"
-                  />
-                </el-col>
-                <el-col :span="4" style="width: 160px; padding: 0 0 0 10px">
-                  <el-input
-                    :size="searchSize"
-                    v-model="parmValue.username"
-                    :maxlength="40"
-                    placeholder="手机号"
-                  />
-                </el-col>
-                <el-col :span="4" style="width: 54px">
-                  <el-button
-                    :size="searchSize"
-                    type="primary"
-                    class="fr"
-                    icon="el-icon-search"
-                    @click="searchList"
-                /></el-col>
-                <el-col :span="4" style="width: 66px">
-                  <el-button
-                    type="warning"
-                    class="fr"
-                    :size="searchSize"
-                    @click="restSearch"
-                  >
-                    重置
-                  </el-button>
-                </el-col>
-                <el-col :span="3" style="width: 66px; float: right">
-                  <el-button
-                    :size="searchSize"
-                    type="primary"
-                    style="float: right; margin-left: 5px"
-                    @click="searchList"
-                  >
-                    刷新
-                  </el-button>
-                </el-col>
-                <el-col
-                  :span="3"
-                  style="width: 66px; float: right"
-                  v-if="powers.some((item) => item == '003')"
+                </el-input>
+              </el-col>
+              <el-col
+                :span="3"
+                class="fr"
+                style="width: 66px; padding: 0 0 0 10px"
+                v-if="powers.some((item) => item == '003')"
+              >
+                <el-button
+                  :size="searchSize"
+                  type="success"
+                  style="float: right"
+                  @click="openModal({}, '003')"
                 >
-                  <el-button
-                    :size="searchSize"
-                    type="success"
-                    style="float: right"
-                    @click="openModal('add', false)"
-                  >
-                    添加
-                  </el-button>
-                </el-col>
+                  添加
+                </el-button>
               </el-col>
             </el-row>
           </div>
@@ -135,7 +155,7 @@
         <template #status="{ scope }">
           <el-tag
             :size="tablebtnSize"
-            :type="scope.row.status == '0' ? 'warning' : ''"
+            :type="scope.row.status === '0' ? 'warning' : ''"
             v-text="
               (statusOptions.find((item) => item.id == scope.row.status) || {})
                 .label || '--'
@@ -163,7 +183,7 @@
           >
             <i
               class="el-icon-view tb-icon"
-              @click="openModal(scope.row.id, true, scope.row)"
+              @click="openModal(scope.row.id, true)"
             ></i>
           </el-tooltip>
           <el-tooltip
@@ -174,7 +194,7 @@
           >
             <i
               class="el-icon-edit tb-icon"
-              @click="openModal(scope.row.id, false, scope.row)"
+              @click="openModal(scope.row.id, false)"
             ></i>
           </el-tooltip>
           <el-tooltip
@@ -203,24 +223,26 @@
               @click="statusConfirm(scope.row.id, scope.row.status)"
             ></i>
           </el-tooltip>
+          <el-tooltip
+            v-if="powers.some((item) => item == '006')"
+            effect="dark"
+            content="删除"
+            placement="top"
+          >
+            <i
+              class="el-icon-delete tb-icon"
+              @click="deleteById(scope.row.id)"
+            ></i>
+          </el-tooltip>
         </template>
       </ex-table>
       <add-edit
         :id="modelId"
-        :sitem="sitem"
         :show-model="showModel"
         :is-detail="isDetail"
         @refresh="searchList"
         @cancel="showModel = false"
       />
-
-      <reset-password
-        :id="passwordModelId"
-        :show-model="passwordModel"
-        :is-detail="isPasswordDetail"
-        @refresh="searchList"
-        @cancel="passwordModel = false"
-      />
     </div>
     <div v-else>
       <no-auth></no-auth>
@@ -255,14 +277,15 @@ export default {
   },
   data() {
     return {
-      sitem: null,
       // 状态
       statusOptions: [
-        { id: "0", label: "用" },
-        { id: "1", label: "用" },
+        { id: "0", label: "用" },
+        { id: "1", label: "用" },
       ],
+      select: "invoice_code",
+      sinput: "",
       statusList: [],
-      loading: false,
+      loading: true,
       showModel: false,
       isDetail: false,
       modelId: 0,
@@ -296,43 +319,28 @@ export default {
         {
           prop: "companyNo",
           label: "客户编码",
-          width: "110px",
+          width: "125px",
         },
         {
           prop: "companyName",
           label: "客户名称",
-          width: "110px",
+          "min-width": "150px",
         },
         {
           prop: "invoice_code",
-          label: "纳税人识别号",
-          width: "110px",
+          label: "纳税登记证号",
+          width: "155px",
         },
         {
           prop: "invoice_title",
           label: "发票抬头",
-          width: "110px",
+          "min-width": "150px",
         },
 
         {
-          prop: "mobile",
-          label: "联系电话",
-          width: "110px",
-        },
-        {
-          prop: "mobile",
+          prop: "invoice_mobile",
           label: "联系电话",
-          width: "110px",
-        },
-        {
-          prop: "mobile",
-          label: "联系电话",
-          width: "110px",
-        },
-        {
-          prop: "mobile",
-          label: "联系电话",
-          width: "110px",
+          "min-width": "110px",
         },
         {
           prop: "status",
@@ -340,6 +348,11 @@ export default {
           _slot_: "status",
           width: "70px",
         },
+        {
+          prop: "creater",
+          label: "创建人",
+          width: "60px",
+        },
         {
           prop: "addtime",
           label: "创建时间",
@@ -357,7 +370,7 @@ export default {
     };
   },
   mounted() {
-    // this.searchList();
+    this.searchList();
   },
   methods: {
     restSearch() {
@@ -376,11 +389,10 @@ export default {
       };
       this.searchList();
     },
-    openModal(id, isDetail, sitem) {
+    openModal(id, isDetail) {
       this.showModel = true;
       this.modelId = id;
       this.isDetail = isDetail;
-      this.sitem = sitem;
     },
     openPasswordModal(id, isDetail) {
       this.passwordModel = true;
@@ -397,9 +409,9 @@ export default {
         .then(async () => {
           const model = {
             id: id,
-            status: status === "1" ? "0" : "1",
+            // status: status === "1" ? "0" : "1",
           };
-          const res = await asyncRequest.status(model);
+          const res = await asyncRequest.delete(model);
           if (res && res.code === 0) {
             this.$notify.success({
               title: "删除成功",
@@ -418,6 +430,12 @@ export default {
     },
     async searchList() {
       this.loading = true;
+      this.parmValue.invoice_code = "";
+      this.parmValue.invoice_mobile = "";
+      this.parmValue.invoice_title = "";
+      this.parmValue.companyName = "";
+      this.parmValue.creater = "";
+      this.parmValue[this.select] = this.sinput;
       const res = await asyncRequest.list(this.parmValue);
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;

+ 2 - 2
src/views/serviceParam/parameter/index.vue

@@ -252,8 +252,8 @@ export default {
       },
       // 状态
       statusOptions: [
-        { id: "1", label: "禁用" },
-        { id: "0", label: "启用" },
+        { id: "0", label: "禁用" },
+        { id: "1", label: "启用" },
       ],
       // 表格 - 数据
       tableData: [],

+ 2 - 2
src/views/serviceParam/supplier/index.vue

@@ -253,8 +253,8 @@ export default {
       },
       // 状态
       statusOptions: [
-        { id: "1", label: "禁用" },
-        { id: "0", label: "启用" },
+        { id: "0", label: "禁用" },
+        { id: "1", label: "启用" },
       ],
       // 表格 - 数据
       tableData: [],

+ 2 - 2
src/views/serviceParam/terrace/index.vue

@@ -253,8 +253,8 @@ export default {
       },
       // 状态
       statusOptions: [
-        { id: "1", label: "禁用" },
-        { id: "0", label: "启用" },
+        { id: "0", label: "禁用" },
+        { id: "1", label: "启用" },
       ],
       // 表格 - 数据
       tableData: [],