yangfeng
2023-09-06 29b5ffe318b8ab32865ebebedd865ea2aa3f6c7e
供应商列表相关bug修复及样式调整
9个文件已修改
238 ■■■■■ 已修改文件
src/assets/style/index.scss 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/layout/components/AppMain.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/layout/components/appHeader/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/CommonFormTableView.vue 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/TableCommonView.vue 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/pager/PagerView.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/purchaseManage/purchase/index.vue 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/supplierManage/supplier/AddNewProduct.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/supplierManage/supplier/index.vue 84 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/style/index.scss
@@ -126,3 +126,12 @@
.cursor_pointer{
  cursor: pointer;
}
.btn-pager {
  display: flex;
  margin-top: 10px;
  // background: #fff;
  .page {
    margin-left: auto;
  }
}
src/components/layout/components/AppMain.vue
@@ -33,7 +33,7 @@
  width: calc(100% - 210px);
  .app-main-content {
    width: 100%;
    overflow-y: auto;
    overflow-y: hidden;
  }
}
</style>
src/components/layout/components/appHeader/index.vue
@@ -41,6 +41,7 @@
  line-height: 55px;
  background-color: #fff;
  margin-bottom: 10px;
  margin-left: -10px;
  .header-title {
    margin-left: 16px;
    font-size: 16px;
src/components/makepager/CommonFormTableView.vue
@@ -1,12 +1,20 @@
<template>
  <div class="page-view">
    <el-form ref="form" :model="tableList" :show-message="false" label-position="right"
    >
      <el-table :data="tableList.tableData" style="width: 100%"
    <el-form ref="form" :model="tableList" :show-message="false" label-position="right">
      <el-table
        :data="tableList.tableData"
        style="width: 100%"
      :show-summary="showSummary.show"
      :summary-method="getSummaries"
      :span-method="arraySpanMethod">
        <el-table-column type="index" v-if="tableList.tableColumn.length>0" label="编号" width="50" align="center"></el-table-column>
        :span-method="arraySpanMethod"
      >
        <el-table-column
          type="index"
          v-if="tableList.tableColumn.length > 0"
          label="编号"
          width="50"
          align="center"
        ></el-table-column>
        <el-table-column
          v-for="(item, i) in tableList.tableColumn"
          :key="i"
@@ -47,7 +55,7 @@
                  v-model="scope.row[item.prop]"
                  :fetch-suggestions="querySearchAsync"
                  value-key="name"
                  style='width:calc(100% - 70px)'
                  style="width: calc(100% - 70px)"
                  size="mini"
                  @select="
                    (val) => {
@@ -170,7 +178,7 @@
    },
    sign:{
      type:String,
      default:''
      default: ""
    },
    productTableList: {
      type: Object,
@@ -201,7 +209,7 @@
    recalculateShow: {
      type: [Boolean],
      defalut: true
    },
    }
  },
  data() {
    return {
@@ -229,7 +237,7 @@
  methods: {
    // 产品名称
    async getProductList() {
      let fn = this.sign == "purchase" ? getProductList : getProductListFromGrpc;
      let fn = this.sign == "purchase" ? getProductList : getProductListFromGrpc
      await fn({
        page: 1,
        pageSize: 100
@@ -298,7 +306,7 @@
        }
        if (column.property === "total") {
          this.total = sums[index]
          this.$emit('getSummaries',this.total)
          this.$emit("getSummaries", this.total)
        }
      })
      return sums
@@ -431,8 +439,7 @@
          }
        })
        
        console.log(this.tableList.tableData,'=====chanp')
        console.log(this.tableList.tableData, "=====chanp")
      }
    },
    // 清除已选择用户
@@ -464,12 +471,11 @@
    },
    deleteClient(row,scope){
      if(this.tableList.tableData.length==1){
        this.$message.error('至少保留一条,不能刪除了!')
        return true;
        this.$message.error("至少保留一条,不能刪除了!")
        return true
      }
      this.tableList.tableData.splice(scope.$index,1)
    },
    }
  }
}
</script>
src/components/makepager/TableCommonView.vue
@@ -6,12 +6,17 @@
      :data="tableList.tableInfomation"
      tooltip-effect="dark"
      style="width: 100%"
      :height="'calc(100% - 0px)'"
      :max-height="tableList.maxHeight"
      :lazy="tableList.lazy"
      :show-summary="showSummary.show"
      :summary-method="getSummaries"
      :span-method="arraySpanMethod"
      @selection-change="handleSelectionChange"
      :header-cell-style="{ background: '#ECF4FF', color: '#666' }"
      :header-cell-style="{ background: '#f1f3f8', color: '#000009' }"
      :highlight-current-row="tableList.highlight"
      :row-class-name="tableRowClassName"
      @row-click="tableRowClick"
      :row-key="tableList.key"
      :default-expand-all="tableList.isDefaultExpandAll"
      :tree-props="{ children: 'child', hasChildren: 'hasChildren' }"
    >
      <el-table-column v-if="tableList.selectBox" type="selection" width="40"> </el-table-column>
      <el-table-column v-if="tableList.selectIndex" type="index" label="序号" width="50"> </el-table-column>
@@ -122,6 +127,13 @@
          totalName: "本页总计"
        }
      }
    },
    // 选中的样式
    selectClassRow: {
      type: Object,
      default: () => {
        return {}
      }
    }
  },
  data() {
@@ -130,10 +142,6 @@
  computed: {},
  mounted() {},
  methods: {
    tableRowClick(row) {
      console.log(row)
      this.$emit("tableRowClick", row)
    },
    handleReserve(row) {
      return row._id ? row._id : row.id
    },
@@ -267,6 +275,18 @@
    // 公共详情
    selCommonClick(row) {
      this.$emit("selCommonClick", row)
    },
    // 单选行相关
    tableRowClassName({ row }) {
      if (Object.keys(this.selectClassRow).length > 0) {
        if (row.id == this.selectClassRow.id) {
          return "onSelect"
        }
      }
      this.$emit("tableRowClassName", row)
    },
    tableRowClick(row) {
      this.$emit("tableRowClick", row)
    }
  }
}
@@ -278,6 +298,7 @@
  // margin-top: 20px;
  margin-right: 10px;
  // margin-bottom: 40px;
  height: 100%;
  .blue {
    width: 70px;
    text-align: center;
src/components/makepager/pager/PagerView.vue
@@ -1,6 +1,7 @@
<template>
  <div class="page-view">
    <el-pagination
      background
      :current-page="pagerOptions.currPage"
      :page-sizes="pageSizes"
      :page-size="pagerOptions.pageSize"
@@ -9,6 +10,16 @@
      v-on="$listeners"
    >
    </el-pagination>
    <!-- :current-page.sync="searchParam.page"
        :page-size="searchParam.pageSize"
        background
        :page-sizes="[15, 30]"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total"
        @current-change="changePage"
        @size-change="handleSizeChange"
        @prev-click="prevPage"
        @next-click="nextPage" -->
  </div>
</template>
@@ -22,7 +33,7 @@
    },
    layout: {
      type: String,
      default: "total, sizes, prev, pager, next"
      default: "total, sizes, prev, pager, next, jumper"
    },
    pagerOptions: {
      type: Object,
src/views/purchaseManage/purchase/index.vue
@@ -52,14 +52,11 @@
</template>
<script>
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import {
  getPurchaseList,getPurchaseInfo,submitPurchase,
} from "@/api/purchaseManage/purchase";
import { getPurchaseList, getPurchaseInfo, submitPurchase } from "@/api/purchaseManage/purchase"
import DetailSupplier from "@/views/purchaseManage/purchase/DetailSupplier"
import AddPurchase from "@/views/purchaseManage/purchase/components/AddPurchase"
import { getDataByType } from "@/api/data";
import { getDataByType } from "@/api/data"
export default {
  name: "SupplierManage",
  props: {},
@@ -75,14 +72,14 @@
        visible: false,
        infomation: {}
      },
      search:'',
      search: "",
      editRow:{},
      editConfig: {
        visible: false,
        title: "创建",
        infomation: {}
      },
      purchaseStatusList:getDataByType('purchaseStatus'),
      purchaseStatusList: getDataByType("purchaseStatus")
    }
  },
  created() {
@@ -94,11 +91,11 @@
      if (val) {
        for (let i in this.purchaseStatusList) {
          if (this.purchaseStatusList[i].id == val) {
            return this.purchaseStatusList[i].name;
            return this.purchaseStatusList[i].name
          }
        }
      } else {
        return "--";
        return "--"
      }
    },
    setTable() {
@@ -113,7 +110,7 @@
          { label: "采购数量", prop: "quantity", min: 130 },
          { label: "收货仓库", prop: "warehouse", min: 130 },
          { label: "经办人", prop: "handledBy", min: 130 },
          { label: "制单人", prop: "creator", min: 130 },
          { label: "制单人", prop: "creator", min: 130 }
        ]
      }
    },
@@ -142,7 +139,7 @@
      this.getData()
    },
    resetClick() {
      this.search = ''
      this.search = ""
      this.getData()
    },
    // 新建
@@ -153,21 +150,21 @@
      this.editConfig.title = "创建"
      this.editConfig.infomation = {
        productList:[],
        purchaseTypeId:'',
        supplierId:'',
        supplierName:'',
        orderSource:'手动创建',
        name:'',
        contact:'',
        phone:'',
          signingDate:'',
          deliveryDate:'',
          remark:'',
        purchaseTypeId: "",
        supplierId: "",
        supplierName: "",
        orderSource: "手动创建",
        name: "",
        contact: "",
        phone: "",
        signingDate: "",
        deliveryDate: "",
        remark: "",
          wholeDiscountType:null,
          wholeDiscount:0,
          priceAdjustmentType:null,
          priceAdjustment:0,
          realTotalPrice:0,
        realTotalPrice: 0
       }
    },
    
@@ -182,10 +179,10 @@
          this.editConfig.infomation = { 
            productList:res.data.productList,
            supplierName:res.data.purchase.supplier.name,
            ...res.data.purchase,
            ...res.data.purchase
           }
        }else{
          this.$message.error(res.msg?res.msg+',':''+'获取信息失败!')
          this.$message.error(res.msg ? res.msg + "," : "" + "获取信息失败!")
        }
      })
      setTimeout(()=>{
@@ -193,7 +190,6 @@
      },3000)
      // this.editRow = row;
      // this.$refs.add.islook = true;
    },
    // 确认发货
    submitClick(row) {
@@ -229,7 +225,7 @@
            ...res.data.purchase
           }
        }else{
          this.$message.error(res.msg?res.msg+',':''+'获取信息失败!')
          this.$message.error(res.msg ? res.msg + "," : "" + "获取信息失败!")
        }
      })
      setTimeout(()=>{
@@ -260,6 +256,7 @@
    }
    .btn-pager {
      display: flex;
      // background: #fff;
      .page {
        margin-left: auto;
      }
src/views/supplierManage/supplier/AddNewProduct.vue
@@ -14,6 +14,7 @@
        <div class="basic-info-title">产品信息</div>
        <div class="basic-info-view">
          <CommonFormTableView
            ref="productTable"
            :product-table-list="productTableList"
            :detail-enter="detailEnter"
            @inputContent="inputContent"
@@ -78,6 +79,8 @@
    },
    // 保存
    saveClick() {
      this.$refs.productTable.$refs.form.validate((valid) => {
        if (valid) {
      console.log(this.editConfig.infomation)
      for (let i = 0; i < this.tableData.length; i++) {
        if (this.tableData[i].name.length === 0) {
@@ -113,6 +116,8 @@
          })
        }
      }
        }
      })
    },
    saveParams() {
      let data = this.editConfig.infomation
src/views/supplierManage/supplier/index.vue
@@ -13,49 +13,30 @@
        </div>
      </div>
      <template>
        <el-table
        <div class="list-view">
          <TableCommonView
          ref="tableSupplier"
          border
          :data="tableList.tableInfomation"
          tooltip-effect="dark"
          style="width: 100%"
          :lazy="tableList.lazy"
          highlight-current-row
          @row-click="tableRowClick"
          :header-cell-style="{ background: '#ECF4FF', color: '#666' }"
            :table-list="tableList"
            @selCommonClick="selCommonClick"
            @tableRowClick="tableRowClick"
        >
          <el-table-column type="index" label="序号" width="50"> </el-table-column>
          <el-table-column
            v-for="(item, i) in tableList.tableColumn"
            :key="i"
            :prop="item.prop"
            :label="item.label"
            :width="item.width"
            :min-width="item.min"
            show-overflow-tooltip
            :sortable="item.sortable"
          >
            <template slot-scope="scope">
              <div v-if="item.status" :class="scope.row.status">{{ scope.row[item.prop] }}</div>
              <span
                v-else-if="item.isCommonClick && scope.row[item.prop]"
                class="sel-name"
                @click="selCommonClick(scope.row)"
                >{{ scope.row[item.prop] }}</span
              >
              <span v-else>{{ scope.row[item.prop] ? scope.row[item.prop] : "--" }}</span>
            </template>
          </el-table-column>
            <template slot="tableButton">
          <el-table-column label="操作" width="100">
            <template slot-scope="scope">
              <el-button v-if="scope.row.status === 0" @click="enableClick(scope.row, '启用')" type="text" size="small"
                  <el-button
                    v-if="scope.row.status === 0"
                    @click="enableClick(scope.row, '启用')"
                    type="text"
                    size="small"
                >启用</el-button
              >
              <el-button v-else @click="enableClick(scope.row, '停用')" type="text" size="small">停用</el-button>
              <el-button @click="modifyClick(scope.row)" type="text" size="small">修改</el-button>
            </template>
          </el-table-column>
        </el-table>
            </template>
          </TableCommonView>
        </div>
        <div class="btn-pager">
          <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
        </div>
@@ -79,6 +60,7 @@
        </div>
      </div>
      <template>
        <div class="list-view">
        <TableCommonView
          ref="tableListProduct"
          :table-list="productTableList"
@@ -95,6 +77,7 @@
            </el-table-column>
          </template>
        </TableCommonView>
        </div>
        <div class="btn-pager">
          <PagerView class="page" :pager-options="productPagerOptions" v-on="pagerEvents" />
        </div>
@@ -169,6 +152,7 @@
      this.tableList = {
        tableInfomation: [],
        selectIndex: true,
        highlight: true,
        ref: "tableListRef",
        tableColumn: [
          { label: "供应商编号", prop: "number", min: 190, isCommonClick: true },
@@ -237,7 +221,7 @@
            this.supplierId = 0
          }
          this.$nextTick(() => {
            this.$refs.tableSupplier.setCurrentRow(this.tableList.tableInfomation[0])
            this.$refs.tableSupplier.$refs.table.setCurrentRow(this.tableList.tableInfomation[0])
          })
          this.getProductList()
        }
@@ -367,8 +351,16 @@
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.rightContent {
  height: 100%;
  background: #f0f2f5;
  padding: 10px;
  .top {
    margin-bottom: 20px;
    height: 55%;
    background: #fff;
    .list-view {
      height: calc(100% - 120px);
    }
    .supplier-search {
      display: flex;
      align-items: center;
@@ -381,14 +373,20 @@
      color: $color-primary;
      cursor: pointer;
    }
    .btn-pager {
      display: flex;
      .page {
        margin-left: auto;
      }
    }
    // .btn-pager {
    //   display: flex;
    //   .page {
    //     margin-left: auto;
    //   }
    // }
  }
  .bottom {
    margin-top: 20px;
    height: calc(40% - 0px);
    background: #fff;
    .list-view {
      height: calc(100% - 120px);
    }
    .product-search {
      display: flex;
      align-items: center;
@@ -398,12 +396,6 @@
      .add-view {
        margin-left: 20px;
        margin-right: 20px;
      }
    }
    .btn-pager {
      display: flex;
      .page {
        margin-left: auto;
      }
    }
  }