戴艳蓉 3 years ago
parent
commit
37af976e49

+ 1 - 1
src/apis/service/sellOut/consultOrder/index.js

@@ -9,7 +9,7 @@ export default {
   // 分页查询
   list: (data, params) => http(api + "Consultlist", data, "post", params),
   // 详情
-  detail: (data, params) => http(api + "detail", data, "post", params),
+  detail: (data, params) => http(api + "Consultinfo", data, "post", params),
   // 更新
   update: (data, params) => http(api + "update", data, "post", params),
   // 修改状态

+ 33 - 0
src/styles/index.scss

@@ -502,4 +502,37 @@ aside {
 
 .el-table .success-row {
   background: #f0f9eb !important;
+}
+
+.consultOrder {
+  .modal-form-style {
+    #demo-ruleForm.el-form {
+      .el-row {
+        border-left: 1px solid #ebeef5 !important;
+        border-bottom: 1px solid #ebeef5 !important;
+        .el-col {
+          border-top: 1px solid #ebeef5 !important;
+          border-right: 1px solid #ebeef5 !important;
+          .el-form-item {
+            margin: 0 !important;
+          
+            // >.el-form-item__label {
+            //   border-right: 1px solid #ebeef5 !important;
+            // }
+          }
+            label.el-form-item__label {
+              background: #fafafa !important;
+              font-weight: 400!important;
+              color: #909399!important;
+              border-right: 1px solid #ebeef5 !important;
+            }
+            .el-form-item__content{
+              padding:0 0 0 12px!important;
+              color: #606266!important;
+            }
+           
+        }
+      }
+    }
+  }
 }

+ 39 - 457
src/views/sellOut/consultOrder/addEdit.vue

@@ -13,289 +13,41 @@
     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 style="margin-top: -20px" class="modal-form-style">
+      <el-form
+        ref="ruleForm"
+        :model="ruleForm"
+        status-icon
+        :rules="rulesThis"
+        label-width="110px"
+        id="demo-ruleForm"
+      >
+        <el-row v-if="ruleForm !== null">
+          <el-col v-for="item in columns" :key="item.prop" :span="item.col">
+            <el-form-item :label="item.label + ':'">
+              <div>{{ ruleForm[item.prop] }}{{ item.unit }}</div>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
     </el-card>
   </el-dialog>
 </template>
    <script>
 import asyncRequest from "@/apis/service/sellOut/consultOrder";
 import resToken from "@/mixins/resToken";
+import setNum from "@/mixins/setNum";
+import columns from "./columnsForm";
 export default {
-  name: "storeSet",
+  name: "consultOrder",
   props: ["showModel", "id", "isDetail"],
-  mixins: [resToken],
+  mixins: [resToken, setNum],
   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",
-          },
-        ],
-      },
+      columns: columns,
+      ruleForm: null,
     };
   },
   watch: {
@@ -315,95 +67,27 @@ export default {
     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();
-      }
+      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;
+        this.ruleForm = res.data;
+        this.ruleForm.mark_fee = this.setNum(this.ruleForm.mark_fee);
+        this.ruleForm.cert_fee = this.setNum(this.ruleForm.cert_fee);
+        this.ruleForm.package_fee = this.setNum(this.ruleForm.package_fee);
+        this.ruleForm.open_fee = this.setNum(this.ruleForm.open_fee);
+        this.ruleForm.cost_fee = this.setNum(this.ruleForm.cost_fee);
+        this.ruleForm.delivery_fee = this.setNum(this.ruleForm.delivery_fee);
+        this.ruleForm.sale_craft = this.setNum(this.ruleForm.sale_craft);
+        this.ruleForm.total_fee = this.setNum(this.ruleForm.total_fee);
+        this.ruleForm.sale_price = this.setNum(this.ruleForm.sale_price);
+        this.ruleForm.sale_fee = this.setNum(this.ruleForm.sale_fee);
+        this.ruleForm.bare_fee = this.setNum(this.ruleForm.bare_fee);
       } else if (res && res.code >= 100 && res.code <= 104) {
         await this.logout();
       } else {
@@ -416,112 +100,10 @@ export default {
         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;
+          this.ruleForm = null;
         }
       });
     },
   },
 };
-</script>
-
-   <style lang="scss" scoped>
-.storeSet {
-}
-</style>
-   
+</script>

+ 314 - 0
src/views/sellOut/consultOrder/columnsForm.js

@@ -0,0 +1,314 @@
+export default [
+    // {
+    //     prop: "name",
+    //     label: "数据标题",
+    //     col: "8",
+    // },
+    {
+        prop: "sequenceNo",
+        label: "单据号",
+        col: "8",
+    },
+    {
+        prop: "cpzxNo",
+        label: "产品咨询单号",
+        col: "8",
+    },
+    {
+        prop: "salesman",
+        label: "申请人",
+        col: "8",
+    },
+    {
+        prop: "saler",
+        label: "采购人员",
+        col: "8",
+    },
+
+    {
+        prop: "brank",
+        label: "品牌",
+        col: "8",
+    },
+
+    {
+        prop: "cat_f",
+        label: "一级分类",
+        col: "8",
+    },
+    {
+        prop: "cat_s",
+        label: "二级分类",
+        col: "8",
+    },
+
+    {
+        prop: "wsm_type",
+        label: "库房性质",
+        col: "8",
+    },
+    {
+        prop: "model",
+        label: "型号",
+        col: "8",
+    },
+    {
+        prop: "khNo",
+        label: "客户编码",
+        col: "8",
+    },
+    {
+        prop: "khname",
+        label: "客户名称", 
+        col: "16",
+    },
+    {
+        prop: "cpNo",
+        label: "产品编码",
+        col: "8",
+    },
+    {
+        prop: "cpName",
+        label: "产品名称",
+        col: "16",
+    },
+
+
+    {
+        prop: "material",
+        label: "材质",
+        col: "8",
+    },
+    {
+        prop: "color",
+        label: "颜色",
+        col: "8",
+    },
+    {
+        prop: "unit",
+        label: "单位",
+        col: "8",
+    },
+    {
+        prop: "zxNo",
+        label: "咨询单号",
+        col: "8",
+    },
+    {
+        prop: "zxtime",
+        label: "咨询日期",
+        col: "8",
+    },
+    {
+        prop: "zxtype",
+        label: "咨询类型",
+        col: "8",
+    },
+    {
+        prop: "specs",
+        label: "规格",
+        col: "8",
+    },
+    {
+        prop: "desc",
+        label: "工艺说明",
+        col: "8",
+    },
+    {
+        prop: "metals",
+        label: "贵金属种类",
+        col: "8",
+    },
+    {
+        prop: "is_diff",
+        label: "是否有公差",
+        col: "8",
+    },
+    {
+        prop: "delivery_day",
+        label: "物流时间",
+        unit: "天",
+        col: "8",
+    },
+    {
+        prop: "work_day",
+        label: "产品工期",
+        unit: "天",
+        col: "8",
+    },
+    {
+        prop: "expiry_day",
+        label: "信息有效期",
+        unit: "天",
+        col: "8",
+    },
+    // {
+    //     prop: "min_num",
+    //     label: "最低一次一地起订量",
+    //     col: "8",
+    // },
+    // {
+    //     prop: "delivery_way",
+    //     label: "发货方式",
+    //     col: "8",
+    // },
+    {
+        prop: "mark_fee",
+        label: "加标费",
+        col: "8",
+    },
+    {
+        prop: "cert_fee",
+        label: "证书费",
+        col: "8",
+    },
+    {
+        prop: "package_fee",
+        label: "包装费",
+        col: "8",
+    },
+    {
+        prop: "open_fee",
+        label: "开模费",
+        col: "8",
+    },
+
+    {
+        prop: "cost_fee",
+        label: "成本工艺费",
+        col: "8",
+    },
+    {
+        prop: "delivery_fee",
+        label: "物流费",
+        col: "8",
+    },
+    // {
+    //     prop: "bare_fee",
+    //     label: "产品裸价",
+    //     col: "8",
+    // },
+    {
+        prop: "total_fee",
+        label: "成本合计",
+        col: "8",
+    },
+    // {
+    //     prop: "gold_price",
+    //     label: "当日进价",
+    //     col: "8",
+    // },
+
+    {
+        prop: "weight",
+        label: "商品重量",
+        unit: "g",
+        col: "8",
+    },
+
+    {
+        prop: "pay_way",
+        label: "付款方式",
+        col: "8",
+    },
+    {
+        prop: "tax",
+        label: "税点",
+        col: "8",
+    },
+
+    // {
+    //     prop: "addr",
+    //     label: "产品所在地",
+    //     col: "8",
+    // },
+
+    {
+        prop: "sale_craft",
+        label: "销售工艺费",
+        col: "8",
+    },
+
+    {
+        prop: "sale_price",
+        label: "采购定价",
+        col: "8",
+    },
+
+    // {
+    //     prop: "cgremark",
+    //     label: "采购备注",
+    //     col: "8",
+    // },
+
+    {
+        prop: "num",
+        label: "需求数量",
+        col: "8",
+    },
+    {
+        prop: "sale_fee",
+        label: "最终销售单价",
+        col: "8",
+    },
+    // {
+    //     prop: "cfNo",
+    //     label: "采反单号",
+    //     col: "8",
+    // },
+    // {
+    //     prop: "cfDate",
+    //     label: "采反日期",
+    //     col: "8",
+    // },
+
+
+    // {
+    //     prop: "proname",
+    //     label: "项目名称",
+    //     col: "8",
+    // },
+    // {
+    //     prop: "scheme_name",
+    //     label: "方案名称",
+    //     col: "8",
+    // },
+
+
+    // {
+    //     prop: "sale_remark",
+    //     label: "采购备注",
+    //     col: "8",
+    // },
+
+    // {
+    //     prop: "gysNo",
+    //     label: "供应商编码",
+    //     col: "8",
+    // },
+    // {
+    //     prop: "gysname",
+    //     label: "供应商名称",
+    //     col: "8",
+    // },
+    // {
+    //     prop: "status",
+    //     label: "状态",
+    //     col: "8",
+    // },
+    // {
+    //     prop: "is_del",
+    //     label: "是否删除",
+    //     col: "8",
+    // },
+    // {
+    //     prop: "addtime",
+    //     label: "添加时间",
+    //     col: "8",
+    // },
+    // {
+    //     prop: "updatetime",
+    //     label: "更新时间",
+    //     col: "8",
+    // },
+]