MrShi
2025-01-14 508567cbb4a41070718afb1e2eaab1e489e784c6
仓库管理、资产分类、资产管理
已添加2个文件
已修改7个文件
544 ■■■■■ 文件已修改
admin/.env.test 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/api/ywMaterial.js 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/api/ywWarehouse.js 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/stock/asset.vue 93 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/stock/assetCate.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/stock/assetList.vue 107 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/stock/components/CateEdit.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/stock/components/newMaterial.vue 196 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/stock/components/newWarehouse.vue 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/.env.test
@@ -4,7 +4,7 @@
# VUE_APP_API_URL  = 'http://192.168.5.13/gateway_interface'
# ä»»åº·
# VUE_APP_API_URL  = 'http://192.168.0.137:10010/'
# VUE_APP_API_URL  = 'http://192.168.0.143:10010'
# èå§
# VUE_APP_API_URL  = 'http://192.168.0.108:10010/'
admin/src/api/ywMaterial.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
import request from '@/utils/request'
// æŸ¥è¯¢
export function fetchList (data) {
  return request.post('/visitsAdmin/cloudService/business/ywMaterial/page', data, {
    trim: true
  })
}
// åˆ›å»º
export function create (data) {
  return request.post('/visitsAdmin/cloudService/business/ywMaterial/create', data)
}
// æ ¹æ®ID修改
export function updateById (data) {
  return request.post('/visitsAdmin/cloudService/business/ywMaterial/updateById', data)
}
// æ ¹æ®ID修改状态
export function updateStatus (data) {
  return request.post('/visitsAdmin/cloudService/business/ywMaterial/updateStatus', data)
}
// åˆ é™¤
export function deleteById (id) {
  return request.get(`/visitsAdmin/cloudService/business/ywMaterial/delete/${id}`)
}
admin/src/api/ywWarehouse.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
import request from '@/utils/request'
// æŸ¥è¯¢
export function fetchList (data) {
  return request.post('/visitsAdmin/cloudService/business/ywWarehouse/page', data, {
    trim: true
  })
}
// åˆ›å»º
export function create (data) {
  return request.post('/visitsAdmin/cloudService/business/ywWarehouse/create', data)
}
// æ ¹æ®ID修改
export function updateById (data) {
  return request.post('/visitsAdmin/cloudService/business/ywWarehouse/updateById', data)
}
// æ ¹æ®ID修改状态
export function updateStatusById (data) {
  return request.post('/visitsAdmin/cloudService/business/ywWarehouse/updateStatusById', data)
}
// åˆ é™¤
export function deleteById (id) {
  return request.get(`/visitsAdmin/cloudService/business/ywWarehouse/delete/${id}`)
}
admin/src/views/stock/asset.vue
@@ -5,16 +5,27 @@
      <el-button type="primary" @click="$refs.newWarehouse.open('新建仓库名称')">新增</el-button>
    </div>
    <el-table v-loading="loading" :data="list" stripe>
      <el-table-column prop="platformName" label="仓库名称" min-width="120" show-overflow-tooltip />
      <el-table-column prop="platformGroupName" label="负责人" min-width="100" show-overflow-tooltip />
      <el-table-column prop="carCodeFront" label="仓库位置" min-width="100" show-overflow-tooltip />
      <el-table-column prop="carCodeBack" label="排序码" min-width="110" show-overflow-tooltip />
      <el-table-column prop="param1" label="备注" min-width="120" show-overflow-tooltip />
      <el-table-column prop="param2" label="状态" min-width="90" show-overflow-tooltip />
      <el-table-column prop="name" label="仓库名称" min-width="120" show-overflow-tooltip />
      <el-table-column prop="userName" label="负责人" min-width="100" show-overflow-tooltip />
      <el-table-column prop="position" label="仓库位置" min-width="100" show-overflow-tooltip />
      <el-table-column prop="sortnum" label="排序码" min-width="110" show-overflow-tooltip />
      <el-table-column prop="remark" label="备注" min-width="120" show-overflow-tooltip />
      <el-table-column label="状态" min-width="90">
        <template v-slot="{ row }">
          <el-switch
            v-model="row.status"
            active-color="#13ce66"
            inactive-color="#ff4949"
            @change="changeStatus($event, row)"
            :active-value="0"
            :inactive-value="1">
          </el-switch>
        </template>
      </el-table-column>
      <el-table-column prop="workTime" label="操作" min-width="100" show-overflow-tooltip>
        <template v-slot="{ row }">
          <span class="primaryColor pointer">查看详情</span>
          <span class="red pointer">删除</span>
          <el-button type="text" @click="$refs.newWarehouse.open('新建仓库名称', row)">编辑</el-button>
          <el-button type="text" @click="dele(row.id)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
@@ -32,7 +43,7 @@
import dayjs from 'dayjs'
import duration from 'dayjs/plugin/duration'
dayjs.extend(duration)
import { platformLogPage, getPlatformGroupList } from '@/api'
import { fetchList, deleteById, updateStatusById } from '@/api/ywWarehouse'
export default {
  components: {
    Pagination,
@@ -53,15 +64,18 @@
      queryFormConfig: {
        formItems: [
          {
            filed: 'carCodeFront',
            filed: 'name',
            type: 'input',
            label: '仓库名称',
          },
          {
            filed: 'platformGroupId',
            filed: 'status',
            type: 'select',
            label: '仓库状态',
            options: []
            options: [
              { value: 0, label: '启用' },
              { value: 1, label: '禁用' }
            ]
          }
        ],
        online: true
@@ -69,50 +83,21 @@
    }
  },
  created() {
    // this.getList()
    // this.getGroupList()
    this.getList()
  },
  methods: {
    handleSub() {
      this.$refs.ruleForm.validate((valid) => {
        if (valid) {
          alert('submit!')
        }
      })
    },
    handleEx() { },
    getGroupList() {
      getPlatformGroupList({ queryData: 0, queryType: 0 }).then(res => {
        this.queryFormConfig.formItems[1].options = res.map(i => {
          return {
            value: i.id,
            label: i.name
          }
        })
        // this.queryFormConfig.formItems[1].options.unshift({ value: '', label: '全部月台组' })
      })
    },
    getList(page) {
      const { pagination, filters } = this
      this.loading = true
      platformLogPage({
      fetchList({
        model: {
          ...filters,
          queryStatus: '6,7,8',
          beginWorkDateStart: filters.selDate && filters.selDate.length > 0 ? filters.selDate[0] : null,
          beginWorkDateEnd: filters.selDate && filters.selDate.length > 0 ? filters.selDate[1] : null,
          ...filters
        },
        sorts: [{ direction: 'DESC', property: 'param1' }],
        capacity: pagination.pageSize,
        page: page || pagination.page,
      }).then(res => {
        this.loading = false
        this.list = res.records || []
        this.list.forEach(item => {
          item.inTypeTemp = item.inType == 0 ? '整托盘' : '件烟'
          item.taskOrigin = 'WMS获取'
          item.workTime = dayjs.duration(item.param3, 'seconds').format('H时m分s秒')
        })
        this.pagination.total = res.total || 0
      }, () => {
        this.loading = false
@@ -124,6 +109,26 @@
      this.pagination.page = 1
      this.getList()
    },
    changeStatus(e, row) {
      updateStatusById({ id: row.id, status: e })
        .then(res => {
          this.getList()
        })
    },
    dele(id) {
      this.$confirm('是否确认删除该仓库?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        deleteById(id)
          .then(res => {
            this.getList()
          })
      }).catch(() => {
      });
    },
    handleSizeChange(capacity) {
      this.pagination.pageSize = capacity
      this.getList()
admin/src/views/stock/assetCate.vue
@@ -1,16 +1,13 @@
<template>
  <TableLayout>
    <template v-slot:table-wrap>
      <ul class="toolbar" v-permissions="['business:category:create', 'business:category:delete']">
        <li><el-button type="primary" @click="handleEdit()" icon="el-icon-plus"
            v-permissions="['business:category:create']">新建</el-button></li>
        <li v-permissions="['business:category:exportExcel']"><el-button type="primary"
            @click="exportExcel">导出</el-button></li>
      <ul class="toolbar">
        <li><el-button type="primary" @click="handleEdit()" icon="el-icon-plus">新建</el-button></li>
        <li><el-button type="primary" @click="exportExcel">导出</el-button></li>
      </ul>
      <el-table row-key="id" :tree-props="{ children: 'childCategoryList' }" v-loading="isWorking.search"
        :data="dataList" stripe @selection-change="handleSelectionChange">
        <el-table-column prop="name" label="资产分类" min-width="100px"></el-table-column>
        <!-- <el-table-column prop="parentName" label="所属分类" min-width="100px"></el-table-column> -->
        <el-table-column prop="sortnum" label="排序码" min-width="100px"></el-table-column>
        <el-table-column v-if="containPermissions(['business:category:update', 'business:category:delete'])" label="操作"
          min-width="120" fixed="right">
@@ -46,6 +43,9 @@
      filters: {
        parentId: ''
      },
      form: {
        type: 7
      },
      isShowEdit: false,
      loading: false,
      pagination: {
@@ -58,7 +58,7 @@
  },
  created() {
    this.config({
      module: '车辆信息表',
      module: '分类信息表',
      api: '/business/category',
      'field.id': 'id',
      'field.main': 'id'
@@ -93,7 +93,7 @@
      const { pagination, filters } = this
      this.loading = true
      fetchList({
        model: { ...filters, type: 5 },
        model: { ...filters, type: 7 },
        capacity: pagination.pageSize,
        page: pagination.page,
      }).then(res => {
admin/src/views/stock/assetList.vue
@@ -7,19 +7,30 @@
      <el-button>导入</el-button>
    </div>
    <el-table v-loading="loading" :data="list" stripe>
      <el-table-column prop="platformName" label="资产编码" min-width="100" show-overflow-tooltip />
      <el-table-column prop="platformGroupName" label="资产名称" min-width="100" show-overflow-tooltip />
      <el-table-column prop="carCodeFront" label="条码" min-width="100" show-overflow-tooltip />
      <el-table-column prop="carCodeBack" label="品牌" min-width="100" show-overflow-tooltip />
      <el-table-column prop="param1" label="规格型号" min-width="100" show-overflow-tooltip />
      <el-table-column prop="param2" label="单位" min-width="70" show-overflow-tooltip />
      <el-table-column prop="param2" label="安全库存(下限)" min-width="120" show-overflow-tooltip />
      <el-table-column prop="param2" label="安全库存(上限)" min-width="120" show-overflow-tooltip />
      <el-table-column prop="param2" label="状态" min-width="80" show-overflow-tooltip />
      <el-table-column prop="code" label="资产编码" min-width="100" show-overflow-tooltip />
      <el-table-column prop="name" label="资产名称" min-width="100" show-overflow-tooltip />
      <el-table-column prop="qrcode" label="条码" min-width="100" show-overflow-tooltip />
      <el-table-column prop="brand" label="品牌" min-width="100" show-overflow-tooltip />
      <el-table-column prop="attr" label="规格型号" min-width="100" show-overflow-tooltip />
      <el-table-column prop="unitName" label="单位" min-width="70" show-overflow-tooltip />
      <el-table-column prop="minStock" label="安全库存(下限)" min-width="120" show-overflow-tooltip />
      <el-table-column prop="maxStock" label="安全库存(上限)" min-width="120" show-overflow-tooltip />
      <el-table-column label="状态" min-width="80">
        <template v-slot="{ row }">
          <el-switch
            v-model="row.status"
            active-color="#13ce66"
            inactive-color="#ff4949"
            @change="changeStatus($event, row)"
            :active-value="0"
            :inactive-value="1">
          </el-switch>
        </template>
      </el-table-column>
      <el-table-column prop="workTime" label="操作" min-width="100" show-overflow-tooltip>
        <template v-slot="{ row }">
          <span class="primaryColor pointer">编辑</span>
          <span class="red pointer">删除</span>
          <el-button type="text" @click="$refs.newMaterial.open('编辑物料', {...row, cateArr: [row.parentCateId, row.cateId] })">编辑</el-button>
          <el-button type="text" @click="dele(row.id)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
@@ -37,7 +48,7 @@
import dayjs from 'dayjs'
import duration from 'dayjs/plugin/duration'
dayjs.extend(duration)
import { platformLogPage, getPlatformGroupList } from '@/api'
import { fetchList, updateStatus, deleteById } from '@/api/ywMaterial'
export default {
  components: {
    Pagination,
@@ -58,77 +69,61 @@
      queryFormConfig: {
        formItems: [
          {
            filed: 'carCodeFront',
            filed: 'code',
            type: 'input',
            label: '资产信息',
            placeholder: '请输入资产名称/编码'
            label: '名称/编码',
            placeholder: '请输入名称/编码'
          },
          {
            filed: 'carCodeFront',
            filed: 'attr',
            type: 'input',
            label: '规格型号',
          },
          {
            filed: 'platformGroupId',
            type: 'select',
            label: '所属项目',
            options: []
          }
        ],
        online: true
        ]
      }
    }
  },
  created() {
    // this.getList()
    // this.getGroupList()
    this.getList()
  },
  methods: {
    handleSub() {
      this.$refs.ruleForm.validate((valid) => {
        if (valid) {
          alert('submit!')
        }
      })
    },
    handleEx() { },
    getGroupList() {
      getPlatformGroupList({ queryData: 0, queryType: 0 }).then(res => {
        this.queryFormConfig.formItems[1].options = res.map(i => {
          return {
            value: i.id,
            label: i.name
          }
        })
        // this.queryFormConfig.formItems[1].options.unshift({ value: '', label: '全部月台组' })
      })
    },
    getList(page) {
      const { pagination, filters } = this
      this.loading = true
      platformLogPage({
      fetchList({
        model: {
          ...filters,
          queryStatus: '6,7,8',
          beginWorkDateStart: filters.selDate && filters.selDate.length > 0 ? filters.selDate[0] : null,
          beginWorkDateEnd: filters.selDate && filters.selDate.length > 0 ? filters.selDate[1] : null,
          ...filters
        },
        sorts: [{ direction: 'DESC', property: 'param1' }],
        capacity: pagination.pageSize,
        page: page || pagination.page,
      }).then(res => {
        this.loading = false
        this.list = res.records || []
        this.list.forEach(item => {
          item.inTypeTemp = item.inType == 0 ? '整托盘' : '件烟'
          item.taskOrigin = 'WMS获取'
          item.workTime = dayjs.duration(item.param3, 'seconds').format('H时m分s秒')
        })
        this.pagination.total = res.total || 0
      }, () => {
        this.loading = false
      })
    },
    dele(id) {
      this.$confirm('是否确认删除该物料?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        deleteById(id)
          .then(res => {
            this.getList()
          })
      }).catch(() => {
      });
    },
    changeStatus(e, row) {
      updateStatus({ id: row.id, status: e })
        .then(res => {
          this.getList()
        })
    },
    clear() {
      this.filters = {}
      this.pagination.pageSize = 10
admin/src/views/stock/components/CateEdit.vue
@@ -1,8 +1,13 @@
<template>
  <GlobalWindow :title="title" :visible.sync="visible" :confirm-working="isWorking" width="600px" @close="close" @confirm="confirm">
  <GlobalWindow
    :title="title"
    :visible.sync="visible"
    :confirm-working="isWorking"
    width="600px"
    @confirm="confirm">
    <el-form :model="form" ref="form" :rules="rules">
      <el-form-item label="分类名称" prop="name">
        <el-input v-model="form.name" placeholder="请输入分类名称" v-trim />
        <el-input v-model="form.name" maxlength="30" placeholder="请输入分类名称" v-trim />
      </el-form-item>
      <el-form-item label="所属分类" prop="parentId">
        <el-select :disabled="form.id" v-model="form.parentId" placeholder="不填为则一级分类">
@@ -19,7 +24,7 @@
<script>
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
import { create, fetchCateList, getInfoById } from '@/api/business/category.js'
import { fetchCateList, getInfoById } from '@/api/business/category.js'
export default {
  name: 'OperaCategoryWindow',
  extends: BaseOpera,
@@ -33,7 +38,7 @@
        remark: '',
        status: '',
        sortnum: '',
        type: 5
        type: 7
      },
      // éªŒè¯è§„则
      rules: {
@@ -55,14 +60,9 @@
  },
  methods: {
    getList() {
      fetchCateList({ type: 5 }).then(res => {
      fetchCateList({ type: 7 }).then(res => {
        this.dataList = res || []
      })
    },
    close() {
      this.visible = false
      this.$emit('close')
    },
    getDetail(id) {
      getInfoById(id).then(res => {
admin/src/views/stock/components/newMaterial.vue
@@ -9,67 +9,47 @@
            <div class="main_content">
                <el-form :model="form" label-position="top" ref="form" :rules="rules">
                    <div class="list">
                        <el-form-item label="物料编码" prop="contractId">
                            <el-input v-model="form.renterName" placeholder="不输入系统会自动编码" v-trim />
                        <el-form-item label="物料编码" prop="code">
                            <el-input v-model="form.code" placeholder="不输入系统会自动编码" v-trim />
                        </el-form-item>
                        <el-form-item label="物料名称" prop="renterName">
                            <el-input v-model="form.renterName" placeholder="请输入" v-trim />
                        <el-form-item label="物料名称" prop="name">
                            <el-input v-model="form.name" placeholder="请输入" v-trim />
                        </el-form-item>
                        <el-form-item label="物料分类" prop="ywContractRoomList">
                            <el-select v-model="form.ywContractRoomList" placeholder="请选择">
                                <el-option
                                    v-for="(item, index) in houseList"
                                    :key="index"
                                    :value="item.id"
                                    :label="item.projectName + item.buildingName + item.floorName + item.roomName" />
                            </el-select>
                        <el-form-item label="物料分类" prop="cateArr">
                            <el-cascader
                                v-model="form.cateArr"
                                :options="cateList"
                                @change="getCateVal"
                                :props="{ label: 'name', value: 'id', children: 'childCategoryList' }"
                                placeholder="请选择" />
                        </el-form-item>
                        <el-form-item label="条码" prop="costType">
                            <el-input v-model="form.renterName" placeholder="请输入" v-trim />
                        <el-form-item label="条码" prop="qrcode">
                            <el-input v-model="form.qrcode" placeholder="请输入" v-trim />
                        </el-form-item>
                        <el-form-item label="品牌" prop="date">
                            <el-input v-model="form.renterName" placeholder="请输入" v-trim />
                        <el-form-item label="品牌" prop="brand">
                            <el-input v-model="form.brand" placeholder="请输入" v-trim />
                        </el-form-item>
                        <el-form-item label="规格型号" prop="totleFee">
                            <el-input v-model="form.renterName" placeholder="请输入" v-trim />
                        <el-form-item label="规格型号" prop="attr">
                            <el-input v-model="form.attr" placeholder="请输入" v-trim />
                        </el-form-item>
                        <el-form-item label="安全库存(下限)" prop="planPayDate">
                            <el-input v-model="form.renterName" placeholder="请输入" v-trim />
                        <el-form-item label="安全库存(下限)" prop="minStock">
                            <el-input v-model="form.minStock" placeholder="请输入" v-trim />
                        </el-form-item>
                        <el-form-item label="安全库存(上限)" prop="companyId">
                            <el-input v-model="form.renterName" placeholder="请输入" v-trim />
                        <el-form-item label="安全库存(上限)" prop="maxStock">
                            <el-input v-model="form.maxStock" placeholder="请输入" v-trim />
                        </el-form-item>
                        <el-form-item label="单位" prop="companyId">
                            <el-input v-model="form.renterName" placeholder="请输入" v-trim />
                        <el-form-item label="单位" prop="unitName">
                            <el-input v-model="form.unitName" placeholder="请输入" v-trim />
                        </el-form-item>
                        <el-form-item label="所属项目" prop="companyId">
                            <el-select v-model="form.ywContractRoomList" placeholder="请选择">
                                <el-option
                                    v-for="(item, index) in houseList"
                                    :key="index"
                                    :value="item.id"
                                    :label="item.projectName + item.buildingName + item.floorName + item.roomName" />
                            </el-select>
                        </el-form-item>
                        <el-form-item label="所属房源" prop="companyId">
                            <el-select v-model="form.ywContractRoomList" placeholder="请选择">
                                <el-option
                                    v-for="(item, index) in houseList"
                                    :key="index"
                                    :value="item.id"
                                    :label="item.projectName + item.buildingName + item.floorName + item.roomName" />
                            </el-select>
                        </el-form-item>
                        <el-form-item label="物料照片" prop="companyId">
                        <el-form-item label="物料照片" prop="multifile">
                            <el-upload
                                class="upload-demo"
                                :show-file-list="false"
                                :data="uploadData"
                                :action="uploadImgUrl"
                                :file-list="fileList"
                                :data="uploadData"
                                list-type="picture-card"
                                :on-success="uploadAvatarSuccess"
                                :before-upload="beforeUpload"
                                :on-error="uploadError">
                                <el-button icon="el-icon-plus" plain>上传</el-button>
                                :on-remove="dele">
                                <i class="el-icon-plus"></i>
                            </el-upload>
                        </el-form-item>
                        <el-form-item style="width: 100%;" label="备注" prop="remark">
@@ -85,6 +65,7 @@
<script>
  import GlobalWindow from '@/components/common/GlobalWindow'
  import BaseOpera from '@/components/base/BaseOpera'
  import { fetchList } from '@/api/business/category.js'
  export default {
    name: 'newMaterial',
    components: {
@@ -92,68 +73,103 @@
    },
    extends: BaseOpera,
    data () {
      var validateCateArr = (rule, value, callback) => {
        if (value.length === 0) {
          callback(new Error('请选择物料分类'));
        } else {
          callback();
        }
      };
      return {
        form: {
          contractId: '',
          renterName: '',
          renterId: '',
          costType: '',
          type: '',
          companyId: '',
          id: null,
          code: '',
          name: '',
          parentCateId: '',
          cateId: '',
          cateArr: [],
          multifile: {},
          remark: '',
          startDate: '',
          endDate: '',
          totleFee: '',
          planPayDate: '',
          multifileList: [],
          ywContractRoomList: [],
          date: [],
          RoomName: ''
          unitName: '',
          maxStock: '',
          minStock: '',
          attr: '',
          brand: '',
          qrcode: ''
        },
        rules: [],
        loadingInstance: null,
        rules: {
          name: [
            { required: true, message: '请输入物料名称', trigger: 'blur' }
          ],
          cateArr: [
            { required: true, validator: validateCateArr, trigger: 'blur' }
          ],
          qrcode: [
            { required: true, message: '请输入条码', trigger: 'blur' }
          ]
        },
        cateList: [],
        uploadImgUrl: process.env.VUE_APP_API_PREFIX + '/visitsAdmin/cloudService/public/uploadBatch',
        fileList: [],
        uploadData: {
          folder: 'YW_CONTRACT_BILL'
        },
          folder: 'YW_MATERIAL'
        }
      }
    },
    created () {
      this.config({
        api: '/ywMaterial'
      })
    },
    methods: {
      open (title, target) {
        this.title = title
        this.fileList = []
        this.visible = true
      },
      dele (imgaddr) {
        this.form.multifileList.forEach((item, index) => {
          if (imgaddr === item.imgaddr) {
            this.form.multifileList.splice(index, 1)
        this.getCategry()
        // æ–°å»º
        if (target == null) {
          this.$nextTick(() => {
            this.$refs.form.resetFields()
            this.form[this.configData['field.id']] = null
          })
          return
        }
        // ç¼–辑
        this.$nextTick(() => {
          for (const key in this.form) {
            this.form[key] = target[key]
          }
          if (this.form.multifile) {
            this.fileList = [
              { url: this.form.multifile.fileurlFull, ...this.form.multifile }
            ]
          }
        })
      },
      beforeUpload (file) {
        this.loadingInstance = Loading.service({
          lock: true,
          text: 'Loading',
          spinner: 'el-icon-loading',
          background: 'rgba(0, 0, 0, 0.7)'
      getCateVal(e) {
        this.form.parentCateId = e[0]
        this.form.cateId = e[1]
      },
      getCategry() {
        fetchList({
          capacity: 1000,
          model: {
            type: 7
          },
          page: 1
        }).then(res => {
          this.cateList = res.records
        })
      },
      uploadError () {
        this.$nextTick(() => { // ä»¥æœåŠ¡çš„æ–¹å¼è°ƒç”¨çš„ Loading éœ€è¦å¼‚步关闭
          if (this.loadingInstance) {
            this.loadingInstance.close()
          }
        })
      dele (e) {
        this.fileList = []
        this.form.multifile = {}
      },
      uploadAvatarSuccess (file) {
        this.$nextTick(() => {
          if (this.loadingInstance) {
            this.loadingInstance.close()
          }
        })
        const item = file.data[0]
        this.form.multifileList.push({ ...item, fileurl: item.imgaddr, name: item.originname, userName: this.userInfo.realname, createTime: this.getDay() })
        this.fileList.push({ ...item, fileurl: item.imgaddr, name: item.originname })
        this.form.multifile = { ...item, fileurl: item.imgaddr, name: item.originname }
      }
    }
  }
admin/src/views/stock/components/newWarehouse.vue
@@ -9,30 +9,33 @@
            <el-form-item label="仓库名称" prop="name">
                <el-input v-model="form.name" placeholder="请输入" v-trim />
            </el-form-item>
            <el-form-item label="所在位置" prop="name">
                <el-input v-model="form.name" placeholder="请输入" v-trim />
            <el-form-item label="所在位置" prop="position">
                <el-input v-model="form.position" placeholder="请输入" v-trim />
            </el-form-item>
            <el-form-item label="负责人" prop="name">
                <el-select v-model="form.name" placeholder="请选择">
                    <el-option label="张三" :value="1"></el-option>
                    <el-option label="李四" :value="1"></el-option>
                    <el-option label="王二" :value="1"></el-option>
            <el-form-item label="负责人" prop="userId">
                <el-select v-model="form.userId" filterable placeholder="请选择">
                    <el-option
                        v-for="item in userList"
                        :key="item.id"
                        :label="item.realname"
                        :value="item.id">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="排序码(升序)" prop="name">
                <el-input v-model="form.name" placeholder="请输入排序码" v-trim />
                <el-form-item label="排序码(升序)" prop="sortnum">
                <el-input v-model="form.sortnum" placeholder="请输入排序码" v-trim />
            </el-form-item>
            <el-form-item label="状态" prop="name">
            <el-form-item label="状态" prop="status">
                <el-switch
                    v-model="form.name"
                    v-model="form.status"
                    active-color="#13ce66"
                    inactive-color="#ff4949"
                    active-value="100"
                    inactive-value="0">
                    :active-value="0"
                    :inactive-value="1">
                </el-switch>
            </el-form-item>
            <el-form-item label="备注" prop="name">
                <el-input v-model="form.name" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入" v-trim />
            <el-form-item label="备注" prop="remark">
                <el-input v-model="form.remark" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入" v-trim />
            </el-form-item>
        </el-form>
    </GlobalWindow>
@@ -41,6 +44,7 @@
<script>
  import BaseOpera from '@/components/base/BaseOpera'
  import GlobalWindow from '@/components/common/GlobalWindow'
  import { getUserList } from '@/api/system/user'
  export default {
    name: 'newWarehouse',
    extends: BaseOpera,
@@ -51,18 +55,32 @@
        form: {
          id: '',
          name: '',
          position: '',
          userId: '',
          sortnum: '',
          remark: '',
          status: 0
        },
        // éªŒè¯è§„则
        rules: {
          name: [{ required: true, message: '请输入项目名称', trigger: 'blur' }]
          name: [{ required: true, message: '仓库名称不能为空', trigger: 'blur' }]
        },
        userList: []
      }
    },
    created() {
      this.config({
        api: '/project/ywProject',
        'field.id': 'id'
        api: '/ywWarehouse'
      })
      this.getUser()
    },
    methods: {
      getUser() {
        getUserList({})
            .then(res => {
              this.userList = res
            })
      }
    }
  }
</script>