Jelajahi Sumber

技术工艺-产品管理

chris 3 tahun lalu
induk
melakukan
b807bac243

+ 9 - 0
src/api/cus.js

@@ -56,3 +56,12 @@ export function revoke (data) {
     data: data
   })
 }
+
+// 客户列表
+export function getCusList (param) {
+  return request({
+    url: request.adornUrl(`/biz-service/cusCustomer/list`),
+    method: 'get',
+    params: param
+  })
+}

+ 27 - 0
src/api/product.js

@@ -0,0 +1,27 @@
+import request from '@/utils/httpRequest'
+
+// 获取产品详情
+export function getProductDetail (id) {
+  return request({
+    url: request.adornUrl(`/biz-service/product/info/${id}`),
+    method: 'get'
+  })
+}
+
+// 产品工艺列表(待完善)
+export function getTechList (param) {
+  return request({
+    url: request.adornUrl(`/biz-service/cusCustomer/list`),
+    method: 'get',
+    params: param
+  })
+}
+
+// 图纸列表
+export function getDrawList (param) {
+  return request({
+    url: request.adornUrl(`/biz-service/drawing/list`),
+    method: 'get',
+    params: param
+  })
+}

+ 160 - 0
src/views/modules/product/template-chose-material.vue

@@ -0,0 +1,160 @@
+<template>
+  <el-dialog
+    title="选择产品配料清单"
+    width="70%"
+    :close-on-click-modal="false"
+    :visible.sync="visible">
+    <div class="stock-order">
+      <el-form :inline="true" :model="dataForm" @keyup.enter.native="search()">
+        <el-form-item label="物品(零件)名称">
+          <el-input v-model="dataForm.materialName" placeholder="物品(零件)名称" clearable></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button @click="search()">查询</el-button>
+          <el-button @click="visible = false" type="primary">返回</el-button>
+        </el-form-item>
+      </el-form>
+      <el-table
+        :data="dataList"
+        border
+        v-loading="dataListLoading"
+        @selection-change="selectionChangeHandle"
+        style="width: 100%;">
+        <el-table-column
+          label="序号"
+          type="index"
+          width="50"
+          align="center">
+        </el-table-column>
+        <el-table-column
+          prop="materialCode"
+          header-align="center"
+          align="center"
+          label="物料编码">
+        </el-table-column>
+        <el-table-column
+          prop="materialName"
+          header-align="center"
+          align="center"
+          label="物料名称">
+        </el-table-column>
+        <el-table-column
+          prop="specifications"
+          header-align="center"
+          align="center"
+          label="规格">
+        </el-table-column>
+        <el-table-column
+          prop="unitName"
+          header-align="center"
+          align="center"
+          label="单位">
+        </el-table-column>
+        <el-table-column
+          prop="warehouseName"
+          header-align="center"
+          align="center"
+          label="所在仓库">
+        </el-table-column>
+        <el-table-column
+          prop="notes"
+          header-align="center"
+          align="center"
+          label="备注">
+        </el-table-column>
+        <el-table-column
+          fixed="right"
+          header-align="center"
+          align="center"
+          width="50"
+          label="操作">
+          <template slot-scope="scope">
+            <el-button type="text" size="small" @click="exportItem(scope.row)">添加</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-pagination
+        @size-change="sizeChangeHandle"
+        @current-change="currentChangeHandle"
+        :current-page="pageIndex"
+        :page-sizes="[10, 20, 50, 100]"
+        :page-size="pageSize"
+        :total="totalPage"
+        layout="total, sizes, prev, pager, next, jumper">
+      </el-pagination>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+  export default {
+    data () {
+      return {
+        visible: false,
+        dataForm: {},
+        dataList: [],
+        pageIndex: 1,
+        pageSize: 10,
+        totalPage: 0,
+        dataListLoading: false,
+        dataListSelections: []
+      }
+    },
+    methods: {
+      init () {
+        this.visible = true
+        this.getDataList()
+      },
+      search () {
+        this.pageIndex = 1
+        this.getDataList()
+      },
+      // 获取数据列表
+      getDataList () {
+        this.dataListLoading = true
+        this.$http({
+          url: this.$http.adornUrl(`/biz-service/stock-mg-ctl/list`),
+          method: 'get',
+          params: this.$http.adornParams({
+            'current': this.pageIndex,
+            'size': this.pageSize,
+            'materialName': this.dataForm.materialName ? this.dataForm.materialName : null,
+            'materialTypeId': this.dataForm.materialTypeId ? this.dataForm.materialTypeId : null
+          })
+        }).then(({data}) => {
+          if (data && data.code === '200') {
+            this.dataList = data.data.records
+            this.totalPage = Number(data.data.total)
+          } else {
+            this.dataList = []
+            this.totalPage = 0
+          }
+          this.dataListLoading = false
+        })
+      },
+      // 每页数
+      sizeChangeHandle (val) {
+        this.pageSize = val
+        this.pageIndex = 1
+        this.getDataList()
+      },
+      // 当前页
+      currentChangeHandle (val) {
+        this.pageIndex = val
+        this.getDataList()
+      },
+      // 多选
+      selectionChangeHandle (val) {
+        this.dataListSelections = val
+      },
+      // 添加
+      exportItem (item) {
+        this.$emit('addItem', item)
+      }
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 14 - 0
src/views/modules/tech/crafts-management.vue

@@ -0,0 +1,14 @@
+<!-- 工艺管理 -->
+<template>
+
+</template>
+
+<script>
+  export default {
+    name: 'crafts-management'
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 14 - 0
src/views/modules/tech/draw-management.vue

@@ -0,0 +1,14 @@
+<!-- 图库管理 -->
+<template>
+
+</template>
+
+<script>
+  export default {
+    name: 'draw-management'
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 486 - 0
src/views/modules/tech/product-add-or-update.vue

@@ -0,0 +1,486 @@
+<template>
+    <div>
+      <el-dialog
+        :title="!id ? '新增': display ? '详情' : '修改'"
+        width="70%"
+        :close-on-click-modal="false"
+        :visible.sync="visible">
+        <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="auto">
+          <el-row class="my-row">
+            <el-col :span="8">
+              <el-form-item label="产品名称" prop="productName">
+                <el-input v-model="dataForm.productName" :disabled="display" placeholder="产品名称"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8" style="padding-left: 20px">
+              <el-form-item label="产品规格" prop="productSpec">
+                <el-input v-model="dataForm.productSpec" :disabled="display" placeholder="产品规格"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8" style="padding-left: 20px">
+              <el-form-item label="产品类别" prop="productType">
+                <el-select
+                  v-model="dataForm.productType"
+                  :disabled="display"
+                  remote
+                  placeholder="请选择">
+                  <el-option
+                    v-for="item in optionsType"
+                    :key="item.code"
+                    :label="item.value"
+                    :value="item.code">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row class="my-row">
+            <el-col :span="8">
+              <el-form-item label="产品来源" prop="source">
+                <el-input v-if="display" v-model="dataForm.sourceName" disabled></el-input>
+                <el-select v-else
+                  v-model="dataForm.source"
+                  :disabled="display"
+                           filterable
+                  remote
+                           :remote-method="remoteCusList"
+                  placeholder="请选择">
+                  <el-option
+                    v-for="item in optionsSource"
+                    :key="item.code"
+                    :label="item.value"
+                    :value="item.code">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8" style="padding-left: 20px">
+              <el-form-item label="产品工艺" prop="techId">
+                <el-input v-if="display" v-model="dataForm.techName" disabled></el-input>
+                <el-select v-else
+                  v-model="dataForm.techId"
+                  :disabled="display"
+                           filterable
+                  remote
+                           :remote-method="remoteTech"
+                  placeholder="请选择">
+                  <el-option
+                    v-for="item in optionsTech"
+                    :key="item.code"
+                    :label="item.value"
+                    :value="item.code">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row class="my-row">
+            <el-form-item label="产品图纸" prop="drawingIdList">
+              <el-upload v-if="display"
+                class="upload-demo"
+                ref="upload"
+                :multiple="true"
+                action="#"
+                accept="image/jpeg,image/gif,image/png"
+                :on-preview="handlePreview"
+                :file-list="fileList"
+                :auto-upload="false">
+              </el-upload>
+              <el-select v-else
+                v-model="dataForm.drawingIdList"
+                :disabled="display"
+                         filterable
+                         multiple
+                         remote
+                         :remote-method="remoteDraw"
+                placeholder="请选择">
+                <el-option
+                  v-for="item in optionsDraw"
+                  :key="item.code"
+                  :label="item.value"
+                  :value="item.code">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-row>
+          <el-row class="my-row">
+            <el-form-item label="备注" prop="notes">
+              <el-input v-model="dataForm.notes" :disabled="display" placeholder="备注"></el-input>
+            </el-form-item>
+          </el-row>
+          <el-row class="my-row">
+            <el-form-item label="是否组合产品" prop="displayProductList">
+              <el-switch
+                v-model="dataForm.displayProductList"
+                :disabled="display"
+                active-color="#13ce66"
+                inactive-color="#ff4949"
+                active-text="是"
+                inactive-text="否">
+              </el-switch>
+            </el-form-item>
+          </el-row>
+          <el-row v-if="dataForm.displayProductList">
+            <div class="title"><span style="color: red">*</span> 组合小产品</div>
+            <el-table
+              :data="productDetails"
+              border
+              style="width: 100%;">
+              <el-table-column
+                label="序号"
+                type="index"
+                width="50"
+                align="center">
+              </el-table-column>
+              <el-table-column
+                prop="productName"
+                header-align="center"
+                align="center"
+                label="产品名称">
+              </el-table-column>
+              <el-table-column
+                prop="productSpec"
+                header-align="center"
+                align="center"
+                label="规格">
+              </el-table-column>
+              <el-table-column
+                prop="cnt"
+                header-align="center"
+                align="center"
+                label="数量"
+                width="170">
+                <template slot-scope="scope">
+                  <el-input-number v-model="scope.row.cnt" :disabled="display" :min="1" style="width: 140px;"/>
+                </template>
+              </el-table-column>
+              <el-table-column
+                prop="unitName"
+                header-align="center"
+                align="center"
+                label="单位">
+              </el-table-column>
+              <el-table-column
+                prop="notes"
+                header-align="center"
+                align="center"
+                label="备注">
+              </el-table-column>
+            </el-table>
+            <el-row style="text-align: center; margin-top: 10px;">
+              <el-button v-show="!display" type="primary" icon="el-icon-plus" @click="addProduct"></el-button>
+            </el-row>
+          </el-row>
+          <el-row>
+            <div class="title"><span style="color: red">*</span> 产品配料清单</div>
+            <el-table
+              :data="materialList"
+              border
+              style="width: 100%;">
+              <el-table-column
+                label="序号"
+                type="index"
+                width="50"
+                align="center">
+              </el-table-column>
+              <el-table-column
+                prop="materialName"
+                header-align="center"
+                align="center"
+                label="物品名称">
+              </el-table-column>
+              <el-table-column
+                prop="specifications"
+                header-align="center"
+                align="center"
+                label="规格">
+              </el-table-column>
+              <el-table-column
+                prop="cnt"
+                header-align="center"
+                align="center"
+                label="数量"
+                width="170">
+                <template slot-scope="scope">
+                  <el-input-number v-model="scope.row.cnt" :disabled="display" :min="1" style="width: 140px;"/>
+                </template>
+              </el-table-column>
+              <el-table-column
+                prop="unitName"
+                header-align="center"
+                align="center"
+                label="单位">
+              </el-table-column>
+              <el-table-column
+                prop="notes"
+                header-align="center"
+                align="center"
+                label="备注">
+              </el-table-column>
+            </el-table>
+            <el-row style="text-align: center; margin-top: 10px;">
+              <el-button v-show="!display" type="primary" icon="el-icon-plus" @click="addMaterial"></el-button>
+            </el-row>
+          </el-row>
+        </el-form>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="visible = false">取消</el-button>
+          <el-button v-if="!display" type="primary" @click="dataFormSubmit()">确定</el-button>
+        </span>
+      </el-dialog>
+      <!-- 图片预览 -->
+      <el-dialog title="图片预览" :visible.sync="previewVisible" width="50%">
+        <img :src="previewPath" :alt="previewName" style="width:100%;height:100%" />
+      </el-dialog>
+      <template-chose v-if="productListVisible" ref="productList" @addItem="addProductItem" />
+      <templateChoseMaterial v-if="materialListVisible" ref="materialList" @addItem="addMaterialItem"/>
+    </div>
+</template>
+
+<script>
+  import templateChose from '../product/template-chose'
+  import templateChoseMaterial from '../product/template-chose-material'
+  import { getDictList } from '@/api/dict'
+  import { getProductDetail, getTechList, getDrawList } from '@/api/product'
+  import { uploadUrl, downloadUrl } from '@/api/file'
+  import { getCusList } from '@/api/cus'
+
+  export default {
+    name: 'product-add-or-update',
+    components: {templateChose, templateChoseMaterial},
+    computed: {
+      orgId: {
+        get () { return this.$store.state.user.orgId }
+      }
+    },
+    watch: {
+      'dataForm.isCompose' (value) {
+        this.dataForm.displayProductList = value === '1'
+      }
+    },
+    data () {
+      return {
+        productListVisible: false,
+        materialListVisible: false,
+        visible: false,
+        display: false,
+        optionsType: [],
+        optionsTech: [],
+        optionsSource: [],
+        optionsDraw: [],
+        fileList: [],
+        dataList: [],
+        id: 0,
+        productDetails: [],
+        materialList: [],
+        dataForm: {
+          displayProductList: false
+        },
+        uploadUrl: uploadUrl,
+        previewPath: '',
+        previewName: '',
+        previewVisible: false,
+        dataRule: {
+          productName: [{ required: true, message: '产品名称不能为空', trigger: 'blur' }],
+          productSpec: [{ required: true, message: '产品规格不能为空', trigger: 'blur' }],
+          productType: [{ required: true, message: '产品类别不能为空', trigger: 'change' }],
+          source: [{ required: true, message: '产品来源不能为空', trigger: 'change' }],
+          techId: [{ required: true, message: '产品工艺不能为空', trigger: 'change' }],
+          drawingIdList: [{ required: true, message: '产品图纸不能为空', trigger: 'change' }]
+        }
+      }
+    },
+    methods: {
+      async init (id, display) {
+        this.fileList = []
+        this.dataForm = {}
+        this.productDetails = []
+        this.materialList = []
+        this.visible = true
+        this.id = id || 0
+        this.display = display
+        // 获取产品类别
+        await getDictList({type: 'product_type'}).then(({data}) => {
+          if (data) {
+            this.optionsType = data
+          }
+        })
+        // 产品工艺
+        if (!id) return
+        await getProductDetail(this.id).then(({data}) => {
+          if (data && data.code === '200') {
+            this.dataForm = data.data
+            // 组合小产品
+            data.data.composeProductMaterialList.forEach((item) => {
+              this.productDetails.push(item)
+            })
+            // 产品配料清单
+            data.data.productMaterialList.forEach((item) => {
+              this.materialList.push(item)
+            })
+            // 产品图纸
+            if (data.data.attachList) {
+              data.data.attachList.forEach((item) => {
+                this.fileList.push({
+                  name: item.fileName,
+                  url: item.url,
+                  id: item.url
+                })
+              })
+            }
+          }
+        })
+      },
+      handlePreview (file) {
+        if (file && file.url) {
+          // 获取文件路径
+          this.previewPath = downloadUrl + file.url
+          this.previewName = file.name
+          this.previewVisible = true
+        }
+      },
+      // 产品来源(客户)列表
+      async remoteCusList (query) {
+        if (!query) {
+          query = ''
+        }
+        await getCusList({'customerName': query}).then(({data}) => {
+          if (data && data.code === '200') {
+            this.optionsSource = []
+            data.data.records.forEach((item) => {
+              this.optionsSource.push({
+                code: item.customerId,
+                value: item.customerName
+              })
+            })
+          }
+        }
+      )
+      },
+      // 产品工艺
+      async remoteTech (query) {
+        if (!query) {
+          query = ''
+        }
+        await getTechList().then(({data}) => {
+          if (data && data.code === '200') {
+            this.optionsTech = []
+            data.data.records.forEach((item) => {
+              this.optionsTech.push({
+                code: item.customerId,
+                value: item.customerName
+              })
+            })
+          }
+        })
+      },
+      // 图纸
+      async remoteDraw (query) {
+        if (!query) {
+          query = ''
+        }
+        await getDrawList({'keyword': query}).then(({data}) => {
+          if (data && data.code === '200') {
+            this.optionsDraw = []
+            data.data.records.forEach((item) => {
+              this.optionsDraw.push({
+                code: item.drawingId,
+                value: item.drawingName
+              })
+            })
+          }
+        })
+      },
+      // 添加组合产品
+      addProduct () {
+        this.productListVisible = true
+        this.$nextTick(() => {
+          this.$refs.productList.init()
+        })
+      },
+      addProductItem (item) {
+        this.productDetails.push({
+          productId: item.productId,
+          productName: item.productName,
+          productSpec: item.productSpec,
+          cnt: 1,
+          unitName: item.unitName,
+          notes: item.notes
+        })
+      },
+      addMaterial () {
+        this.materialListVisible = true
+        this.$nextTick(() => {
+          this.$refs.materialList.init()
+        })
+      },
+      addMaterialItem (item) {
+        this.materialList.push({
+          materialId: item.materialId,
+          materialName: item.materialName,
+          specifications: item.specifications,
+          cnt: item.cnt,
+          unitName: item.unitName,
+          notes: item.notes
+        })
+      },
+      validateField (type) {
+        this.$refs.dataForm.validateField(type)
+      },
+      // 表单提交
+      dataFormSubmit () {
+        this.$refs['dataForm'].validate((valid) => {
+          if (valid) {
+            // 组合小产品
+            this.dataForm.composeProductMaterialList = []
+            const b1 = this.dataForm.displayProductList
+            this.dataForm.isCompose = b1 === true ? '1' : '0'
+            if (this.dataForm.isCompose === '1' && this.productDetails.length > 0) {
+              this.productDetails.forEach((item) => {
+                this.dataForm.composeProductMaterialList.push({
+                  cnt: item.cnt,
+                  materialId: item.productId,
+                  notes: item.notes
+                })
+              })
+            }
+            // 产品配料清单
+            this.dataForm.productMaterialList = []
+            if (this.materialList.length > 0) {
+              this.materialList.forEach((item) => {
+                this.dataForm.productMaterialList.push({
+                  cnt: item.cnt,
+                  materialId: item.materialId,
+                  notes: item.notes
+                })
+              })
+            }
+            this.$http({
+              url: this.$http.adornUrl(`/biz-service/product/save`),
+              method: 'post',
+              data: this.$http.adornData({...this.dataForm, orgId: this.orgId})
+            }).then(({data}) => {
+              if (data && data.code === '200') {
+                this.$message({
+                  message: '操作成功',
+                  type: 'success',
+                  duration: 1500,
+                  onClose: () => {
+                    this.visible = false
+                    this.$emit('refreshDataList')
+                  }
+                })
+              } else {
+                this.$message.error(data.msg)
+              }
+            })
+          }
+        })
+      }
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 254 - 0
src/views/modules/tech/product-management.vue

@@ -0,0 +1,254 @@
+<!-- 产品管理 -->
+<template>
+  <div class="product-management">
+    <el-form :inline="true" :model="dataForm" @keyup.enter.native="search()">
+      <el-form-item label="名称">
+        <el-input v-model="dataForm.productName" placeholder="产品名称" clearable/>
+      </el-form-item>
+      <el-form-item label="产品类别">
+        <el-select
+          v-model="dataForm.productType"
+          remote
+          placeholder="请选择">
+          <el-option
+            v-for="item in optionsType"
+            :key="item.code"
+            :label="item.value"
+            :value="item.code">
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button @click="search()">查询</el-button>
+        <el-button type="primary" @click="addOrUpdateHandle(0, false)">创建新产品</el-button>
+      </el-form-item>
+    </el-form>
+    <el-table
+      :data="dataList"
+      border
+      v-loading="dataListLoading"
+      style="width: 100%;">
+      <el-table-column
+        label="序号"
+        type="index"
+        width="50"
+        align="center">
+      </el-table-column>
+      <el-table-column
+        prop="productCode"
+        header-align="center"
+        align="center"
+        min-width="100"
+        label="产品编码">
+      </el-table-column>
+      <el-table-column
+        prop="productName"
+        header-align="center"
+        align="center"
+        min-width="120"
+        label="产品名称">
+      </el-table-column>
+      <el-table-column
+        prop="productType"
+        header-align="center"
+        align="center"
+        :formatter="typeFormat"
+        label="产品类别">
+      </el-table-column>
+      <el-table-column
+        prop="isCompose"
+        header-align="center"
+        align="center"
+        :formatter="composeFormat"
+        label="是否组合产品">
+      </el-table-column>
+      <el-table-column
+        prop="sourceName"
+        header-align="center"
+        align="center"
+        min-width="200"
+        :show-overflow-tooltip="true"
+        label="来源">
+      </el-table-column>
+      <el-table-column
+        prop="createTime"
+        header-align="center"
+        align="center"
+        min-width="160"
+        label="创建时间">
+      </el-table-column>
+      <el-table-column
+        prop="creatorName"
+        header-align="center"
+        align="center"
+        min-width="100"
+        label="创建人">
+      </el-table-column>
+      <el-table-column
+        prop="notes"
+        header-align="center"
+        align="center"
+        min-width="180"
+        :show-overflow-tooltip="true"
+        label="备注">
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        label="配料清单">
+        <template slot-scope="scope">
+          <el-button type="text" size="small" @click="materialDetails(scope.row.coId, true)">查看</el-button>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        label="对应图纸">
+        <template slot-scope="scope">
+          <el-button type="text" size="small" @click="drawDetails(scope.row.coId, true)">查看</el-button>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        label="对应工艺">
+        <template slot-scope="scope">
+          <el-button type="text" size="small" @click="techDetails(scope.row.coId, true)">查看</el-button>
+        </template>
+      </el-table-column>
+      <el-table-column
+        fixed="right"
+        header-align="center"
+        align="center"
+        width="150"
+        label="操作">
+        <template slot-scope="scope">
+          <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.productId, true)">查看</el-button>
+          <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.productId, false)">编辑</el-button>
+          <el-button style="color: red" type="text" size="small" @click="deleteHandle(scope.row.productId)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      @size-change="sizeChangeHandle"
+      @current-change="currentChangeHandle"
+      :current-page="pageIndex"
+      :page-sizes="[10, 20, 50, 100]"
+      :page-size="pageSize"
+      :total="totalPage"
+      layout="total, sizes, prev, pager, next, jumper">
+    </el-pagination>
+    <!-- 弹窗, 新增 / 修改 -->
+    <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
+  </div>
+</template>
+
+<script>
+  import AddOrUpdate from './product-add-or-update'
+  import { getDictList } from '@/api/dict'
+  export default {
+    name: 'product-management',
+    components: {
+      AddOrUpdate
+    },
+    data () {
+      return {
+        addOrUpdateVisible: false,
+        dataForm: {},
+        dataList: [],
+        pageIndex: 1,
+        pageSize: 10,
+        totalPage: 0,
+        dataListLoading: false,
+        dataListSelections: [],
+        optionsType: []
+      }
+    },
+    created () {
+      this.getTypeList()
+      // this.getStateList()
+      this.getDataList()
+    },
+    methods: {
+      // 获取产品类别字典
+      getTypeList () {
+        getDictList({type: 'product_type'}).then(({data}) => {
+          if (data) {
+            this.optionsType = data
+          }
+        })
+      },
+      // 查询
+      search () {
+        this.pageIndex = 1
+        this.getDataList()
+      },
+      // 获取数据列表
+      getDataList () {
+        this.dataListLoading = true
+        this.addOrUpdateVisible = false
+        this.$http({
+          url: this.$http.adornUrl('/biz-service/product/list'),
+          method: 'get',
+          params: this.$http.adornParams({
+            'current': this.pageIndex,
+            'size': this.pageSize,
+            'productName': this.dataForm.productName ? this.dataForm.productName : null,
+            'productType': this.dataForm.productType ? this.dataForm.productType : null
+          })
+        }).then(({data}) => {
+          if (data && data.code === '200') {
+            this.dataList = data.data.records
+            this.totalPage = Number(data.data.total)
+          } else {
+            this.dataList = []
+            this.totalPage = 0
+          }
+          this.dataListLoading = false
+        })
+      },
+      // 每页数
+      sizeChangeHandle (val) {
+        this.pageSize = val
+        this.pageIndex = 1
+        this.getDataList()
+      },
+      // 当前页
+      currentChangeHandle (val) {
+        this.pageIndex = val
+        this.getDataList()
+      },
+      // 多选
+      selectionChangeHandle (val) {
+        this.dataListSelections = val
+      },
+      // 新增 / 修改
+      addOrUpdateHandle (id, disable) {
+        this.addOrUpdateVisible = true
+        this.$nextTick(() => {
+          this.$refs.addOrUpdate.init(id, disable)
+        })
+      },
+      // 转换属性“产品类别”
+      typeFormat (row) {
+        if (this.optionsType) {
+          for (let i = 0; i < this.optionsType.length; i++) {
+            if (this.optionsType[i].code === row.productType) {
+              return this.optionsType[i].value
+            }
+          }
+        }
+      },
+      // 转换属性“是否组合产品”
+      composeFormat (row) {
+        if (row.isCompose === 1) {
+          return '是'
+        } else return '否'
+      }
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 13 - 0
src/views/modules/tech/work-type.vue

@@ -0,0 +1,13 @@
+<template>
+
+</template>
+
+<script>
+  export default {
+    name: 'work-type'
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 1 - 0
src/views/modules/warehouse/stock-order.vue

@@ -1,3 +1,4 @@
+<!-- 出入库管理 -->
 <template>
   <div class="stock-order">
     <el-form :inline="true" :model="dataForm" @keyup.enter.native="queryData()">

+ 1 - 0
src/views/modules/warehouse/stock.vue

@@ -1,3 +1,4 @@
+<!-- 库存管理 -->
 <template>
     <div class="stock">
       <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">