Merge remote-tracking branch 'origin/0.8.X' into 0.8.X
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
:props="cascaderProps"
|
||||
:placeholder="placeholder"
|
||||
:clearable="clearable && !clearInput"
|
||||
:show-all-levels="true"
|
||||
:show-all-levels="false"
|
||||
:emit-path="true"
|
||||
style="width: 100%;"
|
||||
@change="handleChange"
|
||||
@@ -73,11 +73,16 @@ export default {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 第二2级可以被选中
|
||||
canSelectLevel2: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
canSelectDisabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// ========== 新增核心属性 ==========
|
||||
// 是否展示只读+可清除的输入框,用于将选中名称展示出来和清除为-1操作
|
||||
clearInput: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
@@ -107,7 +112,7 @@ export default {
|
||||
return {
|
||||
lazy: true,
|
||||
lazyLoad: this.loadNode, // 懒加载方法
|
||||
checkStrictly: false, // 只允许选叶子节点
|
||||
checkStrictly: this.canSelectLevel2, // 是否只允许选叶子节点
|
||||
value: 'value',
|
||||
label: 'label',
|
||||
children: 'children'
|
||||
|
||||
@@ -35,8 +35,9 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="实际库区" prop="actualWarehouseId">
|
||||
<actual-warehouse-select v-model="form.actualWarehouseId" placeholder="请选择实际库区" style="width: 100%;"
|
||||
clearable :showEmpty="true" :canSelectDisabled="true" />
|
||||
<actual-warehouse-select v-model="form.actualWarehouseId" placeholder="请选择实际库区"
|
||||
style="width: 100%;" clearable
|
||||
:canSelectDisabled="true" :canSelectLevel2="true" :clearInput="false" :showEmpty="true" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -266,10 +267,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<!-- <div class="card-footer">
|
||||
<el-button v-if="item.dataType == 1" type="primary" icon="el-icon-check" size="mini"
|
||||
@click="handlePickMaterial(item)" :loading="item.picking" class="action-btn">领料</el-button>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -284,7 +285,7 @@
|
||||
|
||||
<script>
|
||||
import { listMaterialCoil } from '@/api/wms/coil'
|
||||
import { listPendingAction, startProcess, cancelAction, delPendingAction, addPendingAction } from '@/api/wms/pendingAction'
|
||||
import { listPendingAction } from '@/api/wms/pendingAction'
|
||||
import { parseTime } from '@/utils/klp'
|
||||
import ProductInfo from '@/components/KLPService/Renderer/ProductInfo'
|
||||
import RawMaterialInfo from '@/components/KLPService/Renderer/RawMaterialInfo'
|
||||
@@ -383,27 +384,6 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 立即加载物料列表(不依赖字典)
|
||||
// this.getMaterialCoil()
|
||||
|
||||
// 尝试加载待操作列表(如果字典已加载)
|
||||
// this.$nextTick(() => {
|
||||
// if (this.acidRollingActionType) {
|
||||
// this.actionQueryParams.actionType = this.acidRollingActionType
|
||||
// this.getPendingAction()
|
||||
// }
|
||||
// })
|
||||
},
|
||||
mounted() {
|
||||
// 确保在mounted时也尝试加载(字典数据可能此时才加载完成)
|
||||
this.$nextTick(() => {
|
||||
if (this.acidRollingActionType && !this.actionQueryParams.actionType) {
|
||||
this.actionQueryParams.actionType = this.acidRollingActionType
|
||||
this.getPendingAction()
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
parseTime,
|
||||
|
||||
@@ -455,41 +435,42 @@ export default {
|
||||
this.handleMaterialQuery()
|
||||
},
|
||||
/** 领料操作 */
|
||||
handlePickMaterial(row) {
|
||||
if (!this.acidRollingActionType) {
|
||||
this.$message.error('未找到酸连轧工序操作类型,请检查字典配置')
|
||||
return
|
||||
}
|
||||
// handlePickMaterial(row) {
|
||||
// if (!this.acidRollingActionType) {
|
||||
// this.$message.error('未找到酸连轧工序操作类型,请检查字典配置')
|
||||
// return
|
||||
// }
|
||||
|
||||
this.$set(row, 'picking', true)
|
||||
// this.$set(row, 'picking', true)
|
||||
|
||||
const pendingData = {
|
||||
coilId: row.coilId,
|
||||
currentCoilNo: row.currentCoilNo,
|
||||
actionType: this.acidRollingActionType,
|
||||
actionStatus: 0, // 待处理
|
||||
sourceType: 'manual', // 手动创建
|
||||
warehouseId: row.warehouseId,
|
||||
priority: 0, // 默认普通优先级
|
||||
remark: `PC端领料创建-酸连轧工序`
|
||||
}
|
||||
// const pendingData = {
|
||||
// coilId: row.coilId,
|
||||
// currentCoilNo: row.currentCoilNo,
|
||||
// actionType: this.acidRollingActionType,
|
||||
// actionStatus: 0, // 待处理
|
||||
// sourceType: 'manual', // 手动创建
|
||||
// warehouseId: row.warehouseId,
|
||||
// priority: 0, // 默认普通优先级
|
||||
// remark: `PC端领料创建-酸连轧工序`
|
||||
// }
|
||||
|
||||
addPendingAction(pendingData).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.$message.success('领料成功,已创建待操作任务')
|
||||
this.getPendingAction() // 刷新待操作列表
|
||||
} else {
|
||||
this.$message.error(response.msg || '领料失败')
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('领料失败:', error)
|
||||
this.$message.error('领料失败,请重试')
|
||||
}).finally(() => {
|
||||
this.$set(row, 'picking', false)
|
||||
})
|
||||
},
|
||||
// addPendingAction(pendingData).then(response => {
|
||||
// if (response.code === 200) {
|
||||
// this.$message.success('领料成功,已创建待操作任务')
|
||||
// this.getPendingAction() // 刷新待操作列表
|
||||
// } else {
|
||||
// this.$message.error(response.msg || '领料失败')
|
||||
// }
|
||||
// }).catch(error => {
|
||||
// console.error('领料失败:', error)
|
||||
// this.$message.error('领料失败,请重试')
|
||||
// }).finally(() => {
|
||||
// this.$set(row, 'picking', false)
|
||||
// })
|
||||
// },
|
||||
|
||||
// ========== 待操作列表相关方法 ==========
|
||||
|
||||
/** 查询待操作列表 */
|
||||
getPendingAction() {
|
||||
// 确保只查询酸连轧工序的待操作
|
||||
@@ -515,113 +496,6 @@ export default {
|
||||
this.actionLoading = false
|
||||
})
|
||||
},
|
||||
/** 待操作搜索 */
|
||||
handleActionQuery() {
|
||||
this.actionQueryParams.pageNum = 1
|
||||
// 确保始终使用酸连轧工序的 actionType
|
||||
if (this.acidRollingActionType) {
|
||||
this.actionQueryParams.actionType = this.acidRollingActionType
|
||||
}
|
||||
this.getPendingAction()
|
||||
},
|
||||
/** 重置待操作搜索 */
|
||||
resetActionQuery() {
|
||||
this.resetForm('actionQueryForm')
|
||||
this.actionQueryParams.currentCoilNo = null
|
||||
this.actionQueryParams.actionStatus = null
|
||||
// 确保始终使用酸连轧工序的 actionType
|
||||
if (this.acidRollingActionType) {
|
||||
this.actionQueryParams.actionType = this.acidRollingActionType
|
||||
}
|
||||
this.handleActionQuery()
|
||||
},
|
||||
/** 处理操作 - 跳转到对应页面 */
|
||||
handleProcess(row) {
|
||||
const actionType = parseInt(row.actionType)
|
||||
|
||||
// 特殊处理:发货和移库操作不需要跳转
|
||||
if (actionType >= 400) {
|
||||
this.$message.info('特殊操作序在对应页面完成')
|
||||
return
|
||||
}
|
||||
|
||||
// 根据操作类型跳转到不同页面
|
||||
let path = ''
|
||||
|
||||
// 分条操作:100-199
|
||||
if (actionType >= 100 && actionType <= 199) {
|
||||
path = '/wms/split'
|
||||
}
|
||||
// 合卷操作:200-299
|
||||
else if (actionType == 200) {
|
||||
path = '/wms/merge'
|
||||
}
|
||||
// 其他操作类型
|
||||
else {
|
||||
path = '/wms/typing'
|
||||
}
|
||||
|
||||
if (!path) {
|
||||
this.$message.error('未知的操作类型: ' + row.actionType)
|
||||
return
|
||||
}
|
||||
|
||||
// 更新状态为处理中
|
||||
startProcess(row.actionId).then(response => {
|
||||
if (response.code !== 200) {
|
||||
this.$message.error(response.msg || '更新状态失败')
|
||||
return
|
||||
}
|
||||
|
||||
// 跳转并传递参数
|
||||
this.$router.push({
|
||||
path: path,
|
||||
query: {
|
||||
coilId: row.coilId,
|
||||
actionId: row.actionId
|
||||
}
|
||||
})
|
||||
}).catch(error => {
|
||||
console.error('更新状态失败:', error)
|
||||
this.$message.error('更新状态失败: ' + (error.message || error))
|
||||
})
|
||||
},
|
||||
/** 取消操作 */
|
||||
handleCancel(row) {
|
||||
this.$confirm('是否确认取消该操作?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
return cancelAction(row.actionId)
|
||||
}).then(() => {
|
||||
this.$message.success('操作已取消')
|
||||
this.getPendingAction()
|
||||
}).catch(() => { })
|
||||
},
|
||||
/** 删除待操作 */
|
||||
handleDeleteAction(row) {
|
||||
const actionId = row.actionId
|
||||
this.$confirm('是否确认删除该待操作记录?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
return delPendingAction(actionId)
|
||||
}).then(() => {
|
||||
this.getPendingAction()
|
||||
this.$message.success('删除成功')
|
||||
}).catch(() => { })
|
||||
},
|
||||
/** 获取物品名称 */
|
||||
getItemName(item) {
|
||||
if (item.itemType === 'product' && item.product) {
|
||||
return item.product.productName || ''
|
||||
} else if (item.itemType === 'raw_material' && item.rawMaterial) {
|
||||
return item.rawMaterial.rawMaterialName || ''
|
||||
}
|
||||
return '—'
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<div class="label-container" :style="{ '--print-scale': printScale }">
|
||||
<!-- 顶部公司信息 -->
|
||||
<div class="label-box">
|
||||
<!-- 顶部公司信息 -->
|
||||
<div class="company-header">
|
||||
<img :src="logo" alt="Company Logo" class="company-logo" />
|
||||
<div class="company-name">
|
||||
@@ -109,6 +110,8 @@
|
||||
<QRCode :content="content.qrcodeRecordId || ''" :size="90" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -280,17 +283,29 @@ export default {
|
||||
|
||||
<style scoped>
|
||||
.label-container {
|
||||
padding: 1em;
|
||||
/* width: 680.315px; */
|
||||
/* height: 377.953px; */
|
||||
/* width: fit-content;
|
||||
height: fit-content; */
|
||||
/* 减少内边距,避免生成PDF时上下留白不一致 */
|
||||
/* padding: 0.1em;
|
||||
font-size: 12px;
|
||||
border: 1px solid #000;
|
||||
box-sizing: border-box;
|
||||
font-family: 'Arial', sans-serif; */
|
||||
/* border: 1px solid #000; */
|
||||
}
|
||||
|
||||
.label-box {
|
||||
width: fit-content;
|
||||
height: fit-content;
|
||||
/* 减少内边距,避免生成PDF时上下留白不一致 */
|
||||
/* margin: 1em; */
|
||||
padding: 0.1em;
|
||||
font-size: 12px;
|
||||
border: 1px solid #000;
|
||||
box-sizing: border-box;
|
||||
font-family: 'Arial', sans-serif;
|
||||
/* border: 1px solid #000; */
|
||||
}
|
||||
|
||||
.company-header {
|
||||
|
||||
@@ -20,6 +20,12 @@
|
||||
style="width: 100%; display: inline-block;" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="实际库区" prop="actualWarehouseId" v-if="!hideWarehouseQuery">
|
||||
<actual-warehouse-select v-model="queryParams.actualWarehouseId" placeholder="请选择仓库/库区/库位"
|
||||
style="width: 100%; display: inline-block;" clearable
|
||||
:canSelectDisabled="true" :canSelectLevel2="true" :clearInput="false" :showEmpty="true"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="产品名称" prop="itemName">
|
||||
<muti-select v-model="queryParams.itemName" :options="dict.type.coil_itemname" placeholder="请选择物料" clearable />
|
||||
</el-form-item>
|
||||
@@ -602,7 +608,9 @@ export default {
|
||||
itemName: itemName,
|
||||
updateTime: row.updateTime?.split(' ')[0] || '',
|
||||
};
|
||||
this.$refs.labelRender.printLabel();
|
||||
this.$nextTick(() => {
|
||||
this.$refs.labelRender.printLabel();
|
||||
})
|
||||
},
|
||||
// 处理材料类型变化
|
||||
handleMaterialTypeChange(value) {
|
||||
|
||||
@@ -177,7 +177,6 @@ export default {
|
||||
pageNum: 1,
|
||||
dataType: 1,
|
||||
createBy: 'suanzhakuguan',
|
||||
// updateBy: 'suanzhakuguan',
|
||||
warehouseId: '1988150099140866050'
|
||||
}),
|
||||
// 镀锌原料库
|
||||
@@ -187,7 +186,6 @@ export default {
|
||||
pageNum: 1,
|
||||
dataType: 1,
|
||||
createBy: 'suanzhakuguan',
|
||||
// updateBy: 'suanzhakuguan',
|
||||
warehouseId: '1988150263284953089'
|
||||
}),
|
||||
// 脱脂原料库
|
||||
@@ -217,32 +215,6 @@ export default {
|
||||
)
|
||||
this.loading = false
|
||||
})
|
||||
// listPendingAction({
|
||||
// // actionStatus: 2,
|
||||
// actionType: 11,
|
||||
// pageSize: 999,
|
||||
// pageNum: 1,
|
||||
// startTime: this.queryParams.startTime,
|
||||
// endTime: this.queryParams.endTime,
|
||||
// }).then(res => {
|
||||
// const actions = res.rows
|
||||
// const coilIds = actions.map(item => item.coilId).join(',')
|
||||
// console.log(coilIds)
|
||||
// if (!coilIds) {
|
||||
// this.$message({
|
||||
// message: '暂无数据',
|
||||
// type: 'warning',
|
||||
// })
|
||||
// this.loading = false
|
||||
// return
|
||||
// }
|
||||
// listCoilWithIds({
|
||||
// coilIds: coilIds,
|
||||
// }).then(res => {
|
||||
// this.list = res.rows
|
||||
// this.loading = false
|
||||
// })
|
||||
// })
|
||||
},
|
||||
// 导出
|
||||
exportData() {
|
||||
|
||||
Reference in New Issue
Block a user