|
@@ -0,0 +1,311 @@
|
|
|
+<template>
|
|
|
+ <a-card size="small" :bordered="false" class="shelfNoMan-wrap">
|
|
|
+ <a-spin :spinning="spinning" tip="Loading...">
|
|
|
+ <!-- 搜索条件 -->
|
|
|
+ <div ref="tableSearch" class="table-page-search-wrapper">
|
|
|
+ <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
|
+ <a-row :gutter="15">
|
|
|
+ <a-col :md="4" :sm="24">
|
|
|
+ <a-form-item label="产品编码">
|
|
|
+ <a-input id="shelfNoMan-code" v-model.trim="queryParam.product.code" allowClear placeholder="请输入产品编码"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="4" :sm="24">
|
|
|
+ <a-form-item label="产品名称">
|
|
|
+ <a-input id="shelfNoMan-name" v-model.trim="queryParam.product.name" allowClear placeholder="请输入产品名称"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="4" :sm="24">
|
|
|
+ <a-form-item label="原厂编码">
|
|
|
+ <a-input id="shelfNoMan-origCode" v-model.trim="queryParam.product.origCode" allowClear placeholder="请输入原厂编码"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="4" :sm="24">
|
|
|
+ <a-form-item label="产品品牌">
|
|
|
+ <ProductBrand id="shelfNoMan-productBrandSn" v-model="queryParam.product.productBrandSn"></ProductBrand>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <template v-if="advanced">
|
|
|
+ <a-col :md="4" :sm="24">
|
|
|
+ <a-form-item label="产品分类">
|
|
|
+ <productTypeAll placeholder="请选择产品分类" @change="changeProductType" v-model="productType" id="shelfNoMan-productType"></productTypeAll>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="4" :sm="24">
|
|
|
+ <a-form-item label="产品状态">
|
|
|
+ <v-select code="PRODUCT_STATUS" id="shelfNoMan-state" v-model="queryParam.product.state" allowClear placeholder="请选择产品状态"></v-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="4" :sm="24">
|
|
|
+ <a-form-item label="货位编号">
|
|
|
+ <a-input id="shelfNoMan-stackPlaceCode" v-model.trim="queryParam.stackPlaceCode" allowClear placeholder="请输入货位编号"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="4" :sm="24">
|
|
|
+ <a-form-item label="是否有货位编号">
|
|
|
+ <a-select id="shelfNoMan-haveStackCode" v-model="queryParam.haveStackCode" allowClear placeholder="请选择">
|
|
|
+ <a-select-option value="1">
|
|
|
+ 有编号
|
|
|
+ </a-select-option>
|
|
|
+ <a-select-option value="0">
|
|
|
+ 无编号
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </template>
|
|
|
+ <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
|
+ <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="shelfNoMan-refresh">查询</a-button>
|
|
|
+ <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="shelfNoMan-reset">重置</a-button>
|
|
|
+ <a-button
|
|
|
+ v-if="$hasPermissions('B_productInfo_export')"
|
|
|
+ style="margin-left: 5px"
|
|
|
+ type="primary"
|
|
|
+ class="button-warning"
|
|
|
+ @click="handleExport"
|
|
|
+ :disabled="disabled"
|
|
|
+ :loading="exportLoading"
|
|
|
+ id="shelfNoMan-export">导出</a-button>
|
|
|
+ <a @click="advanced=!advanced" style="margin-left: 5px">
|
|
|
+ {{ advanced ? '收起' : '展开' }}
|
|
|
+ <a-icon :type="advanced ? 'up' : 'down'"/>
|
|
|
+ </a>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-form>
|
|
|
+ </div>
|
|
|
+ <!-- 操作按钮 -->
|
|
|
+ <div class="table-operator">
|
|
|
+ <a-button
|
|
|
+ id="shelfNoMan-batchAudit"
|
|
|
+ type="primary"
|
|
|
+ @click="openGuideModal = true"
|
|
|
+ >批量导入</a-button>
|
|
|
+ </div>
|
|
|
+ <s-table
|
|
|
+ class="sTable fixPagination"
|
|
|
+ ref="table"
|
|
|
+ :style="{ height: tableHeight+84.5+'px' }"
|
|
|
+ size="small"
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
+ :columns="columns"
|
|
|
+ :data="loadData"
|
|
|
+ :scroll="{ y: tableHeight }"
|
|
|
+ :defaultLoadData="false"
|
|
|
+ bordered>
|
|
|
+ <!-- 产品分类 -->
|
|
|
+ <template slot="productType" slot-scope="text, record">
|
|
|
+ <span v-if="record.productVO.productTypeName2 || record.productVO.productTypeName3">{{ record.productVO.productTypeName2 }} {{ record.productVO.productTypeName3 ? '>' : '' }} {{ record.productVO.productTypeName3 }}</span>
|
|
|
+ <span v-else>--</span>
|
|
|
+ </template>
|
|
|
+ <!-- 操作 -->
|
|
|
+ <template slot="action" slot-scope="text, record">
|
|
|
+ <div>
|
|
|
+ <a-button
|
|
|
+ size="small"
|
|
|
+ type="link"
|
|
|
+ v-if="$hasPermissions('B_productInfo_edit')"
|
|
|
+ class="button-info"
|
|
|
+ @click="handleEdit(record)"
|
|
|
+ id="shelfNoMan-edit-btn">编辑</a-button>
|
|
|
+ <a-button
|
|
|
+ size="small"
|
|
|
+ type="link"
|
|
|
+ v-if="$hasPermissions('B_productInfo_detail')"
|
|
|
+ class="button-success"
|
|
|
+ @click="handleDetail(record)"
|
|
|
+ id="shelfNoMan-detail-btn">变更记录</a-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </s-table>
|
|
|
+ </a-spin>
|
|
|
+ <!-- 导入产品 -->
|
|
|
+ <importGuideModal :openModal="openGuideModal" @close="openGuideModal=false" @ok="hanldeOk" />
|
|
|
+ <!-- 编辑 -->
|
|
|
+ <editHwModal :openModal="openModal" :nowData="nowData" @ok="editOk" @close="closeModal" />
|
|
|
+ <!-- 变更记录 -->
|
|
|
+ <changeRecordModal :openModal="recordModal" :detailData="nowData" @close="closeModal"></changeRecordModal>
|
|
|
+ </a-card>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { commonMixin } from '@/utils/mixin'
|
|
|
+import { STable, VSelect } from '@/components'
|
|
|
+import editHwModal from './editHwModal.vue'
|
|
|
+import ProductBrand from '@/views/common/productBrand.js'
|
|
|
+import productTypeAll from '@/views/common/productTypeAll.js'
|
|
|
+import { exportExcel } from '@/libs/JGPrint.js'
|
|
|
+import ImportGuideModal from './importGuideModal.vue'
|
|
|
+import changeRecordModal from './changeRecordModal.vue'
|
|
|
+import { queryStackPlaceQueryPage, stackPlaceExport, stackPlaceInsertImport } from '@/api/product'
|
|
|
+export default {
|
|
|
+ name: 'ProductInfoList',
|
|
|
+ mixins: [commonMixin],
|
|
|
+ components: { STable, VSelect, editHwModal, ProductBrand, productTypeAll, ImportGuideModal, changeRecordModal },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ spinning: false,
|
|
|
+ openGuideModal: false,
|
|
|
+ advanced: true, // 高级搜索 展开/关闭
|
|
|
+ tableHeight: 0,
|
|
|
+ queryParam: { // 查询条件
|
|
|
+ stackPlaceCode: undefined, // 货位编号
|
|
|
+ haveStackCode: undefined,
|
|
|
+ product: {
|
|
|
+ name: '', // 产品名称
|
|
|
+ code: '', // 产品编码
|
|
|
+ origCode: '', // 原厂编码
|
|
|
+ productBrandSn: undefined, // 产品品牌
|
|
|
+ productTypeSn1: '', // 产品一级分类
|
|
|
+ productTypeSn2: '', // 产品二级分类
|
|
|
+ productTypeSn3: '', // 产品三级分类
|
|
|
+ state: undefined // 产品状态
|
|
|
+ }
|
|
|
+ },
|
|
|
+ productType: [],
|
|
|
+ disabled: false, // 查询、重置按钮是否可操作
|
|
|
+ exportLoading: false,
|
|
|
+ columns: [
|
|
|
+ { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
|
|
|
+ { title: '产品编码', dataIndex: 'productVO.code', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '产品名称', dataIndex: 'productVO.name', align: 'center', width: '30%', ellipsis: true, customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '原厂编码', dataIndex: 'productVO.origCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '产品品牌', dataIndex: 'productVO.productBrandName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: '10%', align: 'center' },
|
|
|
+ { title: '产品状态', dataIndex: 'productVO.stateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '货位编号', dataIndex: 'stackPlaceCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' }
|
|
|
+ ],
|
|
|
+ loadingAudit: false,
|
|
|
+ loadingLaunch: false,
|
|
|
+ loadingDownline: false,
|
|
|
+ // 加载数据方法 必须为 Promise 对象
|
|
|
+ loadData: parameter => {
|
|
|
+ this.disabled = true
|
|
|
+ this.spinning = true
|
|
|
+ return queryStackPlaceQueryPage(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
+ let data
|
|
|
+ if (res.status == 200) {
|
|
|
+ data = res.data
|
|
|
+ const no = (data.pageNo - 1) * data.pageSize
|
|
|
+ for (var i = 0; i < data.list.length; i++) {
|
|
|
+ data.list[i].no = no + i + 1
|
|
|
+ }
|
|
|
+ this.disabled = false
|
|
|
+ }
|
|
|
+ this.spinning = false
|
|
|
+ return data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ openModal: false, // 编辑弹框
|
|
|
+ recordModal: false, // 变更记录弹框
|
|
|
+ nowData: null, // 当前sn
|
|
|
+ pageFromInfo: null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 导入产品
|
|
|
+ hanldeOk (obj) {
|
|
|
+ stackPlaceInsertImport(obj).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.resetSearchForm()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 重置
|
|
|
+ resetSearchForm () {
|
|
|
+ this.queryParam = {
|
|
|
+ stackPlaceCode: undefined, // 货位编号
|
|
|
+ haveStackCode: undefined,
|
|
|
+ product: {
|
|
|
+ name: '', // 产品名称
|
|
|
+ code: '', // 产品编码
|
|
|
+ origCode: '', // 原厂编码
|
|
|
+ productBrandSn: undefined, // 产品品牌
|
|
|
+ productTypeSn1: '', // 产品一级分类
|
|
|
+ productTypeSn2: '', // 产品二级分类
|
|
|
+ productTypeSn3: '', // 产品三级分类
|
|
|
+ state: undefined // 产品状态
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.productType = []
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
+ },
|
|
|
+ // 编辑
|
|
|
+ handleEdit (row) {
|
|
|
+ this.nowData = row
|
|
|
+ this.openModal = true
|
|
|
+ },
|
|
|
+ // 编辑成功
|
|
|
+ editOk () {
|
|
|
+ this.closeModal()
|
|
|
+ this.$refs.table.refresh()
|
|
|
+ },
|
|
|
+ // 关闭编辑弹框
|
|
|
+ closeModal () {
|
|
|
+ this.nowData = null
|
|
|
+ this.openModal = false
|
|
|
+ this.recordModal = false
|
|
|
+ },
|
|
|
+ // 变更记录
|
|
|
+ handleDetail (row) {
|
|
|
+ this.nowData = row
|
|
|
+ this.recordModal = true
|
|
|
+ },
|
|
|
+ // 导出
|
|
|
+ handleExport () {
|
|
|
+ const _this = this
|
|
|
+ const params = this.queryParam
|
|
|
+ this.spinning = true
|
|
|
+ exportExcel(stackPlaceExport, params, '货位编号导出', function () {
|
|
|
+ _this.spinning = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 产品分类 change
|
|
|
+ changeProductType (val, opt) {
|
|
|
+ this.queryParam.product.productTypeSn1 = val[0] ? val[0] : ''
|
|
|
+ this.queryParam.product.productTypeSn2 = val[1] ? val[1] : ''
|
|
|
+ this.queryParam.product.productTypeSn3 = val[2] ? val[2] : ''
|
|
|
+ },
|
|
|
+ pageInit () {
|
|
|
+ const _this = this
|
|
|
+ this.$nextTick(() => { // 页面渲染完成后的回调
|
|
|
+ _this.setTableH()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ setTableH () {
|
|
|
+ const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
|
+ this.tableHeight = window.innerHeight - tableSearchH - 235
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ advanced (newValue, oldValue) {
|
|
|
+ const _this = this
|
|
|
+ this.$nextTick(() => { // 页面渲染完成后的回调
|
|
|
+ _this.setTableH()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
|
|
|
+ this.setTableH()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
|
|
|
+ this.pageInit()
|
|
|
+ this.resetSearchForm()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ activated () {
|
|
|
+ // 如果是新页签打开,则重置当前页面
|
|
|
+ if (this.$store.state.app.isNewTab) {
|
|
|
+ this.pageInit()
|
|
|
+ this.resetSearchForm()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ beforeRouteEnter (to, from, next) {
|
|
|
+ next(vm => {
|
|
|
+ vm.pageFromInfo = from
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|