This commit is contained in:
张怡蓉
2025-10-22 10:57:18 +08:00
parent 727d57b3c5
commit 1483019e1f
25 changed files with 1042 additions and 357 deletions

View File

@@ -33,7 +33,7 @@
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="一层入库锁" prop="inLocked">
<el-form-item label="北入库锁" prop="inLocked">
<el-select v-model="queryParams.inLocked" placeholder="请选择一层入库锁" clearable>
<el-option
v-for="dict in dict.type.roadway_lock"
@@ -43,7 +43,7 @@
/>
</el-select>
</el-form-item>
<el-form-item label="一层出库锁" prop="outLocked">
<el-form-item label="北出库锁" prop="outLocked">
<el-select v-model="queryParams.outLocked" placeholder="请选择一层出库锁" clearable>
<el-option
v-for="dict in dict.type.roadway_lock"
@@ -53,7 +53,7 @@
/>
</el-select>
</el-form-item>
<el-form-item label="二层入库锁" prop="inLocked2">
<el-form-item label="南入库锁" prop="inLocked2">
<el-select v-model="queryParams.inLocked2" placeholder="请选择二层入库锁" clearable>
<el-option
v-for="dict in dict.type.roadway_lock"
@@ -63,7 +63,7 @@
/>
</el-select>
</el-form-item>
<el-form-item label="二层出库锁" prop="outLocked2">
<el-form-item label="南出库锁" prop="outLocked2">
<el-select v-model="queryParams.outLocked2" placeholder="请选择二层出库锁" clearable>
<el-option
v-for="dict in dict.type.roadway_lock"
@@ -131,22 +131,22 @@
<!-- <el-table-column label="仓库id" align="center" prop="warehouseId" />-->
<el-table-column label="巷道名称" align="center" prop="roadwayName" />
<!-- <el-table-column label="设备id" align="center" prop="deviceId" />-->
<el-table-column label="一层入库锁" align="center" prop="inLocked">
<el-table-column label="北入库锁" align="center" prop="inLocked">
<template slot-scope="scope">
<dict-tag :options="dict.type.roadway_lock" :value="scope.row.inLocked"/>
</template>
</el-table-column>
<el-table-column label="一层出库锁" align="center" prop="outLocked">
<el-table-column label="北出库锁" align="center" prop="outLocked">
<template slot-scope="scope">
<dict-tag :options="dict.type.roadway_lock" :value="scope.row.outLocked"/>
</template>
</el-table-column>
<el-table-column label="二层入库锁" align="center" prop="inLocked2">
<el-table-column label="南入库锁" align="center" prop="inLocked2">
<template slot-scope="scope">
<dict-tag :options="dict.type.roadway_lock" :value="scope.row.inLocked2"/>
</template>
</el-table-column>
<el-table-column label="二层出库锁" align="center" prop="outLocked2">
<el-table-column label="南出库锁" align="center" prop="outLocked2">
<template slot-scope="scope">
<dict-tag :options="dict.type.roadway_lock" :value="scope.row.outLocked2"/>
</template>
@@ -183,10 +183,7 @@
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="巷道号" prop="roadwayId">
<el-input v-model="form.roadwayId" placeholder="请输入巷道号" />
</el-form-item>
<el-form-item label="仓库id" prop="warehouseId">
<el-input v-model="form.warehouseId" placeholder="请输入仓库id" />
<el-input v-model="form.roadwayId" placeholder="请输入巷道号" :disabled="form.id != null" />
</el-form-item>
<el-form-item label="巷道名称" prop="roadwayName">
<el-input v-model="form.roadwayName" placeholder="请输入巷道名称" />
@@ -194,8 +191,8 @@
<el-form-item label="设备id" prop="deviceId">
<el-input v-model="form.deviceId" placeholder="请输入设备id" />
</el-form-item>
<el-form-item label="一层入库锁" prop="inLocked">
<el-select v-model="form.inLocked" placeholder="请选择一层入库锁">
<el-form-item label="北入库锁" prop="inLocked">
<el-select v-model="form.inLocked" placeholder="请选择北入库锁">
<el-option
v-for="dict in dict.type.roadway_lock"
:key="dict.value"
@@ -204,8 +201,8 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="一层出库锁" prop="outLocked">
<el-select v-model="form.outLocked" placeholder="请选择一层出库锁">
<el-form-item label="北出库锁" prop="outLocked">
<el-select v-model="form.outLocked" placeholder="请选择北出库锁">
<el-option
v-for="dict in dict.type.roadway_lock"
:key="dict.value"
@@ -214,8 +211,8 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="二层入库锁" prop="inLocked2">
<el-select v-model="form.inLocked2" placeholder="请选择二层入库锁">
<el-form-item label="南入库锁" prop="inLocked2">
<el-select v-model="form.inLocked2" placeholder="请选择南入库锁">
<el-option
v-for="dict in dict.type.roadway_lock"
:key="dict.value"
@@ -224,8 +221,8 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="二层出库锁" prop="outLocked2">
<el-select v-model="form.outLocked2" placeholder="请选择二层出库锁">
<el-form-item label="南出库锁" prop="outLocked2">
<el-select v-model="form.outLocked2" placeholder="请选择南出库锁">
<el-option
v-for="dict in dict.type.roadway_lock"
:key="dict.value"
@@ -286,26 +283,26 @@ export default {
form: {},
// 表单校验
rules: {
id: [
{ required: true, message: "id不能为空", trigger: "blur" }
],
// id: [
// { required: true, message: "id不能为空", trigger: "blur" }
// ],
roadwayId: [
{ required: true, message: "巷道号不能为空", trigger: "blur" }
],
warehouseId: [
{ required: true, message: "仓库id不能为空", trigger: "blur" }
],
// warehouseId: [
// { required: true, message: "仓库id不能为空", trigger: "blur" }
// ],
inLocked: [
{ required: true, message: "一层入库锁不能为空", trigger: "change" }
{ required: true, message: "北入库锁不能为空", trigger: "change" }
],
outLocked: [
{ required: true, message: "一层出库锁不能为空", trigger: "change" }
{ required: true, message: "北出库锁不能为空", trigger: "change" }
],
inLocked2: [
{ required: true, message: "二层入库锁不能为空", trigger: "change" }
{ required: true, message: "南入库锁不能为空", trigger: "change" }
],
outLocked2: [
{ required: true, message: "二层出库锁不能为空", trigger: "change" }
{ required: true, message: "南出库锁不能为空", trigger: "change" }
]
}
}
@@ -356,6 +353,7 @@ export default {
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.roadwayIds = selection.map(item => item.roadwayId)
this.single = selection.length!==1
this.multiple = !selection.length
},
@@ -398,7 +396,8 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids
this.$modal.confirm('是否确认删除巷道管理编号为"' + ids + '"的数据项?').then(function() {
const roadwayIds= row.roadwayId || this.roadwayIds
this.$modal.confirm('是否确认删除巷道管理编号为"' + roadwayIds + '"的数据项?').then(function() {
return delRoadway(ids)
}).then(() => {
this.getList()

View File

@@ -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
@@ -146,19 +160,24 @@
/>
</el-select>
</el-form-item>-->
<el-form-item label="托盘编码" prop="trayCode">
<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>
@@ -188,6 +207,7 @@ import VueQr from 'vue-qr'
export default {
name: "Traycode",
dicts:['sys_yes_no'],
components: {
vueEasyPrint,
VueQr
@@ -353,10 +373,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 +400,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)
});
},

View File

@@ -22,13 +22,11 @@
/>
</el-select>
</el-form-item>
<el-form-item :label="'客户'" prop="customerNo" required><!--客户-->
<el-form-item :label="'备注'" prop="remark"><!--客户-->
<el-input
v-model="formData.customerName"
:placeholder="'请输入客户编号'"
v-model="formData.remark"
:placeholder="'请输入备注'"
clearable
@click.native="openCustomerSelector"
readonly
/>
</el-form-item>
@@ -47,26 +45,76 @@
<el-table v-loading="loading" :data="materialList">
<el-table-column label="物料编码" align="center" prop="productId" /><!--物资编号-->
<el-table-column label="物料名称" align="center" prop="productName" /><!--物资名称-->
<el-table-column label="批次号" align="center" prop="lotNo" />
<el-table-column label="订单号" align="center" prop="orderId" />
<el-table-column label="序列号" align="center" prop="printDate" />
<!-- <el-table-column :label="$t('addOutStockout.batchNo')" align="left" prop="lotNo" />&lt;!&ndash;批号&ndash;&gt;-->
<el-table-column label="批次" align="center" prop="lotNo" />
<el-table-column label="规格型号" align="center" prop="productSpec" />
<el-table-column label="管理号" align="center" prop="fid" />
<el-table-column label="供应商" align="center" prop="supplierName" />
<!-- <el-table-column label="客户编码" align="center" prop="outId" />-->
<el-table-column label="客户名称" align="center" prop="customerName" width="230">
<template slot-scope="scope">
<el-input
v-model="scope.row.customerName"
placeholder="点击选择客户"
readonly
size="mini"
@focus="openRowCustomerSelector(scope.row)"
/>
</template>
</el-table-column>
<el-table-column :label="'数量'" align="center" prop="quantity" width="150"><!--数量-->
<template slot-scope="scope">
<el-input-number v-model="scope.row.quantity" :min="1" size="mini" @change="handleQuantityChange(scope.row)" />
</template>
</el-table-column>
<el-table-column label="规格" align="center" prop="spec" />
<el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="型号" align="center" prop="cargoNo" />
<el-table-column label="颜色" align="center" prop="price" />
<el-table-column label="电压" align="center" prop="voltage" />
<el-table-column label="功率" align="center" prop="power" />
<el-table-column label="相位" align="center" prop="phase" />
<el-table-column label="净重" align="center" prop="netWeight" />
<el-table-column label="毛重" align="center" prop="grossWeight" />
<el-table-column label="分销" align="center" prop="distribution" />
<el-table-column label="机型" align="center" prop="model" />
<el-table-column label="状态" align="center" prop="spec">
<template slot-scope="scope">
<dict-tag :options="dict.type.turnover_type" :value="scope.row.spec"/>
</template>
</el-table-column>
<el-table-column label="来源" align="center" prop="unit" >
<template slot-scope="scope">
<dict-tag :options="dict.type.origin_type" :value="scope.row.unit"/>
</template>
</el-table-column>
<el-table-column label="合同号" align="center" prop="cargoNo" />
<el-table-column label="入库单价" align="center" prop="price" />
<el-table-column label="产品质量" align="center" prop="voltage" >
<template slot-scope="scope">
<dict-tag :options="dict.type.quality_type" :value="scope.row.voltage"/>
</template>
</el-table-column>
<el-table-column label="台次" align="center" prop="power" />
<el-table-column label="件次" align="center" prop="phase" />
<el-table-column label="用途" align="center" prop="model" >
<template slot-scope="scope">
<dict-tag :options="dict.type.purpose_type" :value="scope.row.model"/>
</template>
</el-table-column>
<el-table-column label="套账" align="center" prop="entryid" >
<template slot-scope="scope">
<dict-tag :options="dict.type.account_type" :value="scope.row.entryid"/>
</template>
</el-table-column>
<el-table-column label="单位" align="center" prop="productUnit" />
<el-table-column label="图号" align="center" prop="productDrawNo" />
<el-table-column label="仓库" align="center" prop="warehouseId" >
<template slot-scope="scope">
<dict-tag :options="dict.type.warehouse" :value="scope.row.warehouseId"/>
</template>
</el-table-column>
<el-table-column label="物料状态" align="center" prop="productStatus" >
<template slot-scope="scope">
<dict-tag :options="dict.type.product_type" :value="scope.row.productStatus"/>
</template>
</el-table-column>
<el-table-column label="常用编码" align="center" prop="parentId" />
<el-table-column label="是否启用" align="center" prop="isUsed" >
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.isUsed"/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="创建用户" align="center" prop="createSys" />
<el-table-column :label="'操作'" align="center" class-name="small-padding fixed-width"><!--操作-->
<template slot-scope="scope">
@@ -95,32 +143,55 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="规格" prop="spare1">
<el-input v-model="queryParams.spare1" placeholder="请输入规格"
clearable
@keyup.enter.native="handleQuery"/>
<el-form-item label="批次" prop="lotNo">
<el-input
v-model="queryParams.lotNo"
placeholder="请输入批次"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="单位" prop="spare3">
<el-input v-model="queryParams.spare3" placeholder="请输入单位"
clearable
@keyup.enter.native="handleQuery"/>
<el-form-item label="供应商" prop="supplierName">
<el-input
v-model="queryParams.supplierName"
placeholder="点击选择供应商"
readonly
size="small"
@focus="openSupplierSelector"
/>
</el-form-item>
<el-form-item label="型号" prop="spare4">
<el-input v-model="queryParams.spare4" placeholder="请输入型号"
clearable
@keyup.enter.native="handleQuery"/>
<el-form-item label="管理号" prop="distribution">
<el-input
v-model="queryParams.distribution"
placeholder="请输入管理号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="序列号" prop="spare6">
<el-input v-model="queryParams.spare6" placeholder="请输入序列号"
clearable
@keyup.enter.native="handleQuery"/>
</el-form-item>-->
<el-form-item label="订单号" prop="orderId">
<el-input v-model="queryParams.orderId" placeholder="请输入订单号"
clearable
@keyup.enter.native="handleQuery"/>
<el-form-item label="合同号" prop="orderId">
<el-input
v-model="queryParams.orderId"
placeholder="请输入合同号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="规格型号" prop="spec">
<el-input
v-model="queryParams.spec"
placeholder="请输入规格型号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="图号" prop="cargoNo">
<el-input
v-model="queryParams.cargoNo"
placeholder="请输入图号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{'搜索'}}<!--搜索--></el-button>
@@ -131,24 +202,64 @@
<el-table v-loading="materialLoading" :data="materialOptions" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" prop="onlyIdentity" />
<el-table-column label="订单号" align="center" prop="orderId" />
<el-table-column label="物料编码" align="center" prop="productId" />
<el-table-column label="批次号" align="center" prop="lotNo" />
<el-table-column label="批次" align="center" prop="lotNo" />
<el-table-column label="物料名称" align="center" prop="productName" />
<el-table-column label="数量" align="center" prop="quantity" />
<!-- <el-table-column label="仓库" align="center" prop="warehouseId" />-->
<el-table-column label="规格" align="center" prop="spare1" />
<el-table-column label="单位" align="center" prop="spare3" />
<el-table-column label="型号" align="center" prop="spare4" />
<el-table-column label="颜色" align="center" prop="spare5" />
<el-table-column label="序列号" align="center" prop="spare6" />
<el-table-column label="电压" align="center" prop="voltage" />
<el-table-column label="功率" align="center" prop="power" />
<el-table-column label="相位" align="center" prop="phase" />
<el-table-column label="净重" align="center" prop="netWeight" />
<el-table-column label="毛重" align="center" prop="grossWeight" />
<el-table-column label="分销" align="center" prop="distribution" />
<el-table-column label="机型" align="center" prop="model" />
<el-table-column label="规格型号" align="center" prop="spec" />
<el-table-column label="图号" align="center" prop="cargoNo" />
<el-table-column label="库存数量" align="center" prop="quantity" />
<el-table-column label="仓库" align="center" prop="warehouseId" >
<template slot-scope="scope">
<dict-tag :options="dict.type.warehouse" :value="scope.row.warehouseId"/>
</template>
</el-table-column>
<el-table-column label="来源" align="center" prop="spare1">
<template slot-scope="scope">
<dict-tag :options="dict.type.origin_type" :value="scope.row.spare1"/>
</template>
</el-table-column>
<el-table-column label="套账" align="center" prop="spare3">
<template slot-scope="scope">
<dict-tag :options="dict.type.account_type" :value="scope.row.spare3"/>
</template>
</el-table-column>
<el-table-column label="用途" align="center" prop="spare4">
<template slot-scope="scope">
<dict-tag :options="dict.type.purpose_type" :value="scope.row.spare4"/>
</template>
</el-table-column>
<el-table-column label="台次" align="center" prop="spare5" />
<el-table-column label="入库单价" align="center" prop="spare6" />
<el-table-column label="状态" align="center" prop="voltage">
<template slot-scope="scope">
<dict-tag :options="dict.type.turnover_type" :value="scope.row.voltage"/>
</template>
</el-table-column>
<el-table-column label="件次" align="center" prop="power" />
<!-- <el-table-column label="供应商" align="center" prop="phase" />-->
<el-table-column label="供应商" align="center" prop="supplierName" />
<el-table-column label="管理号" align="center" prop="distribution" />
<el-table-column label="合同号" align="center" prop="orderId" />
<el-table-column label="质量等级" align="center" prop="spare8">
<template slot-scope="scope">
<dict-tag :options="dict.type.quality_type" :value="scope.row.spare8"/>
</template>
</el-table-column>
<el-table-column label="单价" align="center" prop="price" />
<el-table-column label="物料状态" align="center" prop="productStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.product_type" :value="scope.row.productStatus"/>
</template>
</el-table-column>
<el-table-column label="常用编码" align="center" prop="parentId" />
<el-table-column label="启用标识" align="center" prop="spare7">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.spare7"/>
</template>
</el-table-column>
<el-table-column label="创建用户" align="center" prop="createSys" />
<el-table-column label="单位" align="center" prop="unit" />
</el-table>
<pagination
@@ -214,6 +325,55 @@
<el-button @click="cancelSelectCustomer">取消<!--取 消--></el-button>
</div>
</el-dialog>
<!-- 选择供应商弹窗 -->
<el-dialog :title="'选择供应商'" :visible.sync="supplierDialog" width="800px" append-to-body>
<el-form :model="supplierQueryParams" ref="supplierQueryForm" size="small" :inline="true" label-width="100px">
<el-form-item :label="'供应商编号'" prop="supplierNo">
<el-input
v-model="supplierQueryParams.supplierNo"
:placeholder="'请输入供应商编号'"
clearable
@keyup.enter.native="handleSupplierQuery"
/>
</el-form-item>
<el-form-item :label="'供应商名称'" prop="supplierName">
<el-input
v-model="supplierQueryParams.supplierName"
:placeholder="'请输入供应商名称'"
clearable
@keyup.enter.native="handleSupplierQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleSupplierQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetSupplierQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table ref="supplierTable" v-loading="supplierLoading" :data="supplierList" @row-click="handleSupplierRowClick" highlight-current-row>
<el-table-column :label="'供应商编号'" align="left" prop="supplierNo" />
<el-table-column :label="'供应商名称'" align="left" prop="supplierName" />
<el-table-column :label="'是否可用'" align="left" prop="useable">
<template slot-scope="scope">
<dict-tag :options="dict.type.is_available" :value="scope.row.useable"/>
</template>
</el-table-column>
</el-table>
<pagination
v-show="supplierTotal > 0"
:total="supplierTotal"
:page.sync="supplierQueryParams.pageNum"
:limit.sync="supplierQueryParams.pageSize"
@pagination="getSupplierListForDialog"
/>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirmSelectSupplier">确定</el-button>
<el-button @click="cancelSelectSupplier">取消</el-button>
</div>
</el-dialog>
</div>
</template>
@@ -222,10 +382,11 @@ import { listProductAndStock,saveOutStock } from "@/api/out/outStockout";
import {listWarehouse} from "@/api/bas/warehouse";
import { listBasCustomer } from "@/api/bas/BasCustomer";
import Pagination from "@/components/Pagination";
import { listBasSupplier } from "@/api/bas/BasSupplier";
export default {
name: "AddOutStock",
dicts: ['out_bill_type', 'bill_status', 'is_available'],
dicts: ['out_bill_type', 'bill_status', 'is_available', 'product_type', 'quality_type', 'turnover_type', 'sys_yes_no','account_type','origin_type','purpose_type','warehouse'],
components: {
Pagination
},
@@ -243,9 +404,9 @@ export default {
// warehouseId: [
// { required: true, message: '请选择仓库', trigger: "change" }
// ],
customerNo: [
{ required: true, message: '请输入客户编号', trigger: "blur" }
],
// customerNo: [
// { required: true, message: '请输入客户编号', trigger: "blur" }
// ],
outType: [
{ required: true, message: '请选择单据类型', trigger: "change" }
]
@@ -255,7 +416,8 @@ export default {
// warehouseId: null,
customerNo: null,
customerName: null, // 添加客户名称字段,用于显示
outType: null
outType: null,
remark:null
},
// 仓库选项
warehouseOptions: [],
@@ -297,6 +459,8 @@ export default {
customerList: [],
// 当前选中的客户
selectedCustomer: null,
// 当前正在编辑客户的物资行
selectedRowForCustomer: null,
// 客户查询参数
customerQueryParams: {
pageNum: 1,
@@ -304,6 +468,23 @@ export default {
customerNo: null,
customerName: null,
useable: '1' // 默认只查询可用的客户
},
// 供应商选择弹窗
supplierDialog: false,
// 供应商列表数据
supplierList: [],
// 当前选中的供应商
selectedSupplier: null,
// 供应商加载状态与总数
supplierLoading: false,
supplierTotal: 0,
// 供应商查询参数
supplierQueryParams: {
pageNum: 1,
pageSize: 10,
supplierNo: null,
supplierName: null,
useable: '1' // 默认只查询可用的供应商
}
};
},
@@ -321,8 +502,15 @@ export default {
this.warehouseOptions = response.rows;
});
},
/** 打开客户选择弹窗 */
/** 打开客户选择弹窗(全局) */
openCustomerSelector() {
this.selectedRowForCustomer = null;
this.customerDialog = true;
this.getCustomerList();
},
/** 打开客户选择弹窗(行级) */
openRowCustomerSelector(row) {
this.selectedRowForCustomer = row;
this.customerDialog = true;
this.getCustomerList();
},
@@ -357,15 +545,69 @@ export default {
this.$modal.msgError('请选择客户');
return;
}
this.formData.customerNo = this.selectedCustomer.customerNo;
this.formData.customerName = this.selectedCustomer.customerName;
// 如果是行级编辑,赋值到该行;否则赋值到主表
if (this.selectedRowForCustomer) {
this.$set(this.selectedRowForCustomer, 'outId', this.selectedCustomer.customerNo);
this.$set(this.selectedRowForCustomer, 'customerName', this.selectedCustomer.customerName);
} else {
this.formData.customerNo = this.selectedCustomer.customerNo;
this.formData.customerName = this.selectedCustomer.customerName;
}
this.customerDialog = false;
this.selectedCustomer = null;
this.selectedRowForCustomer = null;
},
/** 取消选择客户 */
cancelSelectCustomer() {
this.selectedCustomer = null;
this.selectedRowForCustomer = null;
this.customerDialog = false;
},
/** 打开供应商选择弹窗 */
openSupplierSelector() {
this.getSupplierListForDialog();
this.supplierDialog = true;
},
/** 获取供应商列表(对话框数据) */
getSupplierListForDialog() {
this.supplierLoading = true;
listBasSupplier(this.supplierQueryParams).then(response => {
this.supplierList = response.rows;
this.supplierTotal = response.total;
this.supplierLoading = false;
});
},
/** 供应商查询 */
handleSupplierQuery() {
this.supplierQueryParams.pageNum = 1;
this.getSupplierListForDialog();
},
/** 重置供应商查询 */
resetSupplierQuery() {
this.resetForm("supplierQueryForm");
this.supplierQueryParams.useable = '1';
this.handleSupplierQuery();
},
/** 供应商行点击事件 */
handleSupplierRowClick(row) {
this.selectedSupplier = row;
this.$refs['supplierTable']?.setCurrentRow(row);
},
/** 确认选择供应商 */
confirmSelectSupplier() {
if (!this.selectedSupplier) {
this.$modal.msgError('请选择供应商');
return;
}
this.queryParams.supplierName = this.selectedSupplier.supplierName;
this.queryParams.phase = this.selectedSupplier.supplierNo;
this.supplierDialog = false;
},
/** 取消选择供应商 */
cancelSelectSupplier() {
this.selectedSupplier = null;
this.supplierDialog = false;
},
/** 打开选择物资弹窗 */
handleSelectMaterials() {
// if (!this.formData.warehouseId) {
@@ -411,22 +653,32 @@ export default {
productName: item.productName,
quantity: item.quantity,
quantityOrignal: item.quantity,
voltage: item.voltage,
phase: item.phase,
power: item.power,
netWeight: item.netWeight,
grossWeight: item.grossWeight,
distribution: item.distribution,
model: item.model,
orderId: item.orderId,
unit: item.spare3,
spec: item.spare1,
cargoNo: item.spare4,
printDate:item.spare6,
price:item.spare5,
spec: item.voltage,
supplierId: item.phase,
supplierName: item.supplierName,
phase: item.power,
fid: item.distribution,
cargoNo: item.orderId,
entryid: item.spare3,
unit: item.spare1,
model: item.spare4,
price:item.spare6,
power:item.spare5,
warehouseId: item.warehouseId,
lotNo: item.lotNo,
onlyIdentity: item.onlyIdentity
voltage:item.spare8,
onlyIdentity: item.onlyIdentity,
productPrice:item.price,
productSpec:item.spec,
productUnit:item.unit,
productDrawNo:item.cargoNo,
productStatus:item.productStatus,
parentId: item.parentId,
isUsed:item.spare7,
createTime: item.createTime,
createSys:item.createSys
}))
);
this.materialDialog = false;

View File

@@ -146,10 +146,11 @@
<dict-tag :options="dict.type.out_bill_status" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column :label="'出口'" align="left" prop="exitId" />
<el-table-column :label="'客户编码'" align="left" prop="customerNo" /><!-- 客户编码 -->
<el-table-column :label="'客户名称'" align="left" prop="customerName" />
<!-- <el-table-column :label="'出口'" align="left" prop="exitId" />-->
<!-- <el-table-column :label="'客户编码'" align="left" prop="customerNo" />&lt;!&ndash; 客户编码 &ndash;&gt;-->
<!-- <el-table-column :label="'客户名称'" align="left" prop="customerName" />-->
<el-table-column :label="'建单人'" align="left" prop="createManId" /> <!-- 建单人 -->
<el-table-column :label="'备注'" align="center" prop="remark" /> <!-- 备注 -->
<el-table-column :label="'创建时间'" align="left" prop="createDate" /><!-- 创建时间 -->
<el-table-column :label="'开始时间'" align="left" prop="startDate" /><!-- 开始时间 -->
<el-table-column :label="'确认时间'" align="left" prop="finishDate" /> <!-- 确认时间 -->
@@ -170,24 +171,65 @@
<el-table-column :label="'出库子单编号'" align="center" prop="stockoutDetailId" width="160" /> <!-- 出库子单编号 -->
<el-table-column :label="'物料编码'" align="center" prop="productId" /> <!-- 物资编码 -->
<el-table-column :label="'物料名称'" align="center" prop="productName" />
<el-table-column :label="'批次号'" align="center" prop="lotNo"/><!--英文描述-->
<el-table-column :label="'序列号'" align="center" prop="printDate" /> <!--序列号-->
<el-table-column label="订单号" align="center" prop="orderId" width="160" />
<el-table-column :label="'批次'" align="center" prop="lotNo"/><!--英文描述-->
<el-table-column label="规格型号" align="center" prop="productSpec" />
<el-table-column label="供应商" align="center" prop="supplierName" />
<el-table-column label="客户" align="center" prop="customerName" />
<el-table-column :label="'计划数量'" align="center" prop="quantity" /> <!-- 计划数量 -->
<el-table-column :label="'分配数量'" align="center" prop="allotQuantity" /> <!-- 分配数量 -->
<el-table-column :label="'实际数量'" align="center" prop="assignNum" /> <!-- 实际数量 -->
<el-table-column :label="'颜色'" align="center" prop="price"/><!--箱号-->
<el-table-column :label="'单位'" align="center" prop="unit"/><!--单位-->
<el-table-column :label="'规格'" align="center" prop="spec" /> <!--规格-->
<el-table-column :label="'型号'" align="center" prop="cargoNo" /> <!--型号-->
<el-table-column label="电压" align="center" prop="voltage" />
<el-table-column label="功率" align="center" prop="power" />
<el-table-column label="相位" align="center" prop="phase" />
<el-table-column label="净重" align="center" prop="netWeight" />
<el-table-column label="毛重" align="center" prop="grossWeight" />
<el-table-column label="分销" align="center" prop="distribution" />
<el-table-column label="机型" align="center" prop="model" />
<el-table-column :label="'备注'" align="center" prop="remark" /> <!-- 备注 -->
<el-table-column :label="'入库单价'" align="center" prop="price"/><!--箱号-->
<el-table-column :label="'来源'" align="center" prop="unit">
<template slot-scope="scope">
<dict-tag :options="dict.type.origin_type" :value="scope.row.unit"/>
</template>
</el-table-column>
<el-table-column :label="'状态'" align="center" prop="spec">
<template slot-scope="scope">
<dict-tag :options="dict.type.turnover_type" :value="scope.row.spec"/>
</template>
</el-table-column>
<el-table-column :label="'合同号'" align="center" prop="cargoNo" /> <!--型号-->
<el-table-column label="产品质量" align="center" prop="voltage" >
<template slot-scope="scope">
<dict-tag :options="dict.type.quality_type" :value="scope.row.voltage"/>
</template>
</el-table-column>
<el-table-column label="台次" align="center" prop="power" />
<el-table-column label="件次" align="center" prop="phase" />
<!-- <el-table-column label="分销" align="center" prop="distribution" />-->
<el-table-column label="用途" align="center" prop="model" >
<template slot-scope="scope">
<dict-tag :options="dict.type.purpose_type" :value="scope.row.model"/>
</template>
</el-table-column>
<el-table-column label="套账" align="center" prop="entryid" >
<template slot-scope="scope">
<dict-tag :options="dict.type.account_type" :value="scope.row.entryid"/>
</template>
</el-table-column>
<el-table-column label="仓库" align="center" prop="warehouseId" >
<template slot-scope="scope">
<dict-tag :options="dict.type.warehouse" :value="scope.row.warehouseId"/>
</template>
</el-table-column>
<el-table-column label="单位" align="center" prop="productUnit" />
<el-table-column label="图号" align="center" prop="productDrawNo" />
<el-table-column label="物料状态" align="center" prop="productStatus" >
<template slot-scope="scope">
<dict-tag :options="dict.type.product_type" :value="scope.row.productStatus"/>
</template>
</el-table-column>
<el-table-column label="常用编码" align="center" prop="parentId" />
<el-table-column label="是否启用" align="center" prop="isUsed" >
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.isUsed"/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="创建用户" align="center" prop="createSys" />
</el-table>
<!-- <pagination-->
@@ -317,7 +359,7 @@ import {listWarehouse} from "@/api/bas/warehouse";
export default {
name: "OutStockWithDetail",
dicts: ['out_bill_type', 'out_bill_status'],
dicts: ['out_bill_type', 'out_bill_status', 'product_type', 'quality_type', 'turnover_type', 'sys_yes_no','account_type','origin_type','purpose_type','warehouse'],
data() {
return {
// 遮罩层
@@ -360,8 +402,8 @@ export default {
},
// 出口选项
exitOptions: [
{ exitId: '1', exitName: '一楼'},
{ exitId: '2', exitName: '二楼'},
{ exitId: '1', exitName: '北端'},
{ exitId: '2', exitName: '南端'},
],
@@ -562,7 +604,7 @@ export default {
const stockoutIds = this.selectedRows.map(row => row.stockoutId)
let outstock = this.selectedRows[0]
if (outstock.status != "2" && outstock.status != "3") {
this.$modal.msgError('请先审核出库单')
this.$modal.msgError('单据未审核!')
return
}
let data = {