haoxuan
2023-08-25 db64fc3d6ff2809ec6b5d8cc42a21c67746df209
采购订单的 添加  2023-8-25
5个文件已添加
4个文件已修改
1973 ■■■■■ 已修改文件
src/api/purchaseManage/purchase.js 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/style/index.scss 115 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/CommonFormTableView.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/TableCommonView.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/purchaseManage/purchase/components/AddPurchase.vue 704 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/purchaseManage/purchase/components/AddPurchase2.vue 536 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/purchaseManage/purchase/components/BomDialog.vue 272 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/purchaseManage/purchase/components/SelectClientDialog.vue 192 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/purchaseManage/purchase/index.vue 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/purchaseManage/purchase.js
New file
@@ -0,0 +1,99 @@
import request from "@/common/untils/request.js"
// 销售线索列表
export function getSalesLeadsList(data) {
  return request({
    url: "/api/salesLeads/list",
    method: "post",
    data
  })
}
// 添加销售线索
export function getAddSalesLeads(data) {
  return request({
    url: "/api/salesLeads/add",
    method: "post",
    data
  })
}
// 删除销售线索
export function getDeleteSalesLeads(data) {
  return request({
    url: "/api/salesLeads/delete",
    method: "delete",
    data
  })
}
// 更新销售线索
export function getUpdateSalesLeads(data) {
  return request({
    url: "/api/salesLeads/update",
    method: "put",
    data
  })
}
// 推进销售线索
export function pushSalesSources(data) {
  return request({
    url: "/api/salesLeads/push",
    method: "post",
    data
  })
}
// 商机来源列表
export function getSalesSourcesList() {
  return request({
    url: "/api/salesSources/list",
    method: "get"
  })
}
// 添加报价单
export function getAddQuotation(data) {
  return request({
    url: "/api/quotation/add",
    method: "post",
    data
  })
}
// 更新报价单
export function getUpdateQuotation(data) {
  return request({
    url: "/api/quotation/update",
    method: "put",
    data
  })
}
// 获取客户来源等所有数据
export function getAllData() {
  return request({
    url: "/api/data/getAllData",
    method: "get"
  })
}
// 客户管理列表
export function getClientList(data) {
  return request({
    url: "/api/client/list",
    method: "post",
    data
  })
}
// ----bom --- 計量單位 的數據
export function postGetUnitDictList(data) {
  return request({
    url: "/api-s/v1/dict/getUnitDictList",
    method: "post",
    data
  })
}
// ----bom --- 計量單位 的數據  更新
export function postGetSaveSUnitDict(data) {
  return request({
    url: "/api-s/v1/dict/saveUnitDict",
    method: "post",
    data
  })
}
src/assets/style/index.scss
@@ -11,3 +11,118 @@
  border: 0;
  outline: 0;
}
// 间距
.margin_left_3px{
  margin-left:3px;
}
.margin_left_5px{
  margin-left:5px;
}
.margin_left_10px{
  margin-left:10px;
}
.margin_left_15px{
  margin-left:15px;
}
.margin_left_20px{
  margin-left:20px;
}
.margin_right_5px{
  margin-right:5px;
}
.margin_right_10px{
  margin-right:10px;
}
.margin_right_15px{
  margin-right:15px!important;
}
.margin_right_20px{
  margin-right:20px;
}
.margin_right_40px{
  margin-right:40px;
}
.margin_top_10px{
  margin-top:10px;
}
.margin_top_20px{
  margin-top:20px;
}
.margin_top_30px{
  margin-top:30px;
}
.margin_top_35px{
  margin-top:35px;
}
.margin_top_40px{
  margin-top:40px;
}
.margin_bottom_2px{
  margin-bottom:2px;
}
.margin_bottom_10px{
  margin-bottom:10px!important;
}
.margin_bottom_15px{
  margin-bottom:15px!important;
}
.margin_bottom_20px{
  margin-bottom:20px!important;
}
.margin_bottom_30px{
  margin-bottom:30px!important;
}
.margin_bottom_40px{
  margin-bottom:40px!important;
}
.margin_bottom_50px{
  margin-bottom:50px!important;
}
//
.float_left{
  float:left;
}
.float_right{
  float:right;
}
//
.line_height_32px{
  line-height:32px;
}
.text_indent_20{
  text-indent:20px;
}
.text_indent_30{
  text-indent:30px;
}
// 字体大小
.font_size_12{
  font-size:12px;
}
.font_size_13{
  font-size:13px;
}
.font_size_14{
  font-size:14px;
}
.font_size_15{
  font-size:15px;
}
.font_size_16{
  font-size:16px;
}
.font_size_18{
  font-size:18px;
}
.font_size_20{
  font-size:20px!important;
}
.font_size_30{
  font-size:30px!important;
}
.font_size_40{
  font-size:40px!important;
}
.cursor_pointer{
  cursor: pointer;
}
src/components/makepager/CommonFormTableView.vue
@@ -63,7 +63,7 @@
                    <i class="el-icon-circle-plus-outline" title="选择"></i>
                  </div>
                  <div class="common-select-btn" @click="clearupClient(scope.row)">
                    <i class="el-icon-edit-outline" title="清除"></i>
                    <i class="el-icon-remove-outline" title="清除"></i>
                  </div>
                </div>
              </el-form-item>
@@ -129,7 +129,7 @@
      <el-button size="small" type="primary" @click="add">新增</el-button>
      <!-- <el-button size="small" type="primary" disabled>导入明细</el-button> -->
      <el-button size="small" type="primary" @click="empty">清空</el-button>
      <el-button size="small" type="primary" @click="recalculate" :disabled="isRecalculate ? false : true"
      <el-button size="small" v-if="recalculateShow" type="primary" @click="recalculate" :disabled="isRecalculate ? false : true"
        >重算</el-button
      >
    </div>
@@ -185,10 +185,16 @@
          total: false,
          refundable: false,
          sumProp: [],
          titleProp:["#", "产品名称"],
          mergeNumber: 1
        }
      }
    }
    },
    recalculateShow:{
      type:[Boolean],
      defalut:true,
    },
  },
  data() {
    return {
@@ -263,7 +269,7 @@
          sums[index] = "小计:"
          return
        }
        const title = ["#", "产品名称"]
        const title = this.showSummary.titleProp
        // 去除某些不需要计算的数据
        if (title.includes(column.label)) {
          sums[index] = ""
src/components/makepager/TableCommonView.vue
@@ -33,7 +33,7 @@
              ? "--"
              : dateFormat("YYYY-mm-dd HH:MM:SS", scope.row[item.prop])
          }}</span>
          <span v-else-if="item.isClick && scope.row[item.prop]" class="sel-name" @click="selNameClick(scope.row)">{{
          <span v-else-if="item.isClick && scope.row[item.prop]" class="sel-name" @click="selCommonClick(scope.row)">{{
            scope.row[item.prop]
          }}</span>
          <span v-else-if="item.isFirst">{{ scope.row[item.prop] ? "是" : "否" }}</span>
src/views/purchaseManage/purchase/components/AddPurchase.vue
New file
@@ -0,0 +1,704 @@
<template>
  <div class="add-quotation">
    <el-dialog
      :title="editCommonConfig.title + '采购单'"
      :visible.sync="editConfig.visible"
      :width="dialogWidth"
      :before-close="handleClose"
      append-to-body
      custom-class="iframe-dialog"
    >
      <el-form
        ref="form"
        :model="editConfig.infomation"
        :rules="rules"
        label-position="right"
        label-width="130px"
        size="mini"
        style="height: 60vh; overflow-x: hidden"
      >
        <!-- 信息 -->
        <div class="basic-info">
          <!-- 基本信息 -->
          <div class="basic-info-title">基本信息</div>
          <div class="basic-info-view">
            <el-row>
              <el-col :span="12">
                <el-form-item
                  label="采购类型"
                  prop="brand"
                  class="form-item float_left"
                >
                  <el-select
                    placeholder="请选择采购类型"
                    v-model="editConfig.infomation.client_name"
                    clearable
                    style="width: calc(100% - 30px)"
                  >
                    <el-option
                      v-for="ele in plcBrandList"
                      :key="ele.id"
                      :label="ele.name"
                      :value="ele.name"
                    ></el-option>
                  </el-select>
                  <i
                    class="el-icon-setting margin_left_10px cursor_pointer"
                    style="font-size: 20px; color: #333"
                    @click="handleShow"
                  ></i>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="供应商名称" prop="client_name">
                  <div class="custom-name">
                    <el-autocomplete
                      style="width: calc(100% - 40px)"
                      v-model="editConfig.infomation.client_name"
                      :fetch-suggestions="
                        (queryString, callback) => {
                          querySearchAsync(queryString, callback, 'client');
                        }
                      "
                      value-key="name"
                      placeholder="请选择"
                      @select="handleSelectClient('client', $event)"
                    ></el-autocomplete>
                    <div
                      class="common-select-btn"
                      @click="selClientClick('client')"
                    >
                      <i class="el-icon-circle-plus-outline" title="选择"></i>
                    </div>
                    <div
                      v-if="
                        editConfig.infomation.client_name &&
                        editConfig.infomation.client_name.length > 0
                      "
                      class="common-select-btn"
                      @click="clearupClient('client')"
                    >
                      <i class="el-icon-remove-outline" title="清除"></i>
                    </div>
                  </div>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="单据来源" prop="number">
                  <el-input
                    v-model="editConfig.infomation.number"
                    placeholder="请填写"
                  ></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="采购单名称" prop="number">
                  <el-input
                    v-model="editConfig.infomation.number"
                    placeholder="请填写"
                  ></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="供应商联系人" prop="number">
                  <el-input
                    v-model="editConfig.infomation.number"
                    placeholder="请填写"
                  ></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="联系电话" prop="contact_phone">
                  <el-input
                    v-model="editConfig.infomation.contact_phone"
                    placeholder="请填写"
                  ></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="签约日期" prop="validity_date">
                  <el-date-picker
                    v-model="editConfig.infomation.validity_date"
                    style="width: 100%"
                    type="date"
                    placeholder="选择日期"
                    value-format="yyyy-MM-dd"
                  >
                  </el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="交付日期" prop="validity_date">
                  <el-date-picker
                    v-model="editConfig.infomation.validity_date"
                    style="width: 100%"
                    type="date"
                    placeholder="选择日期"
                    value-format="yyyy-MM-dd"
                  >
                  </el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item label="备注信息" prop="member_id">
                  <el-input
                    type="textarea"
                    :autosize="{ minRows: 3, maxRows: 4 }"
                    maxlength="500"
                    clearable
                    v-model="editConfig.infomation.member_id"
                  ></el-input>
                </el-form-item>
              </el-col>
            </el-row>
          </div>
          <!-- 产品管理 -->
          <div class="basic-info-title" style="display: flex">产品信息</div>
          <div class="product-view">
            <CommonFormTableView
              :show-summary="showSummary"
              :recalculateShow="false"
              :product-table-list="productTableList"
              @inputContent="inputContent"
              @addProductClick="addProductClick"
              @emptyProductClick="emptyProductClick"
              @recalculateProductClick="recalculateProductClick"
              @clearupProduct="clearupProduct"
            />
          </div>
          <div class="table-bottom">
            <div class="table-bottom-item">
              <div class="table-bottom-l">
                <el-form-item label="整单折扣" prop="member_id">
                  <el-select
                    v-model="editConfig.infomation.fieldName"
                    placeholder="请选择"
                    filterable
                  >
                    <el-option label="百分比降价" :value="1"></el-option>
                    <el-option label="直接降价" :value="2"></el-option>
                  </el-select>
                </el-form-item>
              </div>
              <div class="table-bottom-r">
                <el-form-item label="" prop="member_id">
                  <el-input
                    v-model="editConfig.infomation.number"
                    size="mini"
                    placeholder="请填写"
                  ></el-input>
                </el-form-item>
              </div>
            </div>
            <div class="table-bottom-item">
              <div class="table-bottom-l">
                <el-form-item label="调整" prop="member_id">
                  <el-select
                    v-model="editConfig.infomation.fieldName"
                    placeholder="请选择"
                    filterable
                  >
                    <el-option label="增加" :value="1"></el-option>
                    <el-option label="减少" :value="2"></el-option>
                  </el-select>
                </el-form-item>
              </div>
              <div class="table-bottom-r">
                <el-form-item label="" prop="member_id">
                  <el-input
                    v-model="editConfig.infomation.number"
                    size="mini"
                    placeholder="请填写"
                  ></el-input>
                </el-form-item>
              </div>
            </div>
            <div class="table-bottom-item">
              <div class="table-bottom-l">合计</div>
              <div class="table-bottom-r">26000.00</div>
            </div>
          </div>
        </div>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <!-- <el-button type="primary" size="small" @click="editConfig.visible = false">保并提交审批</el-button> -->
        <el-button type="primary" size="small" @click="saveClick('form')"
          >保存</el-button
        >
        <el-button size="small" @click="editConfig.visible = false"
          >取消</el-button
        >
      </div>
      <!-- 选择客户 -->
      <SelectClientDialog
        v-if="editSelectClientConfig.editVisible"
        :edit-common-config="editSelectClientConfig"
        @selClient="selClient"
      />
    </el-dialog>
    <BomDialog
      ref="editDialog"
      @sucessSet="handleGetBomKindDictList"
      @handleConfirmSave="handleConfirmSave"
      :workList="plcBrandList"
      title="采购类型"
    ></BomDialog>
  </div>
</template>
<script>
import CommonFormTableView from "@/components/makepager/CommonFormTableView";
import BomDialog from "@/views/purchaseManage/purchase/components/BomDialog";
import {
  getAddQuotation,
  getUpdateQuotation,
  getAllData,
} from "@/api/purchaseManage/purchase";
// import {
//   postGetUnitDictList,
//   postGetSaveSUnitDict,
// } from "@/api/purchaseManage/purchase";
import SelectClientDialog from "@/views/purchaseManage/purchase/components/SelectClientDialog";
export default {
  name: "QuotationDialog",
  props: {
    editCommonConfig: {
      type: Object,
      default: () => {
        return {
          visible: false,
          title: "创建",
          infomation: {},
        };
      },
    },
  },
  components: { SelectClientDialog, CommonFormTableView,BomDialog },
  computed: {
    searchCommonHeight() {
      return this.$refs.searchCommonView.offsetHeight;
    },
    contactNamelist() {
      return this.$store.state.getClientName.contactNamelist;
    },
  },
  data() {
    return {
      dialogWidth: "50%",
      editConfig: this.editCommonConfig,
      rules: {
        client_id: [{ required: true, message: "请输入", trigger: "blur" }],
        number: [{ required: true, message: "请输入", trigger: "blur" }],
        quotation_status_id: [
          { required: true, message: "请选择", trigger: "change" },
        ],
        member_id: [
          { required: true, message: "请选择负责人", trigger: "change" },
        ],
        contact_phone: [
          {
            required: true,
            message: "请填写",
            trigger: "change",
          },
          { validator: this.validatorPhone, trigger: "change" },
        ],
      },
      memberOptions: [],
      quotationStatusOptions: [{ id: 1, name: "不知道" }], // 报价单状态
      currencyOptions: [{ id: 1, name: "人民币" }], // 币种
      approvalWorkflowOptions: [], // 审批流程
      productTableList: {},
      showSummary: {
        show: true,
        total: false,
        sumProp: ["Amount", "total"],
        titleProp: [
          "编号",
          "产品名称",
          "产品编号",
          "计量单位",
          "规格型号",
          "采购单价",
          "描述",
        ],
        mergeNumber: 4,
      },
      editSelectClientConfig: {
        editVisible: false,
        title: "",
        infomation: {},
      },
      clientId: this.editCommonConfig.infomation.client_id,
      contactId: this.editCommonConfig.infomation.contact_id,
      saleChanceId: this.editCommonConfig.infomation.sale_chance_id,
      tableData: [],
      productId: 1,
      isNoProduct: true,
      clientList: [],
      plcBrandList:[],
    };
  },
  created() {
    this.setTableForm();
    this.getCommonData();
  },
  methods: {
    // PLC配置设置
    handleShow() {
      // this.handleGetBomKindDictList();
      this.$refs.editDialog.editDialogVisible = true;
    },
    //  PLC配置
    handleGetBomKindDictList(val) {
      console.log(val,'val')
      // postGetUnitDictList().then((res) => {
      //   this.plcBrandList = res.data;
      //   if (val) {
      //     for (let i in this.plcBrandList) {
      //       if (this.plcBrandList[i].isDefault) {
      //         this.form.unit = this.form.unit
      //           ? this.form.unit
      //           : this.plcBrandList[i].name;
      //         this.$set(this.form, "unit", this.form.unit);
      //         break;
      //       }
      //     }
      //   }
      // });
    },
    handleConfirmSave(data) {
      console.log(data,'data')
      // postGetSaveSUnitDict({ data: data }).then((res) => {
      //   if (res.code == 200) {
      //     this.$message({
      //       message: "操作成功!",
      //       type: "success",
      //     });
      //     this.$refs.editDialog.editDialogVisible = false;
      //     this.handleGetBomKindDictList();
      //   }
      // });
    },
    validatorPhone(rule, value, callback) {
      if (value) {
        if (value == undefined || value == null) {
          callback(new Error("请输入"));
        } else {
          if (value.length != 11) {
            callback(new Error("长度在11个字符!"));
          } else {
            var reg =
              /^1(3\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\d|9[0-35-9])\d{8}$/;
            if (!reg.test(value)) {
              callback(new Error("请填写正确的联系电话!"));
            } else {
              callback();
            }
          }
        }
      } else {
        callback();
      }
    },
    getCommonData() {
      getAllData()
        .then((res) => {
          this.memberOptions = res.data.member;
          this.quotationStatusOptions = res.data.quotationStatus;
        })
        .catch((err) => {
          console.log(err);
        });
    },
    // 保存
    saveClick(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          for (let i = 0; i < this.tableData.length; i++) {
            if (this.tableData[i].name.length === 0) {
              this.isNoProduct = true;
              break;
            } else {
              this.isNoProduct = false;
            }
          }
          if (this.isNoProduct) {
            this.$message.error("产品名称不能为空");
          } else {
            const params = this.saveParams();
            console.log(params);
            if (this.editConfig.title === "创建") {
              getAddQuotation(params).then((res) => {
                console.log(res);
                this.editConfig.visible = false;
                if (res.code === 200) {
                  this.$message.success("添加成功");
                  this.$parent.getData();
                }
              });
            } else {
              getUpdateQuotation(params).then((res) => {
                this.editConfig.visible = false;
                if (res.code === 200) {
                  this.$message.success("编辑成功");
                  this.$parent.getData();
                }
              });
            }
          }
        } else {
          console.log("error submit");
          return false;
        }
      });
    },
    saveParams() {
      let data = this.editConfig.infomation;
      let params = {
        id: this.editConfig.title === "创建" ? 0 : data.id,
        client_id: this.clientId || 0,
        conditions: data.conditions || "",
        contact_id: this.contactId || 0,
        file: data.file || "",
        member_id: data.member_id || 0,
        number: data.number || "",
        quotation_status_id: data.quotation_status_id || 0,
        sale_chance_id: this.saleChanceId || 0,
        validity_date: data.validity_date || "",
        products: this.tableData,
      };
      return params;
    },
    handleClose() {
      this.editConfig.visible = false;
    },
    // 选择客户相关方法
    querySearchAsync(queryString, cb, value) {
      var restaurants = [];
      if (value === "client") {
        restaurants = this.clientList;
      } else if (value === "contact") {
        restaurants = this.contactNamelist;
      }
      var results = queryString
        ? restaurants.filter(this.createStateFilter(queryString))
        : restaurants;
      cb(results);
    },
    createStateFilter(queryString) {
      return (state) => {
        return (
          state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0
        );
      };
    },
    handleSelectClient(value, item) {
      console.log(value);
      if (value === "client") {
        this.clientId = item.id;
      } else if (value === "chance") {
        this.saleChanceId = item.id;
      } else {
        this.contactId = item.id;
      }
    },
    selClientClick() {
      this.editSelectClientConfig.editVisible = true;
    },
    selClient(row) {
      this.editConfig.infomation.client_name = row.name;
      this.clientId = row.id;
    },
    // 清除已选择用户
    clearupClient(value) {
      if (value == "client") {
        this.editConfig.infomation.client_name = "";
        this.$set(this.editConfig.infomation, "client_name", "");
        this.clientId = null;
        this.$forceUpdate();
      }
    },
    // 添加附件
    addAnnexClick() {},
    // 设置允许上传文件格式
    setFormatClick() {},
    setTableForm() {
      if (
        this.editConfig.title === "创建" ||
        this.editConfig.infomation.products.length === 0
      ) {
        this.tableData = [
          {
            productId: this.productId,
            id: 0,
            amount: 0,
            desc: "",
            name: "",
            number: "",
            price: 0,
            total: 0,
          },
        ];
      } else {
        this.tableData = this.editConfig.infomation.products;
        this.tableData.map((item, index) => {
          item.productId = index + 1;
        });
      }
      this.productTableList = {
        tableData: this.tableData,
        tableColumn: [
          { label: "编号", prop: "productId", width: 40 },
          {
            label: "产品名称",
            prop: "name",
            productName: true,
            isRequird: true,
          },
          { label: "产品编号", prop: "number" },
          { label: "计量单位", prop: "number" },
          { label: "规格型号", prop: "number" },
          { label: "数量", prop: "amount", inputNumber: true, isRequird: true },
          {
            label: "采购单价",
            prop: "price",
            inputFloat: true,
            isRequird: true,
          },
          { label: "价税合计", prop: "total", inputFloat: true },
          { label: "描述", prop: "name", input: true },
        ],
      };
    },
    // 产品列表输入
    inputContent(val, prop, row) {
      this.productId = row.productId;
      this.tableData.map((item) => {
        if (item.productId === row.productId) {
          item[prop] = val;
        }
      });
    },
    // 产品新增
    addProductClick() {
      this.productId++;
      this.tableData.push({
        productId: this.productId,
        id: 0,
        amount: 0,
        desc: "",
        name: "",
        number: "",
        price: 0,
        total: 0,
      });
      this.showSummary.show = true;
    },
    //  产品清空
    emptyProductClick() {
      this.productId = 1;
      this.tableData = [
        {
          productId: this.productId,
          id: 0,
          amount: 0,
          desc: "",
          name: "",
          number: "",
          price: 0,
          total: 0,
        },
      ];
      this.productTableList.tableData = this.tableData;
    },
    // 产品重算
    recalculateProductClick() {},
    clearupProduct(data) {
      this.tableData = data;
      this.productTableList.tableData = this.tableData;
    },
  },
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.table-bottom {
  width: 500px;
  float: right;
  margin-right: 20px;
  margin-top: 10px;
  height: auto;
  line-height: 30px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #333;
  .table-bottom-item {
    width: 100%;
    text-align: right;
    .table-bottom-l {
      width: 250px;
      float: left;
    }
    .table-bottom-r {
      width: calc(100% - 250px);
      float: right;
    }
  }
}
::v-deep {
  .iframe-dialog .el-dialog__body {
    .basic-info {
      overflow: hidden;
      .basic-info-title {
        background-color: #f4f8fe;
        padding-left: 10px;
        font-size: 15px;
        font-weight: bold;
        color: #666;
        height: 42px;
        line-height: 42px;
      }
      .basic-info-view {
        margin-top: 10px;
        padding-right: 40px;
        .custom-name,
        .common-select {
          display: flex;
          .common-select-sel {
            width: 270px;
          }
          .common-select-btn {
            margin-left: 5px;
            font-size: 16px;
            cursor: pointer;
          }
        }
      }
      .annex-view {
        display: flex;
        color: #6166d3;
        .setFormat {
          margin-left: 10px;
        }
      }
    }
    .unflod-collapse {
      display: flex;
      height: 30px;
      justify-content: center;
      align-items: center;
      color: #6166d3;
    }
    .dialog-footer {
      background-color: #f5f5f5;
      height: 55px;
      line-height: 55px;
    }
  }
}
</style>
src/views/purchaseManage/purchase/components/AddPurchase2.vue
New file
@@ -0,0 +1,536 @@
<template>
  <el-dialog
    :close-on-click-modal="false"
    :visible.sync="islook"
    width="60rem"
    class="add-event-dialog"
    @close="shutdown"
  >
    <div slot="title" class="tac drawerHeader">
      <span>{{ editRow.id ? "编辑" : "创建" }}采购单</span>
    </div>
    <div class="dialog-content-box">
      <div class="margin_bottom_20px font_size_14 title">基础信息</div>
      <el-form
        ref="form"
        :rules="rules"
        :model="form"
        label-width="120px"
        label-position="left"
      >
        <el-form-item
          label="采购类型"
          prop="brand"
          class="form-item float_left"
        >
          <el-select
            placeholder="请选择采购类型"
            v-model="form.brand"
            clearable
            style="width: calc(100% - 30px)"
          >
            <el-option
              v-for="ele in plcBrandList"
              :key="ele.id"
              :label="ele.name"
              :value="ele.name"
            ></el-option>
          </el-select>
          <i
            class="el-icon-setting margin_left_10px cursor_pointer"
            style="font-size: 20px; color: #333"
            @click="handleShow"
          ></i>
        </el-form-item>
        <el-form-item label="供应商名称" prop="returnNumber" class="form-item">
          <el-input
            v-model="form.returnNumber"
            maxlength="50"
            clearable
            placeholder="请输入"
          ></el-input>
        </el-form-item>
        <el-form-item label="单据来源" prop="returnName" class="form-item">
          <el-input
            v-model="form.returnName"
            maxlength="50"
            clearable
            placeholder="请输入"
          ></el-input>
        </el-form-item>
        <el-form-item label="采购单名称" prop="returnName" class="form-item">
          <el-input
            v-model="form.returnName"
            maxlength="50"
            clearable
            placeholder="请输入"
          ></el-input>
        </el-form-item>
        <el-form-item label="供应商联系人" prop="returnName" class="form-item">
          <el-input
            v-model="form.returnName"
            maxlength="50"
            clearable
            placeholder="请输入"
          ></el-input>
        </el-form-item>
        <el-form-item label="联系人电话" prop="contact_phone" class="form-item">
          <el-input
            v-model="form.contact_phone"
            placeholder="请输入"
            maxlength="11"
            show-word-limit
          ></el-input>
        </el-form-item>
        <el-form-item label="签约日期" prop="returnAt" class="form-item">
          <el-date-picker
            v-model="form.returnAt"
            style="width: 100%"
            type="date"
            placeholder="选择日期"
            value-format="yyyy-MM-dd"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="交付日期" prop="returnAt" class="form-item">
          <el-date-picker
            v-model="form.returnAt"
            style="width: 100%"
            type="date"
            placeholder="选择日期"
            value-format="yyyy-MM-dd"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="备注信息" prop="remark" class="form-item-two">
          <el-input
            type="textarea"
            :autosize="{ minRows: 3, maxRows: 4 }"
            maxlength="500"
            clearable
            v-model="form.remark"
          ></el-input>
        </el-form-item>
      </el-form>
      <div class="form-bottom-box">
        <div class="form-bottom-box-top">
          <div class="margin_bottom_2px font_size_14 title">产品信息</div>
        </div>
        <el-table
          ref="multipleTable"
          :header-cell-style="{ background: '#f1f3f8', color: '#000009' }"
          :data="returnItems"
          tooltip-effect="dark"
          height="calc(100% - 80px)"
          row-key="id"
          border
          style="width: 100%; padding: 0"
        >
          <el-table-column label="序号" type="index" width="80">
          </el-table-column>
          <el-table-column label="工具类型" prop="toolType" width="120">
            <!-- <template slot-scope="scope">
                {{ scope.row.toolType }}
              </template> -->
          </el-table-column>
          <el-table-column prop="toolNumber" label="工具编码">
          </el-table-column>
          <el-table-column prop="toolName" label="工具名称"> </el-table-column>
          <el-table-column label="操作" width="100">
            <template slot-scope="scope">
              <el-button @click="deleteClick(scope)" type="text" size="small"
                >移除</el-button
              >
            </template>
          </el-table-column>
        </el-table>
        <div class="font_size_14 margin_top_10px float_right">
          归还总数:{{ returnItems ? returnItems.length : 0 }}
        </div>
      </div>
    </div>
    <div slot="footer" class="dialog-footer tac">
      <el-button @click="shutdown">取消</el-button>
      <el-button type="primary" @click="onSubmit(form)">确定</el-button>
    </div>
    <BomDialog
      ref="editDialog"
      @sucessSet="handleGetBomKindDictList"
      @handleConfirmSave="handleConfirmSave"
      :workList="plcBrandList"
      title="PLC品牌"
    ></BomDialog>
  </el-dialog>
</template>
<script>
import BomDialog from "@/views/purchaseManage/purchase/components/BomDialog";
import {
  postGetUnitDictList,
  postGetSaveSUnitDict,
} from "@/api/purchaseManage/purchase";
export default {
  components: {
    BomDialog,
  },
  props: {
    editRow: {
      type: [Object],
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {
      islook: false,
      showWorkerList: [],
      form: {
        remark: "",
        returnAt: "",
        returnName: "",
        returnNumber: "",
        returnObj: "",
        returnerId: "",
        returnerName: "",
        contact_phone: "",
      },
      rules: {
        // 手机号
        contact_phone: [
          {
            required: true,
            message: "请填写",
            trigger: "change",
          },
          { validator: this.validatorPhone, trigger: "change" },
        ],
        // 领用编号
        returnNumber: [
          {
            required: true,
            message: "请填写",
            trigger: "change",
          },
        ],
        // 归还名称
        returnName: [
          {
            required: true,
            message: "请填写",
            trigger: "change",
          },
        ],
        // 归还时间
        returnAt: [
          {
            required: true,
            message: "请选择",
            trigger: "change",
          },
        ],
        // 归还人
        returnObj: [
          {
            required: true,
            message: "请选择",
            trigger: "change",
          },
        ],
      },
      returnItems: [], //字典下的表格
      PreObj: {
        pageSize: 0,
        page: 0,
        projectID: "",
      },
      // 某人的领用明细
      toolsObj: {
        takeName: "",
        page: 1,
        pageSize: 500,
        takerId: "",
        toolName: "",
        toolType: "",
      },
      plcBrandList: [],
    };
  },
  mounted() {},
  watch: {
    editRow(val) {
      if (val.id && this.islook) {
        this.initFormData(val);
      }
    },
    islook(val) {
      if (val) {
        this.returnItems = [];
        this.form = {
          remark: "",
          returnAt: "",
          returnName: "",
          returnNumber: "",
          returnerId: "",
          returnerName: "",
          returnObj: "",
          contact_phone: "",
        };
        if (this.editRow && this.editRow.id) {
          this.initFormData(this.editRow);
        }
      }
    },
  },
  methods: {
    validatorPhone(rule, value, callback) {
      if (value) {
        if (value == undefined || value == null) {
          callback(new Error("请输入"));
        } else {
          if (value.length != 11) {
            callback(new Error("长度在11个字符!"));
          } else {
            var reg =
              /^1(3\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\d|9[0-35-9])\d{8}$/;
            if (!reg.test(value)) {
              callback(new Error("请填写正确的联系电话!"));
            } else {
              callback();
            }
          }
        }
      } else {
        callback();
      }
    },
    // PLC配置设置
    handleShow() {
      this.handleGetBomKindDictList();
      this.$refs.editDialog.editDialogVisible = true;
    },
    //  PLC配置
    handleGetBomKindDictList(val) {
      postGetUnitDictList().then((res) => {
        this.unitList = res.data;
        if (val) {
          for (let i in this.unitList) {
            if (this.unitList[i].isDefault) {
              this.form.unit = this.form.unit
                ? this.form.unit
                : this.unitList[i].name;
              this.$set(this.form, "unit", this.form.unit);
              break;
            }
          }
        }
      });
    },
    handleConfirmSave(data) {
      postGetSaveSUnitDict({ data: data }).then((res) => {
        if (res.code == 200) {
          this.$message({
            message: "操作成功!",
            type: "success",
          });
          this.$refs.editDialog.editDialogVisible = false;
          this.handleGetBomKindDictList();
        }
      });
    },
    returnChange(val) {
      if (val) {
        this.toolsObj.takerId = this.form.returnObj.split("&")[0];
      } else {
        this.toolsObj.takerId = "";
      }
    },
    // 添加工具 领用明细
    selectTools(frockType, selections) {
      for (let i in selections) {
        let isPush = true;
        if (this.returnItems.length > 0) {
          for (let j in this.returnItems) {
            if (selections[i].id == this.returnItems[j].toolNumber) {
              isPush = false;
            }
          }
        }
        if (isPush) {
          let toolName = "";
          if (frockType == "模具") {
            toolName = selections[i].moldName;
          } else if (frockType == "检具") {
            toolName = selections[i].gaugeName;
          } else {
            toolName = selections[i].frockName;
          }
          let item = {
            toolType: frockType,
            toolNumber: selections[i].id,
            toolName: toolName,
          };
          this.returnItems.push(item);
        }
      }
    },
    initFormData(row) {
      if (row.id) {
        let form = JSON.parse(JSON.stringify(row));
        this.form = {
          remark: form.remark,
          returnAt: form.ReturnAt,
          contact_phone: form.contact_phone,
          returnName: form.ReturnName,
          returnNumber: form.ReturnNumber,
          returnerId: form.ReturnerId,
          returnerName: form.ReturnerName,
          returnObj: "",
          id: row.id,
        };
        if (this.form.returnerId && this.form.returnerName) {
          this.form.returnObj =
            this.form.returnerId + "&" + this.form.returnerName;
        }
        this.returnItems = this.editRow.ReturnItems;
      }
    },
    deleteClick(scope) {
      this.returnItems.splice(scope.$index, 1);
      this.$forceUpdate();
      this.$message({
        type: "success",
        message: "移除成功!",
      });
    },
    onSubmit() {
      this.$refs.form.validate((valid) => {
        if (valid) {
          let params = JSON.parse(JSON.stringify(this.form));
          params.returnerId = params.returnObj.split("&")[0];
          params.returnerName = params.returnObj.split("&")[1];
          params.returnItems = this.returnItems;
          if (this.editRow && this.editRow.id) {
            params.id = this.editRow.id;
            // editReturn(params).then((res) => {
            //   if (res.code == 200) {
            //     this.$message.success("编辑成功!");
            //     this.$emit("shutdown", this.form);
            //     this.shutdown();
            //   }
            // });
          } else {
            // addReturn(params).then((res) => {
            //   if (res.code == 200) {
            //     this.$message.success("添加成功!");
            //     this.$emit("shutdown", this.form);
            //     this.shutdown();
            //   }
            // });
          }
        }
      });
    },
    shutdown() {
      this.islook = false;
      this.$refs.form.resetFields();
    },
  },
};
</script>
<style lang="scss" scoped>
::v-deep .el-tabs__content {
  height: calc(100% - 55px);
  overflow-y: auto;
}
.title {
  height: 42px;
  line-height:42px;
  font-weight: 700px;
  padding: 0 10px;
  color: #333;
  background: rgb(236, 244, 255);
}
.form-bottom-box {
  height: calc(100% - 340px);
  .form-bottom-box-top {
    height: 50px;
    overflow: hidden;
  }
}
.form-item {
  width: calc(50% - 20px);
  float: left;
  &:nth-of-type(odd) {
    margin-right: 20px;
  }
}
.form-item-two {
  width: 100%;
  float: left;
}
.form-item-three {
  width: calc(100% - 20px);
  float: left;
}
.form-item-check {
  width: calc(33% - 40px);
  float: left;
  &:nth-of-type(odd) {
    margin-right: 20px;
  }
}
.title {
  width: 100%;
}
.dialog-content-box {
  height: 580px;
  padding-bottom: 50px;
  overflow-y: auto;
  .el-form {
    overflow: hidden;
    padding: 0 10px;
  }
}
.num-identify {
  padding: 5px 8px;
  background-color: rgba(255, 153, 0, 1);
  border-radius: 6px;
  font-size: 14px;
  color: #fff;
  font-weight: 600;
}
.drawerHeader {
  // position:relative;
  .identify {
    width: 80px;
    height: 25px;
    line-height: 25px;
    text-align: center;
    border: 1px solid rgba(255, 153, 0, 1);
    border-radius: 6px;
    font-size: 16px;
    color: rgba(255, 153, 0, 1);
    transform: rotate(15deg);
    font-weight: 600;
    margin-right: 100px;
    margin-top: 12px;
    float: right;
  }
}
</style>
src/views/purchaseManage/purchase/components/BomDialog.vue
New file
@@ -0,0 +1,272 @@
<template>
  <el-dialog
    :close-on-click-modal="false"
    :visible.sync="editDialogVisible"
    width="623px"
    class="add-event-dialog"
    @close="shutdown"
  >
    <div slot="title" class="tac drawerHeader">
      <span> {{title}}组件</span>
    </div>
    <div class="dialog-content-box">
      <el-table
      v-if="isTableShow"
        :header-cell-style="{ background: '#f1f3f8', color: '#000009' }"
        ref="multipleTable"
        :data="BomTableData"
        height="100%"
        tooltip-effect="dark"
      >
        <el-table-column prop="unit" label="类别">
          <template slot-scope="scope">
          <el-input v-model="scope.row.name"></el-input>
          </template>
        </el-table-column>
        <el-table-column prop="createdAt" label="设为默认">
          <template slot-scope="scope">
          <el-switch @change="switchChange(scope,scope.row.isDefault)"  v-model="scope.row.isDefault"></el-switch>
          </template>
        </el-table-column>
        <el-table-column label="操作" width="100">
          <template slot-scope="scope">
            <!-- <i class="el-icon-top" id="iconStyle"></i>
           <i class="el-icon-bottom"  id="iconStyle"></i> -->
            <i class="el-icon-delete" id="iconStyle" @click="handleDelete(scope)"></i>
          </template>
        </el-table-column>
      </el-table>
    </div>
      <div slot="footer" class="drawerFooter">
        <el-button
          @click="handleAdd()"
          style="margin-left: 16px; color: #fff; background-color: #ee790c"
          >新增</el-button
        >
        <el-button @click="shutdown">取消</el-button
        ><el-button
          type="primary"
          @click="handleConfirmSave()"
          style="margin-left: 16px; color: #fff; background-color: #2a78fb"
          >确定</el-button
        >
      </div>
  </el-dialog>
</template>
<script>
export default {
  props: {
    title:{
      type:String,
    },
    editRow: {
      type: Object,
      default: () => {
        return {};
      },
    },
    workList:{
      type:Array,
    }
  },
  data() {
    return {
      editDialogVisible: false,
      isTableShow:true,
      form: {},
      BomTableData: [1],
      work: 1,
      flag: "add",
      Tabs: "msg",
      tableData: [
        {
          date: "PEBU",
          name: "PE布",
          number: "21",
          unit: "吨",
        },
      ],
      rules: {
        id: [{ required: true, message: "请输入物料编码", trigger: "blur" }],
        name: [
          { required: true, message: "请输入物料名称", trigger: "blur" },
        ],
        specs: [{ required: true, message: "请输入物料规格", trigger: "blur" }],
        type: [{ required: true, message: "请输入物料型号", trigger: "blur" }],
        amount: [
          {
            required: true,
            message: "请输入数量",
            trigger: "blur",
          },
        ],
        unit: [
          {
            required: true,
            message: "请输入单位",
            trigger: "blur",
          },
        ],
        model: [
          { required: true, message: "请选择物料类型", trigger: "change" },
        ],
      },
    };
  },
  watch: {
    editDialogVisible(newVal){
      if(newVal){
       this.BomTableData=  JSON.parse(
        JSON.stringify(this.workList))
      }
    },
    workList(){
      this.BomTableData=JSON.parse(
        JSON.stringify(this.workList))
    }
  },
  mounted() {
  },
  methods: {
    handleAdd() {
      this.BomTableData.push({name:'',isDefault:false});
    },
    handleDelete(scope) {
      this.BomTableData.splice(scope.$index,1)
      // this.BomTableData=this.BomTableData.filter(i=>{
      //   return i.id!=id
      // })
    },
    switchChange(scope,val){
      let arr=[]
      for(let i in this.BomTableData){
        if(this.BomTableData[i].isDefault){
          arr.push(i)
        }
      }
      if(arr.length>1){
        this.$message({
          message: '只能设一个为默认',
          type: "warning",
        });
        scope.row.isDefault=!val
      }
    },
    handleConfirmSave() {
      let arr=[]
      for(let i in this.BomTableData){
        if(this.BomTableData[i].isDefault){
          arr.push(i)
        }
      }
      if(arr.length>1){
        this.$message({
          message: '只能设一个为默认',
          type: "warning",
        });
      }else{
        this.$emit('handleConfirmSave',this.BomTableData)
      }
    },
    shutdown() {
      this.editDialogVisible = false;
    },
  },
};
</script>
<style lang="scss" scoped>
.dialog-content-box {
  height:400px;
  .form-item {
    width: 65%;
  }
  .form-item2 {
    width: calc(50% - 5px);
    float:left;
  }
}
  #iconStyle {
    font-size: 20px !important;
  }
::v-deep .el-form {
  width: 389px;
  .input-box .input-content input {
    margin: 0;
    margin-right: 3px;
  }
  .el-input__inner,
  .el-textarea__inner {
    line-height: 18px;
    font-family: PingFangSC;
  }
}
::v-deep .el-tabs__header {
  border: none;
  .el-tabs__nav {
    border: none;
  }
}
::v-deep .el-form-item__content {
  width: 263px;
  .input-box {
    width: 263px;
  }
}
::v-deep .el-form-item__label {
  font-size: 13px !important;
  color: #000;
  font-family: PingFangSC;
  text-align: center !important;
  width: 60px;
}
::v-deep .input-box .input-content input {
  width: 23px;
  height: 26px;
  border-color: rgba(0, 0, 0, 0.1);
  font-family: PingFangSC;
}
::v-deep .el-icon-minus {
  width: 13px !important;
  height: 26px !important;
  line-height: 38px !important;
  color: #e5e5e5;
  font-size: 13px;
}
::v-deep .el-input__inner {
  font-size: 13px !important;
  color: rgba(0, 0, 0, 0.9);
}
::v-deep .el-input__inner::placeholder {
  color: rgba(0, 0, 0, 0.4);
}
::v-deep .el-form-item__error {
  font-family: PingFangSC;
}
.self {
  ::v-deep .el-input__inner {
  }
}
::v-deep .el-select-dropdown {
  position: absolute !important;
  top: 36px !important;
  left: 0px !important;
}
::v-deep .el-select-dropdown__wrap {
  overflow: auto !important;
}
</style>
src/views/purchaseManage/purchase/components/SelectClientDialog.vue
New file
@@ -0,0 +1,192 @@
<template>
  <div class="edit-selClient-box">
    <el-dialog
      :title="'客户管理'"
      :visible.sync="editConfig.editVisible"
      :width="dialogWidth"
      :before-close="handleClose"
      :append-to-body="true"
      :close-on-click-modal="false"
    >
      <div class="bg-view">
        <div class="query-bg">
          <SearchCommonView
            ref="searchCommonView"
            :search-options="searchOptions"
            @searchClick="searchClick"
            @resetClick="resetClick"
          />
          <div class="btn">
            <!-- <el-button type="primary" size="mini" disabled>设置字段</el-button>
            <el-button type="primary" size="mini" disabled>快速创建</el-button> -->
          </div>
        </div>
        <TableCommonView
          ref="tableListRef"
          v-loading="loading"
          :table-list="tableList"
          :select-box="false"
          @selCommonClick="selNameClick"
        >
        </TableCommonView>
        <div slot="footer" class="dialog-footer">
          <div class="remark">说明:支持多字段模糊查询,仅显示符合条件的前5条数据</div>
        </div>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import {
  getClientList
} from "@/api/purchaseManage/purchase";
export default {
  name: "EditSelClientDialog",
  props: {
    editCommonConfig: {
      type: Object,
      default: () => {
        return {
          editVisible: false,
          title: "",
          infomation: {}
        }
      }
    }
  },
  components: {},
  computed: {},
  data() {
    return {
      dialogWidth: "50%",
      editConfig: this.editCommonConfig,
      queryInput: "",
      select: "1",
      tableData: [],
      searchSelOptions: [],
      loading: false,
      searchOptions: [],
      tableList: {},
      search_map: {}
    }
  },
  created() {
    this.setTable()
    this.getData()
  },
  methods: {
    setTable() {
      this.tableList = {
        tableInfomation: [],
        tableColumn: [
          { label: "客户名称", prop: "name", min: 100, isClick: true },
          { label: "客户编号", prop: "number" },
          { label: "客户状态", prop: "client_status" },
          { label: "销售负责人", prop: "member_name", min: 100 },
          { label: "法定代表人", prop: "representative", min: 100 },
          { label: "注册时间", prop: "registration_time" },
          { label: "经营范围", prop: "business_scope" },
          { label: "详细地址", prop: "detail_address" },
          { label: "备注", prop: "remark" }
        ]
      }
      this.searchOptions = []
      for (let i = 0; i < this.tableList.tableColumn.length; i++) {
        const label = this.tableList.tableColumn[i].label
        const value = this.tableList.tableColumn[i].prop
        this.searchOptions.push({ value: value, label: label })
      }
    },
    handleClose() {
      this.editConfig.editVisible = false
    },
    // 请求数据
    async getData() {
      this.loading = true
      await getClientList({
        search_map: this.search_map,
        page: 0,
        pageSize: 0
      })
        .then((res) => {
          console.log(res)
          if (res.code === 200) {
            if (res.data.list && res.data.list.length > 0) {
              const list = res.data.list.map((item) => {
                return {
                  ...item,
                  client_status: item.client_status.name,
                  member_name: item.member.username
                }
              })
              this.tableList.tableInfomation = list.slice(0, 5) || []
            } else {
              this.tableList.tableInfomation = []
            }
          } else {
            this.tableList.tableInfomation = []
          }
          this.loading = false
        })
        .catch((err) => {
          console.log(err)
          this.this.tableList.tableInfomation = []
          this.loading = false
        })
    },
    selNameClick(row) {
      this.editConfig.editVisible = false
      this.$emit("selClient", row)
    },
    // 搜索
    searchClick(val, content) {
      console.log(val, content)
      this.search_map = {
        [val.value]: content
      }
      this.getData()
    },
    resetClick() {
      this.search_map = {}
      this.getData()
    }
  }
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.bg-view {
  margin: 10px;
  .query-bg {
    margin-left: -20px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    .el-input {
      width: 310px;
      .el-select {
        width: 100px;
      }
    }
    .btn {
      float: right;
    }
  }
}
.sel-name {
  color: $color-primary;
  cursor: pointer;
}
.dialog-footer {
  height: 40px;
  line-height: 40px;
  color: red;
}
::v-deep {
  .input-with-select .el-input-group__prepend {
    background-color: #fff;
  }
}
</style>
src/views/purchaseManage/purchase/index.vue
@@ -23,7 +23,7 @@
          <template slot="tableButton">
            <el-table-column label="操作" width="120" fixed="right">
              <template slot-scope="scope">
                <el-button type="text"  size="small" @click="editClick"  style="margin-right: 5px"
                <el-button type="text"  size="small" @click="editClick(scope.row)"  style="margin-right: 5px"
                  >编辑</el-button
                >
                <el-button  @click="submitClick(scope.row)" type="text" size="small">提交</el-button>
@@ -41,18 +41,24 @@
    <!-- <AddSalesLeadDialog v-if="editSalesLeadConfig.visible" :edit-rightContent-config="editSalesLeadConfig" /> -->
    <!-- 详情 -->
    <DetailSupplier v-if="commonDetail.visible" :common-detail="commonDetail" @submitClick="submitClick" />
    <AddPurchase2 ref="add"  :editRow="editRow" @shutdown="getData" />
    <!-- 新建/编辑 -->
    <AddPurchase v-if="editConfig.visible" :edit-common-config="editConfig" />
  </div>
</template>
<script>
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import { getSalesLeadsList, getDeleteSalesLeads } from "@/api/client/salesLead"
import {
  getSalesLeadsList, getDeleteSalesLeads
} from "@/api/purchaseManage/purchase";
import DetailSupplier from "@/views/purchaseManage/purchase/DetailSupplier"
import AddPurchase2 from "@/views/purchaseManage/purchase/components/AddPurchase2"
import AddPurchase from "@/views/purchaseManage/purchase/components/AddPurchase"
export default {
  name: "SupplierManage",
  props: {},
  components: { DetailSupplier },
  components: { DetailSupplier,AddPurchase2,AddPurchase },
  mixins: [pageMixin],
  computed: {},
  data() {
@@ -63,7 +69,13 @@
        visible: false,
        infomation: {}
      },
      search_map: {}
      search_map: {},
      editRow:{},
      editConfig: {
        visible: false,
        title: "创建",
        infomation: {}
      },
    }
  },
  created() {
@@ -125,10 +137,21 @@
      this.getData()
    },
    // 新建
    addBtnClick() {},
    // 编辑
    editClick(){
    addBtnClick() {
      // this.editRow = {};
      // this.$refs.add.islook = true;
      this.editConfig.visible = true
      this.editConfig.title = "创建"
      this.editConfig.infomation = { }
    },
    // 编辑
    editClick(row){
      // this.editRow = row;
      // this.$refs.add.islook = true;
      this.editConfig.visible = true
      this.editConfig.title = "编辑"
      this.editConfig.infomation = { ...row }
    },
    // 确认发货
    submitClick() {