web-base-admin/src/views/configManage/barcodeConfiguration/details.vue

448 lines
11 KiB
Vue
Raw Normal View History

2025-03-23 09:18:42 +08:00
<!--
* @Descripttion:
* @version:
* @Author: kBank
* @Date: 2022-11-15 15:26:39
-->
<template>
<div class="page">
<div class="main">
<el-form
ref="select"
:model="select"
style="padding: 10px 10px 10px 0; background-color: #fff"
label-width="100px"
>
<el-row :gutter="10">
<!-- 一层 -->
<el-col :span="4">
2025-04-01 23:46:26 +08:00
<el-form-item :label="'产品名称'">
2025-03-23 09:18:42 +08:00
<el-input
v-model="select.productName"
2025-04-29 15:06:18 +08:00
clearable
2025-04-01 23:46:26 +08:00
:placeholder="'请输入'"
2025-04-29 15:06:18 +08:00
/>
2025-03-23 09:18:42 +08:00
</el-form-item>
</el-col>
<el-col :span="4">
2025-04-01 23:46:26 +08:00
<el-form-item :label="'产品编号'">
2025-03-23 09:18:42 +08:00
<el-input
v-model="select.productCode"
2025-04-29 15:06:18 +08:00
clearable
2025-04-01 23:46:26 +08:00
:placeholder="'请输入'"
2025-04-29 15:06:18 +08:00
/>
2025-03-23 09:18:42 +08:00
</el-form-item>
</el-col>
<el-col :span="4">
2025-04-01 23:46:26 +08:00
<el-form-item :label="'追溯编号'">
2025-03-23 09:18:42 +08:00
<el-input
v-model="select.barCode"
2025-04-29 15:06:18 +08:00
clearable
2025-04-01 23:46:26 +08:00
:placeholder="'请输入'"
2025-04-29 15:06:18 +08:00
/>
2025-03-23 09:18:42 +08:00
</el-form-item>
</el-col>
<el-col :span="4">
2025-04-01 23:46:26 +08:00
<el-form-item :label="'追溯状态'">
2025-04-29 15:06:18 +08:00
<el-select v-model="select.codeStatus" clearable>
2025-03-23 09:18:42 +08:00
<el-option
v-for="item in codeStatusList"
:key="item.val"
:label="item.text"
:value="item.val"
2025-04-29 15:06:18 +08:00
/>
2025-03-23 09:18:42 +08:00
</el-select>
</el-form-item>
</el-col>
<!-- 二层 -->
<el-col :span="8">
2025-04-01 23:46:26 +08:00
<el-form-item :label="'打印日期'">
2025-03-23 09:18:42 +08:00
<el-date-picker
v-model="creationTime2"
value-format="yyyy-MM-dd"
type="daterange"
2025-04-01 23:46:26 +08:00
:range-separator="'至'"
:start-placeholder="'开始日期'"
:end-placeholder="'结束日期'"
2025-04-29 15:06:18 +08:00
@change="changeTime2"
/>
2025-03-23 09:18:42 +08:00
</el-form-item>
</el-col>
<el-col :span="8">
2025-04-01 23:46:26 +08:00
<el-form-item :label="'生成时间'">
2025-03-23 09:18:42 +08:00
<el-date-picker
v-model="creationTime1"
type="daterange"
value-format="yyyy-MM-dd"
2025-04-01 23:46:26 +08:00
:range-separator="'至'"
:start-placeholder="'开始日期'"
:end-placeholder="'结束日期'"
2025-04-29 15:06:18 +08:00
@change="changeTime1"
/>
2025-03-23 09:18:42 +08:00
</el-form-item>
</el-col>
<el-col :span="4">
2025-04-01 23:46:26 +08:00
<el-form-item :label="'追溯批次'">
2025-03-23 09:18:42 +08:00
<el-input
v-model="select.batch"
2025-04-29 15:06:18 +08:00
clearable
2025-04-01 23:46:26 +08:00
:placeholder="'请输入'"
2025-04-29 15:06:18 +08:00
/>
2025-03-23 09:18:42 +08:00
</el-form-item>
</el-col>
<el-col :span="4" style="margin-left: 30px">
<el-button class="my_search" @click="getDataList">
2025-04-29 15:06:18 +08:00
{{ '搜索' }}</el-button>
2025-03-23 09:18:42 +08:00
<el-button class="my_reset" @click="reset">
2025-04-29 15:06:18 +08:00
{{ '重置' }}</el-button>
2025-03-23 09:18:42 +08:00
</el-col>
</el-row>
</el-form>
<!-- <div class="openClose"
@click="changeActive">
<i :class="isActive?'el-icon-arrow-up':'el-icon-arrow-down'"></i>
2025-04-01 23:46:26 +08:00
<div>{{isActive?'':'点击展开'}}</div>
2025-03-23 09:18:42 +08:00
</div> -->
<div class="maintop">
<div class="mainbtn">
2025-04-29 15:06:18 +08:00
<el-button size="small" class="exportBtn" @click="handleExport">
{{ '导出' }}</el-button>
<el-button
size="small"
class="exportBtn"
@click="handleExportDetail"
>导出明细</el-button>
2025-03-23 09:18:42 +08:00
</div>
</div>
<div class="maintable">
<el-table
:data="tableData"
style="width: 100%"
height="570px"
:header-cell-style="{ background: '#EEEEEE' }"
:row-class-name="tableRowClassName"
@selection-change="handleSelectionChange"
>
2025-04-29 15:06:18 +08:00
<el-table-column type="selection" width="55" />
2025-03-23 09:18:42 +08:00
<el-table-column
align="center"
prop="productCode"
2025-04-01 23:46:26 +08:00
:label="'产品编号'"
2025-04-29 15:06:18 +08:00
/>
2025-03-23 09:18:42 +08:00
<el-table-column
align="center"
prop="productName"
2025-04-01 23:46:26 +08:00
:label="'产品名称'"
2025-04-29 15:06:18 +08:00
/>
<el-table-column align="center" prop="barCode" :label="'追溯编号'" />
2025-03-23 09:18:42 +08:00
<el-table-column
align="center"
prop="codeStatus"
2025-04-01 23:46:26 +08:00
:label="'追溯状态'"
2025-03-23 09:18:42 +08:00
>
<template slot-scope="scope">
<div
v-for="item in codeStatusList"
2025-04-29 15:06:18 +08:00
v-if="scope.row.codeStatus == item.val"
2025-03-23 09:18:42 +08:00
:key="item.val"
>
{{ item.text }}
</div>
</template>
</el-table-column>
<el-table-column
align="center"
prop="batch"
2025-04-01 23:46:26 +08:00
:label="'追溯批次'"
2025-04-29 15:06:18 +08:00
/>
2025-03-23 09:18:42 +08:00
<el-table-column
align="center"
prop="printTime"
2025-04-01 23:46:26 +08:00
:label="'打印日期'"
2025-04-29 15:06:18 +08:00
/>
2025-03-23 09:18:42 +08:00
<el-table-column
align="center"
prop="creationTime"
2025-04-01 23:46:26 +08:00
:label="'生成时间'"
2025-04-29 15:06:18 +08:00
/>
2025-03-23 09:18:42 +08:00
</el-table>
</div>
</div>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getDataList"
/>
</div>
</template>
<script>
2025-04-29 15:06:18 +08:00
import topBar from '@/components/topBar'
import * as api from '@/api/configManage.js'
import { getToken } from '@/utils/auth'
import { specialArea } from '@/api/configManage'
2025-03-23 09:18:42 +08:00
export default {
2025-04-29 15:06:18 +08:00
name: 'ProductList',
2025-03-23 09:18:42 +08:00
components: {
2025-04-29 15:06:18 +08:00
topBar
2025-03-23 09:18:42 +08:00
},
filters: {
isAgree(val) {
if (!val) {
2025-04-29 15:06:18 +08:00
return '允许'
2025-03-23 09:18:42 +08:00
} else {
2025-04-29 15:06:18 +08:00
return '禁止'
2025-03-23 09:18:42 +08:00
}
2025-04-29 15:06:18 +08:00
}
2025-03-23 09:18:42 +08:00
},
data() {
return {
// 折叠搜索框
isActive: false,
2025-04-29 15:06:18 +08:00
select: { pkBarCode: '' },
2025-03-23 09:18:42 +08:00
// 查询参数
queryParams: {
pageNum: 1,
2025-04-29 15:06:18 +08:00
pageSize: 50
2025-03-23 09:18:42 +08:00
},
2025-04-29 15:06:18 +08:00
addOrEdit: '',
2025-03-23 09:18:42 +08:00
total: 0,
tableData: [],
// 1=已生成 2=已打印 3=已绑定
codeStatusList: [
{
2025-04-01 23:46:26 +08:00
text: '已生成',
2025-04-29 15:06:18 +08:00
val: 1
2025-03-23 09:18:42 +08:00
},
{
2025-04-01 23:46:26 +08:00
text: '会员级',
2025-04-29 15:06:18 +08:00
val: 2
2025-03-23 09:18:42 +08:00
},
{
2025-04-01 23:46:26 +08:00
text: '会员级',
2025-04-29 15:06:18 +08:00
val: 3
}
2025-03-23 09:18:42 +08:00
],
form: {},
creationTime1: [],
creationTime2: [],
isCopy: false,
2025-04-29 15:06:18 +08:00
selPkId: '',
2025-03-23 09:18:42 +08:00
// 预售状态
presaleList: [],
2025-04-29 15:06:18 +08:00
// 供应方式
2025-03-23 09:18:42 +08:00
gyList: [],
2025-04-29 15:06:18 +08:00
// 商品分类
2025-03-23 09:18:42 +08:00
hierarchyList: [],
// 所属专区
2025-04-29 15:06:18 +08:00
areaList: []
}
2025-03-23 09:18:42 +08:00
},
mounted() {
2025-04-29 15:06:18 +08:00
this.select.pkBarCode = this.$route.query.id
this.select.pkBarCodeId = this.$route.query.id
2025-03-23 09:18:42 +08:00
// 获取列表
2025-04-29 15:06:18 +08:00
this.getDataList()
2025-03-23 09:18:42 +08:00
},
methods: {
reset() {
this.select = {
pkBarCode: this.$route.query.id,
2025-04-29 15:06:18 +08:00
pkBarCodeId: this.$route.query.id
}
this.creationTime1 = []
this.creationTime2 = []
this.getDataList()
2025-03-23 09:18:42 +08:00
},
changeTime1(val) {
2025-04-29 15:06:18 +08:00
this.select.startDate = val[0]
this.select.endDate = val[1]
2025-03-23 09:18:42 +08:00
},
changeTime2(val) {
2025-04-29 15:06:18 +08:00
this.select.startDatePrint = val[0]
this.select.endDatePrint = val[1]
2025-03-23 09:18:42 +08:00
},
// 展开折叠
changeActive() {
2025-04-29 15:06:18 +08:00
this.isActive = !this.isActive
2025-03-23 09:18:42 +08:00
},
/** 导出按钮操作 */
handleExport() {
2025-04-01 23:46:26 +08:00
this.$confirm('是否确认导出所有数据项?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
2025-04-29 15:06:18 +08:00
type: 'warning'
2025-03-23 09:18:42 +08:00
}).then((_) => {
this.download(
2025-04-29 15:06:18 +08:00
'/system/manage/bar-code-items/printTxm',
2025-03-23 09:18:42 +08:00
Object.assign({}, this.queryParams, this.select),
2025-04-01 23:46:26 +08:00
`${'条形码明细'}${new Date().getTime()}.pdf`
2025-04-29 15:06:18 +08:00
)
2025-03-23 09:18:42 +08:00
// api.printTxm(Object.assign({}, this.queryParams, this.select)).then(res=>{
// console.log('%c [ res ]-267', 'font-size:13px; background:#9fe869; color:#e3ffad;', res)
// })
2025-04-29 15:06:18 +08:00
})
2025-03-23 09:18:42 +08:00
},
handleExportDetail() {
2025-04-01 23:46:26 +08:00
this.$confirm('是否确认导出所有数据项?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
2025-04-29 15:06:18 +08:00
type: 'warning'
2025-03-23 09:18:42 +08:00
}).then((_) => {
this.download(
2025-04-29 15:06:18 +08:00
'/system/manage/bar-code-items/export',
2025-03-23 09:18:42 +08:00
Object.assign({}, this.queryParams, this.select),
2025-04-01 23:46:26 +08:00
`${'条形码明细'}${new Date().getTime()}.xlsx`
2025-04-29 15:06:18 +08:00
)
2025-03-23 09:18:42 +08:00
// api.printTxm(Object.assign({}, this.queryParams, this.select)).then(res=>{
// console.log('%c [ res ]-267', 'font-size:13px; background:#9fe869; color:#e3ffad;', res)
// })
2025-04-29 15:06:18 +08:00
})
2025-03-23 09:18:42 +08:00
},
2025-04-29 15:06:18 +08:00
2025-03-23 09:18:42 +08:00
openDig() {
this.$router.push({
2025-04-29 15:06:18 +08:00
path: '/goodsManage/goodsRelease/jcsz'
})
2025-03-23 09:18:42 +08:00
},
// 查看 0编辑1,复制2
toChecked(id, index) {
this.$router.push({
2025-04-29 15:06:18 +08:00
path: '/goodsManage/goodsList/goodsEdit/jcsz',
2025-03-23 09:18:42 +08:00
query: {
id: id,
2025-04-29 15:06:18 +08:00
methods: index
}
})
2025-03-23 09:18:42 +08:00
},
2025-04-29 15:06:18 +08:00
2025-03-23 09:18:42 +08:00
// 获取列表
getDataList() {
api
.bd_bar_codeItem(Object.assign({}, this.queryParams, this.select))
.then((res) => {
2025-04-29 15:06:18 +08:00
this.tableData = res.rows
this.total = res.total
})
2025-03-23 09:18:42 +08:00
},
toCopy() {
2025-04-29 15:06:18 +08:00
this.toChecked(this.selPkId, 2)
2025-03-23 09:18:42 +08:00
},
handleSelectionChange(val) {
2025-04-29 15:06:18 +08:00
this.selPkId = val[0].pkWares
2025-03-23 09:18:42 +08:00
if (val.length > 1) {
2025-04-29 15:06:18 +08:00
this.isCopy = true
2025-03-23 09:18:42 +08:00
} else {
2025-04-29 15:06:18 +08:00
this.isCopy = false
2025-03-23 09:18:42 +08:00
}
},
tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 == 1) {
2025-04-29 15:06:18 +08:00
return 'warning-row'
2025-03-23 09:18:42 +08:00
} else if (rowIndex % 2 == 0) {
2025-04-29 15:06:18 +08:00
return 'success-row'
2025-03-23 09:18:42 +08:00
}
2025-04-29 15:06:18 +08:00
return ''
}
}
}
2025-03-23 09:18:42 +08:00
</script>
<style scoped lang="scss">
::v-deep .el-table .warning-row {
background: #f9f9f9;
}
::v-deep .el-table .success-row {
background: #ffffff;
}
::v-deep .el-table thead {
color: #000000;
}
::v-deep .el-select {
width: 100%;
}
::v-deep .el-date-editor.el-input,
.el-date-editor.el-input__inner {
width: 100%;
}
.uploadIcon ::v-deep .el-upload--picture-card {
display: none !important; /* 上传按钮隐藏 */
}
.page {
padding: 20px;
background: #f9f9f9;
font-size: 14px;
.main {
background: #f9f9f9;
//border-radius: 8px;
//box-shadow: 0px 2px 20px 0px rgba(238, 238, 238, 0.5);
.maintop {
display: flex;
padding: 10px 0;
justify-content: space-between;
align-items: center;
.mainbtn {
.thebtn1 {
background: #3181e5;
color: #ffffff;
width: 68px;
height: 32px;
}
.thebtn2 {
background: #ffad41;
color: #ffffff;
width: 68px;
height: 32px;
}
.thebtn3 {
background: #6962f6;
color: #ffffff;
}
}
.maintitle {
font-size: 10px;
font-family: MicrosoftYaHei;
color: #999999;
}
}
}
.tem {
display: flex;
align-items: center;
justify-content: center;
img {
width: 28px;
height: 20px;
margin-right: 3px;
}
}
.isRed {
color: #ed1d25;
}
.isGreen {
color: #1ab62b;
}
.bgImg {
width: 48px;
height: 48px;
}
}
.openClose {
margin-right: 10px;
color: #666666;
text-align: center;
}
.btnHeng {
display: flex;
}
</style>