feat(coil): 添加钢卷标签预览功能
在钢卷入库页面新增标签预览功能,用户可查看并打印钢卷标签。添加了相关API调用和弹窗组件,优化了用户体验。
This commit is contained in:
@@ -19,7 +19,8 @@
|
|||||||
<!-- 默认选中今天的收货计划,如果今天还没有收货计划,提醒创建收货计划 -->
|
<!-- 默认选中今天的收货计划,如果今天还没有收货计划,提醒创建收货计划 -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 查找并选择,选择收货计划, 使用远程搜索 -->
|
<!-- 查找并选择,选择收货计划, 使用远程搜索 -->
|
||||||
<el-alert v-if="noPlan" type="warning" title="今天还没有收货计划,点击创建" show-icon @click.native="$router.push('/receive/plan')"></el-alert>
|
<el-alert v-if="noPlan" type="warning" title="今天还没有收货计划,点击创建" show-icon
|
||||||
|
@click.native="$router.push('/receive/plan')"></el-alert>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
@@ -177,6 +178,9 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作">
|
<el-table-column label="操作">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
<el-button size="mini" type="text" icon="el-icon-view" @click="handlePreviewLabel(scope.row)">
|
||||||
|
打印
|
||||||
|
</el-button>
|
||||||
<el-button v-if="scope.row.actionStatus == 0 || scope.row.actionStatus == 1" type="primary"
|
<el-button v-if="scope.row.actionStatus == 0 || scope.row.actionStatus == 1" type="primary"
|
||||||
@click="openReceiptModal(scope.row)" v-loading="buttonLoading">签收</el-button>
|
@click="openReceiptModal(scope.row)" v-loading="buttonLoading">签收</el-button>
|
||||||
<el-button v-if="scope.row.actionStatus == 0 || scope.row.actionStatus == 1" type="danger"
|
<el-button v-if="scope.row.actionStatus == 0 || scope.row.actionStatus == 1" type="danger"
|
||||||
@@ -217,11 +221,16 @@
|
|||||||
<el-button @click="receiptModalVisible = false">取消</el-button>
|
<el-button @click="receiptModalVisible = false">取消</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 标签预览弹窗 -->
|
||||||
|
<el-dialog title="标签预览" :visible.sync="labelRender.visible" append-to-body>
|
||||||
|
<label-render :content="labelRender.data" :labelType="labelRender.type" v-loading="labelRender.loading" />
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getMaterialCoil } from '@/api/wms/coil'
|
import { getMaterialCoil, listMaterialCoil } from '@/api/wms/coil'
|
||||||
import { listPendingAction, delPendingAction, updatePendingAction } from '@/api/wms/pendingAction'
|
import { listPendingAction, delPendingAction, updatePendingAction } from '@/api/wms/pendingAction'
|
||||||
import MaterialSelect from "@/components/KLPService/MaterialSelect";
|
import MaterialSelect from "@/components/KLPService/MaterialSelect";
|
||||||
import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect";
|
import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect";
|
||||||
@@ -231,6 +240,7 @@ import RawMaterialSelect from "@/components/KLPService/RawMaterialSelect";
|
|||||||
import { Pagination } from 'element-ui';
|
import { Pagination } from 'element-ui';
|
||||||
import { listDeliveryPlan } from '@/api/wms/deliveryPlan'
|
import { listDeliveryPlan } from '@/api/wms/deliveryPlan'
|
||||||
import handleCoil, { COIL_ACTIONS } from '../js/coilActions'
|
import handleCoil, { COIL_ACTIONS } from '../js/coilActions'
|
||||||
|
import LabelRender from '../panels/LabelRender/index.vue'
|
||||||
|
|
||||||
// 键值为[400, 500), 不包含在字典中,但后续可以加入的特殊操作,这类操作录入后会立刻完成,例如入库(401)和发货(402)
|
// 键值为[400, 500), 不包含在字典中,但后续可以加入的特殊操作,这类操作录入后会立刻完成,例如入库(401)和发货(402)
|
||||||
|
|
||||||
@@ -241,6 +251,7 @@ export default {
|
|||||||
WarehouseSelect,
|
WarehouseSelect,
|
||||||
ProductSelect,
|
ProductSelect,
|
||||||
RawMaterialSelect,
|
RawMaterialSelect,
|
||||||
|
LabelRender,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -298,6 +309,12 @@ export default {
|
|||||||
{ required: true, message: "毛重不能为空", trigger: "blur" }
|
{ required: true, message: "毛重不能为空", trigger: "blur" }
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
labelRender: {
|
||||||
|
visible: false,
|
||||||
|
data: {},
|
||||||
|
type: '2',
|
||||||
|
loading: false,
|
||||||
|
},
|
||||||
planList: [],
|
planList: [],
|
||||||
noPlan: false,
|
noPlan: false,
|
||||||
// 确认收货表单参数
|
// 确认收货表单参数
|
||||||
@@ -443,6 +460,29 @@ export default {
|
|||||||
this.buttonLoading = false;
|
this.buttonLoading = false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
/** 预览标签 */
|
||||||
|
handlePreviewLabel({ coilId, currentCoilNo, enterCoilNo, itemType }) {
|
||||||
|
this.labelRender.visible = true;
|
||||||
|
this.labelRender.loading = true;
|
||||||
|
listMaterialCoil({ coilId, currentCoilNo, enterCoilNo, itemType }).then(res => {
|
||||||
|
if (res.rows.length === 0) {
|
||||||
|
this.$modal.msgError("钢卷不存在");
|
||||||
|
this.labelRender.visible = false;
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const row = res.rows[0]
|
||||||
|
this.labelRender.loading = false;
|
||||||
|
const item = row.itemType === 'product' ? row.product : row.rawMaterial;
|
||||||
|
const itemName = row.itemType === 'product' ? item?.productName || '' : item?.rawMaterialName || '';
|
||||||
|
this.labelRender.type = row.itemType === 'product' ? '3' : '2'
|
||||||
|
this.labelRender.data = {
|
||||||
|
...row,
|
||||||
|
itemName: itemName,
|
||||||
|
updateTime: row.updateTime?.split(' ')[0] || '',
|
||||||
|
};
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
this.$modal.confirm("确认删除吗?", "删除确认", {
|
this.$modal.confirm("确认删除吗?", "删除确认", {
|
||||||
|
|||||||
Reference in New Issue
Block a user