zuozhengqing
2023-11-21 0712b49e5538589dac4859ca8cebf196caa954ab
fix:供应商管理添加产品,产品列表展示修改及采购管理bug修改
6个文件已修改
174 ■■■■ 已修改文件
src/components/makepager/CommonFormTableView.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/purchaseManage/purchase/DetailSupplier.vue 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/purchaseManage/purchase/index.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/supplierManage/supplier/AddSupplier.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/supplierManage/supplier/DetailSupplier.vue 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/supplierManage/supplier/index.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/CommonFormTableView.vue
@@ -113,6 +113,7 @@
              :prop="'tableData.' + scope.$index + '.' + item.prop"
              :rules="[{ required: item.isRequird ? true : false, message: '输入不能为空' }]"
            >
            <!-- 采购管理 -->
              <template v-if="item.multiply">
                <el-input-number
                  :disabled="item.disabled"
@@ -227,7 +228,8 @@
        title: "",
        infomation: {}
      },
      productIndex: 0
      productIndex: 0,
      tableProductLists:[],
    }
  },
  created() {
@@ -251,6 +253,7 @@
        if (res.data.code === 200) {
          if (res.data.data.list && res.data.data.list.length > 0) {
            this.productList = res.data.data.list
            this.tableProductLists = res.data.data.list
          }
        }
      })
@@ -350,8 +353,6 @@
      this.$emit("addProductClick")
    },
    commonInputChange(val, prop, row) {
      console.log(val, prop)
      console.log(row)
      this.$emit("inputContent", val, prop, row)
    },
    // 清空
@@ -360,7 +361,7 @@
    },
    // 选择产品名称相关方法
    querySearchAsync(queryString, cb) {
      var restaurants = this.productTableList.tableProductList
      var restaurants = this.tableProductLists
      var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants
      cb(results)
    },
@@ -371,7 +372,6 @@
    },
    handleSelectClient(item, prop, row) {
      // this.clientId = item.id
      console.log(item, prop, row)
      this.tableList.tableData.map((ite) => {
        if (ite.name === item.name) {
          ite.ID = row.ID
src/views/purchaseManage/purchase/DetailSupplier.vue
@@ -121,6 +121,7 @@
                ref="tableListRef"
                :showSummary="showSummary"
                :table-list="tableList"
                @selTableCol="selTableCol"
              >
              </TableCommonView>
              <div class="table-bottom">
@@ -189,7 +190,18 @@
        mergeNumber: 5,
        totalName:'小计'
      },
      showCol: ['产品名称', '产品编码', '计量单位', '规格型号', '数量', '销售单价','价税合计','描述'],
      purchaseStatusList:getDataByType('purchaseStatus'),
      tableColumn: [
        { label: "产品名称", prop: "name", min: 160,  },
        { label: "产品编码", prop: "number", min: 130, },
        { label: "计量单位", prop: "unit", min: 130 },
        { label: "规格型号", prop: "specifications", min: 130 },
        { label: "数量", prop: "amount", min: 130 },
        { label: "销售单价", prop: "price", min: 130 },
        { label: "价税合计", prop: "total", min: 130 },
        { label: "描述", prop: "remark", min: 130 },
      ],
    };
  },
  created() {
@@ -326,17 +338,23 @@
      this.tableList = {
        tableInfomation: item.productList?item.productList:[],
        selectIndex: true,
        tableColumn: [
          { label: "产品名称", prop: "name", min: 160,  },
          { label: "产品编码", prop: "number", min: 130, },
          { label: "计量单位", prop: "unit", min: 130 },
          { label: "规格型号", prop: "specifications", min: 130 },
          { label: "数量", prop: "amount", min: 130 },
          { label: "销售单价", prop: "price", min: 130 },
          { label: "价税合计", prop: "total", min: 130 },
          { label: "描述", prop: "remark", min: 130 },
        ],
        showcol: this.showCol,
        allcol:[],
        tableColumn:this.setColumnVisible(this.showCol)
      };
      this.tableList.allcol = this.tableList.tableColumn.filter(ele=>!ele.default).map(ele=>ele.label);
    },
    selTableCol(val) {
      this.showcol = val;
      this.tableList.tableColumn = this.setColumnVisible(val);
    },
    setColumnVisible(showCol){
      return  this.tableColumn.map(ele=>{
        return {
          ...ele,
          isShowColumn:showCol.includes(ele.label)
        }
      })
    },
    handleClose() {
      this.detailConfig.visible = false;
src/views/purchaseManage/purchase/index.vue
@@ -32,19 +32,19 @@
              </el-table-column>
              <el-table-column label="操作" width="220" fixed="right">
                <template slot-scope="scope">
                  <el-button type="text" size="small" @click="btnConfirm(scope.row)" style="margin-right: 5px"
                  <el-button v-if="scope.row.status===1" type="text" size="small" @click="btnConfirm(scope.row)" style="margin-right: 5px"
                  >确认</el-button
                  >
                  <el-button type="text" size="small" @click="btnEdit(scope.row)" style="margin-right: 5px"
                  <el-button v-if="scope.row.status===1" type="text" size="small" @click="btnEdit(scope.row)" style="margin-right: 5px"
                  >编辑</el-button
                  >
                  <el-button type="text" size="small" @click="btnLook(scope.row)" style="margin-right: 5px"
                  >查看</el-button
                  >
                  <el-button type="text" size="small" @click="btnCancel(scope.row)" style="margin-right: 5px"
                  <el-button v-if="scope.row.status===1" type="text" size="small" @click="btnCancel(scope.row)" style="margin-right: 5px"
                  >取消</el-button
                  >
                  <el-button type="text" size="small" @click="btnDelete(scope.row)" style="margin-right: 5px"
                  <el-button v-if="scope.row.status===1" type="text" size="small" @click="btnDelete(scope.row)" style="margin-right: 5px"
                  >删除</el-button
                  >
                  <!-- <el-button v-if="scope.row.status< 4" @click="submitClick(scope.row)" type="text" size="small">提交</el-button> -->
@@ -101,16 +101,16 @@
        }
      },
      tableColumn: [
        { label: "单据类型", prop: "orderType", min: 130 },
        { label: "采购单号", prop: "number", min: 150, isCommonClick: true ,default:true},
        { label: "采购单名称", prop: "name", min: 130, isCommonClick: true },
        { label: "单据类型", prop: "orderType", min: 130 },
        { label: "供应商名称", prop: "supplierName", min: 130 },
        { label: "采购数量", prop: "quantity", min: 130 },
        { label: "收货仓库", prop: "warehouse", min: 130 },
        { label: "经办人", prop: "handledBy", min: 130 },
        { label: "制单人", prop: "creator", min: 130 }
      ],
      showCol: ['采购单号', '采购单名称', '单据类型', '供应商名称', '采购数量', '收货仓库']
      showCol: ['采购单号', '采购单名称', '单据类型', '供应商名称', '采购数量', '收货仓库','经办人','制单人']
    }
  },
  created() {
@@ -336,10 +336,10 @@
    },
    // 详情
    selCommonClick(row) {
      console.log(row)
      this.tableLoading = true
      getPurchaseInfo({ id: row.ID }).then((res) => {
        if (res.code == 200) {
          console.log(res,"产品详情")
          this.tableLoading = false
          this.commonDetail.visible = true
          this.commonDetail.infomation = {
src/views/supplierManage/supplier/AddSupplier.vue
@@ -363,7 +363,7 @@
        name: data.name || "",
        number: data.number || "",
        phone: data.phone || "",
        responsiblePersonName: data.responsiblePersonName || "",
        responsiblePersonName: data.responsiblePersonName || "admin",
        status: data.status || 0,
        supplierType: data.supplierType || "",
        url: data.url || ""
src/views/supplierManage/supplier/DetailSupplier.vue
@@ -72,12 +72,26 @@
            </div>
          </div>
        </div>
        <div v-if="activeName === 'second'" class="second">
          <!-- <FollowupRecords
            :isDetail="true"
            :follow-record="detailConfig.infomation.FollowRecord"
            :add-config="addConfig"
          /> -->
        <div v-if="activeName === 'second'" class="detail">
          <!-- 采购订单-基本信息 -->
          <!-- 产品信息 -->
          <div class="basic-info">
            <div class="basic-info-label" @click="expandClick('basic')">
              <i v-if="isBasicExpand" class="el-icon-arrow-down"></i>
              <i v-else class="el-icon-arrow-up"></i>
              <span style="margin-left: 10px">产品信息</span>
            </div>
            <div v-show="isBasicExpand" class="basic-info-content">
              <TableCommonView
                style="margin-top: 2px"
                class="content-table"
                ref="tableListRef"
                :table-list="tableList"
                @selTableCol="selTableCol"
              >
              </TableCommonView>
            </div>
          </div>
        </div>
      </div>
    </el-drawer>
@@ -93,7 +107,8 @@
      default: () => {
        return {
          visible: false,
          infomation: {}
          infomation: {},
          productListInfo:[]
        }
      }
    }
@@ -111,10 +126,23 @@
      addConfig: {},
      record: "", // 最新进展
      noContactDays: 0,
      newContactDays: ""
      newContactDays: "",
      tableList:{},
      showCol: ['产品名称', '产品编码', '计量单位', '规格型号', '数量', '销售单价','价税合计','描述'],
      tableColumn: [
        { label: "产品名称", prop: "name", min: 160,  },
        { label: "产品编码", prop: "number", min: 130, },
        { label: "计量单位", prop: "unit", min: 130 },
        { label: "规格型号", prop: "specifications", min: 130 },
        { label: "数量", prop: "amount", min: 130 },
        { label: "销售单价", prop: "price", min: 130 },
        { label: "价税合计", prop: "total", min: 130 },
        { label: "描述", prop: "remark", min: 130 },
      ],
    }
  },
  created() {
    console.log(this.detailConfig,"抽屉组件")
    this.setData(this.detailConfig.infomation)
    this.addConfig = {
      id_name: "sales_leads_id",
@@ -166,6 +194,44 @@
          rightValue: ""
        }
      ]
      this.purchaseList = [
        {
          leftStr: "采购单号",
          leftValue: item.number,
          rightStr: "采购单名称",
          rightValue: item.name
        },
        {
          leftStr: "供应商类型",
          leftValue: item.supplierType,
          rightStr: "所属行业",
          rightValue: item.industry
        },
        {
          leftStr: "单据类型",
          leftValue: item.contact,
          rightStr: "供应商名称",
          rightValue: item.phone
        },
        {
          leftStr: "采购数量",
          leftValue: item.responsiblePersonName,
          rightStr: "收货仓库",
          rightValue: item.url
        },
        {
          leftStr: "经办人",
          leftValue: item.email,
          rightStr: "制单人",
          rightValue: ""
        },
        {
          leftStr: "状态",
          leftValue: item.email,
          rightStr: "",
          rightValue: ""
        },
      ]
      this.dynamicInfoList = [
        {
          leftStr: "户名",
@@ -180,6 +246,26 @@
          rightValue: ""
        }
      ]
      this.tableList = {
        tableInfomation: this.detailConfig.productListInfo?this.detailConfig.productListInfo:[],
        selectIndex: true,
        showcol: this.showCol,
        allcol:[],
        tableColumn:this.setColumnVisible(this.showCol),
      };
      this.tableList.allcol = this.tableList.tableColumn.filter(ele=>!ele.default).map(ele=>ele.label);
    },
    selTableCol(val) {
      this.showcol = val;
      this.tableList.tableColumn = this.setColumnVisible(val);
    },
    setColumnVisible(showCol){
      return  this.tableColumn.map(ele=>{
        return {
          ...ele,
          isShowColumn:showCol.includes(ele.label)
        }
      })
    },
    handleClose() {
      this.detailConfig.visible = false
src/views/supplierManage/supplier/index.vue
@@ -119,6 +119,7 @@
<script>
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import { getSupplierList, changeSupplierStatus } from "@/api/supplierManage/supplier"
import {getPurchaseList} from "@/api/purchaseManage/purchase"
import DetailSupplier from "@/views/supplierManage/supplier/DetailSupplier"
import AddSupplier from "@/views/supplierManage/supplier/AddSupplier"
import RaleteSupplierList from "@/views/supplierManage/supplier/RaleteSupplierList"
@@ -142,7 +143,8 @@
      searchProductOptions: [], // 产品查询
      commonDetail: {
        visible: false,
        infomation: {}
        infomation: {},
        productListInfo:[]
      },
      editConfig: {
        visible: false,
@@ -422,7 +424,9 @@
    },
    // 详情
    selCommonClick(row) {
      console.log(row)
      getPurchaseList({pageSize:10,page:1,supplierId:row.ID}).then((res)=>{
        this.commonDetail.productListInfo=res.data.data.list
      })
      this.commonDetail.visible = true
      this.commonDetail.infomation = { ...row }
    },