Przeglądaj źródła

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-eom into dev

2213980799@qq.com 1 rok temu
rodzic
commit
14e593159a

+ 87 - 0
src/api/goodsManage/index.js

@@ -0,0 +1,87 @@
+import request from '@/utils/request';
+//查询列表
+export async function getList(data) {
+  const res = await request.get('/eom/goods/page', {
+    params: data
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+//添加
+export async function saveGoods(data) {
+  const res = await request.post('/eom/goods/save', data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+//删除
+export async function del(data) {
+  const res = await request.delete('/eom/goods/delete', {
+    data
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+//查询历史列表
+export async function getHistoryList(data) {
+  const res = await request.get(`/eom/goods/getHistoryList/${data}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+// 上下架
+export async function offOnSheft(data) {
+  const res = await request.put(`/eom/goods/offOnSheft/${data.shelf_type}/${data.goods_id}`);
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+//详情
+export async function getGoodsById(data) {
+  const res = await request.get(`/eom/goods/getGoodsById/${data}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+//修改商品
+export async function updateGoods(data) {
+  const res = await request.put('/eom/goods/updateGoods', data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+//商品价格详情
+export async function getGoodsPriceById(data) {
+  const res = await request.get(`/eom/goods/getGoodsPriceById/${data}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+//修改商品
+export async function updateGoodsPrice(data) {
+  const res = await request.put('/eom/goods/updateGoodsPrice', data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 2 - 1
src/enum/dict.js

@@ -61,7 +61,8 @@ export default {
   企业荣誉: 'enterprise_honor',
   企业规模: 'enterprise_size',
   产地: 'purchase_origin',
-  故障等级:'fault_level'
+  故障等级:'fault_level',
+  商品价格类型: 'goods_price_type',
 };
 
 export const numberList = [

+ 426 - 0
src/views/commodityManagement/commodityPriceList/components/addDialog.vue

@@ -0,0 +1,426 @@
+<template>
+  <ele-modal custom-class="ele-dialog-form long-dialog-form" :centered="true" :append-to-body="true"
+    :visible.sync="visible" :close-on-click-modal="false" width="60%" @close="cancel" :title="title"
+    :fullscreen="fullscreen">
+    <template slot="title">
+      <modalTitle :title="title" @setFullscreen="fullscreen = !fullscreen">
+      </modalTitle>
+    </template>
+    <headerTitle title="基本信息"></headerTitle>
+    <el-form label-width="120px" ref="form" :model="form" :rules="rules" class="el-form-box">
+      <el-row>
+        <el-col :span="8">
+          <el-form-item label="商品名称:" prop="goodsName">
+            <el-input placeholder="请输入" v-model="form.goodsName" maxlength="50"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="商品分类:" prop="categoryLevelId">
+            <SelectTree :data="gList" placeholder="请选择商品分类" v-model="form.categoryLevelId" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="商机编码:" prop="goodsCode">
+            <el-input disabled="true" v-model="form.goodsCode" maxlength="50"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="24">
+          <el-form-item label="商品图片:">
+            <ImgUpload ref="imgUploadRef" v-model="form.backgroundImgs" />
+          </el-form-item>
+        </el-col>
+        <!-- <el-col :span="8">
+          <el-form-item label="产品名称:" prop="productName">
+            <el-input disabled="true" v-model="form.productName" maxlength="50"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="产品类型:" prop="productCategoryName">
+            <el-input disabled="true" v-model="form.productCategoryName" maxlength="50"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="产品编码:" prop="productCode">
+            <el-input disabled="true" v-model="form.productCode" maxlength="50"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="属性类型:" prop="produceType">
+            <el-input disabled="true" v-model="form.produceType" maxlength="50"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="仓库名称:" prop="warehouseId">
+            <el-select
+            v-model="form.warehouseId"
+            placeholder="请选择"
+            width="100%"
+            @change="warehouseChange"
+          >
+            <el-option
+              v-for="item in form.warehouseList"
+              :key="item.warehouseId"
+              :label="item.warehouseName"
+              :value="item.warehouseId"
+            >
+            </el-option>
+          </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="库存:" prop="warehouseNum">
+            <el-input disabled="true" v-model="form.warehouseNum" maxlength="50"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="计量单位:" prop="measuringUnit">
+            <el-input disabled="true" v-model="form.measuringUnit" maxlength="50"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="重量单位:" prop="weightUnit">
+            <el-input disabled="true" v-model="form.weightUnit" maxlength="50"></el-input>
+          </el-form-item>
+        </el-col> -->
+      </el-row>
+      <BIZproductList
+      ref="BIZproductListRef"
+      classType="1"
+      :isGetInventoryTotal="true"
+      @changeParent="changeParentBiz"
+    ></BIZproductList>
+    </el-form>
+    <headerTitle title="产品" v-show="!isUpdate"></headerTitle>
+    <el-form v-show="!isUpdate" label-width="120px" class="el-form-box">
+      <el-button
+        size="small"
+        type="primary"
+        icon="el-icon-plus"
+        class="ele-btn-icon"
+        @click="handParent()"
+      >
+        选择产品
+      </el-button>
+      <el-row>
+        <el-col :span="8">
+          <el-form-item label="产品名称:" >
+            <el-input disabled="true" v-model="form.productName" maxlength="50"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="产品类型:">
+            <el-input disabled="true" v-model="form.productCategoryName" maxlength="50"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="产品编码:">
+            <el-input disabled="true" v-model="form.productCode" maxlength="50"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="属性类型:">
+            <el-input disabled="true" v-model="form.produceType" maxlength="50"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="仓库名称:">
+            <el-select
+            v-model="form.warehouseId"
+            placeholder="请选择"
+            width="100%"
+            @change="warehouseChange"
+          >
+            <el-option
+              v-for="item in form.warehouseList"
+              :key="item.warehouseId"
+              :label="item.warehouseName"
+              :value="item.warehouseId"
+            >
+            </el-option>
+          </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="库存:">
+            <el-input disabled="true" v-model="form.warehouseNum" maxlength="50"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="计量单位:">
+            <el-input disabled="true" v-model="form.measuringUnit" maxlength="50"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="重量单位:">
+            <el-input disabled="true" v-model="form.weightUnit" maxlength="50"></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <BIZproductList
+      ref="BIZproductListRef"
+      classType="1"
+      :isGetInventoryTotal="true"
+      @changeParent="changeParentBiz"
+    ></BIZproductList>
+    </el-form>
+    <headerTitle title="价格"></headerTitle>
+    <ProductTable ref="inventoryTable" />
+    <template slot="footer">
+      <el-button type="primary" @click="save">保存</el-button>
+      <el-button @click="cancel">返回</el-button>
+    </template>
+    
+  </ele-modal>
+</template>
+<script>
+import BIZproductList from '@/BIZComponents/product-list.vue';
+import SelectTree from './selectTree.vue';
+import modalTitle from '@/BIZComponents/modalTitle.vue';
+import dictMixins from '@/mixins/dictMixins';
+import ProductTable from './productTable.vue';
+import { saveGoods } from '@/api/goodsManage/index';
+import { getTreeByPid, getPcTreeByPids } from '@/api/classifyManage';
+import { getByCode } from '@/api/system/dictionary-data';
+import { copyObj } from '@/utils/util';
+import {
+  getWarehouseOutStock,
+  getIdWarehouseList
+} from '@/api/saleManage/saleorder';
+import { lbjtList } from '@/enum/dict.js';
+import { getCode } from '@/api/login/index';
+import ImgUpload from './imgUpload.vue';
+import { getGoodsById, updateGoods } from '@/api/goodsManage/index'
+
+
+export default {
+  components: {
+    ProductTable,
+    modalTitle,
+    SelectTree,
+    BIZproductList,
+    ImgUpload
+  },
+  mixins: [dictMixins],
+  data() {
+    const formDef = {
+      id: '',//商品id
+      categoryLevelId: '',//商品分类
+      goodsName:'',//商品名称
+      goodsCode:'',//商品编码
+      backgroundImgs: "",//商品图片
+      categoryId: '',//产品id
+      productName: '',//产品名称
+      productCategoryName: '',//产品类型
+      productCode: '',//产品编码
+      produceType: '',//属性类型
+      warehouseId: '',//仓库名称
+      warehouseNum:'',//库存
+      measuringUnit: '',//计量单位
+      weightUnit: '',//重量单位
+      warehouseList:[],//仓库
+      imagesFileIds: '',
+      children:[],//价格数组
+    };
+    return {
+      // form:{
+      //   id: '',//产品id
+      //   productName: '',//产品名称
+      //   productCategoryName: '',//产品类型
+      //   productCode: '',//产品编码
+      //   produceType: '',//属性类型
+      //   warehouseId: '',//仓库名称
+      //   warehouseNum:'',//库存
+      //   measuringUnit: '',//计量单位
+      //   weightUnit: '',//重量单位
+      //   warehouseList:[],//仓库
+      // },
+      title: '',
+      visible: false,
+      fullscreen: false,
+      form: copyObj(formDef),
+      // 提交状态
+      loading: false,
+      // 是否是修改
+      isUpdate: false,
+      gList: [], //商品分类
+      rules: {
+        categoryLevelId: [
+            { required: true, message: '请选择商品分类', trigger: 'change' }
+          ],
+          goodsName: [
+            { required: true, message: '请输入商品名称', trigger: 'blur' }
+          ],
+          goodsCode: [
+            { required: true, message: '请输入商品编码', trigger: 'blur' }
+          ],
+      }
+    };
+  },
+
+  created() {
+    this.getTreeData();
+    this.getByCode('goods_price_type'); //获取商品类型字典
+  },
+  methods: {
+    //打开弹出框
+    async open(type, row, contactCategoryId) {
+      // this.$refs.inventoryTable.resetTable()
+      this.form.categoryLevelId = contactCategoryId;
+      this.title = type === 'add' ? '新增' : '修改';
+      this.visible = true;
+      if (type == 'add') {
+        this.isUpdate = false;
+      } else {
+        this.isUpdate = true;
+      }
+      if (type === 'editGoodsInfo') {
+        this.getGoodsById(row.id);
+      }
+    },
+
+    //获取详情数据
+    async getGoodsById(id) {
+      let res = await getGoodsById(id);
+      this.form = res;
+      let goodsImgItem = {id: res.imagesFileIds,url:window.location.origin + '/api/main/file/getFile?objectName=' + res.imagesPaths,status: 'done'}
+      this.form.backgroundImgs = goodsImgItem;
+      this.$refs.imgUploadRef.putValue(goodsImgItem);
+      this.$refs.inventoryTable.putTableList(res.children);
+    },
+
+    //查询商品分类
+    async getTreeData() {
+      const res = await getTreeByPid('1789827921908150274');
+      if (res?.code === '0') {
+        this.gList = res.data;
+      }
+    },
+
+    //查询商品价格字典
+    async getByCode(code) {
+      const res = await getByCode(code);
+      if (res?.code === '0') {
+        this.goodsTypeList = res.data;
+      }
+    },
+
+    //库存计算
+    async warehouseChange(e) {
+      const warehouseOutStock = await getWarehouseOutStock({
+        warehouseId: e,
+        code: this.form.productCode
+      });
+      this.form.warehouseNum = warehouseOutStock || 0
+    },
+
+    //选择产品
+    handParent() {
+      this.$refs.BIZproductListRef.open('', 1);
+    },
+
+    changeParentBiz(obj = [], idx) {
+      this.getGoodsCode('goods_code')
+      obj.forEach(async (item, index) => {
+        this.form.categoryId = item.id;
+        this.form.productName = item.name
+        this.form.productCategoryName = item.categoryLevelPath;
+        this.form.productCode = item.code;
+        this.form.produceType = lbjtList[item.componentAttribute].toString();
+        this.form.warehouseId = item.warehouseId;
+        this.form.measuringUnit = item.measuringUnit;
+        this.form.weightUnit = item.weightUnit;
+        this.form.warehouseList = await getIdWarehouseList({ categoryId: item.id });
+      })
+    },
+
+    //提交
+    async save() {
+      try {
+        if (this.form.categoryId === '' && this.$message.error('请选择产品')) return;
+        await this.getValidate();
+        // 表单验证通过,执行保存操作
+        let commitData = this.$refs?.inventoryTable?.getTableValue() || [];
+        if (commitData.length < 1) {
+          return
+        }
+        let comitDatasource = {};
+        const {  categoryLevelId, goodsName, goodsCode, categoryId, backgroundImgs, id } = this.form;
+        comitDatasource['categoryId'] = categoryId;
+        comitDatasource['categoryLevelId'] = categoryLevelId;
+        comitDatasource['goodsCode'] = goodsCode;
+        comitDatasource['goodsName'] = goodsName;
+        comitDatasource['imagesFileIds'] = backgroundImgs[0]?.id;
+        comitDatasource['priceList'] = commitData;
+        console.log('comitDatasource',comitDatasource);
+        this.loading = true;
+        var res = {}
+        if (!this.isUpdate) {
+          res = await saveGoods(comitDatasource);
+        } else {
+          comitDatasource['id'] = id
+          res = await updateGoods(comitDatasource);
+        }
+        if (res?.code === '0') {
+          this.$message.success('操作成功');
+          this.cancel();
+          this.$emit('done');
+        }
+      } catch (error) {
+        this.loading = false;
+      }
+    },
+
+    //查询商品编码
+    async getGoodsCode(code) {
+      this.form.goodsCode = await getCode(code);
+    },
+
+    cancel() {
+      this.$nextTick(() => {
+        this.$refs.inventoryTable.putTableList([]);
+        this.$refs.imgUploadRef.putValue();
+        // 重置表单验证状态
+        // 关闭后,销毁所有的表单数据
+        this.form = {}
+        this.visible = false;
+      });
+    },
+
+    getValidate() {
+      //开始表单校验
+      return Promise.all([
+          new Promise((resolve, reject) => {
+            this.$refs.form.validate((valid) => {
+              if (!valid) {
+                reject(false);
+              } else {
+                resolve(true);
+              }
+            });
+          }),
+          new Promise((resolve, reject) => {
+            this.$refs.inventoryTable.validateForm((valid) => {
+              if (!valid) {
+                reject(false);
+              } else {
+                resolve(true);
+              }
+            });
+          }),
+          
+        ]);
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.el-form-item {
+    margin-bottom: 20px !important;
+  }
+
+  .el-form-item__error {
+  display: block !important;
+  color: red;
+  padding-top: 4px;
+}
+</style>

+ 227 - 0
src/views/commodityManagement/commodityPriceList/components/editPriceDialog.vue

@@ -0,0 +1,227 @@
+<template>
+  <ele-modal
+    custom-class="ele-dialog-form long-dialog-form"
+    :centered="true"
+    :append-to-body="true"
+    :visible.sync="visible"
+    :close-on-click-modal="false"
+    width="60%"
+    @close="cancel"
+    title="修改商品价格"
+    :fullscreen="fullscreen"
+    v-if="visible"
+  >
+    <el-form
+      label-width="120px"
+      ref="form"
+      :model="form"
+      :rules="rules"
+      class="el-form-box"
+    >
+      <!-- <el-row v-if="type === 1">
+        <el-col :span="8">
+          <el-form-item label="商品分类" prop="nameType">
+            <el-input
+              v-model="form.nameType"
+              maxlength="50"
+              type="number"
+              disabled="true"
+            >
+            </el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="	商机名称" prop="name">
+            <el-input
+              placeholder="请输入"
+              v-model="form.name"
+              maxlength="50"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row> -->
+      <el-row >
+          <el-col :span="6">
+            <el-form-item label="价格分类" prop="priceType">
+              <DictSelection
+                dictName="商品价格类型"
+                clearable
+                v-model="form.priceType"
+              >
+              </DictSelection>
+            </el-form-item>
+          </el-col>
+        <el-col :span="6">
+          <el-form-item label="含税单价" prop="unitPrice">
+            <el-input
+              placeholder="请输入"
+              v-model="form.unitPrice"
+              maxlength="50"
+              type="number"
+              @input="changeCount"
+            >
+              <template slot="append">元</template>
+            </el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="税率" prop="taxRate">
+            <el-input
+              placeholder="请输入"
+              v-model="form.taxRate"
+              maxlength="50"
+              type="number"
+              @input="changeCount"
+            >
+              <template slot="append">%</template>
+            </el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="不含税单价" prop="excludeTaxPrice">
+            <el-input
+              placeholder="请输入"
+              v-model="form.excludeTaxPrice"
+              maxlength="50"
+              disabled="ture"
+            >
+              <template slot="append">元</template>
+            </el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <template slot="footer">
+      <el-button type="primary" @click="save" v-click-once>提交</el-button>
+      <el-button @click="cancel">返回</el-button>
+    </template>
+  </ele-modal>
+</template>
+
+<script>
+import { copyObj } from '@/utils/util';
+import { getGoodsPriceById } from '@/api/goodsManage/index'
+
+export default {
+  props: {
+    list: {
+      type: Array,
+      default: []
+    }
+  },
+  data() {
+    let formDef = {
+      id: '',
+
+      priceType: '',
+      unitPrice: 0,
+      taxRate: 0,
+      excludeTaxPrice: 0
+    };
+    return {
+      formDef,
+      fullscreen: false,
+      title: '',
+      visible: false,
+      type: '修改商品价格',
+      form: copyObj(formDef),
+      type: 1, // 1为商品信息 2为商品价格
+      rules: {
+        priceType: [
+          { required: true, message: '请选择价格分类', trigger: 'change' }
+        ],
+        unitPrice: [
+          { required: true, message: '请输入含税单价', trigger: 'change' }
+        ],
+        taxRate: [{ required: true, message: '请输入税率', trigger: 'change' }],
+        winRate: [
+          {
+            required: false,
+            trigger: 'blur',
+            validator: (_rule, value, callback) => {
+              console.log(_rule);
+              const reg = /^\d+(\.\d{1,2})?$/; // 限制为最多两位小数的正数
+              if (!value) {
+                callback(); // 验证通过
+                return;
+              }
+              if (reg.test(value) && parseFloat(value) <= 100) {
+                callback(); // 验证通过
+              } else {
+                value = value && value.replace(/[^0-9.]/g, ''); // 只保留数字和小数点
+                const [integerPart, decimalPart] = value && value.split('.');
+                if (decimalPart && decimalPart.length > 2) {
+                  callback(new Error('小数位数不能超过两位'));
+                } else {
+                  callback(new Error('只能输入小于100的数字'));
+                }
+              }
+            }
+          }
+        ],
+        budget: [
+          {
+            required: false,
+            trigger: 'blur',
+            validator: (_rule, value, callback) => {
+              const reg = /^\d{1,13}(\.\d{1,2})?$/; // 限制为最多两位小数的13位以内的正数
+              if (!value) {
+                callback(); // 验证通过
+                return;
+              }
+              if (reg.test(value)) {
+                callback(); // 验证通过
+              } else {
+                value = value && value.replace(/[^0-9.]/g, ''); // 只保留数字和小数点
+                const [integerPart, decimalPart] = value && value.split('.');
+                if (decimalPart && decimalPart.length > 2) {
+                  callback(new Error('小数位数不能超过两位'));
+                } else if (integerPart.length > 13) {
+                  callback(new Error('整数位数不能超过13位'));
+                } else {
+                  callback(new Error('只能输入数字'));
+                }
+              }
+            }
+          }
+        ]
+      }
+    };
+  },
+  methods: {
+    async open(row) {
+      let res = await getGoodsPriceById(row.id);
+      this.form = res || {};
+      this.visible = true;
+    },
+
+    changeCount() {
+      let row = this.form;
+      if (row.unitPrice == null || row.taxRate == null) return;
+      let excludeTaxPrice = (
+        Number(row.unitPrice) /
+        (1 + Number(row.taxRate) / 100)
+      ).toFixed(2);
+      this.form.excludeTaxPrice = excludeTaxPrice || 0;
+    },
+     async save() {
+      let commitDatasource = this.form;
+      res = await updateGoods(commitDatasource);
+      if (res?.code === '0') {
+          this.$message.success('操作成功');
+          this.cancel();
+          this.$emit('done');
+        }
+    },
+    cancel() {
+      this.$nextTick(() => {
+        // 关闭后,销毁所有的表单数据
+        this.form = {};
+        this.visible = false;
+      });
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 248 - 0
src/views/commodityManagement/commodityPriceList/components/historicalpriceDialog.vue

@@ -0,0 +1,248 @@
+<template>
+  <ele-modal
+    custom-class="ele-dialog-form long-dialog-form"
+    :centered="true"
+    :append-to-body="true"
+    :visible.sync="visible"
+    :close-on-click-modal="false"
+    width="40%"
+    @close="cancel"
+    :title="title"
+    v-if="visible"
+  >
+    <headerTitle title="历史价格趋势图"></headerTitle>
+    <v-chart ref="lineRef" style="width: 100%;min-height: 350px;margin-bottom: 40px;" :option="lineOption" />
+    <headerTitle title="历史价格列表"></headerTitle>
+    <!-- <PriceSearch @search="reload" /> -->
+    <!-- <ele-pro-table
+      ref="table"
+      :columns="columns"
+      :datasource="datasource"
+      tool-class="ele-toolbar-form"
+      :page-size="20"
+    >
+    </ele-pro-table> -->
+    <el-container>
+
+    <el-table
+      :data="data"
+      style="width: 100%">
+      <el-table-column
+        prop="date"
+        label="日期"
+        >
+      </el-table-column>
+      <el-table-column
+        prop="price"
+        label="价格"
+        >
+      </el-table-column>
+    </el-table>
+  </el-container>
+
+  </ele-modal>
+</template>
+
+<script>
+import PriceSearch from './priceSearch.vue';
+import VChart from 'vue-echarts';
+import { use } from 'echarts/core';
+import { CanvasRenderer } from 'echarts/renderers';
+import { BarChart, PieChart, LineChart } from 'echarts/charts';
+import { getHistoryList } from '@/api/goodsManage/index'
+import {
+  GridComponent,
+  TooltipComponent,
+  LegendComponent
+} from 'echarts/components';
+use([
+  CanvasRenderer,
+  BarChart,
+  PieChart,
+  GridComponent,
+  TooltipComponent,
+  LegendComponent,
+  LineChart
+]);
+export default {
+  components: { PriceSearch, VChart },
+  data() {
+    return {
+      title:'价格历史趋势',
+      lineOption: {
+        tooltip: {
+          // formatter: (item) => {
+          //   return (
+          //     item.name + ' ' + item.seriesName + ':' + item.value + '万元'
+          //   );
+          // },
+          trigger: 'item'
+        },
+        legend: {
+          itemGap: window.innerHeight * 0.014,
+        },
+        grid: {
+            left: '5%',
+            right: '5%',
+            bottom: '8%'
+          },
+        xAxis: {  
+          type: 'category',
+          data: [
+            '1月',
+            '2月',
+            '3月',
+            '4月',
+            '5月',
+            '6月',
+            '7月',
+            '8月',
+            '9月',
+            '10月',
+            '11月',
+            '12月'
+          ]
+        },
+        yAxis: {
+            type: 'value',
+            name: '',
+            alignTicks: true,
+            axisLine: {
+              show: false
+            },
+            axisLabel: {
+              formatter: '{value}元'
+            }
+        },
+        series: [{
+              name: '价格趋势',
+              type: 'line',
+              itemStyle: {
+                color: '#FF9669'
+              },
+              data: [
+                2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2
+              ]
+            }]
+      },
+      title: '',
+      visible: false,
+      columns: [
+        {
+          columnKey: 'index',
+          type: 'index',
+          width: 50,
+          align: 'center',
+          showOverflowTooltip: true,
+          label: '序号'
+        },
+        {
+          prop: 'name',
+          label: '商品编码',
+          align: 'center',
+          showOverflowTooltip: true,
+          sortable: true
+        },
+        {
+          prop: 'code',
+          label: '商品图片',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'name',
+          label: '商品名称',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'categoryLevelPath',
+          label: '商品分类',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: '产品名称',
+          align: 'center',
+          label: '产品名称',
+          showOverflowTooltip: true
+        },
+        {
+          prop: '产品编码',
+          label: '产品编码',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: '产品类型',
+          label: '产品类型',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'priceType',
+          label: '价格类型',
+          slot: 'priceType',
+          align: 'center'
+        },
+        {
+          prop: 'singlePrice',
+          headerSlot: 'headerSinglePrice',
+          label: '含税单价',
+          slot: 'singlePrice',
+          align: 'center'
+        },
+        {
+          prop: 'taxRate',
+          headerSlot: 'headerTaxRate',
+          slot: 'taxRate',
+          label: '税率',
+          align: 'center'
+        },
+        {
+          prop: 'notaxSinglePrice',
+          // headerSlot: 'headerNotaxSinglePrice',
+          label: '不含税单价',
+          slot: 'notaxSinglePrice',
+          align: 'center'
+        }
+      ],
+      data: {},
+
+    };
+  },
+  mounted() {
+  },
+  methods: {
+    async open(row) {
+      this.visible = true;
+      let res = await getHistoryList(row.id);
+      const list = res.map((item) => {
+        const date = Object.keys(item)[0];
+        const price = item[key];
+        return { date, price };
+      })
+      debugger;
+      this.data = list;
+    },
+
+    /* 表格数据源 */
+    datasource({ page, limit, where }) {
+      where.goodsPriceId = this.row.id;
+      return getHistoryList({
+        pageNum: page,
+        size: limit,
+        ...where
+      });
+    },
+
+    cancel() {
+      this.visible = false;
+    }
+    
+  }
+};
+</script>
+<style lang="scss" scoped>
+
+</style>

+ 92 - 0
src/views/commodityManagement/commodityPriceList/components/imgUpload.vue

@@ -0,0 +1,92 @@
+<template>
+  <ele-image-upload
+    v-model="images"
+    :limit="1"
+    :drag="true"
+    :multiple="false"
+    :upload-handler="uploadHandler"
+    :beforeUpload="beforeUpload"
+    @upload="onUpload"
+  >
+  </ele-image-upload>
+</template>
+
+<script>
+  import EleImageUpload from 'ele-admin/es/ele-image-upload';
+  import { uploadFile } from '@/api/system/file/index';
+
+  export default {
+    components: { EleImageUpload },
+    props: {
+      // 所属模块
+      module: {
+        type: String,
+        default: 'main'
+      },
+      // 限制数量
+      limit: {
+        type: Number,
+        default: -1
+      },
+      value: {
+        type: Array,
+        default: () => []
+      }
+    },
+    data () {
+      return {
+        images: []
+      };
+    },
+
+    methods: {
+      // beforeUpload(){},
+      /* 上传事件 */
+      uploadHandler (file) {
+        const item = {
+          file,
+          uid: file.uid,
+          name: file.name,
+          progress: 0,
+          status: null
+        };
+        if (!file.type.startsWith('image')) {
+          this.$message.error('只能选择图片');
+          return;
+        }
+        if (file.size / 1024 / 1024 > 2) {
+          this.$message.error('大小不能超过 2MB');
+          return;
+        }
+        this.$emit('input', [...this.value, item]);
+        this.onUpload(item);
+      },
+      /* 上传 item */
+      async onUpload (item) {
+        // 模拟上传
+        item.status = 'uploading';
+        item.progress = 20;
+
+        const res = await uploadFile({
+          module: this.module,
+          multiPartFile: item.file
+        });
+        if (res.data) {
+          item.url = res.data.url;
+          item.id = res.data.id;
+          item.progress === 100;
+          item.status = 'done';
+          this.images.push(item)
+        }
+      },
+
+      putValue(item) {
+        if (item) {
+          this.images.push(item)
+        } else {
+          this.images = []
+        }
+      }
+    }
+  };
+</script>

+ 99 - 0
src/views/commodityManagement/commodityPriceList/components/priceSearch.vue

@@ -0,0 +1,99 @@
+<template>
+  <el-form
+    label-width="100px"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row :gutter="15">
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 4 }">
+        <el-form-item label="价格类型:" prop="categoryLevelId">
+          <DictSelection
+            dictName="商品价格类型"
+            clearable
+            v-model="params.categoryLevelId"
+          >
+          </DictSelection>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 4 }">
+        <el-form-item label="商品编码:" prop="goodsCode">
+          <el-input
+            clearable
+            v-model="params.goodsCode"
+            placeholder="请输入"
+            maxlength="50"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 4 }">
+        <el-form-item label="商品名称:" prop="goodsName">
+          <el-input
+            clearable
+            placeholder="请输入"
+            v-model.trim="params.goodsName"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col
+        style="display: flex; justify-content: end"
+        v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 4 }"
+      >
+        <div class="ele-form-actions">
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+          >
+            查询
+          </el-button>
+          <el-button @click="reset">重置</el-button>
+        </div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+export default {
+  data() {
+    // 默认表单数据
+    const defaultParams = {
+      priceType: '',
+      name: '',
+      codeOrSerialNo: '',
+      status: ''
+    };
+    return {
+      defaultParams,
+      // 表单数据
+      params: { ...defaultParams },
+      // 状态数据源
+      statusList: [
+        { value: 1, label: '启用' },
+        { value: 2, label: '禁用' }
+      ]
+    };
+  },
+  computed: {
+    // 是否开启响应式布局
+    styleResponsive() {
+      return this.$store.state.theme.styleResponsive;
+    }
+  },
+  methods: {
+    //搜索
+    search() {
+      this.$emit('search', {
+        ...this.params
+      });
+    },
+    //重置
+    reset() {
+      this.params = { ...this.defaultParams };
+      this.search();
+    }
+  }
+};
+</script>

+ 352 - 0
src/views/commodityManagement/commodityPriceList/components/productTable.vue

@@ -0,0 +1,352 @@
+<template>
+  <el-form ref="form" :model="form">
+    <ele-pro-table
+      ref="table"
+      :needPage="false"
+      :columns="columns"
+      :datasource="form.datasource"
+      class="time-form"
+      :toolkit="[]"
+    >
+      <!-- 表头工具栏 -->
+      <template v-slot:toolbar>
+        <div class="headbox">
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-plus"
+            class="ele-btn-icon"
+            @click="handParent()"
+            :disabled="form.datasource.length >= 4"
+          >
+            新增
+          </el-button>
+        </div>
+      </template>
+      <template v-slot:unitPrice="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.unitPrice'"
+          :rules="{
+            required: true,
+            message: '请输入正确的单价',
+            trigger: 'change'
+          }"
+        >
+          <el-input
+            v-model="scope.row.unitPrice"
+            placeholder="请输入"
+            @input="changeCount(scope.row, scope.$index)"
+            type="number"
+          >
+            <template slot="append">元</template>
+          </el-input>
+        </el-form-item>
+      </template>
+      <template v-slot:taxRate="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.taxRate'"
+        >
+          <el-input
+            v-model="scope.row.taxRate"
+            placeholder="请输入"
+            type="number"
+            @input="changeCount(scope.row, scope.$index)"
+          >
+            <template slot="append">%</template>
+          </el-input>
+        </el-form-item>
+      </template>
+      <template v-slot:priceType="scope">
+        <el-form-item style="margin-bottom: 20px"
+        :prop="'datasource.' + scope.$index + '.priceType'"
+        :rules="{
+            required: true,
+            message: '请输入选择价格类型',
+            trigger: 'change'
+          }">
+          <el-select v-model="scope.row.priceType" placeholder="请选择价格类型" clearable >
+            <el-option v-for="item in goodsTypeList" :key="item.key" :label="item.value" :value="item.key">
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </template>
+      <!-- <template v-slot:commImg="scope">
+        <ImgUpload v-model="scope.row.commImg" />
+      </template> -->
+      <template v-slot:headerPriceType="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+      <template v-slot:headerTaxRate="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+      <template v-slot:headerUnitPrice="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+      <template v-slot:headerExcludeTaxPrice="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+      <!-- 操作列 -->
+      <template v-slot:action="scope">
+        <el-popconfirm
+          class="ele-action"
+          title="确定要删除吗?"
+          @confirm="remove(scope.$index)"
+          :disabled="form.datasource.length <= 1"
+        >
+          <template v-slot:reference>
+            <el-link :disabled="form.datasource.length <= 1" type="danger" :underline="false" icon="el-icon-delete">
+              删除
+            </el-link>
+          </template>
+        </el-popconfirm>
+      </template>
+    </ele-pro-table>
+  </el-form>
+</template>
+<script>
+import SelectTree from './selectTree.vue';
+import dictMixins from '@/mixins/dictMixins';
+import { lbjtList } from '@/enum/dict.js';
+import FileMain from '@/components/addDoc/index.vue';
+import ImgUpload from './imgUpload.vue';
+import {
+  getWarehouseOutStock,
+  getIdWarehouseList
+} from '@/api/saleManage/saleorder';
+import { getTreeByPid, getPcTreeByPids } from '@/api/classifyManage';
+import { getByCode } from '@/api/system/dictionary-data';
+import { getCode } from '@/api/login/index';
+
+export default {
+  components: { SelectTree, FileMain, ImgUpload },
+  mixins: [dictMixins],
+  props: { groupId: String },
+  data() {
+    return {
+      title: '',
+      visible: false,
+      fullscreen: false,
+      form: {
+        datasource: []
+      },
+      // 提交状态
+      loading: false,
+      // 是否是修改
+      isUpdate: false,
+      // 组织机构树形结构数据
+      groupTreeData: [],
+      // 组织机构平铺数据
+      groupData: [],
+      goodsTypeList: [], //商品类型
+      goodsCode: '' //商品编码
+    };
+  },
+  created() {
+    this.getByCode('goods_price_type'); //获取商品类型字典
+  },
+
+  computed: {
+    columns() {
+      return [
+        {
+          width: 80,
+          type: 'index',
+          columnKey: 'index',
+          align: 'center',
+          fixed: 'left',
+          label:'序号'
+        },
+        {
+          width: 200,
+          prop: 'priceType',
+          label: '价格类型',
+          slot: 'priceType',
+          headerSlot: 'headerPriceType',
+          align: 'center',
+        },
+        {
+          width: 200,
+          prop: 'unitPrice',
+          headerSlot: 'headerUnitPrice',
+          label: '含税单价',
+          slot: 'unitPrice',
+          align: 'center'
+        },
+        {
+          width: 200,
+          prop: 'taxRate',
+          // headerSlot: 'headerTaxRate',
+          slot: 'taxRate',
+          label: '税率',
+          align: 'center'
+        },
+        {
+          width: 200,
+          prop: 'excludeTaxPrice',
+          label: '不含税单价',
+          slot: 'excludeTaxPrice',
+          align: 'center'
+        },
+        {
+          columnKey: 'action',
+          label: '操作',
+          align: 'center',
+          resizable: false,
+          slot: 'action',
+          showOverflowTooltip: true
+        }
+      ];
+    }
+  },
+
+  methods: {
+    //改变单价或税率计算不含税单价
+    changeCount(row, index) {
+      if (row.unitPrice == null) return;
+      let excludeTaxPrice = (
+        Number(row.unitPrice) /
+        (1 + (Number(row.taxRate) || 0) / 100)
+      ).toFixed(2);
+      this.form.datasource[index].excludeTaxPrice = excludeTaxPrice || 0;
+    },
+    // 返回列表数据
+    getTableValue() {
+      let dList = this.form.datasource;
+      if (dList.length === 0) {
+        this.$message.error('请新增价格信息!');
+        return ;
+      }
+      const priceTypes = dList.map(item => item.priceType); 
+      const uniquePriceTypes = new Set(priceTypes); 
+      if (uniquePriceTypes.size !== priceTypes.length) {
+        this.$message.error('价格类型不能重复!');
+        return; 
+      }
+      let priceList = dList.map((item) => ({
+        excludeTaxPrice: +item.excludeTaxPrice,
+        priceType: item.priceType,
+        taxRate: +item.taxRate / 100,
+        unitPrice: +item.unitPrice
+      }));
+      return priceList;
+    },
+
+    //修改回显
+    putTableList(data) {
+      let list = data.map((i) =>  {
+        return {taxRate:i.taxRate * 100, ...i}
+      }) || [];
+      this.form.datasource = list
+    },
+
+    remove(i) {
+      this.form.datasource.splice(i, 1);
+      this.setSort();
+    },
+    // 清空表格
+    restTable() {
+      debugger;
+      this.form.datasource = [];
+    },
+    // 重新排序
+    setSort() {
+      this.form.datasource.forEach((n, index) => {
+        n.key = index + 1;
+      });
+    },
+    //选择产品
+    handParent() {
+      let row = {};
+      this.$set(row, 'unitPrice', '')
+      this.$set(row, 'taxRate', '')
+      this.$set(row, 'priceType', '')
+      row.key = this.form.datasource.length + 1;
+      this.form.datasource.push(row);
+    },
+
+    validateForm(callback) {
+      //开始表单校验
+      this.$refs.form.validate((valid, obj) => {
+        if (obj) {
+          let messages = Object.keys(obj).map((key) => obj[key][0]);
+          if (messages.length > 0) {
+            this.$message.warning(messages[0].message);
+          }
+        }
+        callback(valid);
+      });
+    },
+
+
+    //查询商品价格字典
+    async getByCode(code) {
+      const res = await getByCode(code);
+      if (res?.code === '0') {
+        const newArray = res.data.map(item => {
+            const key = Object.keys(item)[0]; 
+            const value = item[key];        
+            return { key, value };           
+        });
+        this.goodsTypeList = newArray;
+      }
+    },
+
+    //查询商品编码
+    async getGoodsCode(code) {
+      this.goodsCode = await getCode(code);
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.headbox {
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+
+  .amount {
+    font-size: 14px;
+    font-weight: bold;
+    padding-right: 30px;
+  }
+}
+
+.time-form .el-form-item {
+  margin-bottom: 0 !important;
+}
+
+::v-deep .period {
+  display: flex;
+
+  .borderleftnone {
+    .el-input--medium .el-input__inner {
+      border-top-right-radius: 0;
+      border-bottom-right-radius: 0;
+    }
+  }
+
+  .borderrightnone {
+    .el-input--medium .el-input__inner {
+      border-top-left-radius: 0;
+      border-bottom-left-radius: 0;
+    }
+  }
+}
+
+::v-deep .time-form tbody > tr:hover > td {
+  background-color: transparent !important;
+}
+
+::v-deep .time-form .el-table tr {
+  background-color: #ffffff;
+}
+
+.pricebox {
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+  font-weight: bold;
+}
+</style>

+ 46 - 0
src/views/commodityManagement/commodityPriceList/components/selectTree.vue

@@ -0,0 +1,46 @@
+<!-- 机构选择下拉框 -->
+<template>
+    <ele-tree-select
+      ref="tree"
+      clearable
+      :value="value || ''"
+      :data="data"
+      label-key="name"
+      value-key="id"
+      default-expand-all
+      :placeholder="placeholder"
+      @input="updateValue"
+      :disabled="disabled"
+    />
+  </template>
+  
+  <script>
+  export default {
+    props: {
+      // 选中的数据(v-model)
+      value: [Number, String],
+      disabled: {
+        type: Boolean,
+        default: false
+      },
+      // 提示信息
+      placeholder: {
+        type: String,
+        default: '请选择机构'
+      },
+      // 机构数据
+      data: Array
+    },
+    methods: {
+      /* 更新选中数据 */
+      updateValue(value) {
+        this.$emit('input', value);
+        let nodesInfo = [];
+        nodesInfo = this.$refs['tree'].getHalfCheckedKeys();
+        nodesInfo.push(value);
+        this.$emit('checkedKeys', nodesInfo);
+      }
+    }
+  };
+  </script>
+  

+ 426 - 0
src/views/commodityManagement/commodityPriceList/index.vue

@@ -0,0 +1,426 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+      <ele-split-layout width="210px" allow-collapse :right-style="{ overflow: 'hidden' }">
+        <div>
+          <div class="ele-border-lighter sys-organization-list">
+            <AssetTree @handleNodeClick="handleNodeClick" id="1789827921908150274" :isIds="false"
+              :isFirstRefreshTable="false" ref="treeList" />
+          </div>
+        </div>
+        <template v-slot:content>
+          <div class="ele-border-lighter form-content" v-loading="loading"></div>
+          <PriceSearch @search="reload"> </PriceSearch>
+          <!-- 数据表格 -->
+          <ele-pro-table ref="table" :columns="columns" :datasource="datasource" height="calc(100vh - 325px)"
+            full-height="calc(100vh - 116px)" tool-class="ele-toolbar-form" :page-size="20" :selection.sync="selection"
+            @columns-change="handleColumnChange" :cache-key="cacheKeyUrl">
+            <!-- 表头工具栏 -->
+            <template v-slot:toolbar>
+              <el-button size="small" type="primary" icon="el-icon-plus" class="ele-btn-icon" @click="openEdit('add')">
+                新建
+              </el-button>
+              <el-button size="small" type="danger" el-icon-delete class="ele-btn-icon" @click="allDelBtn"
+                :disabled="selection?.length === 0">
+                批量删除
+              </el-button>
+            </template>
+
+            <!-- 展开列 -->
+            <template v-slot:expand="{ row }">
+              <el-form v-for="item in row.children" :key="item.id" label-width="100px" class="el-form-box">
+                <el-row class="price-info">
+                  <el-col :span="3"><el-form-item label="价格类型:">{{goodsTypeList.find((i) => i[item.priceType])?.[
+                    item.priceType
+                  ]}}</el-form-item></el-col>
+                  <el-col :span="3"><el-form-item label="含税单价:">{{ item.unitPrice }}</el-form-item></el-col>
+                  <el-col :span="3"><el-form-item label="税率:">{{ item.taxRate }}%</el-form-item></el-col>
+                  <el-col :span="3"><el-form-item label="不含税单价:">{{ item.excludeTaxPrice }}</el-form-item></el-col>
+                  <el-col :span="3" v-show="row.goodsStatus === 0" ><el-link @click="openEditPrice(item)" type="primary" :underline="false" icon="el-icon-sort-edit">
+                      修改
+                    </el-link></el-col>
+                    <el-col :span="3" ><el-link @click="openHistoricalprice(item)" type="primary" :underline="false" icon="el-icon-sort-edit">
+                      历史价格
+                    </el-link></el-col>
+                </el-row>
+              </el-form>
+            </template>
+            <!-- 列详情 -->
+            <template v-slot:name="{ row }">
+              <el-link type="primary" :underline="false" @click="openDetail(row)">
+                {{ row.name }}</el-link>
+            </template>
+
+            <!-- 商品图片 -->
+            <template v-slot:imagesPaths="{ row }">
+              <el-image style="width: 100px; height: 100px" fit="cover"
+                :src="locationUrl + '/api/main/file/getFile?objectName=' + row.imagesPaths"
+                :preview-src-list="[locationUrl + '/api/main/file/getFile?objectName=' + row.imagesPaths]" />
+            </template>
+
+            <!-- 操作列 -->
+            <template v-slot:action="{ row }">
+              <el-link @click="editGoodsStatus(row)" v-show="row.goodsStatus === 0" type="primary" :underline="false"
+                icon="el-icon-sort-up">
+                上架
+              </el-link>
+              <el-link @click="editGoodsStatus(row)" v-show="row.goodsStatus === 1" type="primary" :underline="false"
+                icon="el-icon-sort-down">
+                下架
+              </el-link>
+              <el-popconfirm
+                    class="ele-action"
+                    title="确定要删除此信息吗?"
+                    @confirm="commitBtn([row.id])"
+                  >
+                    <template v-slot:reference>
+                      <el-link type="danger" :underline="false" >
+                        删除
+                      </el-link>
+                    </template>
+              </el-popconfirm>
+              <el-dropdown @command="(command) => handleCommand(command, row)">
+                <span class="el-dropdown-link">
+                  操作菜单<i class="el-icon-arrow-down el-icon--right"></i>
+                </span>
+                <el-dropdown-menu slot="dropdown">
+                  <!-- <el-dropdown-item 
+                    command="up"
+                    icon="el-icon-up"
+                    v-show="row.goodsStatus === 0"
+                    >上架
+                  </el-dropdown-item>
+                  <el-dropdown-item command="down" v-show="row.goodsStatus === 1"
+                    >下架
+                  </el-dropdown-item> -->
+                  <el-dropdown-item v-show="row.goodsStatus === 0"command="openEditGoodsInfo">修改商品信息
+                  </el-dropdown-item>
+                  <!-- <el-dropdown-item command="openEditInfo" v-if="!row.verifyStatus">修改商品价格
+                  </el-dropdown-item> -->
+                  <!-- <el-dropdown-item
+                    icon="el-icon-circle-close"
+                    command="del"
+                    >删除
+                  </el-dropdown-item> -->
+                  <!-- <el-popconfirm
+                    class="ele-action"
+                    title="确定要删除此信息吗?"
+                    @confirm="remove([row.id])"
+                  >
+                    <template v-slot:reference>
+                      <el-link type="danger" :underline="false" >
+                        删除
+                      </el-link>
+                    </template>
+</el-popconfirm> -->
+                  <!-- <el-dropdown-item command="openHistoricalprice">历史价格
+                  </el-dropdown-item> -->
+                </el-dropdown-menu>
+              </el-dropdown>
+            </template>
+          </ele-pro-table>
+        </template>
+      </ele-split-layout>
+    </el-card>
+
+    <AddDialog ref="addContactDialogRef" @done="reload"></AddDialog>
+    <EditPriceDialog ref="editPriceDialogRef" @done="reload"> </EditPriceDialog>
+    <HistoricalpriceDialog ref="historicalpriceDialogRef" @done="reload"></HistoricalpriceDialog>
+  </div>
+</template>
+
+<script>
+import HistoricalpriceDialog from './components/historicalpriceDialog.vue';
+import EditPriceDialog from './components/editPriceDialog.vue';
+import AssetTree from '@/components/AssetTree';
+import PriceSearch from './components/priceSearch.vue';
+import AddDialog from './components/addDialog.vue';
+import tabMixins from '@/mixins/tableColumnsMixin';
+import { getList, del, offOnSheft } from '@/api/goodsManage/index'
+import { getByCode } from '@/api/system/dictionary-data';
+
+export default {
+  mixins: [tabMixins],
+  components: {
+    AssetTree,
+    PriceSearch,
+    AddDialog,
+    EditPriceDialog,
+    HistoricalpriceDialog
+  },
+  data() {
+    return {
+      locationUrl: window.location.origin,
+      loading: false,
+      cacheKeyUrl: 'eos-01283c34-commodityManagement-commodityPriceList',
+      // 表格列配置
+      columns: [
+        {
+          width: 45,
+          type: 'selection',
+          columnKey: 'selection',
+          align: 'center',
+        },
+        {
+          width: 45,
+          type: 'expand',
+          columnKey: 'expand',
+          align: 'center',
+          slot: 'expand',
+        },
+        {
+          columnKey: 'index',
+          type: 'index',
+          width: 50,
+          align: 'center',
+          showOverflowTooltip: true,
+          label: '序号'
+        },
+        {
+          prop: 'goodsCode',
+          label: '商品编码',
+          align: 'center',
+          showOverflowTooltip: true,
+          sortable: true,
+          width: 180,
+        },
+        {
+          prop: 'imagesPaths',
+          label: '商品图片',
+          align: 'center',
+          slot: 'imagesPaths',
+          width: 180,
+        },
+        {
+          prop: 'goodsName',
+          label: '商品名称',
+          align: 'center',
+          showOverflowTooltip: true,
+          width: 180,
+        },
+        {
+          prop: 'categoryLevelName',
+          label: '商品分类',
+          align: 'center',
+          showOverflowTooltip: true,
+          width: 180,
+        },
+        {
+          prop: 'categoryName',
+          align: 'center',
+          label: '产品名称',
+          showOverflowTooltip: true,
+          width: 180,
+        },
+        // {
+        //   prop: '产品编码',
+        //   label: '产品编码',
+        //   align: 'center',
+        //   showOverflowTooltip: true
+        // },
+        // {
+        //   prop: '产品类型',
+        //   label: '产品类型',
+        //   align: 'center',
+        //   showOverflowTooltip: true
+        // },
+        // {
+        //   prop: 'priceType',
+        //   label: '价格类型',
+        //   slot: 'priceType',
+        //   align: 'center',
+        //   width: 120,
+        //   formatter: (row, column) => {
+        //     if (row.priceType) {
+        //       return this.goodsTypeList.find((item) => item[row.priceType])?.[
+        //         row.priceType
+        //       ];
+        //     }
+        //   }
+        // },
+        // {
+        //   prop: 'unitPrice',
+        //   label: '含税单价',
+        //   slot: 'unitPrice',
+        //   align: 'center'
+        // },
+        // {
+        //   prop: 'taxRate',
+        //   slot: 'taxRate',
+        //   label: '税率',
+        //   align: 'center'
+        // },
+        // {
+        //   prop: 'excludeTaxPrice',
+        //   label: '不含税单价',
+        //   slot: 'excludeTaxPrice',
+        //   align: 'center'
+        // },
+        {
+          prop: 'goodsStatus',
+          align: 'center',
+          label: '状态',
+          showOverflowTooltip: true,
+          formatter: (row, column) => {
+            return row.goodsStatus === 0
+              ? '下架'
+              : row.goodsStatus === 1
+                ? '上架'
+                : '';
+          }
+        },
+        {
+          prop: 'createTime',
+          label: '创建时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          width: 180,
+        },
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 250,
+          align: 'center',
+          resizable: false,
+          slot: 'action',
+          showOverflowTooltip: true,
+          fixed: 'right'
+        }
+      ],
+      selection: [],
+      curNodeData: {}, //右侧菜单选择对象
+      goodsTypeList: [] //商品价格类型
+    };
+  },
+  created() {
+    // this.getTreeData();
+    this.getByCode('goods_price_type')
+  },
+  methods: {
+    /* 表格数据源 */
+    datasource({ page, limit, where }) {
+      return getList({
+        pageNum: page,
+        size: limit,
+        ...where
+      });
+    },
+
+    handleCommand(command, row) {
+      if (command === 'openEditGoodsInfo') {
+        this.openEdit('editGoodsInfo', row)
+      } else if (command === 'openHistoricalprice') {
+        this.openEditPrice(row)
+      } else if (command === 'del') {
+        this.commitBtn([row.id]);
+      }
+    },
+
+    handleNodeClick(data, node) {
+      this.curNodeData = data;
+      this.reload({ categoryLevelId: data.id });
+    },
+
+    /* 刷新表格 */
+    reload(where) {
+      this.$refs.table.reload({ page: 1, where });
+    },
+
+    //历史价格
+    openHistoricalprice(row) {
+      this.$refs.historicalpriceDialogRef.open(row);
+    },
+
+    openEdit(type, row) {
+      this.$refs.addContactDialogRef.open(type, row, this.curNodeData.id);
+      this.$refs.addContactDialogRef.$refs.form &&
+        this.$refs.addContactDialogRef.$refs.form.clearValidate();
+    },
+
+    openEditPrice(row) {
+      this.$refs.editPriceDialogRef.open(row);
+      this.$refs.editPriceDialogRef.$refs.form &&
+        this.$refs.editPriceDialogRef.$refs.form.clearValidate();
+    },
+    //上架下架操作
+    editGoodsStatus(row) {
+      const data = { shelf_type: row.goodsStatus === 1 ? 'off' : 'on', goods_id: row.id };
+      offOnSheft(data).then((res) => {
+        this.$message.success('操作成功!');
+        this.reload();
+      }).catch((error) => { });
+    },
+
+    //批量删除
+    allDelBtn() {
+      if (this.selection.length === 0) return;
+      let flag = this.selection.some((item) =>
+        [1].includes(item.goodsStatus)
+      );
+      if (flag)
+        return this.$message.warning('抱歉已上架中的数据不能删除,请检查');
+      this.commitBtn()
+    },
+
+    commitBtn(id = []) {
+      const dataId = id || this.selection.map((v) => v.id);
+      del(dataId).then((res) => {
+        this.$message.success('删除成功!');
+        this.reload();
+      }).catch((error) => { });
+    },
+
+    //查询商品价格字典
+    async getByCode(code) {
+      const res = await getByCode(code);
+      if (res?.code === '0') {
+        this.goodsTypeList = res.data;
+      }
+    },
+
+    // async getTreeData() {
+    //   const res = await getTreeByPid('1789827921908150274');
+    //   if (res?.code === '0') {
+    //     this.treeList = res.data;
+    //   }
+    // }
+  }
+};
+</script>
+<style lang="scss" scoped>
+:deep(.el-link--inner) {
+  margin-left: 0px !important;
+}
+
+.sys-organization-list {
+  height: calc(100vh - 225px);
+  box-sizing: border-box;
+  border-width: 1px;
+  border-style: solid;
+  overflow: auto;
+}
+
+.sys-organization-list :deep(.el-tree-node__content) {
+  height: 40px;
+
+  &>.el-tree-node__expand-icon {
+    margin-left: 10px;
+  }
+}
+
+.el-dropdown-link {
+  cursor: pointer;
+  color: var(--color-primary-5);
+}
+
+.el-icon-arrow-down {
+  font-size: 12px;
+}
+
+.price-info {
+  border-bottom: 1px solid #ebeef5;
+  padding-bottom: 10px;
+  display: flex;
+  align-items: center;
+}
+</style>