Merge remote-tracking branch 'origin/0.8.X' into 0.8.X

This commit is contained in:
2026-05-12 10:11:38 +08:00
4 changed files with 122 additions and 167 deletions

View File

@@ -94,55 +94,6 @@
</el-table-column> </el-table-column>
</KLPTable> </KLPTable>
<!-- <coil-card v-for="(item, index) in materialCoilList" :key="item.coilId || index" :coil="item"
:card-style="getBorderStyle(item)">
<template slot="header">
<el-tag type="info" size="small" class="coil-no-tag" :style="getBorderStyle(item)">{{
getTypeLabel(item) }}</el-tag>
<span class="material-type">{{ item.materialType || '原料' }}</span>
<i class="el-icon-view param-icon" @click="handlePreviewLabel(item)" title="查看标签"></i>
<i class="el-icon-time param-icon" @click="handleTrace(item)" title="追溯"></i>
</template>
<template slot="body">
<div class="info-list">
<div class="info-item">
<span class="info-label">入场</span>
<span class="info-value" :title="item.enterCoilNo">{{ item.enterCoilNo || '—' }}</span>
</div>
<div class="info-item">
<span class="info-label">厂家</span>
<span class="info-value" :title="item.supplierCoilNo">{{ item.supplierCoilNo || '—' }}</span>
</div>
<div class="info-item">
<span class="info-label">库位</span>
<span class="info-value" :title="item.warehouseName">{{ item.warehouseName || '—' }}</span>
</div>
<div class="info-item">
<span class="info-label">规格</span>
<span class="info-value" :title="item.specification">{{ item.specification || '—'
}}</span>
</div>
<div class="info-item">
<span class="info-label">重量</span>
<span class="info-value">{{ item.netWeight || '—' }}t</span>
</div>
</div>
<el-button v-if="item.dataType == 1 && item.status == 0"
style="position: absolute; bottom: 10px; right: 10px;" type="success" icon="el-icon-refresh"
size="mini" @click="handleRestoreMaterial(item)" :loading="item.cancelling"
class="action-btn">回滚</el-button>
<el-button v-if="item.dataType == 10 && item.status == 0"
style="position: absolute; bottom: 10px; right: 10px;" type="success" icon="el-icon-refresh"
size="mini" @click="handleForceInMaterial(item)" :loading="item.cancelling"
class="action-btn">强制入库</el-button>
</template>
<template slot="footer">
<el-button type="primary" icon="el-icon-check" size="mini" @click="handleCorrectMaterial(item)"
:loading="item.picking" class="action-btn">修正</el-button>
<el-button type="danger" icon="el-icon-delete" size="mini" @click="hanleDeleteMaterial(item)"
:loading="item.picking" class="action-btn">删除</el-button>
</template>
</coil-card> -->
</div> </div>
<!-- 分页 --> <!-- 分页 -->
@@ -315,6 +266,8 @@
<el-dialog title="钢卷追溯" :visible.sync="traceOpen" width="90%" append-to-body> <el-dialog title="钢卷追溯" :visible.sync="traceOpen" width="90%" append-to-body>
<coil-trace-result v-loading="traceLoading" :trace-result="traceResult"></coil-trace-result> <coil-trace-result v-loading="traceLoading" :trace-result="traceResult"></coil-trace-result>
</el-dialog> </el-dialog>
<label-render ref="labelRender" v-show="false" :content="labelRender.data" :labelType="labelRender.type" />
</div> </div>
</template> </template>
@@ -612,6 +565,16 @@ export default {
path: '/wms/coil/' + row.coilId, path: '/wms/coil/' + row.coilId,
}); });
}, },
// 打印标签
handlePrintLabel(row) {
this.labelRender.data = {
...row,
updateTime: row.updateTime?.split(' ')[0] || '',
};
this.$nextTick(() => {
this.$refs.labelRender.printLabel();
})
},
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset();

View File

@@ -61,9 +61,8 @@
size="mini" icon="el-icon-view" @click="handlePreviewLabel(scope.row)" title="预览标签">预览</el-button> size="mini" icon="el-icon-view" @click="handlePreviewLabel(scope.row)" title="预览标签">预览</el-button>
<el-button v-loading="buttonLoading" style="margin-left: 0px; padding: 4px !important;" type="default" <el-button v-loading="buttonLoading" style="margin-left: 0px; padding: 4px !important;" type="default"
size="mini" icon="el-icon-printer" @click="handlePrintLabel(scope.row)" title="打印标签">打印</el-button> size="mini" icon="el-icon-printer" @click="handlePrintLabel(scope.row)" title="打印标签">打印</el-button>
<el-button size="mini" type="default" style="margin-left: 0px; padding: 4px !important;" icon="el-icon-view" @click="handleNumberCoilClick(scope.row)"> <el-button v-loading="buttonLoading" style="margin-left: 0px; padding: 4px !important;" type="default"
数字钢卷 size="mini" icon="el-icon-printer" @click="handleNumberCoilClick(scope.row)" title="数字钢卷">数字钢卷</el-button>
</el-button>
<el-button type="warning" icon="el-icon-time" size="mini" @click="handleTrace(scope.row)" <el-button type="warning" icon="el-icon-time" size="mini" @click="handleTrace(scope.row)"
:loading="scope.row.picking" class="action-btn">追溯</el-button> :loading="scope.row.picking" class="action-btn">追溯</el-button>
@@ -80,57 +79,7 @@
:loading="scope.row.cancelling" class="action-btn">强制入库</el-button> :loading="scope.row.cancelling" class="action-btn">强制入库</el-button>
</template> </template>
</el-table-column> </el-table-column>
</KLPTable> </KLPTable>
<!-- <div v-if="materialCoilList.length === 0" class="empty-state">
<i class="el-icon-box"></i>
<p>未找到钢卷数据</p>
</div>
<coil-card v-for="(item, index) in materialCoilList" :key="item.coilId || index" :coil="item"
:card-style="getBorderStyle(item)">
<template slot="header">
<el-tag type="info" size="small" class="coil-no-tag" :style="getBorderStyle(item)">{{
getTypeLabel(item) }}</el-tag>
<span class="material-type">{{ item.materialType || '原料' }}</span>
<i class="el-icon-view param-icon" @click="handlePreviewLabel(item)" title="查看标签"></i>
<i class="el-icon-time param-icon" @click="handleTrace(item)" title="追溯"></i>
</template>
<template slot="body">
<div class="info-list">
<div class="info-item">
<span class="info-label">入场</span>
<span class="info-value" :title="item.enterCoilNo">{{ item.enterCoilNo || '—' }}</span>
</div>
<div class="info-item">
<span class="info-label">厂家</span>
<span class="info-value" :title="item.supplierCoilNo">{{ item.supplierCoilNo || '—' }}</span>
</div>
<div class="info-item">
<span class="info-label">库位</span>
<span class="info-value" :title="item.warehouseName">{{ item.warehouseName || '—' }}</span>
</div>
<div class="info-item">
<span class="info-label">规格</span>
<span class="info-value" :title="item.specification">{{ item.specification || '—'
}}</span>
</div>
<div class="info-item">
<span class="info-label">重量</span>
<span class="info-value">{{ item.netWeight || '—' }}t</span>
</div>
</div>
<el-button v-if="item.dataType == 1 && item.status == 0"
style="position: absolute; bottom: 10px; right: 10px;" type="success" icon="el-icon-refresh" size="mini"
@click="handleRestoreMaterial(item)" :loading="item.cancelling" class="action-btn">回滚</el-button>
<el-button v-if="item.dataType == 10 && item.status == 0"
style="position: absolute; bottom: 10px; right: 10px;" type="success" icon="el-icon-refresh" size="mini"
@click="handleForceInMaterial(item)" :loading="item.cancelling" class="action-btn">强制入库</el-button>
</template>
<template slot="footer">
<el-button type="primary" icon="el-icon-check" size="mini" @click="handleCorrectMaterial(item)"
:loading="item.picking" class="action-btn">修正</el-button>
</template>
</coil-card> -->
</div> </div>
</div> </div>
@@ -275,6 +224,8 @@
<label-render :content="labelRender.data" :labelType="labelRender.type" /> <label-render :content="labelRender.data" :labelType="labelRender.type" />
</el-dialog> </el-dialog>
<label-render ref="labelRender" v-show="false" :content="labelRender.data" :labelType="labelRender.type" />
<!-- 钢卷修正对话框 --> <!-- 钢卷修正对话框 -->
<el-dialog :title="title" :visible.sync="correctVisible" width="600px"> <el-dialog :title="title" :visible.sync="correctVisible" width="600px">
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
@@ -603,12 +554,6 @@ export default {
} }
return '物品类型'; return '物品类型';
}, },
// 进入数字钢卷页面
handleNumberCoilClick(row) {
this.$router.push({
path: '/wms/coil/' + row.coilId,
});
},
// 分条操作列表100-199 // 分条操作列表100-199
splitTypes() { splitTypes() {
if (!this.dict.type.action_type) return []; if (!this.dict.type.action_type) return [];
@@ -648,6 +593,25 @@ export default {
}) })
}, },
// 打印标签
handlePrintLabel(row) {
this.labelRender.data = {
...row,
updateTime: row.updateTime?.split(' ')[0] || '',
};
this.$nextTick(() => {
this.$refs.labelRender.printLabel();
})
},
// 进入数字钢卷页面
handleNumberCoilClick(row) {
console.log(row)
this.$router.push({
path: '/wms/coil/' + row.coilId,
});
},
// 处理材料类型变化 // 处理材料类型变化
handleMaterialTypeChange(value) { handleMaterialTypeChange(value) {
// 清空物品选择 // 清空物品选择
@@ -663,6 +627,7 @@ export default {
/** 预览标签 */ /** 预览标签 */
handlePreviewLabel(row) { handlePreviewLabel(row) {
console.log(row)
this.labelRender.visible = true; this.labelRender.visible = true;
const type = getCoilTagPrintType(row); const type = getCoilTagPrintType(row);
this.labelRender.type = type; this.labelRender.type = type;

View File

@@ -609,7 +609,7 @@
</el-dialog> </el-dialog>
<!-- 钢卷暂存单据管理 --> <!-- 钢卷暂存单据管理 -->
<el-card class="box-card" style="margin-top: 20px;" :body-style="{ padding: '20px' }"> <el-card v-if="moreColumn" class="box-card" style="margin-top: 20px;" :body-style="{ padding: '20px' }">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>钢卷暂存单据管理</span> <span>钢卷暂存单据管理</span>
<el-button style="float: right; padding: 3px 0" type="text" @click="createTempOrder">创建暂存单据</el-button> <el-button style="float: right; padding: 3px 0" type="text" @click="createTempOrder">创建暂存单据</el-button>

View File

@@ -3,25 +3,29 @@
<!-- 头部 --> <!-- 头部 -->
<div class="page-header"> <div class="page-header">
<span class="page-title">规程版本管理</span> <span class="page-title">规程版本管理</span>
<el-button <el-button type="primary" size="small" icon="el-icon-plus" style="margin-left:auto"
type="primary" @click="openSpecDialog()">新建规程</el-button>
size="small" </div>
icon="el-icon-plus"
style="margin-left:auto" <div>
@click="openSpecDialog()" <el-form>
>新建规程</el-button> <el-form-item label="规程类型">
<dict-select @change="loadSpecs" renderType="radio" v-model="queryParams.specType"
dict-type="wms_process_spec_type" :kisv="false" :editable="true"></dict-select>
</el-form-item>
<el-form-item label="产线">
<dict-select @change="loadSpecs" renderType="radio" v-model="queryParams.lineId"
dict-type="wms_process_spec_line" :kisv="false" :editable="true"></dict-select>
</el-form-item>
</el-form>
</div> </div>
<!-- 规程列表 --> <!-- 规程列表 -->
<div class="section-wrapper"> <div class="section-wrapper">
<div class="section-title">规程列表</div> <div class="section-title">规程列表</div>
<el-table
:data="specList" <el-table :data="specList" size="small" highlight-current-row @row-click="onSpecRowClick"
size="small" :row-class-name="tableRowClassName">
highlight-current-row
@row-click="onSpecRowClick"
:row-class-name="tableRowClassName"
>
<el-table-column label="规程编码" prop="specCode" width="150" /> <el-table-column label="规程编码" prop="specCode" width="150" />
<el-table-column label="规程名称" prop="specName" /> <el-table-column label="规程名称" prop="specName" />
<el-table-column label="创建时间" prop="createTime" width="180" /> <el-table-column label="创建时间" prop="createTime" width="180" />
@@ -32,36 +36,25 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="loadSpecs" />
</div> </div>
<!-- 版本列表 --> <!-- 版本列表 -->
<div class="section-wrapper" v-if="currentSpec"> <div class="section-wrapper" v-if="currentSpec" v-loading="versionLoading">
<div class="section-title"> <div class="section-title">
版本列表 - {{ currentSpec.specName }} 版本列表 - {{ currentSpec.specName }}
<el-button <el-button type="primary" size="mini" icon="el-icon-plus" @click="openVersionDialog()">新建版本</el-button>
type="primary"
size="mini"
icon="el-icon-plus"
@click="openVersionDialog()"
>新建版本</el-button>
</div> </div>
<el-table <el-table :data="versionList" size="small" highlight-current-row @row-click="onVersionRowClick">
:data="versionList"
size="small"
highlight-current-row
@row-click="onVersionRowClick"
>
<el-table-column label="版本号" prop="versionCode" /> <el-table-column label="版本号" prop="versionCode" />
<el-table-column label="状态" prop="status" /> <el-table-column label="状态" prop="status" />
<el-table-column label="创建时间" prop="createTime" /> <el-table-column label="创建时间" prop="createTime" />
<el-table-column label="生效" align="center"> <el-table-column label="生效" align="center">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<el-switch <el-switch :value="row.isActive === 1" active-color="#5F7BA0" @click.native.stop
:value="row.isActive === 1" @change="handleActiveChange(row, $event)" />
active-color="#5F7BA0"
@click.native.stop
@change="handleActiveChange(row, $event)"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="right"> <el-table-column label="操作" align="right">
@@ -141,7 +134,16 @@ export default {
versionList: [], versionList: [],
versionLoading: false, versionLoading: false,
statusOptions: ['DRAFT', 'PUBLISHED', 'OBSOLETE'], statusOptions: ['DRAFT', 'PUBLISHED', 'OBSOLETE'],
// 分页相关
total: 0,
queryParams: {
pageNum: 1,
pageSize: 10,
specType: '',
lineId: ''
},
// 规程相关 // 规程相关
specOpen: false, specOpen: false,
specTitle: '', specTitle: '',
@@ -151,7 +153,7 @@ export default {
specCode: [{ required: true, message: '规程编码不能为空', trigger: 'blur' }], specCode: [{ required: true, message: '规程编码不能为空', trigger: 'blur' }],
specName: [{ required: true, message: '规程名称不能为空', trigger: 'blur' }] specName: [{ required: true, message: '规程名称不能为空', trigger: 'blur' }]
}, },
// 版本相关 // 版本相关
versionOpen: false, versionOpen: false,
versionTitle: '', versionTitle: '',
@@ -171,30 +173,35 @@ export default {
tableRowClassName({ row }) { tableRowClassName({ row }) {
return row.specId === this.currentSpecId ? 'current-row' : '' return row.specId === this.currentSpecId ? 'current-row' : ''
}, },
// 加载规程列表 // 加载规程列表
loadSpecs() { loadSpecs() {
this.pageLoading = true this.pageLoading = true
listProcessSpec({ pageNum: 1, pageSize: 500 }).then(res => { listProcessSpec(this.queryParams).then(res => {
this.total = res.total || 0
this.specList = res.rows || [] this.specList = res.rows || []
if (this.specList.length > 0 && !this.currentSpec) { if (this.specList.length > 0 && !this.currentSpec) {
this.selectSpec(this.specList[0]) this.selectSpec(this.specList[0])
} else {
this.currentSpec = null
this.currentSpecId = null
this.versionList = []
} }
}).catch(e => console.error(e)).finally(() => { this.pageLoading = false }) }).catch(e => console.error(e)).finally(() => { this.pageLoading = false })
}, },
// 选择规程 // 选择规程
selectSpec(spec) { selectSpec(spec) {
this.currentSpec = spec this.currentSpec = spec
this.currentSpecId = spec.specId this.currentSpecId = spec.specId
this.loadVersions() this.loadVersions()
}, },
// 点击规程行 // 点击规程行
onSpecRowClick(row) { onSpecRowClick(row) {
this.selectSpec(row) this.selectSpec(row)
}, },
// 加载版本列表 // 加载版本列表
loadVersions() { loadVersions() {
if (!this.currentSpecId) return if (!this.currentSpecId) return
@@ -203,12 +210,12 @@ export default {
this.versionList = res.rows || [] this.versionList = res.rows || []
}).catch(e => console.error(e)).finally(() => { this.versionLoading = false }) }).catch(e => console.error(e)).finally(() => { this.versionLoading = false })
}, },
// 点击版本行 // 点击版本行
onVersionRowClick(row) { onVersionRowClick(row) {
this.goPlanSpec(row) this.goPlanSpec(row)
}, },
// 跳转到方案详情 // 跳转到方案详情
goPlanSpec(row) { goPlanSpec(row) {
const basePath = this.$route.path.replace(/\/[^/]*$/, '') const basePath = this.$route.path.replace(/\/[^/]*$/, '')
@@ -218,7 +225,7 @@ export default {
query: { specId: this.currentSpecId, versionId: String(row.versionId), versionCode: row.versionCode } query: { specId: this.currentSpecId, versionId: String(row.versionId), versionCode: row.versionCode }
}) })
}, },
// 生效切换 // 生效切换
handleActiveChange(row, val) { handleActiveChange(row, val) {
if (!val) { if (!val) {
@@ -230,9 +237,9 @@ export default {
}).then(() => { }).then(() => {
this.$modal.msgSuccess('已生效') this.$modal.msgSuccess('已生效')
this.loadVersions() this.loadVersions()
}).catch(() => {}) }).catch(() => { })
}, },
// 规程对话框 // 规程对话框
openSpecDialog(row) { openSpecDialog(row) {
this.specForm = row this.specForm = row
@@ -242,7 +249,7 @@ export default {
this.specOpen = true this.specOpen = true
this.$nextTick(() => this.$refs.specFormRef && this.$refs.specFormRef.clearValidate()) this.$nextTick(() => this.$refs.specFormRef && this.$refs.specFormRef.clearValidate())
}, },
// 提交规程 // 提交规程
submitSpec() { submitSpec() {
this.$refs.specFormRef.validate(ok => { this.$refs.specFormRef.validate(ok => {
@@ -256,7 +263,7 @@ export default {
}).catch(e => console.error(e)).finally(() => { this.specSubmitLoading = false }) }).catch(e => console.error(e)).finally(() => { this.specSubmitLoading = false })
}) })
}, },
// 删除规程 // 删除规程
removeSpec(row) { removeSpec(row) {
this.$modal.confirm('确认删除规程"' + row.specName + '"').then(() => { this.$modal.confirm('确认删除规程"' + row.specName + '"').then(() => {
@@ -269,9 +276,9 @@ export default {
this.versionList = [] this.versionList = []
} }
this.loadSpecs() this.loadSpecs()
}).catch(() => {}) }).catch(() => { })
}, },
// 版本对话框 // 版本对话框
openVersionDialog(row) { openVersionDialog(row) {
this.versionForm = row this.versionForm = row
@@ -281,7 +288,7 @@ export default {
this.versionOpen = true this.versionOpen = true
this.$nextTick(() => this.$refs.versionFormRef && this.$refs.versionFormRef.clearValidate()) this.$nextTick(() => this.$refs.versionFormRef && this.$refs.versionFormRef.clearValidate())
}, },
// 提交版本 // 提交版本
submitVersion() { submitVersion() {
this.$refs.versionFormRef.validate(ok => { this.$refs.versionFormRef.validate(ok => {
@@ -297,7 +304,7 @@ export default {
}).catch(e => console.error(e)).finally(() => { this.versionSubmitLoading = false }) }).catch(e => console.error(e)).finally(() => { this.versionSubmitLoading = false })
}) })
}, },
// 删除版本 // 删除版本
removeVersion(row) { removeVersion(row) {
this.$modal.confirm('确认删除版本"' + row.versionCode + '"').then(() => { this.$modal.confirm('确认删除版本"' + row.versionCode + '"').then(() => {
@@ -305,7 +312,7 @@ export default {
}).then(() => { }).then(() => {
this.$modal.msgSuccess('删除成功') this.$modal.msgSuccess('删除成功')
this.loadVersions() this.loadVersions()
}).catch(() => {}) }).catch(() => { })
} }
} }
} }
@@ -370,23 +377,43 @@ export default {
background: #5F7BA0 !important; background: #5F7BA0 !important;
border-color: #5F7BA0 !important; border-color: #5F7BA0 !important;
} }
::v-deep .el-button--primary:hover, ::v-deep .el-button--primary:hover,
::v-deep .el-button--primary:focus { background: #4d6a8e !important; border-color: #4d6a8e !important; } ::v-deep .el-button--primary:focus {
::v-deep .el-button--primary:active { background: #4a6585 !important; border-color: #4a6585 !important; } background: #4d6a8e !important;
::v-deep .el-button--primary.is-disabled { opacity: .5; } border-color: #4d6a8e !important;
}
::v-deep .el-button--primary:active {
background: #4a6585 !important;
border-color: #4a6585 !important;
}
::v-deep .el-button--primary.is-disabled {
opacity: .5;
}
::v-deep .el-button:not(.el-button--primary):not(.el-button--text):not(.el-button--danger) { ::v-deep .el-button:not(.el-button--primary):not(.el-button--text):not(.el-button--danger) {
color: #606266 !important; color: #606266 !important;
background: #fff !important; background: #fff !important;
border-color: #dcdfe6 !important; border-color: #dcdfe6 !important;
} }
::v-deep .el-button:not(.el-button--primary):not(.el-button--text):not(.el-button--danger):hover { ::v-deep .el-button:not(.el-button--primary):not(.el-button--text):not(.el-button--danger):hover {
color: #5F7BA0 !important; color: #5F7BA0 !important;
border-color: #5F7BA0 !important; border-color: #5F7BA0 !important;
} }
::v-deep .el-button--text { background: transparent !important; border-color: transparent !important; } ::v-deep .el-button--text {
::v-deep .el-button--text.btn-danger { color: #f56c6c !important; } background: transparent !important;
border-color: transparent !important;
}
.btn-danger { color: #f56c6c; } ::v-deep .el-button--text.btn-danger {
color: #f56c6c !important;
}
.btn-danger {
color: #f56c6c;
}
</style> </style>