ll
liukangdong
2025-01-16 1bb77fec82c4761112d143b1098303fc17798844
ll
已添加2个文件
已修改10个文件
809 ■■■■■ 文件已修改
admin/src/api/index.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/api/store/index.js 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/stock/components/AssetSel.vue 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/stock/components/InDetail.vue 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/stock/components/InEdit.vue 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/stock/components/OutDetail.vue 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/stock/components/OutEdit.vue 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/stock/components/config.js 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/stock/in.vue 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/stock/out.vue 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/stock/query.vue 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/stock/record.vue 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/api/index.js
@@ -3,3 +3,4 @@
export * from './business/index'
export * from './other/other'
export * from './workbench/index'
export * from './store/index'
admin/src/api/store/index.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,44 @@
import request from '@/utils/request'
export function ywOutinboundPage (data) {
  return request.post('/visitsAdmin/cloudService/business/ywOutinbound/page', data, {
    trim: true
  })
}
export function ywOutinboundEx (data) {
  return request.post('/visitsAdmin/cloudService/business/ywOutinbound/exportExcel', data, {
    trim: true
  })
}
export function ywOutinboundDetail (id) {
  return request.get('/visitsAdmin/cloudService/business/ywOutinbound/' + id)
}
export function ywOutinboundCreate (data) {
  return request.post('/visitsAdmin/cloudService/business/ywOutinbound/create', data, {
    trim: true
  })
}
// åº“存查询
export function ywStockPage (data) {
  return request.post('/visitsAdmin/cloudService/business/ywStock/page', data, {
    trim: true
  })
}
export function ywStockPageEx (data) {
  return request.post('/visitsAdmin/cloudService/business/ywStock/exportExcel', data, {
    trim: true
  })
}
export function ywOutinboundRecord (data) {
  return request.post('/visitsAdmin/cloudService/business/ywOutinboundRecord/page', data, {
    trim: true
  })
}
export function ywOutinboundRecordEx (data) {
  return request.post('/visitsAdmin/cloudService/business/ywOutinboundRecord/exportExcel', data, {
    trim: true
  })
}
admin/src/views/stock/components/AssetSel.vue
@@ -2,8 +2,8 @@
  <GlobalWindow title="选择物料" :visible.sync="isShowModal" :confirm-working="isLoading" width="900px" @close="close"
    @confirm="confirm">
    <el-form ref="searchForm" :model="searchForm" label-width="100px" inline>
      <el-form-item prop="areaType" label="物料信息">
        <el-input v-model="searchForm.aaa" placeholder="请输入物料编码/名称" @keypress.enter.native="search"></el-input>
      <el-form-item prop="code" label="物料信息">
        <el-input v-model="searchForm.code" placeholder="请输入物料编码/名称" @keypress.enter.native="search"></el-input>
      </el-form-item>
      <el-form-item prop="areaIds" label="物料分类">
        <el-cascader v-model="searchForm.areaIds" @change="changeSel" placeholder="请选择物料分类" clearable
@@ -14,22 +14,22 @@
          }"></el-cascader>
      </el-form-item>
      <span>
        <el-button type="primary" @click="getList">搜索</el-button>
        <el-button type="primary" @click="getList(1)">搜索</el-button>
        <el-button @click="reset">重置</el-button>
      </span>
    </el-form>
    <!--  -->
    <el-table @selection-change="handleSelectionChange" :data="list" stripe>
      <el-table-column type="selection"  width="55" />
      <el-table-column prop="categoryName" label="物料编码" min-width="100px"></el-table-column>
      <el-table-column prop="creatorName" label="物料名称" min-width="80px"></el-table-column>
      <el-table-column prop="createDate" label="条码" min-width="100px"></el-table-column>
      <el-table-column prop="dealUserName" label="品牌" min-width="80px"></el-table-column>
      <el-table-column prop="dealUserName" label="规格型号" min-width="80px"></el-table-column>
      <el-table-column prop="dealUserName" label="单位" min-width="80px"></el-table-column>
      <el-table-column prop="dealUserName" label="库存" min-width="80px"></el-table-column>
      <el-table-column prop="code" label="物料编码" min-width="100px"></el-table-column>
      <el-table-column prop="name" label="物料名称" min-width="80px"></el-table-column>
      <el-table-column prop="qrcode" label="条码" min-width="100px"></el-table-column>
      <el-table-column prop="brand" label="品牌" min-width="80px"></el-table-column>
      <el-table-column prop="attr" label="规格型号" min-width="80px"></el-table-column>
      <el-table-column prop="unitName" label="单位" min-width="80px"></el-table-column>
      <el-table-column prop="maxStock" label="库存" min-width="80px"></el-table-column>
    </el-table>
    <Pagination @size-change="handleSizeChange" @current-change="getList" :pagination="pagination">
    <Pagination class="mt10" @size-change="handleSizeChange" @current-change="getList" :pagination="pagination">
    </Pagination>
  </GlobalWindow>
</template>
@@ -38,6 +38,8 @@
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
import Pagination from '@/components/common/Pagination'
import { fetchList } from '@/api/ywMaterial'
import { ywStockPage } from '@/api/store/index'
import { fetchList as getCateList } from '@/api/business/category.js'
export default {
  name: 'OperaCategoryWindow',
@@ -51,6 +53,7 @@
        page: 1,
        total: 0
      },
      isOut: false,
      list: [],
      selList: [],
      cateList: [],
@@ -64,7 +67,7 @@
    }
  },
  created() {
    this.initData()
    this.getCate()
  },
  methods: {
    confirm() {
@@ -75,10 +78,13 @@
      this.selList = val
    },
    getList(page) {
      const { pagination, searchForm } = this
      const { pagination, searchForm, isOut } = this
      this.listLoading = true
      if(page){pagination.page = page}
      fetchList({
      console.log('isOut', isOut);
      let fn = isOut ? ywStockPage : fetchList
      fn({
        capacity: pagination.pageSize,
        page: pagination.page,
        model: {...searchForm}
@@ -86,13 +92,25 @@
        this.listLoading = false
        this.list = res.records
        this.pagination.total = res.total || 0
        if(isOut){
          this.list.forEach(item => {
            item.brand = item.materialBrand
            item.attr = item.materialAttr
            item.name = item.materialName
            item.id = item.materialId
            item.code = item.materialCode
            item.qrcode = item.materialQrcode
            item.unitName = item.materialUnitName
            item.maxStock = item.stock
          })
        }
      }, () => {
        this.listLoading = false
      })
    },
    initData() {
    getCate() {
      getCateList({
        model: { type: 3 },
        model: { type: 7 },
        capacity: 1000,
        page: 1,
      }).then(res => {
admin/src/views/stock/components/InDetail.vue
@@ -1,43 +1,46 @@
<template>
  <GlobalWindow width="960px" title="出库单详情" :visible.sync="visible" :confirm-working="isWorking" @close="close"
  <GlobalWindow width="960px" :showConfirm="false" title="入库单详情" :visible.sync="visible" :confirm-working="isWorking" @close="close"
    @confirm="confirm">
    <div class="main">
      <div class="title" style="color: #333333;">
        <span>入库单编号:{{ info.code }}</span>
      </div>
      <div class="title">
        <span>工单详情</span>
        <span>基础信息</span>
      </div>
      <div class="main_content">
        <div class="list">
          <div class="item">
            <div class="la">出库仓库</div>
            <div class="val">{{ info.projectName }}</div>
            <div class="la">入库仓库</div>
            <div class="val">{{ info.warehouseName }}</div>
          </div>
          <div class="item">
            <div class="la">出库日期</div>
            <div class="val">{{ info.categoryName }}</div>
            <div class="la">入库日期</div>
            <div class="val">{{ info.doneDate }}</div>
          </div>
          <div class="item">
            <div class="la">出库类型</div>
            <div class="val">{{ info.creatorName }}{{ info.creatorCompany ? "-" + info.creatorCompany : '' }}</div>
            <div class="la">入库类型</div>
            <div class="val" v-if="info.type || info.type == 0">{{ StoreTypeOps[info.type].name }}</div>
          </div>
          <div class="item">
            <div class="la">处理人</div>
            <div class="val">{{ info.creatorPhone || info.creatorMobile }}</div>
            <div class="val">{{ info.createUserName }}</div>
          </div>
          <div class="item">
          <div class="item" style="width: 66.6%;">
            <div class="la">备注</div>
            <div class="val">{{ info.createDate }}</div>
            <div class="val">{{ info.remark }}</div>
          </div>
        </div>
      </div>
      <div class="title">物料信息</div>
      <el-table :data="list" stripe>
        <el-table-column align="center" type="index" width="55" />
        <el-table-column prop="creatorName" label="物料名称" show-overflow-tooltip min-width="80px"></el-table-column>
        <el-table-column prop="categoryName" label="物料编码" show-overflow-tooltip min-width="100px"></el-table-column>
        <el-table-column prop="createDate" label="条形码" show-overflow-tooltip min-width="100px"></el-table-column>
        <el-table-column prop="dealUserName" label="品牌" show-overflow-tooltip min-width="80px"></el-table-column>
        <el-table-column prop="dealUserName" label="单位" show-overflow-tooltip min-width="80px"></el-table-column>
        <el-table-column prop="dealUserName" label="出库数量" show-overflow-tooltip min-width="80px"></el-table-column>
      <el-table :data="info.recordList" stripe>
        <el-table-column align="center" label="序号" type="index" width="55" />
        <el-table-column prop="materialName" label="物料名称" show-overflow-tooltip min-width="80px"></el-table-column>
        <el-table-column prop="materialCode" label="物料编码" show-overflow-tooltip min-width="100px"></el-table-column>
        <el-table-column prop="materialQrcode" label="条形码" show-overflow-tooltip min-width="100px"></el-table-column>
        <el-table-column prop="materialBrand" label="品牌" show-overflow-tooltip min-width="80px"></el-table-column>
        <el-table-column prop="materialUnitName" label="单位" show-overflow-tooltip min-width="80px"></el-table-column>
        <el-table-column prop="stock" label="入库数量" show-overflow-tooltip min-width="80px"></el-table-column>
      </el-table>
    </div>
  </GlobalWindow>
@@ -46,10 +49,8 @@
<script>
import GlobalWindow from '@/components/common/GlobalWindow'
import BaseOpera from '@/components/base/BaseOpera'
import { detailById, dispatchOrder, dealOrder } from '@/api/workorder/ywWorkorder'
import { getUserList } from '@/api/system/user'
import { Message, Loading } from 'element-ui'
import dayjs from 'dayjs'
import { ywOutinboundDetail } from '@/api'
import { StoreTypeOps } from './config'
export default {
  components: {
    GlobalWindow
@@ -57,21 +58,18 @@
  extends: BaseOpera,
  data() {
    return {
      id: '',
      visible: false,
      info: {},
      list: []
      info: {recordList: []},
      StoreTypeOps
    }
  },
  created() {
    // this.getDetail()
  },
  methods: {
    getDetail() {
      const { id } = this
      detailById(id).then(res => {
    getDetail(id) {
      ywOutinboundDetail(id).then(res => {
        this.info = res
      })
    },
admin/src/views/stock/components/InEdit.vue
@@ -1,27 +1,27 @@
<template>
  <GlobalWindow title="新建出库单" :visible.sync="isShowModal" :confirm-working="isLoading" width="900px" @close="close"
  <GlobalWindow title="新建入库单" :visible.sync="isShowModal" :confirm-working="isLoading" width="900px" @close="close"
    @confirm="confirm">
    <el-form :model="param" ref="form" :rules="rules">
      <div class="df_ac">
        <el-form-item class="w3" label="出库仓库" prop="parentId">
          <el-select :disabled="param.id" v-model="param.parentId" placeholder="不填为则一级分类">
            <el-option v-for="op in dataList" :key="op.id" :label="op.name" :value="op.id"></el-option>
        <el-form-item class="w3" label="入库仓库" prop="warehouseId">
          <el-select :disabled="param.id" v-model="param.warehouseId" placeholder="请选择">
            <el-option v-for="op in storeList" :key="op.id" :label="op.name" :value="op.id"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item class="w3" label="出库日期">
          <el-date-picker type="date" v-model="param.getDate" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
            placeholder="请选择出库日期"></el-date-picker>
        <el-form-item class="w3" label="入库日期" prop="doneDate">
          <el-date-picker type="date" v-model="param.doneDate" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
            placeholder="请选择入库日期"></el-date-picker>
        </el-form-item>
        <el-form-item class="w3" label="出库类型" prop="parentId">
          <el-select :disabled="param.id" v-model="param.parentId" placeholder="不填为则一级分类">
            <el-option v-for="op in dataList" :key="op.id" :label="op.name" :value="op.id"></el-option>
        <el-form-item class="w3" label="入库类型" prop="type">
          <el-select :disabled="param.id" v-model="param.type" placeholder="请选择入库类型">
            <el-option v-for="op in StoreTypeOps" :key="op.id" :label="op.name" :value="op.id"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item class="w3" label="处理人" prop="name">
          <el-input v-model="param.name" v-trim />
          <el-input v-model="param.createUserName" :disabled="true" v-trim />
        </el-form-item>
        <el-form-item class="w6" label="备注" prop="name">
          <el-input v-model="param.name" placeholder="请输入" v-trim />
        <el-form-item class="w6" label="备注" prop="remark">
          <el-input v-model="param.remark" placeholder="请输入" v-trim />
        </el-form-item>
      </div>
    </el-form>
@@ -32,18 +32,19 @@
    <el-button type="primary" @click="handleOpenMaterial">选择物料</el-button>
    <el-table :data="list" stripe>
      <el-table-column align="center" label="序号" type="index" width="50" />
      <el-table-column prop="creatorName" label="物料名称" show-overflow-tooltip min-width="80px"></el-table-column>
      <el-table-column prop="categoryName" label="物料编码" show-overflow-tooltip min-width="90px"></el-table-column>
      <el-table-column prop="createDate" label="条形码" show-overflow-tooltip min-width="70px"></el-table-column>
      <el-table-column prop="dealUserName" label="品牌" show-overflow-tooltip min-width="70px"></el-table-column>
      <el-table-column prop="dealUserName" label="单位" show-overflow-tooltip min-width="70px"></el-table-column>
      <el-table-column prop="dealUserName" label="出库数量" min-width="90px">
        <template v-slot="{row}">
          <el-input oninput="value=value.replace(/^(0+)|[^\d]+/g, '').slice(0, 11)" v-model="row.aa" class="w100"></el-input>
      <el-table-column prop="name" label="物料名称" show-overflow-tooltip min-width="80px"></el-table-column>
      <el-table-column prop="code" label="物料编码" show-overflow-tooltip min-width="90px"></el-table-column>
      <el-table-column prop="qrcode" label="条形码" show-overflow-tooltip min-width="70px"></el-table-column>
      <el-table-column prop="brand" label="品牌" show-overflow-tooltip min-width="70px"></el-table-column>
      <el-table-column prop="unitName" label="单位" show-overflow-tooltip min-width="70px"></el-table-column>
      <el-table-column prop="dealUserName" label="入库数量" min-width="90px">
        <template v-slot="{ row }">
          <el-input oninput="value=value.replace(/^(0+)|[^\d]+/g, '').slice(0, 11)" v-model="row.stock"
            class="w100"></el-input>
        </template>
      </el-table-column>
      <el-table-column prop="dealUserName" label="库存数量" show-overflow-tooltip min-width="80px"></el-table-column>
      <el-table-column prop="dealUserName" label="操作" min-width="60px">
      <el-table-column prop="maxStock" label="库存数量" show-overflow-tooltip min-width="80px"></el-table-column>
      <el-table-column label="操作" min-width="60px">
        <template v-slot="scope">
          <span @click="handleDel(scope)" class="red pointer">删除</span>
        </template>
@@ -57,52 +58,92 @@
<script>
import GlobalWindow from '@/components/common/GlobalWindow'
import AssetSel from './AssetSel'
import { create, fetchCateList, getInfoById } from '@/api/business/category.js'
import { fetchList as getStoreList } from '@/api/ywWarehouse'
import { ywOutinboundCreate } from '@/api/store/index'
import { StoreTypeOps, rules } from './config'
import { Message } from 'element-ui'
export default {
  name: 'OperaCategoryWindow',
  components: { GlobalWindow, AssetSel },
  data() {
    return {
      // è¡¨å•数据
      param: {},
      param: {
        createUserName: this.$store.state.userInfo.username,
        creator: this.$store.state.userInfo.id,
        inOut: 0
      },
      activeName: 'first',
      isShowModal: false,
      isShowSel: false,
      isLoading: false,
      // éªŒè¯è§„则
      rules: {
        name: [{ required: true, message: '请输入二级分类名称', trigger: 'blur' }],
      },
      list: [{}],
      rules,
      storeList: [],
      list: [],
      StoreTypeOps: StoreTypeOps.filter(i => i.type == 0),
      dataList: [],
    }
  },
  created() {
    this.initData()
    console.log(this.$store.state.userInfo)
  },
  methods: {
    confirm() {
      this.$refs['form'].validate((valid) => {
        if (valid) {
          const { param, list } = this
          if(list.length == 0) return Message.warning('请先选择物料信息')
          let count = 0 // å…¥åº“数量必填
          list.forEach(item => {
            if(!item.stock) count ++
          })
          if(count > 0) return Message.warning('请输入正确的入库数量')
          this.isLoading = true
          ywOutinboundCreate({
            ...param,
            recordList: list
          }).then(res => {
            this.isLoading = false
            Message.success('提交成功')
            this.$emit('success')
            this.close()
          }, () => {
            this.isLoading = false
          })
        }
      })
    },
    getList() {
      fetchCateList({ type: 5 }).then(res => {
        this.dataList = res || []
    initData() {
      getStoreList({ capacity: 9999, page: 1, model: {} }).then(res => {
        this.storeList = res.records || []
      })
    },
    changeSel() {
    changeSel(val) {
      const list = val
      list.forEach(item => {
        const index = this.list.findIndex(i => i.id == item.id)
        if(index == -1){
          item.materialId = item.id
          item.multifile = null
          this.list.push(item)
        }
      })
    },
    handleDel(val) {
      const index = val.$index
      this.list.splice(index, 1)
    },
    handleOpenMaterial() {
      this.isShowSel = true
      this.$nextTick(() => {
        this.$refs.AssetSelRef.isShowModal = true
        this.$refs.AssetSelRef.getList()
      })
    },
    close() {
admin/src/views/stock/components/OutDetail.vue
@@ -1,43 +1,46 @@
<template>
  <GlobalWindow width="960px" title="出库单详情" :visible.sync="visible" :confirm-working="isWorking" @close="close"
  <GlobalWindow width="960px" :showConfirm="false" title="出库单详情" :visible.sync="visible" :confirm-working="isWorking" @close="close"
    @confirm="confirm">
    <div class="main">
      <div class="title" style="color: #333333;">
        <span>出库单编号:{{ info.code }}</span>
      </div>
      <div class="title">
        <span>工单详情</span>
        <span>基础信息</span>
      </div>
      <div class="main_content">
        <div class="list">
          <div class="item">
            <div class="la">出库仓库</div>
            <div class="val">{{ info.projectName }}</div>
            <div class="val">{{ info.warehouseName }}</div>
          </div>
          <div class="item">
            <div class="la">出库日期</div>
            <div class="val">{{ info.categoryName }}</div>
            <div class="val">{{ info.doneDate }}</div>
          </div>
          <div class="item">
            <div class="la">出库类型</div>
            <div class="val">{{ info.creatorName }}{{ info.creatorCompany ? "-" + info.creatorCompany : '' }}</div>
            <div class="val" v-if="info.type || info.type == 0">{{ StoreTypeOps[info.type].name }}</div>
          </div>
          <div class="item">
            <div class="la">处理人</div>
            <div class="val">{{ info.creatorPhone || info.creatorMobile }}</div>
            <div class="val">{{ info.createUserName }}</div>
          </div>
          <div class="item">
          <div class="item" style="width: 66.6%;">
            <div class="la">备注</div>
            <div class="val">{{ info.createDate }}</div>
            <div class="val">{{ info.remark }}</div>
          </div>
        </div>
      </div>
      <div class="title">物料信息</div>
      <el-table :data="list" stripe>
        <el-table-column align="center" type="index" width="55" />
        <el-table-column prop="creatorName" label="物料名称" show-overflow-tooltip min-width="80px"></el-table-column>
        <el-table-column prop="categoryName" label="物料编码" show-overflow-tooltip min-width="100px"></el-table-column>
        <el-table-column prop="createDate" label="条形码" show-overflow-tooltip min-width="100px"></el-table-column>
        <el-table-column prop="dealUserName" label="品牌" show-overflow-tooltip min-width="80px"></el-table-column>
        <el-table-column prop="dealUserName" label="单位" show-overflow-tooltip min-width="80px"></el-table-column>
        <el-table-column prop="dealUserName" label="出库数量" show-overflow-tooltip min-width="80px"></el-table-column>
      <el-table :data="info.recordList" stripe>
        <el-table-column align="center" label="序号" type="index" width="55" />
        <el-table-column prop="materialName" label="物料名称" show-overflow-tooltip min-width="80px"></el-table-column>
        <el-table-column prop="materialCode" label="物料编码" show-overflow-tooltip min-width="100px"></el-table-column>
        <el-table-column prop="materialQrcode" label="条形码" show-overflow-tooltip min-width="100px"></el-table-column>
        <el-table-column prop="materialBrand" label="品牌" show-overflow-tooltip min-width="80px"></el-table-column>
        <el-table-column prop="materialUnitName" label="单位" show-overflow-tooltip min-width="80px"></el-table-column>
        <el-table-column prop="stock" label="出库数量" show-overflow-tooltip min-width="80px"></el-table-column>
      </el-table>
    </div>
  </GlobalWindow>
@@ -46,10 +49,8 @@
<script>
import GlobalWindow from '@/components/common/GlobalWindow'
import BaseOpera from '@/components/base/BaseOpera'
import { detailById, dispatchOrder, dealOrder } from '@/api/workorder/ywWorkorder'
import { getUserList } from '@/api/system/user'
import { Message, Loading } from 'element-ui'
import dayjs from 'dayjs'
import { ywOutinboundDetail } from '@/api'
import { StoreTypeOps } from './config'
export default {
  components: {
    GlobalWindow
@@ -57,21 +58,18 @@
  extends: BaseOpera,
  data() {
    return {
      id: '',
      visible: false,
      info: {},
      list: []
      info: {recordList: []},
      StoreTypeOps
    }
  },
  created() {
    // this.getDetail()
  },
  methods: {
    getDetail() {
      const { id } = this
      detailById(id).then(res => {
    getDetail(id) {
      ywOutinboundDetail(id).then(res => {
        this.info = res
      })
    },
admin/src/views/stock/components/OutEdit.vue
@@ -3,25 +3,25 @@
    @confirm="confirm">
    <el-form :model="param" ref="form" :rules="rules">
      <div class="df_ac">
        <el-form-item class="w3" label="出库仓库" prop="parentId">
          <el-select :disabled="param.id" v-model="param.parentId" placeholder="不填为则一级分类">
            <el-option v-for="op in dataList" :key="op.id" :label="op.name" :value="op.id"></el-option>
        <el-form-item class="w3" label="出库仓库" prop="warehouseId">
          <el-select :disabled="param.id" v-model="param.warehouseId" placeholder="请选择">
            <el-option v-for="op in storeList" :key="op.id" :label="op.name" :value="op.id"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item class="w3" label="出库日期">
          <el-date-picker type="date" v-model="param.getDate" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
        <el-form-item class="w3" label="出库日期" prop="doneDate">
          <el-date-picker type="date" v-model="param.doneDate" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
            placeholder="请选择出库日期"></el-date-picker>
        </el-form-item>
        <el-form-item class="w3" label="出库类型" prop="parentId">
          <el-select :disabled="param.id" v-model="param.parentId" placeholder="不填为则一级分类">
            <el-option v-for="op in dataList" :key="op.id" :label="op.name" :value="op.id"></el-option>
        <el-form-item class="w3" label="出库类型" prop="type">
          <el-select :disabled="param.id" v-model="param.type" placeholder="请选择出库类型">
            <el-option v-for="op in StoreTypeOps" :key="op.id" :label="op.name" :value="op.id"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item class="w3" label="处理人" prop="name">
          <el-input v-model="param.name" v-trim />
          <el-input v-model="param.createUserName" :disabled="true" v-trim />
        </el-form-item>
        <el-form-item class="w6" label="备注" prop="name">
          <el-input v-model="param.name" placeholder="请输入" v-trim />
        <el-form-item class="w6" label="备注" prop="remark">
          <el-input v-model="param.remark" placeholder="请输入" v-trim />
        </el-form-item>
      </div>
    </el-form>
@@ -32,18 +32,19 @@
    <el-button type="primary" @click="handleOpenMaterial">选择物料</el-button>
    <el-table :data="list" stripe>
      <el-table-column align="center" label="序号" type="index" width="50" />
      <el-table-column prop="creatorName" label="物料名称" show-overflow-tooltip min-width="80px"></el-table-column>
      <el-table-column prop="categoryName" label="物料编码" show-overflow-tooltip min-width="90px"></el-table-column>
      <el-table-column prop="createDate" label="条形码" show-overflow-tooltip min-width="70px"></el-table-column>
      <el-table-column prop="dealUserName" label="品牌" show-overflow-tooltip min-width="70px"></el-table-column>
      <el-table-column prop="dealUserName" label="单位" show-overflow-tooltip min-width="70px"></el-table-column>
      <el-table-column prop="name" label="物料名称" show-overflow-tooltip min-width="80px"></el-table-column>
      <el-table-column prop="code" label="物料编码" show-overflow-tooltip min-width="90px"></el-table-column>
      <el-table-column prop="qrcode" label="条形码" show-overflow-tooltip min-width="70px"></el-table-column>
      <el-table-column prop="brand" label="品牌" show-overflow-tooltip min-width="70px"></el-table-column>
      <el-table-column prop="unitName" label="单位" show-overflow-tooltip min-width="70px"></el-table-column>
      <el-table-column prop="dealUserName" label="出库数量" min-width="90px">
        <template v-slot="{row}">
          <el-input oninput="value=value.replace(/^(0+)|[^\d]+/g, '').slice(0, 11)" v-model="row.aa" class="w100"></el-input>
        <template v-slot="{ row }">
          <el-input oninput="value=value.replace(/^(0+)|[^\d]+/g, '').slice(0, 11)" v-model="row.stock"
            class="w100"></el-input>
        </template>
      </el-table-column>
      <el-table-column prop="dealUserName" label="库存数量" show-overflow-tooltip min-width="80px"></el-table-column>
      <el-table-column prop="dealUserName" label="操作" min-width="60px">
      <el-table-column prop="maxStock" label="库存数量" show-overflow-tooltip min-width="80px"></el-table-column>
      <el-table-column label="操作" min-width="60px">
        <template v-slot="scope">
          <span @click="handleDel(scope)" class="red pointer">删除</span>
        </template>
@@ -57,52 +58,91 @@
<script>
import GlobalWindow from '@/components/common/GlobalWindow'
import AssetSel from './AssetSel'
import { create, fetchCateList, getInfoById } from '@/api/business/category.js'
import { fetchList as getStoreList } from '@/api/ywWarehouse'
import { ywOutinboundCreate } from '@/api/store/index'
import { StoreTypeOps, rules } from './config'
import { Message } from 'element-ui'
export default {
  name: 'OperaCategoryWindow',
  components: { GlobalWindow, AssetSel },
  data() {
    return {
      // è¡¨å•数据
      param: {},
      param: {
        createUserName: this.$store.state.userInfo.username,
        creator: this.$store.state.userInfo.id,
        inOut: 1
      },
      activeName: 'first',
      isShowModal: false,
      isShowSel: false,
      isLoading: false,
      // éªŒè¯è§„则
      rules: {
        name: [{ required: true, message: '请输入二级分类名称', trigger: 'blur' }],
      },
      list: [{}],
      rules,
      storeList: [],
      list: [],
      StoreTypeOps: StoreTypeOps.filter(i => i.type == 1),
      dataList: [],
    }
  },
  created() {
    this.initData()
  },
  methods: {
    confirm() {
    },
    getList() {
      fetchCateList({ type: 5 }).then(res => {
        this.dataList = res || []
      this.$refs['form'].validate((valid) => {
        if (valid) {
          const { param, list } = this
          if(list.length == 0) return Message.warning('请先选择物料信息')
          let count = 0 // å‡ºåº“数量必填
          list.forEach(item => {
            if(!item.stock) count ++
          })
          if(count > 0) return Message.warning('请输入正确的出库数量')
          this.isLoading = true
          ywOutinboundCreate({
            ...param,
            recordList: list
          }).then(res => {
            this.isLoading = false
            Message.success('提交成功')
            this.$emit('success')
            this.close()
          }, () => {
            this.isLoading = false
          })
        }
      })
    },
    changeSel() {
    initData() {
      getStoreList({ capacity: 9999, page: 1, model: {} }).then(res => {
        this.storeList = res.records || []
      })
    },
    changeSel(val) {
      const list = val
      list.forEach(item => {
        if(this.list.indexOf(item.id) === -1){
          item.materialId = item.id
          item.stock = null
          this.list.push(item)
        }
      })
    },
    handleDel(val) {
      const index = val.$index
      this.list.splice(index, 1)
    },
    handleOpenMaterial() {
      this.isShowSel = true
      this.$nextTick(() => {
        this.$refs.AssetSelRef.isShowModal = true
        this.$refs.AssetSelRef.isOut = true
        this.$refs.AssetSelRef.getList()
        console.log('-----');
      })
    },
    close() {
admin/src/views/stock/components/config.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
export const StoreTypeOps = [
  { name: '采购入库', id: 0, type: 0 },
  { name: '领用退回', id: 1, type: 0 },
  { name: '调整入库', id: 2, type: 0 },
  { name: '其他入库', id: 3, type: 0 },
  { name: '盘盈入库', id: 4, type: 0 },
  { name: '领用出库', id: 5, type: 1 },
  { name: '仓库出库', id: 6, type: 1 },
  { name: '调整出库', id: 7, type: 1 },
  { name: '采购出库', id: 8, type: 1 },
  { name: '其他出库', id: 9, type: 1 },
  { name: '盘出出库', id: 10, type: 1 },
]
export const rules = {
  warehouseId: [{ required: true, message: '请选择', trigger: 'blur' }],
  doneDate: [{ required: true, message: '请选择', trigger: 'blur' }],
  type: [{ required: true, message: '请选择', trigger: 'blur' }],
}
admin/src/views/stock/in.vue
@@ -2,17 +2,22 @@
  <div class="main_app">
    <QueryForm v-model="filters" :query-form-config="queryFormConfig" @handleQuery="getList(1)" @clear="clear" />
    <div class="mt20">
      <el-button type="primary" @click="handleEdit()" v-permissions="['business:ywpatrolline:create']">新建出库单</el-button>
      <el-button type="primary" @click="handleEdit()" v-permissions="['business:ywpatrolline:create']">新建入库单</el-button>
      <el-button @click="handleEx()" v-permissions="['business:ywpatrolline:create']">导出</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="workTime" label="操作时间" min-width="140" show-overflow-tooltip />
      <el-table-column prop="code" label="入库单号" min-width="120" show-overflow-tooltip />
      <el-table-column prop="warehouseName" label="入库仓库" min-width="100" show-overflow-tooltip />
      <el-table-column prop="typeName" label="入库类型" min-width="100" show-overflow-tooltip />
      <el-table-column prop="doneDate" label="入库日期" min-width="110" show-overflow-tooltip />
      <el-table-column label="入库数量" min-width="140">
        <template v-slot="{ row }">
          <div v-for="item in row.recordList">{{ item.materialName }}[{{ item.materialCode }}]*{{ item.stock }}{{
            item.materialUnitName }}</div>
        </template>
      </el-table-column>
      <el-table-column prop="createUserName" label="操作人" min-width="90" show-overflow-tooltip />
      <el-table-column prop="createDate" label="操作时间" min-width="140" show-overflow-tooltip />
      <el-table-column prop="workTime" label="操作" min-width="80" show-overflow-tooltip>
        <template v-slot="{ row }">
          <span @click="handleDetail(row)" class="primaryColor pointer">查看详情</span>
@@ -36,7 +41,9 @@
import dayjs from 'dayjs'
import duration from 'dayjs/plugin/duration'
dayjs.extend(duration)
import { platformLogPage, getPlatformGroupList } from '@/api'
import { ywOutinboundPage, ywOutinboundEx } from '@/api'
import { fetchList as getStoreList } from '@/api/ywWarehouse'
import { StoreTypeOps, rules } from './components/config'
export default {
  components: {
    Pagination,
@@ -54,26 +61,34 @@
        page: 1,
        total: 0
      },
      filters: {},
      list: [{}],
      filters: {
        inOut: 0
      },
      StoreTypeOps,
      list: [],
      total: 0,
      queryFormConfig: {
        formItems: [
          {
            filed: 'carCodeFront',
            filed: 'code',
            type: 'input',
            label: '出库单号',
            label: '入库单号',
          },
          {
            filed: 'platformGroupId',
            filed: 'warehouseId',
            type: 'select',
            label: '所在仓库',
            labelCode: 'name',
            valueCode: 'id',
            options: []
          },
          {
            filed: 'carCodeFront',
            type: 'input',
            label: '出库类型',
            filed: 'type',
            type: 'select',
            label: '入库类型',
            labelCode: 'name',
            valueCode: 'id',
            options: StoreTypeOps.filter(i => i.type == 0)
          },
        ],
        online: true
@@ -81,8 +96,8 @@
    }
  },
  created() {
    // this.getList()
    // this.getGroupList()
    this.getList()
    this.initData()
  },
  methods: {
    handleSub() {
@@ -98,45 +113,56 @@
        this.$refs.InEditRef.isShowModal = true
      })
    },
    handleDetail() {
    handleDetail(row) {
      this.isShowDetail = true
      this.$nextTick(() => {
        this.$refs.InDetailRef.visible = true
        this.$refs.InDetailRef.getDetail(row.id)
      })
    },
    handleEx() { },
    getGroupList() {
      getPlatformGroupList({ queryData: 0, queryType: 0 }).then(res => {
        this.queryFormConfig.formItems[1].options = res.map(i => {
          return {
            value: i.id,
            label: i.name
          }
    handleEx() {
      this.$dialog.exportConfirm('确认导出吗?')
        .then(() => {
          this.loading = true
          ywOutinboundEx({
            page: this.pagination.page,
            capacity: 1000000,
            model: this.filters
          })
            .then(response => {
              this.download(response)
            })
            .catch(e => {
              this.$tip.apiFailed(e)
            })
            .finally(() => {
              this.loading = false
            })
        })
        // this.queryFormConfig.formItems[1].options.unshift({ value: '', label: '全部月台组' })
        .catch(() => { })
    },
    initData() {
      getStoreList({ capacity: 9999, page: 1, model: {} }).then(res => {
        this.queryFormConfig.formItems[1].options = res.records || []
      })
    },
    getList(page) {
      const { pagination, filters } = this
      this.loading = true
      if(page){pagination.page = page}
      platformLogPage({
      if (page) { pagination.page = page }
      ywOutinboundPage({
        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,
          inOut: 0
        },
        sorts: [{ direction: 'DESC', property: 'param1' }],
        // sorts: [{ direction: 'DESC', property: 'param1' }],
        capacity: pagination.pageSize,
        page: 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秒')
          item.typeName = this.StoreTypeOps[item.type].name
        })
        this.pagination.total = res.total || 0
      }, () => {
@@ -144,7 +170,7 @@
      })
    },
    clear() {
      this.filters = {}
      this.filters = {inOut: 0}
      this.pagination.pageSize = 10
      this.pagination.page = 1
      this.getList()
admin/src/views/stock/out.vue
@@ -6,13 +6,17 @@
      <el-button @click="handleEx()" v-permissions="['business:ywpatrolline:create']">导出</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="workTime" label="操作时间" min-width="140" show-overflow-tooltip />
      <el-table-column prop="code" label="出库单号" min-width="120" show-overflow-tooltip />
      <el-table-column prop="warehouseName" label="出库仓库" min-width="100" show-overflow-tooltip />
      <el-table-column prop="typeName" label="出库类型" min-width="100" show-overflow-tooltip />
      <el-table-column prop="doneDate" label="出库日期" min-width="110" show-overflow-tooltip />
      <el-table-column label="出库数量" min-width="140">
        <template v-slot="{ row }">
          <div v-for="item in row.recordList">{{ item.materialName }}[{{ item.materialCode }}]*{{ item.stock }}{{ item.materialUnitName }}</div>
        </template>
      </el-table-column>
      <el-table-column prop="createUserName" label="领用人" min-width="90" show-overflow-tooltip />
      <el-table-column prop="createDate" label="操作时间" min-width="140" show-overflow-tooltip />
      <el-table-column prop="workTime" label="操作" min-width="80" show-overflow-tooltip>
        <template v-slot="{ row }">
          <span @click="handleDetail(row)" class="primaryColor pointer">查看详情</span>
@@ -24,19 +28,21 @@
    </div>
    <!--  -->
    <OutEdit v-if="isShowEdit" @close="isShowEdit = false" @success="getList" ref="OutEditRef" />
    <OutDetail v-if="isShowDetail" ref="OutDetailRef" />
    <OutDetail v-if="isShowDetail" ref="InDetailRef" />
  </div>
</template>
<script>
import Pagination from '@/components/common/Pagination'
import QueryForm from '@/components/common/QueryForm'
import OutEdit from './components/OutEdit'
import OutDetail from './components/OutDetail'
import OutEdit from './components/OutEdit.vue'
import OutDetail from './components/OutDetail.vue'
import dayjs from 'dayjs'
import duration from 'dayjs/plugin/duration'
dayjs.extend(duration)
import { platformLogPage, getPlatformGroupList } from '@/api'
import { ywOutinboundPage } from '@/api'
import { fetchList as getStoreList } from '@/api/ywWarehouse'
import { StoreTypeOps, rules } from './components/config'
export default {
  components: {
    Pagination,
@@ -54,26 +60,34 @@
        page: 1,
        total: 0
      },
      filters: {},
      list: [{}],
      filters: {
        inOut: 1
      },
      StoreTypeOps,
      list: [],
      total: 0,
      queryFormConfig: {
        formItems: [
          {
            filed: 'carCodeFront',
            filed: 'code',
            type: 'input',
            label: '出库单号',
          },
          {
            filed: 'platformGroupId',
            filed: 'warehouseId',
            type: 'select',
            label: '所在仓库',
            labelCode: 'name',
            valueCode: 'id',
            options: []
          },
          {
            filed: 'carCodeFront',
            type: 'input',
            filed: 'type',
            type: 'select',
            label: '出库类型',
            labelCode: 'name',
            valueCode: 'id',
            options: StoreTypeOps.filter(i => i.type == 0)
          },
        ],
        online: true
@@ -81,8 +95,8 @@
    }
  },
  created() {
    // this.getList()
    // this.getGroupList()
    this.getList()
    this.initData()
  },
  methods: {
    handleSub() {
@@ -98,45 +112,55 @@
        this.$refs.OutEditRef.isShowModal = true
      })
    },
    handleDetail() {
    handleDetail(row) {
      this.isShowDetail = true
      this.$nextTick(() => {
        this.$refs.OutDetailRef.visible = true
        this.$refs.InDetailRef.visible = true
        this.$refs.InDetailRef.getDetail(row.id)
      })
    },
    handleEx() { },
    getGroupList() {
      getPlatformGroupList({ queryData: 0, queryType: 0 }).then(res => {
        this.queryFormConfig.formItems[1].options = res.map(i => {
          return {
            value: i.id,
            label: i.name
          }
    handleEx() {
      this.$dialog.exportConfirm('确认导出吗?')
        .then(() => {
          this.loading = true
          ywOutinboundEx({
            page: this.pagination.page,
            capacity: 1000000,
            model: this.filters
          })
            .then(response => {
              this.download(response)
            })
            .catch(e => {
              this.$tip.apiFailed(e)
            })
            .finally(() => {
              this.loading = false
            })
        })
        // this.queryFormConfig.formItems[1].options.unshift({ value: '', label: '全部月台组' })
        .catch(() => { })
    },
    initData() {
      getStoreList({ capacity: 9999, page: 1, model: {} }).then(res => {
        this.queryFormConfig.formItems[1].options = res.records || []
      })
    },
    getList(page) {
      const { pagination, filters } = this
      this.loading = true
      if(page){pagination.page = page}
      platformLogPage({
      ywOutinboundPage({
        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' }],
        // sorts: [{ direction: 'DESC', property: 'param1' }],
        capacity: pagination.pageSize,
        page: 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秒')
          item.typeName = this.StoreTypeOps[item.type].name
        })
        this.pagination.total = res.total || 0
      }, () => {
@@ -144,7 +168,9 @@
      })
    },
    clear() {
      this.filters = {}
      this.filters = {
        inOut: 1
      }
      this.pagination.pageSize = 10
      this.pagination.page = 1
      this.getList()
admin/src/views/stock/query.vue
@@ -2,7 +2,7 @@
  <div class="main_app">
    <QueryForm v-model="filters" :query-form-config="queryFormConfig" @handleQuery="getList(1)" @clear="clear" />
    <div class="mt20">
      <el-button v-permissions="['business:ywpatrolline:create']">导出</el-button>
      <el-button @click="handleEx" v-permissions="['business:ywpatrolline:create']">导出</el-button>
    </div>
    <el-table v-loading="loading" :data="list" stripe>
      <el-table-column prop="materialId" label="资产编码" min-width="100" show-overflow-tooltip />
@@ -25,7 +25,7 @@
import dayjs from 'dayjs'
import duration from 'dayjs/plugin/duration'
dayjs.extend(duration)
import { fetchList } from '@/api/ywStock'
import { ywStockPage,ywStockPageEx  } from '@/api/store/index'
export default {
  components: {
    Pagination,
@@ -72,7 +72,7 @@
    getList(page) {
      const { pagination, filters } = this
      this.loading = true
      fetchList({
      ywStockPage({
        model: {
          ...filters
        },
@@ -86,6 +86,27 @@
        this.loading = false
      })
    },
    handleEx() {
      this.$dialog.exportConfirm('确认导出吗?')
        .then(() => {
          this.loading = true
          ywStockPageEx({
            page: this.pagination.page,
            capacity: 1000000,
            model: this.filters
          })
            .then(response => {
              this.download(response)
            })
            .catch(e => {
              this.$tip.apiFailed(e)
            })
            .finally(() => {
              this.loading = false
            })
        })
        .catch(() => { })
    },
    clear() {
      this.filters = {}
      this.pagination.pageSize = 10
admin/src/views/stock/record.vue
@@ -2,19 +2,35 @@
  <div class="main_app">
    <QueryForm v-model="filters" :query-form-config="queryFormConfig" @handleQuery="getList(1)" @clear="clear" />
    <div class="mt20">
      <el-button type="primary" @click="handleEx()" v-permissions="['business:ywpatrolline:create']">导出</el-button>
      <el-button @click="handleEx()" v-permissions="['business:ywpatrolline:create']">导出</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="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="80" show-overflow-tooltip />
      <el-table-column prop="param1" label="类型" min-width="80" show-overflow-tooltip />
      <el-table-column prop="workTime" label="仓库" min-width="90" show-overflow-tooltip />
      <el-table-column prop="workTime" label="单据编号" min-width="120" show-overflow-tooltip />
      <el-table-column prop="workTime" label="创建人" min-width="80" show-overflow-tooltip />
      <el-table-column prop="workTime" label="创建时间" min-width="140" show-overflow-tooltip />
      <el-table-column prop="doneDate" label="单据日期" min-width="90" show-overflow-tooltip />
      <el-table-column prop="materialCode" label="物料编码" min-width="90" show-overflow-tooltip />
      <el-table-column prop="materialName" label="物料名称" min-width="90" show-overflow-tooltip />
      <el-table-column prop="carCodeFront" label="物料分类" min-width="120" show-overflow-tooltip>
        <template v-slot="{ row }">
          <span>{{ row.categoryParentName }}/{{ row.categoryName }}</span>
        </template>
      </el-table-column>
      <el-table-column prop="carCodeBack" label="数量" min-width="80" show-overflow-tooltip>
        <template v-slot="{ row }">
          <span>{{ row.stock }}{{ row.materialUnitName }}</span>
        </template>
      </el-table-column>
      <el-table-column prop="param1" label="类型" min-width="70" show-overflow-tooltip>
        <template v-slot="{ row }">
          <span v-if="row.type || row.type == 0">{{ StoreTypeOps[row.type] }}</span>
        </template>
      </el-table-column>
      <el-table-column prop="warehouseName" label="仓库" min-width="90" show-overflow-tooltip />
      <el-table-column prop="code" label="单据编号" min-width="120" show-overflow-tooltip>
        <template v-slot="{ row }">
          <span class="primaryColor">{{ row.code }}</span>
        </template>
      </el-table-column>
      <el-table-column prop="createUserName" label="创建人" min-width="80" show-overflow-tooltip />
      <el-table-column prop="createDate" label="创建时间" min-width="140" show-overflow-tooltip />
    </el-table>
    <div class="mt20">
      <Pagination @size-change="handleSizeChange" @current-change="getList" :pagination="pagination" />
@@ -28,7 +44,9 @@
import dayjs from 'dayjs'
import duration from 'dayjs/plugin/duration'
dayjs.extend(duration)
import { platformLogPage, getPlatformGroupList } from '@/api'
import { ywOutinboundRecord, ywOutinboundRecordEx } from '@/api'
import { fetchList as getStoreList } from '@/api/ywWarehouse'
import { StoreTypeOps } from './components/config'
export default {
  components: {
    Pagination,
@@ -45,29 +63,34 @@
      filters: {},
      list: [],
      total: 0,
      StoreTypeOps,
      queryFormConfig: {
        formItems: [
          {
            filed: 'carCodeFront',
            filed: 'materialCode',
            type: 'input',
            label: '资产编码',
            label: '物料编码',
          },
          {
            filed: 'platformGroupId',
            filed: 'warehouseId',
            type: 'select',
            labelCode: 'name',
            valueCode: 'id',
            label: '所在仓库',
            options: []
          },
          {
            filed: 'carCodeFront',
            filed: 'code',
            type: 'input',
            label: '单据编号',
          },
          {
            filed: 'platformGroupId',
            filed: 'type',
            type: 'select',
            label: '单据类型',
            options: []
            labelCode: 'name',
            valueCode: 'id',
            options: StoreTypeOps
          },
          {
            filed: 'selDate',
@@ -76,7 +99,7 @@
          },
          {
            filed: 'selTime',
            type: 'daterange',
            type: 'datetimerange',
            label: '创建时间',
          },
        ],
@@ -85,8 +108,8 @@
    }
  },
  created() {
    // this.getList()
    // this.getGroupList()
    this.getList()
    this.initData()
  },
  methods: {
    handleSub() {
@@ -96,39 +119,58 @@
        }
      })
    },
    handleEx() { },
    getGroupList() {
      getPlatformGroupList({ queryData: 0, queryType: 0 }).then(res => {
        this.queryFormConfig.formItems[1].options = res.map(i => {
          return {
            value: i.id,
            label: i.name
          }
    handleEx() {
      this.$dialog.exportConfirm('确认导出吗?')
        .then(() => {
          this.loading = true
          ywOutinboundRecordEx({
            page: this.pagination.page,
            capacity: 1000000,
            model: this.filters
          })
            .then(response => {
              this.download(response)
            })
            .catch(e => {
              this.$tip.apiFailed(e)
            })
            .finally(() => {
              this.loading = false
            })
        })
        // this.queryFormConfig.formItems[1].options.unshift({ value: '', label: '全部月台组' })
        .catch(() => { })
    },
    initData() {
      getStoreList({ capacity: 9999, page: 1, model: {} }).then(res => {
        this.queryFormConfig.formItems[1].options = res.records || []
      })
    },
    getList(page) {
      const { pagination, filters } = this
      this.loading = true
      platformLogPage({
      if (filters.selDate && filters.selDate.length > 0) {
        filters.doneDateStart = filters.selDate[0]
        filters.doneDateEnd = filters.selDate[1]
      } else {
        filters.doneDateStart = null
        filters.doneDateEnd = null
      }
      if (filters.selTime && filters.selTime.length > 0) {
        filters.createDateStart = filters.selTime[0]
        filters.createDateEnd = filters.selTime[1]
      } else {
        filters.createDateStart = null
        filters.createDateEnd = null
      }
      ywOutinboundRecord({
        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