入库部分和接口
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
"sortablejs": "1.10.2",
|
||||
"splitpanes": "2.4.1",
|
||||
"vue": "2.6.12",
|
||||
"vue-barcode": "^1.3.0",
|
||||
"vue-count-to": "1.0.13",
|
||||
"vue-cropper": "0.5.5",
|
||||
"vue-easy-print": "^0.0.8",
|
||||
|
||||
@@ -25,6 +25,16 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否可用" prop="spare2">
|
||||
<el-select v-model="queryParams.spare2" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_yes_no"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
@@ -91,12 +101,16 @@
|
||||
|
||||
<el-table ref="table" v-loading="loading" :data="traycodeList" @selection-change="handleSelectionChange" max-height="700">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" align="left" prop="id" width="120" />
|
||||
<!-- <el-table-column label="序号" align="center" prop="id" />-->
|
||||
<!-- <el-table-column label="格式ID" align="left" prop="formatName" />-->
|
||||
<el-table-column label="条码" align="left" prop="trayCode" />
|
||||
<el-table-column label="Spare Field 1" align="center" prop="spare1" />
|
||||
<el-table-column label="Spare Field 2" align="center" prop="spare2" />
|
||||
<el-table-column label="Spare Field 3" align="center" prop="spare3" />
|
||||
<el-table-column label="条码" align="center" prop="trayCode" />
|
||||
<!-- <el-table-column label="Spare Field 1" align="center" prop="spare1" />-->
|
||||
<el-table-column label="是否可用" align="center" prop="spare2" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.spare2"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="Spare Field 3" align="center" prop="spare3" />-->
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" >
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
@@ -136,7 +150,7 @@
|
||||
<!-- 添加或修改条码信息对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<!-- <el-form-item label="格式ID" prop="formatId">
|
||||
<el-form-item label="格式ID" prop="formatId">
|
||||
<el-select v-model="form.formatId" placeholder="请选择格式ID">
|
||||
<el-option
|
||||
v-for="item in traycodeFormatList"
|
||||
@@ -145,20 +159,25 @@
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="托盘编码" prop="trayCode">
|
||||
</el-form-item>
|
||||
|
||||
<el-input v-model="form.trayCode" placeholder="请输入托盘编码" />
|
||||
<el-form-item label="数量" prop="spare1" v-if="form.id == null">
|
||||
<el-input v-model="form.spare1" placeholder="请输入数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="Spare Field 1" prop="spare1">
|
||||
<el-input v-model="form.spare1" placeholder="Enter spare field 1" />
|
||||
<el-form-item label="托盘编码" prop="trayCode" v-if="form.id != null" >
|
||||
|
||||
<el-input v-model="form.trayCode" placeholder="请输入托盘编码" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item label="Spare Field 2" prop="spare2">
|
||||
<el-input v-model="form.spare2" placeholder="Enter spare field 2" />
|
||||
<el-form-item label="是否可用" prop="spare2" v-if="form.id != null">
|
||||
<el-select v-model="form.spare2" placeholder="请选择" >
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_yes_no"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="Spare Field 3" prop="spare3">
|
||||
<el-input v-model="form.spare3" placeholder="Enter spare field 3" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确定</el-button>
|
||||
@@ -170,10 +189,13 @@
|
||||
<!-- 打印模板 -->
|
||||
<vue-easy-print v-show="true" ref="easyPrint2">
|
||||
<div v-for="item in printData" :key="item.id" style="page-break-after:always" class="vue-easy-print">
|
||||
<vue-qr :text='item.trayCode' :size="150" :margin="10" :align-item="center" :correctLevel="2"></vue-qr>
|
||||
<div>
|
||||
<span class="num">{{ item.trayCode }}</span>
|
||||
</div>
|
||||
<vue-barcode
|
||||
:value=item.trayCode
|
||||
format="CODE39"
|
||||
width="2"
|
||||
height="100"
|
||||
display-value
|
||||
/>
|
||||
</div>
|
||||
</vue-easy-print>
|
||||
</div>
|
||||
@@ -184,13 +206,15 @@ import { listTraycode, getTraycode, delTraycode, addTraycode, updateTraycode } f
|
||||
import { listTraycodeFormat } from "@/api/bas/traycodeFormat"
|
||||
import vueEasyPrint from 'vue-easy-print'
|
||||
import VueQr from 'vue-qr'
|
||||
|
||||
import VueBarcode from 'vue-barcode'
|
||||
|
||||
export default {
|
||||
name: "Traycode",
|
||||
dicts:['sys_yes_no'],
|
||||
components: {
|
||||
vueEasyPrint,
|
||||
VueQr
|
||||
VueQr,
|
||||
VueBarcode
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -353,10 +377,23 @@ export default {
|
||||
},
|
||||
/** 打印条码 */
|
||||
printBarcode: function (row) {
|
||||
const yesValItem = (this.dict && this.dict.type && this.dict.type.sys_yes_no) ? (this.dict.type.sys_yes_no.find(i => i.label === '是') || this.dict.type.sys_yes_no.find(i => i.value === 'Y' || i.value === '1')) : null
|
||||
const yesVal = yesValItem ? yesValItem.value : 'Y'
|
||||
if (row.spare2 !== yesVal) {
|
||||
this.$modal.msgError("该托盘不可打印:仅“是”可用")
|
||||
return;
|
||||
}
|
||||
this.printData = [row]
|
||||
this.$nextTick(() => {
|
||||
setTimeout(() => {
|
||||
this.$refs.easyPrint2.print()
|
||||
const noValItem = (this.dict && this.dict.type && this.dict.type.sys_yes_no) ? (this.dict.type.sys_yes_no.find(i => i.label === '否') || this.dict.type.sys_yes_no.find(i => i.value === 'N' || i.value === '0')) : null
|
||||
const noVal = noValItem ? noValItem.value : 'N'
|
||||
const data = Object.assign({}, row, { spare2: noVal })
|
||||
updateTraycode(data).then(() => {
|
||||
this.$modal.msgSuccess("打印完成,已标记为不可用")
|
||||
this.getList()
|
||||
}).catch(() => {})
|
||||
}, 100)
|
||||
})
|
||||
},
|
||||
@@ -367,10 +404,27 @@ export default {
|
||||
this.$modal.msgError("请选择要打印的数据项");
|
||||
return;
|
||||
}
|
||||
const yesValItem = (this.dict && this.dict.type && this.dict.type.sys_yes_no) ? (this.dict.type.sys_yes_no.find(i => i.label === '是') || this.dict.type.sys_yes_no.find(i => i.value === 'Y' || i.value === '1')) : null
|
||||
const yesVal = yesValItem ? yesValItem.value : 'Y'
|
||||
const invalid = selection.filter(item => item.spare2 !== yesVal)
|
||||
if (invalid.length > 0) {
|
||||
this.$modal.msgError("存在不可打印项(非“是”),请重新选择")
|
||||
return;
|
||||
}
|
||||
this.printData = selection;
|
||||
this.$nextTick(() => {
|
||||
setTimeout(() => {
|
||||
this.$refs.easyPrint2.print()
|
||||
const noValItem = (this.dict && this.dict.type && this.dict.type.sys_yes_no) ? (this.dict.type.sys_yes_no.find(i => i.label === '否') || this.dict.type.sys_yes_no.find(i => i.value === 'N' || i.value === '0')) : null
|
||||
const noVal = noValItem ? noValItem.value : 'N'
|
||||
const updates = selection.map(item => {
|
||||
const data = Object.assign({}, item, { spare2: noVal })
|
||||
return updateTraycode(data)
|
||||
})
|
||||
Promise.all(updates).then(() => {
|
||||
this.$modal.msgSuccess("批量打印完成,已标记为不可用")
|
||||
this.getList()
|
||||
}).catch(() => {})
|
||||
}, 100)
|
||||
});
|
||||
},
|
||||
@@ -405,7 +459,7 @@ export default {
|
||||
|
||||
@media print {
|
||||
@page {
|
||||
size: A4;
|
||||
size: 80mm 50mm;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user