yusheng пре 1 година
родитељ
комит
63a200d27f

+ 2 - 2
lib/vue-form-making/src/components/Container.vue

@@ -130,8 +130,8 @@
         <el-container class="center-container" direction="vertical">
           <el-header class="btn-bar" style="height: 45px;">
             <div class="btn-bar-plat">
-<!--              <a :class="{'active': platform == 'pc'}" @click="handlePlatform('pc')"><i class="fm-iconfont icon-pc"></i></a>-->
-<!--              <a :class="{'active': platform == 'pad'}" @click="handlePlatform('pad')"><i class="fm-iconfont icon-pad"></i></a>-->
+             <a :class="{'active': platform == 'pc'}" @click="handlePlatform('pc')"><i class="fm-iconfont icon-pc"></i></a>
+             <!-- <a :class="{'active': platform == 'pad'}" @click="handlePlatform('pad')"><i class="fm-iconfont icon-pad"></i></a> -->
               <a :class="{'active': platform == 'mobile'}" @click="handlePlatform('mobile')"><i class="fm-iconfont icon-mobile"></i></a>
             </div>
             <div class="btn-diviler"></div>

+ 88 - 0
src/api/bpm/components/goodsManage/index.js

@@ -0,0 +1,88 @@
+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/priceOffOnSheft/${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));
+}

+ 8 - 2
src/enum/dict.js

@@ -87,7 +87,7 @@ export default {
   客户联系人状态: 'contact_link_status',
   产地:'purchase_origin',
   管理类别: 'manage_type',
-
+  商品价格类型: 'goods_price_type'
 
 };
 
@@ -170,6 +170,12 @@ export const lbjtList = {
   4: '受托件'
 };
 
-
+//商品级别
+export const levelList = [
+  { value: '1', label: '特级' },
+  { value: '2', label: '一级' },
+  { value: '3', label: '二级' },
+  { value: '4', label: '三级' }
+];
 //变更类型
 export const relationTypeList = [{ value: 100, label: '采购订单' }];

+ 223 - 0
src/views/bpm/handleTask/components/commodityManagement/addDialog.vue

@@ -0,0 +1,223 @@
+<template>
+  <div>
+    <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
+              v-model="form.goodsName"
+              maxlength="50"
+              disabled
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="商品分类:" prop="categoryLevelId">
+            <SelectTree :data="gList" v-model="form.categoryLevelId" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="商品编码:" prop="goodsCode">
+            <el-input disabled v-model="form.goodsCode"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="商品级别:" prop="level">
+            <el-select v-model="form.level" width="100%" disabled>
+              <el-option
+                v-for="item in levelList"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="包装规格:">
+            <el-input disabled v-model="form.packingSpecification"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="24">
+          <el-form-item label="商品图片:">
+            <el-image
+              v-if="imgs.length > 0"
+              style="width: 100px; height: 100px"
+              fit="cover"
+              :src="imgs[0].url"
+              :preview-src-list="imgs.map((item) => item.url)"
+            />
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+
+    <headerTitle title="价格"></headerTitle>
+    <ele-pro-table
+      ref="table"
+      :needPage="false"
+      :columns="columns"
+      :datasource="form.goodsPriceList"
+      class="time-form"
+      :toolkit="[]"
+    >
+      <template v-slot:priceType="scope">
+        <DictSelection
+          dictName="商品价格类型"
+          clearable
+          disabled
+          v-model="scope.row.priceType"
+        >
+        </DictSelection>
+      </template>
+    </ele-pro-table>
+  </div>
+</template>
+<script>
+  const formDef = {
+    id: '', //商品id
+    categoryLevelId: '', //商品分类
+    goodsName: '', //商品名称
+    goodsCode: '', //商品编码
+    imagesPaths: '', //商品图片
+    imagesFileIds: '', //商品图片id
+    categoryId: '', //物品id
+    productName: '', //物品名称
+    productCategoryName: '', //物品类型
+    productCode: '', //物品编码
+    produceType: '', //属性类型
+    warehouseId: '', //仓库名称
+    warehouseNum: '', //库存
+    packingSpecification: '', //包装规格
+    measuringUnit: '', //计量单位
+    weightUnit: '', //重量单位
+    warehouseList: [], //仓库
+    level: '2',
+    children: [] //价格数组
+  };
+  import SelectTree from './selectTree.vue';
+  import dictMixins from '@/mixins/dictMixins';
+  import { getTreeByPid } from '@/api/classifyManage';
+
+  import { getGoodsById } from '@/api/bpm/components/goodsManage/index';
+  import { levelList } from '@/enum/dict.js';
+  export default {
+    components: {
+      SelectTree
+    },
+    mixins: [dictMixins],
+    data() {
+      return {
+        imgs: [],
+        form: {},
+        levelList,
+        gList:[]
+      };
+    },
+    props: {
+      businessId: {
+        default: ''
+      },
+      taskId: {
+        default: ''
+      },
+      id: {
+        default: ''
+      },
+      taskDefinitionKey: {
+        default: ''
+      }
+    },
+    computed: {
+      columns() {
+        return [
+          {
+            width: 80,
+            type: 'index',
+            columnKey: 'index',
+            align: 'center',
+            fixed: 'left',
+            label: '序号'
+          },
+          {
+            prop: 'priceType',
+            label: '价格类型',
+            slot: 'priceType',
+            headerSlot: 'headerPriceType',
+            align: 'center'
+          },
+          {
+            prop: 'unitPrice',
+            headerSlot: 'headerUnitPrice',
+            label: '含税单价',
+            slot: 'unitPrice',
+            align: 'center'
+          },
+          {
+            prop: 'taxRate',
+            slot: 'taxRate',
+            label: '税率',
+            align: 'center'
+          },
+          {
+            prop: 'excludeTaxPrice',
+            label: '不含税单价',
+            slot: 'excludeTaxPrice',
+            align: 'center'
+          }
+        ];
+      }
+    },
+    created() {
+      this.getTreeData();
+      this.getGoodsById();
+    },
+    methods: {
+      //获取详情数据
+      async getGoodsById() {
+        let res = await getGoodsById(this.businessId);
+        if (res.imagesPaths) {
+          res.imagesPaths.split(',').map((item, index) => {
+            this.imgs = [];
+            this.imgs.push({
+              id: res.imagesFileIds.split(',')[index],
+              url:
+                window.location.origin +
+                '/api/main/file/getFile?objectName=' +
+                item,
+              status: 'done'
+            });
+          });
+        }
+        this.form = res;
+      },
+
+      //查询商品分类
+      async getTreeData() {
+        const res = await getTreeByPid('1789827921908150274');
+        if (res?.code === '0') {
+          this.gList = res.data;
+        }
+      }
+    }
+  };
+</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>

+ 46 - 0
src/views/bpm/handleTask/components/commodityManagement/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>
+  

+ 145 - 0
src/views/bpm/handleTask/components/commodityManagement/submit.vue

@@ -0,0 +1,145 @@
+<template>
+  <el-col :span="16" :offset="6">
+    <el-form label-width="100px" ref="formRef" :model="form">
+      <el-form-item
+        label="审批建议"
+        style="margin-bottom: 20px"
+        :rules="{
+          required: true,
+          message: '请输入',
+          trigger: 'blur'
+        }"
+      >
+        <el-input
+          type="textarea"
+          v-model="form.reason"
+          placeholder="请输入审批建议"
+        />
+      </el-form-item>
+    </el-form>
+    <div style="margin-left: 10%; margin-bottom: 20px; font-size: 14px">
+      <el-button
+        icon="el-icon-edit-outline"
+        type="success"
+        size="mini"
+        @click="handleAudit(1)"
+        >通过
+      </el-button>
+      <el-button
+        icon="el-icon-circle-close"
+        type="danger"
+        size="mini"
+        @click="handleAudit(0)"
+        >驳回
+      </el-button>
+
+      <el-dropdown
+        @command="(command) => handleCommand(command)"
+        style="margin-left: 30px"
+      >
+        <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="cancel">作废</el-dropdown-item>
+        </el-dropdown-menu>
+      </el-dropdown>
+    </div>
+  </el-col>
+</template>
+
+<script>
+  import { approveTaskWithVariables, rejectTask } from '@/api/bpm/task';
+
+  // 流程实例的详情页,可用于审批
+  export default {
+    name: '',
+    components: {
+      //   Parser
+    },
+    props: {
+      businessId: {
+        default: ''
+      },
+      taskId: {
+        default: ''
+      },
+      id: {
+        default: ''
+      },
+      taskDefinitionKey: {
+        default: ''
+      }
+    },
+    data() {
+      return {
+        form: {
+          technicianId: '',
+          reason: ''
+        },
+      };
+    },
+    created() {
+
+    },
+    methods: {
+      /** 处理转办审批人 */
+      handleUpdateAssignee() {
+        this.$emit('handleUpdateAssignee');
+      },
+      /** 退回 */
+      handleBackList() {
+        this.$emit('handleBackList');
+      },
+
+      async handleAudit(status) {
+        await this._approveTaskWithVariables(status);
+      },
+      async _approveTaskWithVariables(status) {
+        let variables = {
+          pass: !!status
+        };
+        let API = !!status ? approveTaskWithVariables : rejectTask;
+        API({
+          id: this.taskId,
+          reason: this.form.reason,
+          variables
+        }).then((res) => {
+          if (res.data.code != '-1') {
+            this.$emit('handleAudit', {
+              status,
+              title: status === 0 ? '驳回' : ''
+            });
+          }
+        });
+      },
+
+      //更多
+      handleCommand(command) {
+        if (command === 'cancel') {
+          this.$confirm('是否确认作废?', {
+            type: 'warning',
+            cancelButtonText: '取消',
+            confirmButtonText: '确定'
+          })
+            .then(() => {
+              cancel({
+                id: this.taskId,
+                reason: this.form.reason,
+                businessId: this.businessId
+              })
+                .then(() => {
+                  this.$emit('handleClose');
+                })
+                .catch(() => {
+                  this.$message.error('流程作废失败');
+                });
+            })
+            .catch(() => {});
+        }
+      }
+    }
+  };
+</script>
+
+<style lang="scss"></style>

+ 1 - 1
src/views/bpm/outgoingManagement/details.vue

@@ -234,7 +234,7 @@
             <el-table-column label="单价" prop="price" align="center">
               <template slot-scope="{ row }">
                 <template>
-                  {{ row.price ? row.price : '-' + '元' }}/{{ row.measureUnit }}
+                  {{ row.price ? row.price : ' ' + '元' }}/{{ row.measureUnit }}
                 </template>
               </template>
             </el-table-column>