Prechádzať zdrojové kódy

Merge branch 'live' into edit

戴艳蓉 3 rokov pred
rodič
commit
27f923ee17

+ 1 - 1
.gitignore

@@ -1,6 +1,6 @@
 .DS_Store
 node_modules/
-# dist/
+dist/
 npm-debug.log*
 yarn-debug.log*
 yarn-error.log*

+ 1 - 1
package.json

@@ -1,5 +1,5 @@
 {
-  "name": "account-ui",
+  "name": "order-ui-pc",
   "version": "4.4.0",
   "description": "A magical vue admin. An out-of-box UI solution for enterprise applications. Newest development stack of vue. Lots of awesome features",
   "author": "daiyanrong <836647807@qq.com>",

+ 0 - 9
scripts/page/indexPage.js

@@ -194,15 +194,6 @@ module.exports = function (inputName, compoenntName) {
   <div v-else>
     <no-auth></no-auth>
   </div>
-       
-   
-      <add-edit
-        :showModel="showModel"
-        :id="modelId"
-        :isDetail="isDetail"
-        @refresh="searchList"
-        @cancel="showModel = false"
-      ></add-edit>
     </div>
    </template>
    <script>

+ 3 - 3
src/App.vue

@@ -6,7 +6,7 @@
 
 <script>
 import { JudgeEnvironment } from "@/utils/validate";
-// import asyncRequest from "@/apis/service/test";
+import asyncRequest from "@/apis/service/test";
 import { getCode } from "@/utils/dingding";
 export default {
   name: "App",
@@ -16,8 +16,8 @@ export default {
     };
   },
   async created() {
-    // const res = await asyncRequest.list({type_code:"WSM8b49211013191450"});
-    // console.log(res);
+    const res = await asyncRequest.list({type_code:"WSM8b49211013191450"});
+    console.log(res);
     // if (res && res.code === 0 && res.data) {
     //   this.tableData = res.data.list;
     //   this.pageInfo.total = Number(res.data.count);

+ 3 - 3
src/apis/service/purchaseIn/storeSet/index.js

@@ -10,10 +10,10 @@ export default {
   // 详情
   detail: (data, params) => http(api + "wareinfo", data, "post", params),
   // 更新
-  update: (data, params) => http(api + "update", data, "post", params),
+  update: (data, params) => http(api + "waresave", data, "post", params),
   // 修改状态
-  status: (data, params) => http(api + "accountstatus", data, "post", params),
+  status: (data, params) => http(api + "warestatus", data, "post", params),
     // 删除
-    delete: (data, params) => http(api + "delete", data, "post", params),
+  delete: (data, params) => http(api + "waredel", data, "post", params),
 };
    

+ 18 - 0
src/apis/service/sellOut/consultOrder/index.js

@@ -0,0 +1,18 @@
+// 物业管理员
+import http from "@/apis/axios";
+const api = "admin/";
+export default {
+  // 添加
+  add: (data, params) => http(api + "add", data, "post", params),
+  // 删除
+  delete: (data, params) => http(api + "Consultdel", data, "post", params),
+  // 分页查询
+  list: (data, params) => http(api + "Consultlist", data, "post", params),
+  // 详情
+  detail: (data, params) => http(api + "detail", data, "post", params),
+  // 更新
+  update: (data, params) => http(api + "update", data, "post", params),
+  // 修改状态
+  status: (data, params) => http(api + "accountstatus", data, "post", params),
+};
+   

+ 7 - 0
src/mixins/setNum.js

@@ -0,0 +1,7 @@
+export default {
+  methods: {
+    setNum(s) {
+      return s ? parseFloat(s + "").toFixed(2) : "-";
+    },
+  }
+}

+ 4 - 4
src/views/purchaseIn/storeSet/addEdit.vue

@@ -384,10 +384,10 @@ export default {
         await this.resetForm();
       } else {
         if (this.isDetail) {
-          this.title = "账号详情";
+          this.title = "仓库详情";
           this.rulesThis = {};
         } else {
-          this.title = "修改账号";
+          this.title = "修改仓库";
           this.rulesThis = this.rules;
         }
         await this.resetForm();
@@ -403,6 +403,7 @@ export default {
           addr_code,
           addrs_code,
           contactor,
+          contactor_name,
           mobile,
           name,
           supplierNo,
@@ -414,8 +415,7 @@ export default {
         } = res.data;
 
         this.supplier_name = supplier_name;
-        this.accountNames = ""
-        //accountNames||"";
+        this.accountNames = contactor_name
         this.ruleForm = {
           name: name, // 仓库名称
           supplierNo: [supplierNo], //供应商编码

+ 99 - 39
src/views/purchaseIn/storeSet/index.vue

@@ -118,6 +118,16 @@
             </el-row>
           </div>
         </template>
+        <template #status="{ scope }">
+          <el-tag
+            :size="tablebtnSize"
+            :type="scope.row.status == '0' ? 'warning' : ''"
+            v-text="
+              (statusOptions.find((item) => item.id == scope.row.status) || {})
+                .label || '--'
+            "
+          ></el-tag>
+        </template>
         <template #operation="{ scope }">
           <el-tooltip
             v-if="powers.some((item) => item == '007')"
@@ -130,7 +140,7 @@
               @click="openModal(scope.row.id, true)"
             ></i>
           </el-tooltip>
-          <el-tooltip 
+          <el-tooltip
             v-if="powers.some((item) => item == '005')"
             effect="dark"
             content="修改"
@@ -167,6 +177,17 @@
               @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, scope.row.status)"
+            ></i>
+          </el-tooltip>
         </template>
       </ex-table>
       <add-edit
@@ -251,7 +272,7 @@ export default {
         {
           prop: "wsm_code",
           label: "编号",
-          width:"170px"
+          width: "170px",
         },
         {
           prop: "name",
@@ -260,22 +281,29 @@ export default {
         {
           prop: "supplierNo",
           label: "供应商编号",
-          width:"140px"
+          width: "140px",
         },
         {
           prop: "supplier_name",
           label: "供应商公司",
-           'min-width':"140px"
+          "min-width": "140px",
+        },
+        {
+          prop: "status",
+          label: "状态",
+           width: "60px",
+          // sortable: true,
+          _slot_: "status",
         },
         {
-          prop: "contactor",
+          prop: "contactor_name",
           label: "负责人",
-          width:"70px"
+          width: "70px",
         },
         {
           prop: "mobile",
           label: "负责人电话",
-          width:"100px"
+          width: "100px",
         },
         {
           prop: "addtime",
@@ -285,7 +313,7 @@ export default {
         {
           prop: "",
           label: "操作",
-          width: "100px",
+          width: "140px",
           fixed: "right",
           _noset_: true,
           _slot_: "operation",
@@ -369,37 +397,69 @@ export default {
       this.loading = false;
     },
 
-    // async statusConfirm(id, status) {
-    //   let str = status === "1" ? "禁用" : "启用";
-    //   await this.$confirm("确定要改为" + str + "?", {
-    //     confirmButtonText: "确定",
-    //     cancelButtonText: "取消",
-    //     type: "warning",
-    //   })
-    //     .then(async () => {
-    //       this.loading = true;
-    //       const model = {
-    //         id: id,
-    //         status: status === "1" ? "0" : "1",
-    //       };
-    //       const res = await asyncRequest.status(model);
-    //       if (res && res.code === 0) {
-    //         this.loading = false;
-    //         this.$notify.success({
-    //           title: "状态修改成功!",
-    //           message: "",
-    //         });
-    //         await this.searchList();
-    //       } else if (res && res.code >= 100 && res.code <= 104) {
-    //         await this.logout();
-    //       } else {
-    //         this.$message.warning(res.message);
-    //       }
-    //     })
-    //     .catch(() => {
-    //       console.log("取消");
-    //     });
-    // },
+    async statusConfirm(id, status) {
+      let str = status === "1" ? "禁用" : "启用";
+      await this.$confirm("确定要改为" + str + "?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+          this.loading = true;
+          const model = {
+            id: id,
+            status: status === "1" ? "0" : "1",
+          };
+          const res = await asyncRequest.status(model);
+          if (res && res.code === 0) {
+            this.loading = false;
+            this.$notify.success({
+              title: "状态修改成功!",
+              message: "",
+            });
+            await this.searchList();
+          } else if (res && res.code >= 100 && res.code <= 104) {
+            await this.logout();
+          } else {
+            this.$message.warning(res.message);
+          }
+        })
+        .catch(() => {
+          console.log("取消");
+        });
+    },
+    async deleteById(id, status) {
+      if (status === "1") {
+        this.$message.warning("正在启用的仓库不能删除!");
+        return;
+      }
+      await this.$confirm("确定要删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+          const model = {
+            id: id,
+            // status: status === "1" ? "0" : "1",
+          };
+          const res = await asyncRequest.delete(model);
+          if (res && res.code === 0) {
+            this.$notify.success({
+              title: "删除成功",
+              message: "",
+            });
+            this.searchList();
+          } else if (res && res.code >= 100 && res.code <= 104) {
+            await this.logout();
+          } else {
+            this.$message.warning(res.message);
+          }
+        })
+        .catch(() => {
+          console.log("取消");
+        });
+    },
   },
 };
 </script>

+ 527 - 0
src/views/sellOut/consultOrder/addEdit.vue

@@ -0,0 +1,527 @@
+<template>
+  <el-dialog
+    title="咨询单详情"
+    :center="true"
+    align="left"
+    top="8vh"
+    width="1040px"
+    @close="closeModel"
+    :close-on-click-modal="false"
+    :visible.sync="showModelThis"
+    v-loading="loading"
+    element-loading-text="拼命加载中"
+    element-loading-spinner="el-icon-loading"
+    element-loading-background="rgba(0, 0, 0, 0.8)"
+  >
+    <el-card style="margin-top: -20px">
+      <el-row :gutter="10">
+        <el-col :span="24">
+          <el-form
+            ref="ruleForm"
+            :model="ruleForm"
+            status-icon
+            :rules="rulesThis"
+            label-width="100px"
+            class="demo-ruleForm"
+          >
+            <div style="padding: 0 0 12px 0">
+              <el-divider content-position="center">仓库信息</el-divider>
+            </div>
+
+            <el-row>
+              <el-col :span="12"
+                ><el-form-item
+                  label="所属公司"
+                  prop="supplierNo"
+                  style="width: 100%"
+                >
+                  <search-supplier
+                    :value="ruleForm.supplierNo"
+                    :names="supplier_name"
+                    :is-detail="id !== 'add'"
+                    :disabled="isDetail"
+                    :placeholder="'请输入公司名称'"
+                    @searchChange="supplierChange"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="仓库名称" prop="name">
+                  <el-input
+                    placeholder="请输入仓库名称"
+                    filterable
+                    :disabled="isDetail"
+                    maxlength="20"
+                    clearable
+                    v-model="ruleForm.name"
+                  >
+                  </el-input>
+                </el-form-item>
+              </el-col>
+            </el-row>
+
+            <el-row>
+              <el-col :span="12">
+                <el-form-item
+                  label="负责人"
+                  prop="contactor"
+                  style="width: 100%"
+                >
+                  <search-account
+                    :size="searchSize"
+                    :value="ruleForm.contactor"
+                    :placeholder="'请输入负责人'"
+                    :is-detail="id !== 'add'"
+                    :disabled="isDetail"
+                    :names="accountNames"
+                    @searchChange="accountChange"
+                  /> </el-form-item
+              ></el-col>
+              <el-col :span="12">
+                <el-form-item label="负责人电话" prop="mobile">
+                  <el-input
+                    placeholder="请输入联系人电话"
+                    v-model="ruleForm.mobile"
+                    maxlength="11"
+                    clearable
+                    :disabled="isDetail"
+                  >
+                  </el-input> </el-form-item
+              ></el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="12">
+                <el-form-item label="省/市/区" prop="addr_code">
+                  <select-area
+                    :placeholder="'请选择省/市/区'"
+                    :value="ruleForm.addr_code"
+                    :is-detail="id !== 'add'"
+                    :disabled="isDetail"
+                    @selectChange="selectAreaAddr_code"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="详细地址" prop="addr">
+                  <el-input
+                    placeholder="请输入详细地址"
+                    v-model="ruleForm.addr"
+                    maxlength="100"
+                    clearable
+                    :disabled="isDetail"
+                  >
+                  </el-input>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <div style="padding: 0 0 12px 0">
+              <el-divider content-position="center">收发货信息</el-divider>
+            </div>
+            <el-row>
+              <el-col :span="12">
+                <el-form-item label="联系人" prop="wsm_name">
+                  <el-input
+                    placeholder="请填写联系人"
+                    maxlength="20"
+                    :disabled="isDetail"
+                    v-model="ruleForm.wsm_name"
+                    clearable
+                  >
+                  </el-input> </el-form-item
+              ></el-col>
+              <el-col :span="12">
+                <el-form-item label="电话" prop="wsm_mobile">
+                  <el-input
+                    placeholder="请输入联系人电话"
+                    v-model="ruleForm.wsm_mobile"
+                    maxlength="11"
+                    :disabled="isDetail"
+                    clearable
+                  >
+                  </el-input> </el-form-item
+              ></el-col>
+            </el-row>
+
+            <el-row>
+              <el-col :span="12">
+                <el-form-item label="省/市/区" prop="addrs_code">
+                  <select-area
+                    :is-detail="id !== 'add'"
+                    :disabled="isDetail"
+                    :value="ruleForm.addrs_code"
+                    :placeholder="'请选择省/市/区'"
+                    @selectChange="selectAreaAddrs_code"
+                  /> </el-form-item
+              ></el-col>
+              <el-col :span="12">
+                <el-form-item label="详细地址" prop="wsm_addr">
+                  <el-input
+                    placeholder="请输入详细地址"
+                    maxlength="100"
+                    :disabled="isDetail"
+                    v-model="ruleForm.wsm_addr"
+                    clearable
+                  >
+                  </el-input> </el-form-item
+              ></el-col>
+            </el-row>
+          </el-form>
+        </el-col>
+        <el-col :span="24" style="text-align: right">
+          <el-button type="primary" @click="submitForm" v-if="!isDetail"
+            >保 存
+          </el-button>
+          <el-button @click="showModelThis = false">{{
+            isDetail ? "关 闭" : "取 消"
+          }}</el-button>
+        </el-col>
+      </el-row>
+    </el-card>
+  </el-dialog>
+</template>
+   <script>
+import asyncRequest from "@/apis/service/sellOut/consultOrder";
+import resToken from "@/mixins/resToken";
+export default {
+  name: "storeSet",
+  props: ["showModel", "id", "isDetail"],
+  mixins: [resToken],
+  data() {
+    return {
+      supplier_name: "",
+      accountNames:"",
+      loading: false,
+      title: "添加仓库",
+      showModelThis: this.showModel,
+      ruleForm: {
+        name: "", // 仓库名称
+        supplierNo: [], //供应商编码
+        // wsmtype: "", //仓库类型 目前随便填
+        addr_code: [], //仓库省市区
+        addr: "", //仓库详细地址
+        contactor: [], //仓库联系人
+        mobile: "", //仓库联系方式
+        // position: "", //联系人职位  目前随便填
+        // wsm_type: "", //目前随便填
+
+        wsm_name: "", //收发货联系人
+        wsm_mobile: "", //收发货联系方式
+        wsm_addr: "", //收发货地址详细
+        addrs_code: [], //收发货省市区
+      },
+      rulesThis: this.rules,
+      rules: {
+        name: [
+          { required: true, message: "请输入仓库名称", trigger: "blur" },
+          {
+            min: 1,
+            max: 20,
+            message: "长度在 1 到 20 个字符",
+            trigger: "blur",
+          },
+        ],
+        supplierNo: [
+          {
+            type: "array",
+            required: true,
+            message: "请选择供应商公司",
+            trigger: "change",
+          },
+        ],
+        addr_code: [
+          {
+            type: "array",
+            required: true,
+            message: "请选择仓库所在省/市/区",
+            trigger: "change",
+          },
+        ],
+        addr: [
+          { required: true, message: "请输入仓库详细地址", trigger: "blur" },
+          {
+            min: 1,
+            max: 100,
+            message: "长度在 1 到 100 个字符",
+            trigger: "blur",
+          },
+        ],
+
+        contactor: [
+          {
+            required: true,
+            type: "array",
+            message: "请选择仓库负责人",
+            trigger: "change",
+          },
+        ],
+
+        mobile: [
+          {
+            required: true,
+            // validator: validatemobile,
+            trigger: "blur",
+          },
+        ],
+        wsm_name: [
+          { required: true, message: "请输入收发货联系人", trigger: "blur" },
+          {
+            min: 1,
+            max: 20,
+            message: "长度在 1 到 20 个字符",
+            trigger: "blur",
+          },
+        ],
+        wsm_mobile: [
+          {
+            required: true,
+            // validator: validatewsmmobile,
+            trigger: "blur",
+          },
+        ],
+        addrs_code: [
+          {
+            type: "array",
+            required: true,
+            message: "请选择收发货所在省/市/区",
+            trigger: "change",
+          },
+        ],
+        wsm_addr: [
+          { required: true, message: "请输入收发货详细地址", trigger: "blur" },
+          {
+            min: 1,
+            max: 100,
+            message: "长度在 1 到 100 个字符",
+            trigger: "blur",
+          },
+        ],
+      },
+    };
+  },
+  watch: {
+    showModel: function (val) {
+      this.showModelThis = val;
+      if (val) {
+        this.initForm();
+      }
+    },
+    showModelThis(val) {
+      if (!val) {
+        this.$emit("cancel");
+      }
+    },
+  },
+  methods: {
+    closeModel() {
+      console.log("closeModel!!");
+    },
+    //供应商公司选择
+    supplierChange(e) {
+      if (e && e.id) {
+        this.ruleForm.supplierNo = [e.code]; //供应商编码
+      } else {
+        this.ruleForm.supplierNo = [];
+      }
+      this.$refs.ruleForm.validateField("supplierNo");
+    },
+    //仓库省市区
+    selectAreaAddr_code(e) {
+      this.ruleForm.addr_code = e;
+      this.$refs.ruleForm.validateField("addr_code");
+    },
+    //收发货省市区
+    selectAreaAddrs_code(e) {
+      this.ruleForm.addrs_code = e;
+      this.$refs.ruleForm.validateField("addrs_code");
+    },
+    //负责人选择
+    accountChange(e) {
+      if (e && e.id) {
+        this.ruleForm.contactor = [e.id];
+      } else {
+        this.ruleForm.contactor = [];
+      }
+      this.$refs.ruleForm.validateField("contactor");
+    },
+    async initForm() {
+      this.supplier_name = "";
+      this.loading = true;
+      if (this.id === "add") {
+        this.title = "新建仓库";
+        this.rulesThis = this.rules;
+        await this.resetForm();
+      } else {
+        if (this.isDetail) {
+          this.title = "仓库详情";
+          this.rulesThis = {};
+        } else {
+          this.title = "修改仓库";
+          this.rulesThis = this.rules;
+        }
+        await this.resetForm();
+        await this.initData();
+      }
+      this.loading = false;
+    },
+    async initData() {
+      const res = await asyncRequest.detail({ id: this.id });
+      if (res && res.code === 0 && res.data) {
+        const {
+          addr,
+          addr_code,
+          addrs_code,
+          contactor,
+          contactor_name,
+          mobile,
+          name,
+          supplierNo,
+          supplier_name,
+          wsm_addr,
+          wsm_code,
+          wsm_mobile,
+          wsm_name,
+        } = res.data;
+
+        this.supplier_name = supplier_name;
+        this.accountNames = contactor_name
+        this.ruleForm = {
+          name: name, // 仓库名称
+          supplierNo: [supplierNo], //供应商编码
+          // wsmtype: "", //仓库类型 目前随便填
+          addr_code: this.getCode(addr_code), //仓库省市区
+          addr: addr, //仓库详细地址
+          contactor: contactor ? [contactor] : [], //仓库联系人
+          mobile: mobile, //仓库联系方式
+          // position: "", //联系人职位  目前随便填
+          // wsm_type: "", //目前随便填
+
+          wsm_name: wsm_name, //收发货联系人
+          wsm_mobile: wsm_mobile, //收发货联系方式
+          wsm_addr: wsm_addr, //收发货地址详细
+          addrs_code: this.getCode(addrs_code), //收发货省市区
+        };
+        console.log(this.ruleForm);
+
+        // this.ruleForm = res.data;
+        // this.ruleForm.role_id = this.ruleForm.role;
+      } else if (res && res.code >= 100 && res.code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(res.message);
+      }
+    },
+    async resetForm() {
+      // 重置
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields();
+          this.$refs.ruleForm.clearValidate();
+          this.supplier_name = "";
+          this.accountNames = "";
+          this.ruleForm = {
+            name: "测试测试", // 仓库名称
+            supplierNo: [], //供应商编码
+            // wsmtype: "", //仓库类型 目前随便填
+            addr_code: [], //仓库省市区
+            addr: "测试地址测试地址", //仓库详细地址
+            contactor: [], //仓库联系人
+            mobile: "1989898977", //仓库联系方式
+            // position: "", //联系人职位  目前随便填
+            // wsm_type: "", //目前随便填
+
+            wsm_name: "张三", //收发货联系人
+            wsm_mobile: "19888888888", //收发货联系方式
+            wsm_addr: "测试1", //收发货地址详细
+            addrs_code: [], //收发货省市区
+          };
+        }
+      });
+    },
+    setCode(list) {
+      let model = {
+        provice_code: list[0],
+        city_code: list[1],
+        area_code: list[2],
+      };
+      return model;
+    },
+    getCode(obj) {
+      let arr = [];
+      arr.push(obj.provice_code);
+      arr.push(obj.city_code);
+      arr.push(obj.area_code);
+      return arr;
+    },
+    getId(list) {
+      let arr = JSON.parse(JSON.stringify(list));
+      return arr.join(",");
+    },
+    async submitForm() {
+      await this.$refs.ruleForm.validate(async (valid) => {
+        if (valid) {
+          this.loading = true;
+          const {
+            name,
+            supplierNo,
+            addr_code,
+            addr,
+            contactor,
+            mobile,
+            wsm_name,
+            wsm_mobile,
+            wsm_addr,
+            addrs_code,
+          } = JSON.parse(JSON.stringify(this.ruleForm));
+          const model = {
+            id: this.id,
+            name,
+            supplierNo: this.getId(supplierNo),
+            addr_code: this.setCode(addr_code),
+            addr,
+            contactor: this.getId(contactor),
+            mobile,
+            wsm_name,
+            wsm_mobile,
+            wsm_addr,
+            addrs_code: this.setCode(addrs_code),
+            position: "1", //暂时随便填
+            wsm_type: "1", //后台暂时不用
+            wsmtype: "1", //后台暂时不用
+          };
+          let res = {};
+          if (this.id === "add") {
+            delete model["id"];
+            res = await asyncRequest.add(model);
+          } else {
+            res = await asyncRequest.update(model);
+          }
+          this.loading = false;
+          if (res && res.code === 0) {
+            const title = this.id === "add" ? "添加成功" : "修改成功";
+            this.$notify.success({
+              title,
+              message: "",
+            });
+            this.showModelThis = false;
+            // 刷新
+            this.$emit("refresh");
+          } else if (res && res.code >= 100 && res.code <= 104) {
+            await this.logout();
+          } else {
+            this.$message.warning(res.message);
+          }
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+  },
+};
+</script>
+
+   <style lang="scss" scoped>
+.storeSet {
+}
+</style>
+   

+ 387 - 0
src/views/sellOut/consultOrder/index.vue

@@ -0,0 +1,387 @@
+<template>
+  <div class="consultOrder pagePadding">
+    <div
+      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
+    >
+      <ex-table
+        v-loading="loading"
+        :table="table"
+        :data="tableData"
+        :columns="columns"
+        :page="pageInfo"
+        :size="size"
+        @page-curr-change="handlePageChange"
+        @page-size-change="handleSizeChange"
+        @screen-reset="
+          pageInfo.curr = 1;
+          parmValue.page = 1;
+          searchList();
+        "
+        @screen-submit="
+          pageInfo.curr = 1;
+          parmValue.page = 1;
+          searchList();
+        "
+      >
+        <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-select
+                    :size="searchSize"
+                    v-model="parmValue.status"
+                    filterable
+                    clearable
+                    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="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>
+            </el-row>
+          </div>
+        </template>
+        <template #status="{ scope }">
+          <el-tag
+            :size="tablebtnSize"
+            :type="scope.row.status == '0' ? 'warning' : ''"
+            v-text="
+              (statusOptions.find((item) => item.id == scope.row.status) || {})
+                .label || '--'
+            "
+          ></el-tag>
+        </template>
+        <template #operation="{ scope }">
+          <el-tooltip
+            v-if="powers.some((item) => item == '007')"
+            effect="dark"
+            content="详情"
+            placement="top"
+          >
+            <i
+              class="el-icon-view tb-icon"
+              @click="openModal(scope.row.id, true)"
+            ></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, scope.row.status)"
+            ></i>
+          </el-tooltip>
+        </template>
+      </ex-table>
+      <add-edit
+        :id="modelId"
+        :sitem="sitem"
+        :show-model="showModel"
+        :is-detail="isDetail"
+        @refresh="searchList"
+        @cancel="showModel = false"
+      />
+    </div>
+    <div v-else>
+      <no-auth></no-auth>
+    </div>
+  </div>
+</template>
+   <script>
+import mixinPage from "@/mixins/elPaginationHandle";
+import resToken from "@/mixins/resToken";
+import setNum from "@/mixins/setNum";
+import addEdit from "./addEdit";
+import statusList from "@/assets/js/statusList";
+import asyncRequest from "@/apis/service/sellOut/consultOrder";
+import { mapGetters } from "vuex";
+
+export default {
+  name: "consultOrder",
+  mixins: [mixinPage, resToken, setNum],
+  components: {
+    addEdit,
+  },
+  computed: {
+    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
+    powers() {
+      let tran =
+        this.$store.getters.btnList.find(
+          (item) => item.menu_route == "consultOrder"
+        ) || {};
+      if (tran && tran.action && tran.action.length > 0) {
+        return tran.action;
+      } else {
+        return [];
+      }
+    },
+  },
+  data() {
+    return {
+      sitem: null,
+      // 状态
+      statusOptions: [
+        { id: "0", label: "禁用" },
+        { id: "1", label: "启用" },
+      ],
+      statusList: statusList,
+      loading: true,
+      showModel: false,
+      isDetail: false,
+      modelId: 0,
+      parmValue: {
+        name: "", // 业务员名字
+        username: "", // 账号
+        status: "", //
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+      },
+      tableData: [],
+      passwordModel: false,
+      passwordModelId: 0,
+      isPasswordDetail: false,
+      // 表格 - 数据
+      tableData: [],
+      // 表格 - 参数
+      table: {
+        stripe: true,
+        border: true,
+        _defaultHeader_: ["setcol"],
+      },
+      // 表格 - 分页
+      pageInfo: {
+        size: 15,
+        curr: 1,
+        total: 0,
+      },
+      // 表格 - 列参数
+      columns: [
+        {
+          prop: "zxNo",
+          label: "咨询单号",
+          fixed: "left",
+          width: "152px",
+        },
+        {
+          prop: "salesman",
+          label: "申请人",
+          width: "60px",
+        },
+        {
+          prop: "khNo",
+          label: "客户公司编码",
+          width: "125px",
+        },
+        {
+          prop: "khname",
+          label: "客户公司名称",
+          "min-width": "160px",
+        },
+        {
+          prop: "zxtype",
+          label: "咨询类型",
+          width: "85px",
+        },
+
+        {
+          prop: "cpname",
+          label: "产品名称",
+          "min-width": "160px",
+        },
+        {
+          prop: "unit",
+          label: "单位",
+          width: "45px",
+        },
+        {
+          prop: "num",
+          label: "需求数量",
+          width: "80px",
+        },
+        {
+          prop: "sale_price",
+          label: "财务定价",
+          width: "110px",
+        },
+        {
+          prop: "sale_fee",
+          label: "最终销售单价",
+          width: "110px",
+        },
+
+        {
+          prop: "color",
+          label: "颜色",
+        },
+        {
+          prop: "model",
+          label: "型号",
+        },
+        {
+          prop: "material",
+          label: "材质",
+        },
+        // {
+        //   prop: "status",
+        //   label: "状态",
+        //   _slot_: "status",
+        //   width: "80px",
+        // },
+        {
+          prop: "scheme_name",
+          label: "方案名称",
+        },
+        {
+          prop: "zxtime",
+          label: "创建时间",
+          width: "140px",
+        },
+        {
+          prop: "",
+          label: "操作",
+          fixed: "right",
+          _noset_: true,
+          width: "80px",
+          _slot_: "operation",
+        },
+      ],
+    };
+  },
+  mounted() {
+    this.searchList();
+  },
+
+  methods: {
+    restSearch() {
+      this.parmValue = {
+        name: "", // 业务员名字
+        username: "", // 账号
+        status: "", //
+        page: 1, // 页码
+        size: 10, // 每页显示条数
+      };
+      this.searchList();
+    },
+    openModal(id, isDetail) {
+      this.showModel = true;
+      this.modelId = id;
+      this.isDetail = isDetail;
+    },
+    async deleteById(id, status) {
+      await this.$confirm("确定要删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+          const model = {
+            id: id,
+            // status: status === "1" ? "0" : "1",
+          };
+          const res = await asyncRequest.delete(model);
+          if (res && res.code === 0) {
+            this.$notify.success({
+              title: "删除成功",
+              message: "",
+            });
+            this.searchList();
+          } else if (res && res.code >= 100 && res.code <= 104) {
+            await this.logout();
+          } else {
+            this.$message.warning(res.message);
+          }
+        })
+        .catch(() => {
+          console.log("取消");
+        });
+    },
+    async searchList() {
+      this.loading = true;
+      const res = await asyncRequest.list(this.parmValue);
+      if (res && res.code === 0 && res.data) {
+        this.tableData = res.data.list;
+        this.tableData.map((v) => {
+          v.sale_price = this.setNum(v.sale_price);
+          v.sale_fee = this.setNum(v.sale_fee);
+          // v.num =
+          //pa (v.sale_price);
+          return v;
+        });
+        //
+        this.pageInfo.total = Number(res.data.count);
+      } else if (res && res.code >= 100 && res.code <= 104) {
+        await this.logout();
+      } else {
+        this.tableData = [];
+        this.pageInfo.total = 0;
+      }
+      this.loading = false;
+    },
+  },
+};
+</script>
+   <style lang="scss" scoped>
+.consultOrder {
+}
+</style>
+   

+ 0 - 0
src/views/sellOut/consultOrder/咨询单管理