现场 wms 字段显示修改
This commit is contained in:
@@ -1,355 +1,232 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="客户编号" prop="customerNo">
|
||||
<el-input v-model="queryParams.customerNo" placeholder="请输入客户编号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户名称" prop="customerName">
|
||||
<el-input v-model="queryParams.customerName" placeholder="请输入客户名称" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="简称" prop="simpleName">
|
||||
<el-input v-model="queryParams.simpleName" placeholder="请输入简称" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否可用" prop="useable">
|
||||
<el-select v-model="queryParams.useable" placeholder="请选择是否可用" clearable>
|
||||
<div>
|
||||
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
|
||||
<el-form-item label="仓库" prop="warehouseId">
|
||||
<el-select
|
||||
v-model="formData.warehouseId"
|
||||
placeholder="请选择仓库"
|
||||
clearable
|
||||
:style="{width: '15%'}"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.is_available"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
v-for="item in warehouseOptions"
|
||||
:key="item.warehouseId"
|
||||
:label="item.warehouseName"
|
||||
:value="item.warehouseId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
<el-form-item label="托盘码" prop="trayCode">
|
||||
<el-input
|
||||
v-model="formData.trayCode"
|
||||
:maxlength="8"
|
||||
show-word-limit
|
||||
placeholder="请输入条码"
|
||||
clearable
|
||||
:style="{width: '15%'}"
|
||||
@change="handleTrayChange"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库子单" prop="stockinDetailId">
|
||||
<el-input
|
||||
v-model="formData.stockinDetailId"
|
||||
placeholder="请输入入库子单"
|
||||
clearable
|
||||
:style="{width: '15%'}"
|
||||
@keyup.enter.native="handleQueryDetail"
|
||||
@change="handleQueryDetail"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-card style="margin-top: 16px;">
|
||||
<div slot="header">托盘已绑定物料</div>
|
||||
<el-table v-if="trayMaterials && trayMaterials.length" :data="trayMaterials" size="small">
|
||||
<el-table-column label="子单编码" align="left" prop="stockinDetailId"/>
|
||||
<el-table-column label="物料名称" align="left" prop="productName"/>
|
||||
<el-table-column label="数量" align="right" prop="quantity"/>
|
||||
</el-table>
|
||||
<el-empty v-else description="暂无数据"></el-empty>
|
||||
</el-card>
|
||||
<el-form-item size="large">
|
||||
<el-button type="primary" @click="submitForm">确认入库</el-button>
|
||||
<el-button @click="resetForm">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['bas:BasCustomer:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['bas:BasCustomer:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['bas:BasCustomer:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['bas:BasCustomer:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="BasCustomerList" @selection-change="handleSelectionChange" max-height="700">
|
||||
<el-table-column type="selection" align="center" />
|
||||
<el-table-column label="客户编号" align="left" prop="customerNo" />
|
||||
<!-- <el-table-column label="客户类别" align="left" prop="customerGroupNo" /> -->
|
||||
<el-table-column label="客户名称" align="left" prop="customerName" />
|
||||
<el-table-column label="简称" align="left" prop="simpleName" />
|
||||
<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-dialog :title="'入库子单详情'" :visible.sync="detailOpen" width="1400px" append-to-body>
|
||||
<el-table v-if="detailRow" :data="[detailRow]" size="small">
|
||||
<el-table-column label="子单ID" align="left" prop="stockinDetailId" />
|
||||
<el-table-column label="物料编码" align="left" prop="productId"/>
|
||||
<el-table-column label="物料名称" align="left" prop="productName"/>
|
||||
<el-table-column label="台次" align="left" prop="spare5"/>
|
||||
<el-table-column label="合同号" align="left" prop="spare6"/>
|
||||
<el-table-column label="入库数量" align="right">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="inQuantity" :min="1" :max="remainQty" :step="1" controls-position="right"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="left" prop="remark" />
|
||||
<!-- <el-table-column width="120" label="业务部门" align="left" prop="businessDepartment" />
|
||||
<el-table-column width="120" label="业务员" align="left" prop="salesman" />
|
||||
<el-table-column width="120" label="助记码" align="left" prop="mnemonicCode" />
|
||||
<el-table-column width="120" label="客户类型" align="left" prop="type" />
|
||||
<el-table-column width="120" label="纳税人识别号" align="left" prop="taxpayerRegistrationNumber" />
|
||||
<el-table-column width="120" label="财务组织" align="left" prop="organization" />
|
||||
<el-table-column width="120" label="上级客户" align="left" prop="supCustomer" />
|
||||
<el-table-column width="120" label="个人客户" align="left" prop="retailInvestor" />
|
||||
<el-table-column width="120" label="国家/地区" align="left" prop="country" />
|
||||
<el-table-column width="120" label="时区" align="left" prop="timeZone" />
|
||||
<el-table-column width="120" label="数据格式" align="left" prop="dataFormat" />
|
||||
<el-table-column width="120" label="联系人" align="left" prop="contactName" />
|
||||
<el-table-column width="120" label="装运国家" align="left" prop="shipment" />
|
||||
<el-table-column width="120" label="税种" align="left" prop="taxCategory" /> -->
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['bas:BasCustomer:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['bas:BasCustomer:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改客户对话框 -->
|
||||
<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="customerNo">
|
||||
<el-input v-model="form.customerNo" placeholder="请输入客户编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户名称" prop="customerName">
|
||||
<el-input v-model="form.customerName" placeholder="请输入客户名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="简称" prop="simpleName">
|
||||
<el-input v-model="form.simpleName" placeholder="请输入简称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否可用" prop="useable">
|
||||
<el-select v-model="form.useable" placeholder="请选择是否可用">
|
||||
<el-option
|
||||
v-for="dict in dict.type.is_available"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="业务部门" prop="businessDepartment">
|
||||
<el-input v-model="form.businessDepartment" placeholder="请输入业务部门" />
|
||||
</el-form-item>
|
||||
<el-form-item label="业务员" prop="salesman">
|
||||
<el-input v-model="form.salesman" placeholder="请输入业务员" />
|
||||
</el-form-item>
|
||||
<el-form-item label="助记码" prop="mnemonicCode">
|
||||
<el-input v-model="form.mnemonicCode" placeholder="请输入助记码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户类型" prop="type">
|
||||
<el-input v-model="form.type" placeholder="请输入客户类型" />
|
||||
</el-form-item>
|
||||
<el-form-item label="纳税人识别号" prop="taxpayerRegistrationNumber">
|
||||
<el-input v-model="form.taxpayerRegistrationNumber" placeholder="请输入纳税人识别号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="财务组织" prop="organization">
|
||||
<el-input v-model="form.organization" placeholder="请输入财务组织" />
|
||||
</el-form-item>
|
||||
<el-form-item label="上级客户" prop="supCustomer">
|
||||
<el-input v-model="form.supCustomer" placeholder="请输入上级客户" />
|
||||
</el-form-item>
|
||||
<el-form-item label="个人客户" prop="retailInvestor">
|
||||
<el-input v-model="form.retailInvestor" placeholder="请输入个人客户" />
|
||||
</el-form-item>
|
||||
<el-form-item label="国家/地区" prop="country">
|
||||
<el-input v-model="form.country" placeholder="请输入国家/地区" />
|
||||
</el-form-item>
|
||||
<el-form-item label="时区" prop="timeZone">
|
||||
<el-input v-model="form.timeZone" placeholder="请输入时区" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数据格式" prop="dataFormat">
|
||||
<el-input v-model="form.dataFormat" placeholder="请输入数据格式" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人" prop="contactName">
|
||||
<el-input v-model="form.contactName" placeholder="请输入联系人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="装运国家" prop="shipment">
|
||||
<el-input v-model="form.shipment" placeholder="请输入装运国家" />
|
||||
</el-form-item>
|
||||
<el-form-item label="税种" prop="taxCategory">
|
||||
<el-input v-model="form.taxCategory" placeholder="请输入税种" />
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
</el-table>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确定</el-button>
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button type="primary" @click="confirmBind">确 定</el-button>
|
||||
<el-button @click="detailOpen=false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listBasCustomer, getBasCustomer, delBasCustomer, addBasCustomer, updateBasCustomer } from "@/api/bas/BasCustomer"
|
||||
import { getStockInDetail} from '@/api/in/stockInDetail'
|
||||
import { bindTray ,getTrayInfo ,addInJob} from '@/api/rf/rf'
|
||||
import {listWarehouse} from "@/api/bas/warehouse";
|
||||
|
||||
export default {
|
||||
name: "BasCustomer",
|
||||
dicts:['is_available'],
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 客户管理表格数据
|
||||
BasCustomerList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
customerNo: null,
|
||||
customerGroupNo: null,
|
||||
customerName: null,
|
||||
simpleName: null,
|
||||
useable: null,
|
||||
businessDepartment: null,
|
||||
salesman: null,
|
||||
mnemonicCode: null,
|
||||
type: null,
|
||||
taxpayerRegistrationNumber: null,
|
||||
organization: null,
|
||||
supCustomer: null,
|
||||
retailInvestor: null,
|
||||
country: null,
|
||||
timeZone: null,
|
||||
dataFormat: null,
|
||||
contactName: null,
|
||||
shipment: null,
|
||||
taxCategory: null
|
||||
formData: {
|
||||
warehouseId: undefined,
|
||||
trayCode: undefined,
|
||||
stockinDetailId: undefined,
|
||||
},
|
||||
detailLoading: false,
|
||||
detailOpen: false,
|
||||
detailRow: null,
|
||||
inQuantity: null,
|
||||
trayMaterials: [],
|
||||
warehouseOptions:[],
|
||||
queryWarehouseParams:{
|
||||
pageNum:1,
|
||||
pageSize:99,
|
||||
warehouseType:1
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
id: [
|
||||
{ required: true, message: "ID不能为空", trigger: "blur" }
|
||||
],
|
||||
customerNo: [
|
||||
{ required: true, message: "客户编号不能为空", trigger: "blur" }
|
||||
],
|
||||
customerName: [
|
||||
{ required: true, message: "客户名称不能为空", trigger: "blur" }
|
||||
],
|
||||
useable: [
|
||||
{ required: true, message: "是否可用不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
warehouseId: [{
|
||||
required: true,
|
||||
message: '请输入仓库号仓库',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
trayCode: [{
|
||||
required: true,
|
||||
message: '请输入条码',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
stockinDetailId: [{
|
||||
required: true,
|
||||
message: '请输入入库子单',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
computed: {
|
||||
remainQty() {
|
||||
const plan = this.detailRow && Number(this.detailRow.quantity || 0)
|
||||
const assigned = this.detailRow && Number(this.detailRow.scanNum || 0)
|
||||
const remain = (plan || 0) - (assigned || 0)
|
||||
return remain > 0 ? remain : 0
|
||||
}
|
||||
},
|
||||
watch: {},
|
||||
created() {
|
||||
this.getWarehouseList()
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
/** 查询客户管理列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listBasCustomer(this.queryParams).then(response => {
|
||||
this.BasCustomerList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
customerNo: null,
|
||||
customerGroupNo: null,
|
||||
customerName: null,
|
||||
simpleName: null,
|
||||
useable: null,
|
||||
remark: null,
|
||||
businessDepartment: null,
|
||||
salesman: null,
|
||||
mnemonicCode: null,
|
||||
type: null,
|
||||
taxpayerRegistrationNumber: null,
|
||||
organization: null,
|
||||
supCustomer: null,
|
||||
retailInvestor: null,
|
||||
country: null,
|
||||
timeZone: null,
|
||||
dataFormat: null,
|
||||
contactName: null,
|
||||
shipment: null,
|
||||
taxCategory: null
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm")
|
||||
this.handleQuery()
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "添加客户"
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const id = row.id || this.ids
|
||||
getBasCustomer(id).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改客户"
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateBasCustomer(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addBasCustomer(this.form).then(response => {
|
||||
this.$modal.msgSuccess("添加成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
/** 获取仓库列表 */
|
||||
getWarehouseList() {
|
||||
listWarehouse(this.queryWarehouseParams).then(response => {
|
||||
this.warehouseOptions = response.rows;
|
||||
if (this.warehouseOptions.length > 0) {
|
||||
this.handleQuery();
|
||||
}
|
||||
});
|
||||
},
|
||||
async handleTrayChange() {
|
||||
const code = (this.formData.trayCode || '').toString().trim()
|
||||
if (!code) {
|
||||
this.trayMaterials = []
|
||||
return
|
||||
}
|
||||
const res = await getTrayInfo(code)
|
||||
this.trayMaterials = res.data || res.rows || []
|
||||
},
|
||||
async handleQueryDetail() {
|
||||
const id = (this.formData.stockinDetailId || '').toString().trim()
|
||||
if (!id) return
|
||||
this.detailLoading = true
|
||||
try {
|
||||
const res = await getStockInDetail(id)
|
||||
this.detailRow = res.data || null
|
||||
if (!this.detailRow) {
|
||||
this.$message.error('未找到入库子单')
|
||||
return
|
||||
}
|
||||
const remain = this.remainQty
|
||||
this.inQuantity = remain > 0 ? remain : 1
|
||||
this.detailOpen = !!this.detailRow
|
||||
} finally {
|
||||
this.detailLoading = false
|
||||
}
|
||||
},
|
||||
submitForm() {
|
||||
if (!this.formData.warehouseId){
|
||||
this.$message.error('请输入仓库号')
|
||||
return
|
||||
}
|
||||
if (!this.formData.trayCode){
|
||||
this.$message.error('请输入托盘码')
|
||||
return
|
||||
}
|
||||
addInJob(this.formData).then(() => {
|
||||
this.$message.success('入库成功')
|
||||
this.resetForm()
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids
|
||||
this.$modal.confirm('是否确认删除客户编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delBasCustomer(ids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
resetForm() {
|
||||
this.$refs['elForm'].resetFields()
|
||||
this.trayMaterials = []
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('bas/BasCustomer/export', {
|
||||
...this.queryParams
|
||||
}, `BasCustomer_${new Date().getTime()}.xlsx`)
|
||||
confirmBind() {
|
||||
if (!this.detailRow) return
|
||||
const remain = this.remainQty
|
||||
if (remain <= 0) {
|
||||
this.$message.error('无剩余数量可入库')
|
||||
return
|
||||
}
|
||||
const qty = Number(this.inQuantity || 0)
|
||||
if (!qty || qty < 1) {
|
||||
this.$message.error('请输入入库数量')
|
||||
return
|
||||
}
|
||||
if (qty > remain) {
|
||||
this.$message.error('入库数量不能超过剩余数量')
|
||||
return
|
||||
}
|
||||
if (!this.formData.trayCode){
|
||||
this.$message.error('请输入托盘码')
|
||||
return
|
||||
}
|
||||
if (!this.formData.warehouseId){
|
||||
this.$message.error('请输入仓库号')
|
||||
return
|
||||
}
|
||||
const payload = {
|
||||
trayCode: this.formData.trayCode,
|
||||
stockinDetailId: this.formData.stockinDetailId,
|
||||
inQuantity: qty,
|
||||
warehouseId: this.formData.warehouseId
|
||||
}
|
||||
bindTray(payload).then(() => {
|
||||
this.$message.success('绑定成功')
|
||||
this.detailOpen = false
|
||||
this.handleTrayChange()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
/* 统一表单控件宽度 */
|
||||
.el-select,
|
||||
.el-input {
|
||||
width: 100%;
|
||||
}
|
||||
<style>
|
||||
</style>
|
||||
|
||||
@@ -1,355 +1,119 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="客户编号" prop="customerNo">
|
||||
<el-input v-model="queryParams.customerNo" placeholder="请输入客户编号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户名称" prop="customerName">
|
||||
<el-input v-model="queryParams.customerName" placeholder="请输入客户名称" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="简称" prop="simpleName">
|
||||
<el-input v-model="queryParams.simpleName" placeholder="请输入简称" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否可用" prop="useable">
|
||||
<el-select v-model="queryParams.useable" placeholder="请选择是否可用" clearable>
|
||||
<div>
|
||||
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
|
||||
<el-form-item label="仓库" prop="warehouseId">
|
||||
<el-select
|
||||
v-model="formData.warehouseId"
|
||||
placeholder="请选择仓库"
|
||||
clearable
|
||||
:style="{width: '15%'}"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.is_available"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
v-for="item in warehouseOptions"
|
||||
:key="item.warehouseId"
|
||||
:label="item.warehouseName"
|
||||
:value="item.warehouseId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
<el-form-item label="托盘码" prop="trayCode">
|
||||
<el-input
|
||||
v-model="formData.trayCode"
|
||||
placeholder="请输入托盘码"
|
||||
:maxlength="8"
|
||||
show-word-limit
|
||||
clearable
|
||||
prefix-icon='el-icon-mobile'
|
||||
:style="{width: '15%'}"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item size="large">
|
||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||
<el-button @click="resetForm">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['bas:BasCustomer:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['bas:BasCustomer:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['bas:BasCustomer:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['bas:BasCustomer:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="BasCustomerList" @selection-change="handleSelectionChange" max-height="700">
|
||||
<el-table-column type="selection" align="center" />
|
||||
<el-table-column label="客户编号" align="left" prop="customerNo" />
|
||||
<!-- <el-table-column label="客户类别" align="left" prop="customerGroupNo" /> -->
|
||||
<el-table-column label="客户名称" align="left" prop="customerName" />
|
||||
<el-table-column label="简称" align="left" prop="simpleName" />
|
||||
<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-column label="备注" align="left" prop="remark" />
|
||||
<!-- <el-table-column width="120" label="业务部门" align="left" prop="businessDepartment" />
|
||||
<el-table-column width="120" label="业务员" align="left" prop="salesman" />
|
||||
<el-table-column width="120" label="助记码" align="left" prop="mnemonicCode" />
|
||||
<el-table-column width="120" label="客户类型" align="left" prop="type" />
|
||||
<el-table-column width="120" label="纳税人识别号" align="left" prop="taxpayerRegistrationNumber" />
|
||||
<el-table-column width="120" label="财务组织" align="left" prop="organization" />
|
||||
<el-table-column width="120" label="上级客户" align="left" prop="supCustomer" />
|
||||
<el-table-column width="120" label="个人客户" align="left" prop="retailInvestor" />
|
||||
<el-table-column width="120" label="国家/地区" align="left" prop="country" />
|
||||
<el-table-column width="120" label="时区" align="left" prop="timeZone" />
|
||||
<el-table-column width="120" label="数据格式" align="left" prop="dataFormat" />
|
||||
<el-table-column width="120" label="联系人" align="left" prop="contactName" />
|
||||
<el-table-column width="120" label="装运国家" align="left" prop="shipment" />
|
||||
<el-table-column width="120" label="税种" align="left" prop="taxCategory" /> -->
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['bas:BasCustomer:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['bas:BasCustomer:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改客户对话框 -->
|
||||
<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="customerNo">
|
||||
<el-input v-model="form.customerNo" placeholder="请输入客户编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户名称" prop="customerName">
|
||||
<el-input v-model="form.customerName" placeholder="请输入客户名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="简称" prop="simpleName">
|
||||
<el-input v-model="form.simpleName" placeholder="请输入简称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否可用" prop="useable">
|
||||
<el-select v-model="form.useable" placeholder="请选择是否可用">
|
||||
<el-option
|
||||
v-for="dict in dict.type.is_available"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="业务部门" prop="businessDepartment">
|
||||
<el-input v-model="form.businessDepartment" placeholder="请输入业务部门" />
|
||||
</el-form-item>
|
||||
<el-form-item label="业务员" prop="salesman">
|
||||
<el-input v-model="form.salesman" placeholder="请输入业务员" />
|
||||
</el-form-item>
|
||||
<el-form-item label="助记码" prop="mnemonicCode">
|
||||
<el-input v-model="form.mnemonicCode" placeholder="请输入助记码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户类型" prop="type">
|
||||
<el-input v-model="form.type" placeholder="请输入客户类型" />
|
||||
</el-form-item>
|
||||
<el-form-item label="纳税人识别号" prop="taxpayerRegistrationNumber">
|
||||
<el-input v-model="form.taxpayerRegistrationNumber" placeholder="请输入纳税人识别号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="财务组织" prop="organization">
|
||||
<el-input v-model="form.organization" placeholder="请输入财务组织" />
|
||||
</el-form-item>
|
||||
<el-form-item label="上级客户" prop="supCustomer">
|
||||
<el-input v-model="form.supCustomer" placeholder="请输入上级客户" />
|
||||
</el-form-item>
|
||||
<el-form-item label="个人客户" prop="retailInvestor">
|
||||
<el-input v-model="form.retailInvestor" placeholder="请输入个人客户" />
|
||||
</el-form-item>
|
||||
<el-form-item label="国家/地区" prop="country">
|
||||
<el-input v-model="form.country" placeholder="请输入国家/地区" />
|
||||
</el-form-item>
|
||||
<el-form-item label="时区" prop="timeZone">
|
||||
<el-input v-model="form.timeZone" placeholder="请输入时区" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数据格式" prop="dataFormat">
|
||||
<el-input v-model="form.dataFormat" placeholder="请输入数据格式" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人" prop="contactName">
|
||||
<el-input v-model="form.contactName" placeholder="请输入联系人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="装运国家" prop="shipment">
|
||||
<el-input v-model="form.shipment" placeholder="请输入装运国家" />
|
||||
</el-form-item>
|
||||
<el-form-item label="税种" prop="taxCategory">
|
||||
<el-input v-model="form.taxCategory" placeholder="请输入税种" />
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确定</el-button>
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listBasCustomer, getBasCustomer, delBasCustomer, addBasCustomer, updateBasCustomer } from "@/api/bas/BasCustomer"
|
||||
|
||||
import { emptyTrayIn} from '@/api/rf/rf'
|
||||
import {listWarehouse} from "@/api/bas/warehouse";
|
||||
|
||||
|
||||
export default {
|
||||
name: "BasCustomer",
|
||||
dicts:['is_available'],
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 客户管理表格数据
|
||||
BasCustomerList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
customerNo: null,
|
||||
customerGroupNo: null,
|
||||
customerName: null,
|
||||
simpleName: null,
|
||||
useable: null,
|
||||
businessDepartment: null,
|
||||
salesman: null,
|
||||
mnemonicCode: null,
|
||||
type: null,
|
||||
taxpayerRegistrationNumber: null,
|
||||
organization: null,
|
||||
supCustomer: null,
|
||||
retailInvestor: null,
|
||||
country: null,
|
||||
timeZone: null,
|
||||
dataFormat: null,
|
||||
contactName: null,
|
||||
shipment: null,
|
||||
taxCategory: null
|
||||
formData: {
|
||||
trayCode: '',
|
||||
warehouseId: '',
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
loading: false,
|
||||
taskDetails: [],
|
||||
rules: {
|
||||
id: [
|
||||
{ required: true, message: "ID不能为空", trigger: "blur" }
|
||||
],
|
||||
customerNo: [
|
||||
{ required: true, message: "客户编号不能为空", trigger: "blur" }
|
||||
],
|
||||
customerName: [
|
||||
{ required: true, message: "客户名称不能为空", trigger: "blur" }
|
||||
],
|
||||
useable: [
|
||||
{ required: true, message: "是否可用不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
trayCode: [{
|
||||
required: true,
|
||||
message: '请输入托盘码',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
},
|
||||
warehouseOptions:[],
|
||||
queryWarehouseParams:{
|
||||
pageNum:1,
|
||||
pageSize:99
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
this.getList()
|
||||
this.getWarehouseList()
|
||||
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
/** 查询客户管理列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listBasCustomer(this.queryParams).then(response => {
|
||||
this.BasCustomerList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
customerNo: null,
|
||||
customerGroupNo: null,
|
||||
customerName: null,
|
||||
simpleName: null,
|
||||
useable: null,
|
||||
remark: null,
|
||||
businessDepartment: null,
|
||||
salesman: null,
|
||||
mnemonicCode: null,
|
||||
type: null,
|
||||
taxpayerRegistrationNumber: null,
|
||||
organization: null,
|
||||
supCustomer: null,
|
||||
retailInvestor: null,
|
||||
country: null,
|
||||
timeZone: null,
|
||||
dataFormat: null,
|
||||
contactName: null,
|
||||
shipment: null,
|
||||
taxCategory: null
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm")
|
||||
this.handleQuery()
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "添加客户"
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const id = row.id || this.ids
|
||||
getBasCustomer(id).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改客户"
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateBasCustomer(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addBasCustomer(this.form).then(response => {
|
||||
this.$modal.msgSuccess("添加成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
/** 获取仓库列表 */
|
||||
getWarehouseList() {
|
||||
listWarehouse(this.queryWarehouseParams).then(response => {
|
||||
this.warehouseOptions = response.rows;
|
||||
if (this.warehouseOptions.length > 0) {
|
||||
this.handleQuery();
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids
|
||||
this.$modal.confirm('是否确认删除客户编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delBasCustomer(ids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
async submitForm() {
|
||||
const code = (this.formData.trayCode || '').toString().trim()
|
||||
if (!code) {
|
||||
this.$message.error('请输入托盘码')
|
||||
return
|
||||
}
|
||||
const code1 = (this.formData.warehouseId || '').toString().trim()
|
||||
if (!code1) {
|
||||
this.$message.error('请选择仓库')
|
||||
return
|
||||
}
|
||||
this.loading = true
|
||||
try {
|
||||
const res = await emptyTrayIn({ trayCode: code,warehouseId:code1 })
|
||||
if (res.code === 200) {
|
||||
this.$message.success('空托入库生成任务成功')
|
||||
this.resetForm()
|
||||
} else {
|
||||
this.$message.error(res.msg || '空托入库生成任务失败')
|
||||
}
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
resetForm() {
|
||||
this.$refs['elForm'].resetFields()
|
||||
this.taskDetails = []
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('bas/BasCustomer/export', {
|
||||
...this.queryParams
|
||||
}, `BasCustomer_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
/* 统一表单控件宽度 */
|
||||
.el-select,
|
||||
.el-input {
|
||||
width: 100%;
|
||||
}
|
||||
<style>
|
||||
</style>
|
||||
|
||||
@@ -1,355 +1,114 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="客户编号" prop="customerNo">
|
||||
<el-input v-model="queryParams.customerNo" placeholder="请输入客户编号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户名称" prop="customerName">
|
||||
<el-input v-model="queryParams.customerName" placeholder="请输入客户名称" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="简称" prop="simpleName">
|
||||
<el-input v-model="queryParams.simpleName" placeholder="请输入简称" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否可用" prop="useable">
|
||||
<el-select v-model="queryParams.useable" placeholder="请选择是否可用" clearable>
|
||||
<div>
|
||||
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
|
||||
<el-form-item label="仓库" prop="warehouseId">
|
||||
<el-select
|
||||
v-model="formData.warehouseId"
|
||||
placeholder="请选择仓库"
|
||||
clearable
|
||||
:style="{width: '15%'}"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.is_available"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
v-for="item in warehouseOptions"
|
||||
:key="item.warehouseId"
|
||||
:label="item.warehouseName"
|
||||
:value="item.warehouseId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
<el-form-item label="出口" prop="exitId">
|
||||
<el-input
|
||||
v-model="formData.exitId"
|
||||
placeholder="请输入出口"
|
||||
:maxlength="1"
|
||||
show-word-limit
|
||||
clearable
|
||||
prefix-icon='el-icon-mobile'
|
||||
:style="{width: '15%'}"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item size="large">
|
||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||
<el-button @click="resetForm">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['bas:BasCustomer:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['bas:BasCustomer:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['bas:BasCustomer:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['bas:BasCustomer:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="BasCustomerList" @selection-change="handleSelectionChange" max-height="700">
|
||||
<el-table-column type="selection" align="center" />
|
||||
<el-table-column label="客户编号" align="left" prop="customerNo" />
|
||||
<!-- <el-table-column label="客户类别" align="left" prop="customerGroupNo" /> -->
|
||||
<el-table-column label="客户名称" align="left" prop="customerName" />
|
||||
<el-table-column label="简称" align="left" prop="simpleName" />
|
||||
<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-column label="备注" align="left" prop="remark" />
|
||||
<!-- <el-table-column width="120" label="业务部门" align="left" prop="businessDepartment" />
|
||||
<el-table-column width="120" label="业务员" align="left" prop="salesman" />
|
||||
<el-table-column width="120" label="助记码" align="left" prop="mnemonicCode" />
|
||||
<el-table-column width="120" label="客户类型" align="left" prop="type" />
|
||||
<el-table-column width="120" label="纳税人识别号" align="left" prop="taxpayerRegistrationNumber" />
|
||||
<el-table-column width="120" label="财务组织" align="left" prop="organization" />
|
||||
<el-table-column width="120" label="上级客户" align="left" prop="supCustomer" />
|
||||
<el-table-column width="120" label="个人客户" align="left" prop="retailInvestor" />
|
||||
<el-table-column width="120" label="国家/地区" align="left" prop="country" />
|
||||
<el-table-column width="120" label="时区" align="left" prop="timeZone" />
|
||||
<el-table-column width="120" label="数据格式" align="left" prop="dataFormat" />
|
||||
<el-table-column width="120" label="联系人" align="left" prop="contactName" />
|
||||
<el-table-column width="120" label="装运国家" align="left" prop="shipment" />
|
||||
<el-table-column width="120" label="税种" align="left" prop="taxCategory" /> -->
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['bas:BasCustomer:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['bas:BasCustomer:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改客户对话框 -->
|
||||
<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="customerNo">
|
||||
<el-input v-model="form.customerNo" placeholder="请输入客户编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户名称" prop="customerName">
|
||||
<el-input v-model="form.customerName" placeholder="请输入客户名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="简称" prop="simpleName">
|
||||
<el-input v-model="form.simpleName" placeholder="请输入简称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否可用" prop="useable">
|
||||
<el-select v-model="form.useable" placeholder="请选择是否可用">
|
||||
<el-option
|
||||
v-for="dict in dict.type.is_available"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="业务部门" prop="businessDepartment">
|
||||
<el-input v-model="form.businessDepartment" placeholder="请输入业务部门" />
|
||||
</el-form-item>
|
||||
<el-form-item label="业务员" prop="salesman">
|
||||
<el-input v-model="form.salesman" placeholder="请输入业务员" />
|
||||
</el-form-item>
|
||||
<el-form-item label="助记码" prop="mnemonicCode">
|
||||
<el-input v-model="form.mnemonicCode" placeholder="请输入助记码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户类型" prop="type">
|
||||
<el-input v-model="form.type" placeholder="请输入客户类型" />
|
||||
</el-form-item>
|
||||
<el-form-item label="纳税人识别号" prop="taxpayerRegistrationNumber">
|
||||
<el-input v-model="form.taxpayerRegistrationNumber" placeholder="请输入纳税人识别号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="财务组织" prop="organization">
|
||||
<el-input v-model="form.organization" placeholder="请输入财务组织" />
|
||||
</el-form-item>
|
||||
<el-form-item label="上级客户" prop="supCustomer">
|
||||
<el-input v-model="form.supCustomer" placeholder="请输入上级客户" />
|
||||
</el-form-item>
|
||||
<el-form-item label="个人客户" prop="retailInvestor">
|
||||
<el-input v-model="form.retailInvestor" placeholder="请输入个人客户" />
|
||||
</el-form-item>
|
||||
<el-form-item label="国家/地区" prop="country">
|
||||
<el-input v-model="form.country" placeholder="请输入国家/地区" />
|
||||
</el-form-item>
|
||||
<el-form-item label="时区" prop="timeZone">
|
||||
<el-input v-model="form.timeZone" placeholder="请输入时区" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数据格式" prop="dataFormat">
|
||||
<el-input v-model="form.dataFormat" placeholder="请输入数据格式" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人" prop="contactName">
|
||||
<el-input v-model="form.contactName" placeholder="请输入联系人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="装运国家" prop="shipment">
|
||||
<el-input v-model="form.shipment" placeholder="请输入装运国家" />
|
||||
</el-form-item>
|
||||
<el-form-item label="税种" prop="taxCategory">
|
||||
<el-input v-model="form.taxCategory" placeholder="请输入税种" />
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确定</el-button>
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listBasCustomer, getBasCustomer, delBasCustomer, addBasCustomer, updateBasCustomer } from "@/api/bas/BasCustomer"
|
||||
|
||||
import { emptyTrayOut} from '@/api/rf/rf'
|
||||
import {listWarehouse} from "@/api/bas/warehouse";
|
||||
|
||||
|
||||
export default {
|
||||
name: "BasCustomer",
|
||||
dicts:['is_available'],
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 客户管理表格数据
|
||||
BasCustomerList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
customerNo: null,
|
||||
customerGroupNo: null,
|
||||
customerName: null,
|
||||
simpleName: null,
|
||||
useable: null,
|
||||
businessDepartment: null,
|
||||
salesman: null,
|
||||
mnemonicCode: null,
|
||||
type: null,
|
||||
taxpayerRegistrationNumber: null,
|
||||
organization: null,
|
||||
supCustomer: null,
|
||||
retailInvestor: null,
|
||||
country: null,
|
||||
timeZone: null,
|
||||
dataFormat: null,
|
||||
contactName: null,
|
||||
shipment: null,
|
||||
taxCategory: null
|
||||
formData: {
|
||||
exitId: '',
|
||||
warehouseId: '',
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
loading: false,
|
||||
taskDetails: [],
|
||||
rules: {
|
||||
id: [
|
||||
{ required: true, message: "ID不能为空", trigger: "blur" }
|
||||
],
|
||||
customerNo: [
|
||||
{ required: true, message: "客户编号不能为空", trigger: "blur" }
|
||||
],
|
||||
customerName: [
|
||||
{ required: true, message: "客户名称不能为空", trigger: "blur" }
|
||||
],
|
||||
useable: [
|
||||
{ required: true, message: "是否可用不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
},
|
||||
warehouseOptions:[],
|
||||
queryWarehouseParams:{
|
||||
pageNum:1,
|
||||
pageSize:99
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
this.getList()
|
||||
this.getWarehouseList()
|
||||
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
/** 查询客户管理列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listBasCustomer(this.queryParams).then(response => {
|
||||
this.BasCustomerList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
customerNo: null,
|
||||
customerGroupNo: null,
|
||||
customerName: null,
|
||||
simpleName: null,
|
||||
useable: null,
|
||||
remark: null,
|
||||
businessDepartment: null,
|
||||
salesman: null,
|
||||
mnemonicCode: null,
|
||||
type: null,
|
||||
taxpayerRegistrationNumber: null,
|
||||
organization: null,
|
||||
supCustomer: null,
|
||||
retailInvestor: null,
|
||||
country: null,
|
||||
timeZone: null,
|
||||
dataFormat: null,
|
||||
contactName: null,
|
||||
shipment: null,
|
||||
taxCategory: null
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm")
|
||||
this.handleQuery()
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "添加客户"
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const id = row.id || this.ids
|
||||
getBasCustomer(id).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改客户"
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateBasCustomer(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addBasCustomer(this.form).then(response => {
|
||||
this.$modal.msgSuccess("添加成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
/** 获取仓库列表 */
|
||||
getWarehouseList() {
|
||||
listWarehouse(this.queryWarehouseParams).then(response => {
|
||||
this.warehouseOptions = response.rows;
|
||||
if (this.warehouseOptions.length > 0) {
|
||||
this.handleQuery();
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids
|
||||
this.$modal.confirm('是否确认删除客户编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delBasCustomer(ids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
async submitForm() {
|
||||
const code = (this.formData.exitId || '').toString().trim()
|
||||
if (!code) {
|
||||
this.$message.error('请输入出口')
|
||||
return
|
||||
}
|
||||
const code1 = (this.formData.warehouseId || '').toString().trim()
|
||||
if (!code1) {
|
||||
this.$message.error('请选择仓库')
|
||||
return
|
||||
}
|
||||
this.loading = true
|
||||
try {
|
||||
const res = await emptyTrayOut({ exitId: code,warehouseId:code1 })
|
||||
if (res.code === 200) {
|
||||
this.$message.success('空托出库生成任务成功')
|
||||
this.resetForm()
|
||||
} else {
|
||||
this.$message.error(res.msg || '空托出库生成任务失败')
|
||||
}
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
resetForm() {
|
||||
this.$refs['elForm'].resetFields()
|
||||
this.taskDetails = []
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('bas/BasCustomer/export', {
|
||||
...this.queryParams
|
||||
}, `BasCustomer_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
/* 统一表单控件宽度 */
|
||||
.el-select,
|
||||
.el-input {
|
||||
width: 100%;
|
||||
}
|
||||
<style>
|
||||
</style>
|
||||
|
||||
@@ -1,355 +1,145 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="客户编号" prop="customerNo">
|
||||
<el-input v-model="queryParams.customerNo" placeholder="请输入客户编号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户名称" prop="customerName">
|
||||
<el-input v-model="queryParams.customerName" placeholder="请输入客户名称" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="简称" prop="simpleName">
|
||||
<el-input v-model="queryParams.simpleName" placeholder="请输入简称" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否可用" prop="useable">
|
||||
<el-select v-model="queryParams.useable" placeholder="请选择是否可用" clearable>
|
||||
<div>
|
||||
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
|
||||
<el-form-item label="仓库" prop="warehouseId">
|
||||
<el-select
|
||||
v-model="formData.warehouseId"
|
||||
placeholder="请选择仓库"
|
||||
clearable
|
||||
:style="{width: '15%'}"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.is_available"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
v-for="item in warehouseOptions"
|
||||
:key="item.warehouseId"
|
||||
:label="item.warehouseName"
|
||||
:value="item.warehouseId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
<el-form-item label="托盘码" prop="trayCode">
|
||||
<el-input
|
||||
v-model="formData.trayCode"
|
||||
placeholder="请输入托盘码"
|
||||
:maxlength="8"
|
||||
show-word-limit
|
||||
clearable
|
||||
prefix-icon='el-icon-mobile'
|
||||
:style="{width: '15%'}"
|
||||
@change="handleTrayChange"
|
||||
@keyup.enter.native="handleTrayChange"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-card style="margin-top: 16px;">
|
||||
<div slot="header">出库任务物资</div>
|
||||
<el-table v-loading="loading" :data="taskDetails">
|
||||
<el-table-column label="子单ID" align="left" prop="inOrOutDId" />
|
||||
<el-table-column label="物料编码" align="left" prop="productId" />
|
||||
<el-table-column label="物料名称" align="left" prop="productName" />
|
||||
<el-table-column label="出库数量" align="right" prop="outQuantity" />
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-form-item size="large">
|
||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||
<el-button @click="resetForm">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['bas:BasCustomer:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['bas:BasCustomer:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['bas:BasCustomer:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['bas:BasCustomer:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="BasCustomerList" @selection-change="handleSelectionChange" max-height="700">
|
||||
<el-table-column type="selection" align="center" />
|
||||
<el-table-column label="客户编号" align="left" prop="customerNo" />
|
||||
<!-- <el-table-column label="客户类别" align="left" prop="customerGroupNo" /> -->
|
||||
<el-table-column label="客户名称" align="left" prop="customerName" />
|
||||
<el-table-column label="简称" align="left" prop="simpleName" />
|
||||
<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-column label="备注" align="left" prop="remark" />
|
||||
<!-- <el-table-column width="120" label="业务部门" align="left" prop="businessDepartment" />
|
||||
<el-table-column width="120" label="业务员" align="left" prop="salesman" />
|
||||
<el-table-column width="120" label="助记码" align="left" prop="mnemonicCode" />
|
||||
<el-table-column width="120" label="客户类型" align="left" prop="type" />
|
||||
<el-table-column width="120" label="纳税人识别号" align="left" prop="taxpayerRegistrationNumber" />
|
||||
<el-table-column width="120" label="财务组织" align="left" prop="organization" />
|
||||
<el-table-column width="120" label="上级客户" align="left" prop="supCustomer" />
|
||||
<el-table-column width="120" label="个人客户" align="left" prop="retailInvestor" />
|
||||
<el-table-column width="120" label="国家/地区" align="left" prop="country" />
|
||||
<el-table-column width="120" label="时区" align="left" prop="timeZone" />
|
||||
<el-table-column width="120" label="数据格式" align="left" prop="dataFormat" />
|
||||
<el-table-column width="120" label="联系人" align="left" prop="contactName" />
|
||||
<el-table-column width="120" label="装运国家" align="left" prop="shipment" />
|
||||
<el-table-column width="120" label="税种" align="left" prop="taxCategory" /> -->
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['bas:BasCustomer:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['bas:BasCustomer:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改客户对话框 -->
|
||||
<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="customerNo">
|
||||
<el-input v-model="form.customerNo" placeholder="请输入客户编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户名称" prop="customerName">
|
||||
<el-input v-model="form.customerName" placeholder="请输入客户名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="简称" prop="simpleName">
|
||||
<el-input v-model="form.simpleName" placeholder="请输入简称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否可用" prop="useable">
|
||||
<el-select v-model="form.useable" placeholder="请选择是否可用">
|
||||
<el-option
|
||||
v-for="dict in dict.type.is_available"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="业务部门" prop="businessDepartment">
|
||||
<el-input v-model="form.businessDepartment" placeholder="请输入业务部门" />
|
||||
</el-form-item>
|
||||
<el-form-item label="业务员" prop="salesman">
|
||||
<el-input v-model="form.salesman" placeholder="请输入业务员" />
|
||||
</el-form-item>
|
||||
<el-form-item label="助记码" prop="mnemonicCode">
|
||||
<el-input v-model="form.mnemonicCode" placeholder="请输入助记码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户类型" prop="type">
|
||||
<el-input v-model="form.type" placeholder="请输入客户类型" />
|
||||
</el-form-item>
|
||||
<el-form-item label="纳税人识别号" prop="taxpayerRegistrationNumber">
|
||||
<el-input v-model="form.taxpayerRegistrationNumber" placeholder="请输入纳税人识别号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="财务组织" prop="organization">
|
||||
<el-input v-model="form.organization" placeholder="请输入财务组织" />
|
||||
</el-form-item>
|
||||
<el-form-item label="上级客户" prop="supCustomer">
|
||||
<el-input v-model="form.supCustomer" placeholder="请输入上级客户" />
|
||||
</el-form-item>
|
||||
<el-form-item label="个人客户" prop="retailInvestor">
|
||||
<el-input v-model="form.retailInvestor" placeholder="请输入个人客户" />
|
||||
</el-form-item>
|
||||
<el-form-item label="国家/地区" prop="country">
|
||||
<el-input v-model="form.country" placeholder="请输入国家/地区" />
|
||||
</el-form-item>
|
||||
<el-form-item label="时区" prop="timeZone">
|
||||
<el-input v-model="form.timeZone" placeholder="请输入时区" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数据格式" prop="dataFormat">
|
||||
<el-input v-model="form.dataFormat" placeholder="请输入数据格式" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人" prop="contactName">
|
||||
<el-input v-model="form.contactName" placeholder="请输入联系人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="装运国家" prop="shipment">
|
||||
<el-input v-model="form.shipment" placeholder="请输入装运国家" />
|
||||
</el-form-item>
|
||||
<el-form-item label="税种" prop="taxCategory">
|
||||
<el-input v-model="form.taxCategory" placeholder="请输入税种" />
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确定</el-button>
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listBasCustomer, getBasCustomer, delBasCustomer, addBasCustomer, updateBasCustomer } from "@/api/bas/BasCustomer"
|
||||
|
||||
import { getTaskDetail ,ckMakeSure} from '@/api/rf/rf'
|
||||
import {listWarehouse} from "@/api/bas/warehouse";
|
||||
|
||||
|
||||
export default {
|
||||
name: "BasCustomer",
|
||||
dicts:['is_available'],
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 客户管理表格数据
|
||||
BasCustomerList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
customerNo: null,
|
||||
customerGroupNo: null,
|
||||
customerName: null,
|
||||
simpleName: null,
|
||||
useable: null,
|
||||
businessDepartment: null,
|
||||
salesman: null,
|
||||
mnemonicCode: null,
|
||||
type: null,
|
||||
taxpayerRegistrationNumber: null,
|
||||
organization: null,
|
||||
supCustomer: null,
|
||||
retailInvestor: null,
|
||||
country: null,
|
||||
timeZone: null,
|
||||
dataFormat: null,
|
||||
contactName: null,
|
||||
shipment: null,
|
||||
taxCategory: null
|
||||
formData: {
|
||||
trayCode: '',
|
||||
warehouseId: '',
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
loading: false,
|
||||
taskDetails: [],
|
||||
rules: {
|
||||
id: [
|
||||
{ required: true, message: "ID不能为空", trigger: "blur" }
|
||||
],
|
||||
customerNo: [
|
||||
{ required: true, message: "客户编号不能为空", trigger: "blur" }
|
||||
],
|
||||
customerName: [
|
||||
{ required: true, message: "客户名称不能为空", trigger: "blur" }
|
||||
],
|
||||
useable: [
|
||||
{ required: true, message: "是否可用不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
trayCode: [{
|
||||
required: true,
|
||||
message: '请输入托盘码',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
},
|
||||
warehouseOptions:[],
|
||||
queryWarehouseParams:{
|
||||
pageNum:1,
|
||||
pageSize:99
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
this.getList()
|
||||
this.getWarehouseList()
|
||||
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
/** 查询客户管理列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listBasCustomer(this.queryParams).then(response => {
|
||||
this.BasCustomerList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
customerNo: null,
|
||||
customerGroupNo: null,
|
||||
customerName: null,
|
||||
simpleName: null,
|
||||
useable: null,
|
||||
remark: null,
|
||||
businessDepartment: null,
|
||||
salesman: null,
|
||||
mnemonicCode: null,
|
||||
type: null,
|
||||
taxpayerRegistrationNumber: null,
|
||||
organization: null,
|
||||
supCustomer: null,
|
||||
retailInvestor: null,
|
||||
country: null,
|
||||
timeZone: null,
|
||||
dataFormat: null,
|
||||
contactName: null,
|
||||
shipment: null,
|
||||
taxCategory: null
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm")
|
||||
this.handleQuery()
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "添加客户"
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const id = row.id || this.ids
|
||||
getBasCustomer(id).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改客户"
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateBasCustomer(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addBasCustomer(this.form).then(response => {
|
||||
this.$modal.msgSuccess("添加成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
/** 获取仓库列表 */
|
||||
getWarehouseList() {
|
||||
listWarehouse(this.queryWarehouseParams).then(response => {
|
||||
this.warehouseOptions = response.rows;
|
||||
if (this.warehouseOptions.length > 0) {
|
||||
this.handleQuery();
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids
|
||||
this.$modal.confirm('是否确认删除客户编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delBasCustomer(ids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
async handleTrayChange() {
|
||||
const code = (this.formData.trayCode || '').toString().trim()
|
||||
if (!code) {
|
||||
this.taskDetails = []
|
||||
return
|
||||
}
|
||||
this.loading = true
|
||||
try {
|
||||
const res = await getTaskDetail({ trayCode: code })
|
||||
const rows = Array.isArray(res?.data) ? res.data : (Array.isArray(res?.rows) ? res.rows : [])
|
||||
this.taskDetails = rows
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
async submitForm() {
|
||||
const code = (this.formData.trayCode || '').toString().trim()
|
||||
if (!code) {
|
||||
this.$message.error('请输入托盘码')
|
||||
return
|
||||
}
|
||||
const code1 = (this.formData.warehouseId || '').toString().trim()
|
||||
if (!code1) {
|
||||
this.$message.error('请选择仓库')
|
||||
return
|
||||
}
|
||||
this.loading = true
|
||||
try {
|
||||
const res = await ckMakeSure({ trayCode: code,warehouseId:code1 })
|
||||
if (res.code === 200) {
|
||||
this.$message.success('出库确认成功')
|
||||
this.resetForm()
|
||||
} else {
|
||||
this.$message.error(res.msg || '出库确认失败')
|
||||
}
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
resetForm() {
|
||||
this.$refs['elForm'].resetFields()
|
||||
this.taskDetails = []
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('bas/BasCustomer/export', {
|
||||
...this.queryParams
|
||||
}, `BasCustomer_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
/* 统一表单控件宽度 */
|
||||
.el-select,
|
||||
.el-input {
|
||||
width: 100%;
|
||||
}
|
||||
<style>
|
||||
</style>
|
||||
|
||||
@@ -1,355 +1,248 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="客户编号" prop="customerNo">
|
||||
<el-input v-model="queryParams.customerNo" placeholder="请输入客户编号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户名称" prop="customerName">
|
||||
<el-input v-model="queryParams.customerName" placeholder="请输入客户名称" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="简称" prop="simpleName">
|
||||
<el-input v-model="queryParams.simpleName" placeholder="请输入简称" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否可用" prop="useable">
|
||||
<el-select v-model="queryParams.useable" placeholder="请选择是否可用" clearable>
|
||||
<div>
|
||||
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
|
||||
<el-form-item label="仓库" prop="warehouseId">
|
||||
<el-select
|
||||
v-model="formData.warehouseId"
|
||||
placeholder="请选择仓库"
|
||||
clearable
|
||||
:style="{width: '15%'}"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.is_available"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
v-for="item in warehouseOptions"
|
||||
:key="item.warehouseId"
|
||||
:label="item.warehouseName"
|
||||
:value="item.warehouseId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
<el-form-item label="托盘码" prop="trayCode">
|
||||
<el-input
|
||||
v-model="formData.trayCode"
|
||||
placeholder="请输入托盘码"
|
||||
:maxlength="8"
|
||||
show-word-limit
|
||||
clearable
|
||||
prefix-icon='el-icon-mobile'
|
||||
:style="{width: '15%'}"
|
||||
@change="handleTrayChange"
|
||||
@keyup.enter.native="handleTrayChange"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="openAddDialog">新增物料</el-button>
|
||||
<el-button type="warning" @click="submitCheck">提交盘点</el-button>
|
||||
</el-form-item>
|
||||
<el-card style="margin-top: 16px;">
|
||||
<div slot="header">盘点任务物资</div>
|
||||
<el-table v-loading="loading" :data="editableRows">
|
||||
<el-table-column label="物料编码" align="left" prop="productId" />
|
||||
<el-table-column label="物料名称" align="left" prop="productName" />
|
||||
<el-table-column label="原数量" align="right" prop="origQuantity" />
|
||||
<el-table-column label="盘点数量">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="scope.row.countedQuantity" :min="0" :step="1" controls-position="right"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="差异" align="right">
|
||||
<template slot-scope="scope">
|
||||
{{ (Number(scope.row.countedQuantity||0)) - (Number(scope.row.origQuantity||0)) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="来源" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.isNew ? '新增' : '现有' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<!-- <el-card style="margin-top: 16px;">
|
||||
<div slot="header">已保存的盘点</div>
|
||||
<el-table :data="savedCheck">
|
||||
<el-table-column label="物料编码" align="left" prop="productId" />
|
||||
<el-table-column label="物料名称" align="left" prop="productName" />
|
||||
<el-table-column label="盘点数量" align="right" prop="countedQuantity" />
|
||||
</el-table>
|
||||
</el-card>-->
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['bas:BasCustomer:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['bas:BasCustomer:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['bas:BasCustomer:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['bas:BasCustomer:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="BasCustomerList" @selection-change="handleSelectionChange" max-height="700">
|
||||
<el-table-column type="selection" align="center" />
|
||||
<el-table-column label="客户编号" align="left" prop="customerNo" />
|
||||
<!-- <el-table-column label="客户类别" align="left" prop="customerGroupNo" /> -->
|
||||
<el-table-column label="客户名称" align="left" prop="customerName" />
|
||||
<el-table-column label="简称" align="left" prop="simpleName" />
|
||||
<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-column label="备注" align="left" prop="remark" />
|
||||
<!-- <el-table-column width="120" label="业务部门" align="left" prop="businessDepartment" />
|
||||
<el-table-column width="120" label="业务员" align="left" prop="salesman" />
|
||||
<el-table-column width="120" label="助记码" align="left" prop="mnemonicCode" />
|
||||
<el-table-column width="120" label="客户类型" align="left" prop="type" />
|
||||
<el-table-column width="120" label="纳税人识别号" align="left" prop="taxpayerRegistrationNumber" />
|
||||
<el-table-column width="120" label="财务组织" align="left" prop="organization" />
|
||||
<el-table-column width="120" label="上级客户" align="left" prop="supCustomer" />
|
||||
<el-table-column width="120" label="个人客户" align="left" prop="retailInvestor" />
|
||||
<el-table-column width="120" label="国家/地区" align="left" prop="country" />
|
||||
<el-table-column width="120" label="时区" align="left" prop="timeZone" />
|
||||
<el-table-column width="120" label="数据格式" align="left" prop="dataFormat" />
|
||||
<el-table-column width="120" label="联系人" align="left" prop="contactName" />
|
||||
<el-table-column width="120" label="装运国家" align="left" prop="shipment" />
|
||||
<el-table-column width="120" label="税种" align="left" prop="taxCategory" /> -->
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['bas:BasCustomer:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['bas:BasCustomer:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改客户对话框 -->
|
||||
<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="customerNo">
|
||||
<el-input v-model="form.customerNo" placeholder="请输入客户编号" />
|
||||
<el-dialog :title="'新增物料'" :visible.sync="addOpen" width="500px" append-to-body>
|
||||
<el-form ref="addForm" :model="addForm" :rules="addRules" label-width="90px">
|
||||
<el-form-item label="物料编码" prop="productId">
|
||||
<el-input v-model="addForm.productId" placeholder="请输入物料编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户名称" prop="customerName">
|
||||
<el-input v-model="form.customerName" placeholder="请输入客户名称" />
|
||||
<el-form-item label="物料名称" prop="productName">
|
||||
<el-input v-model="addForm.productName" placeholder="请输入物料名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="简称" prop="simpleName">
|
||||
<el-input v-model="form.simpleName" placeholder="请输入简称" />
|
||||
<el-form-item label="盘点数量" prop="countedQuantity">
|
||||
<el-input-number v-model="addForm.countedQuantity" :min="0" :step="1" controls-position="right" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否可用" prop="useable">
|
||||
<el-select v-model="form.useable" placeholder="请选择是否可用">
|
||||
<el-option
|
||||
v-for="dict in dict.type.is_available"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="业务部门" prop="businessDepartment">
|
||||
<el-input v-model="form.businessDepartment" placeholder="请输入业务部门" />
|
||||
</el-form-item>
|
||||
<el-form-item label="业务员" prop="salesman">
|
||||
<el-input v-model="form.salesman" placeholder="请输入业务员" />
|
||||
</el-form-item>
|
||||
<el-form-item label="助记码" prop="mnemonicCode">
|
||||
<el-input v-model="form.mnemonicCode" placeholder="请输入助记码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户类型" prop="type">
|
||||
<el-input v-model="form.type" placeholder="请输入客户类型" />
|
||||
</el-form-item>
|
||||
<el-form-item label="纳税人识别号" prop="taxpayerRegistrationNumber">
|
||||
<el-input v-model="form.taxpayerRegistrationNumber" placeholder="请输入纳税人识别号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="财务组织" prop="organization">
|
||||
<el-input v-model="form.organization" placeholder="请输入财务组织" />
|
||||
</el-form-item>
|
||||
<el-form-item label="上级客户" prop="supCustomer">
|
||||
<el-input v-model="form.supCustomer" placeholder="请输入上级客户" />
|
||||
</el-form-item>
|
||||
<el-form-item label="个人客户" prop="retailInvestor">
|
||||
<el-input v-model="form.retailInvestor" placeholder="请输入个人客户" />
|
||||
</el-form-item>
|
||||
<el-form-item label="国家/地区" prop="country">
|
||||
<el-input v-model="form.country" placeholder="请输入国家/地区" />
|
||||
</el-form-item>
|
||||
<el-form-item label="时区" prop="timeZone">
|
||||
<el-input v-model="form.timeZone" placeholder="请输入时区" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数据格式" prop="dataFormat">
|
||||
<el-input v-model="form.dataFormat" placeholder="请输入数据格式" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人" prop="contactName">
|
||||
<el-input v-model="form.contactName" placeholder="请输入联系人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="装运国家" prop="shipment">
|
||||
<el-input v-model="form.shipment" placeholder="请输入装运国家" />
|
||||
</el-form-item>
|
||||
<el-form-item label="税种" prop="taxCategory">
|
||||
<el-input v-model="form.taxCategory" placeholder="请输入税种" />
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确定</el-button>
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button type="primary" @click="confirmAdd">确 定</el-button>
|
||||
<el-button @click="addOpen=false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listBasCustomer, getBasCustomer, delBasCustomer, addBasCustomer, updateBasCustomer } from "@/api/bas/BasCustomer"
|
||||
|
||||
import { getTrayMaterials,confirmPandian } from '@/api/rf/rf'
|
||||
import {listWarehouse} from "@/api/bas/warehouse";
|
||||
import { saveCheckStock } from '@/api/check/stockCheck'
|
||||
|
||||
|
||||
export default {
|
||||
name: "BasCustomer",
|
||||
dicts:['is_available'],
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 客户管理表格数据
|
||||
BasCustomerList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
customerNo: null,
|
||||
customerGroupNo: null,
|
||||
customerName: null,
|
||||
simpleName: null,
|
||||
useable: null,
|
||||
businessDepartment: null,
|
||||
salesman: null,
|
||||
mnemonicCode: null,
|
||||
type: null,
|
||||
taxpayerRegistrationNumber: null,
|
||||
organization: null,
|
||||
supCustomer: null,
|
||||
retailInvestor: null,
|
||||
country: null,
|
||||
timeZone: null,
|
||||
dataFormat: null,
|
||||
contactName: null,
|
||||
shipment: null,
|
||||
taxCategory: null
|
||||
formData: {
|
||||
trayCode: '',
|
||||
warehouseId: '',
|
||||
},
|
||||
loading: false,
|
||||
editableRows: [],
|
||||
savedCheck: [],
|
||||
addOpen: false,
|
||||
addForm: {
|
||||
productId: '',
|
||||
productName: '',
|
||||
countedQuantity: 0
|
||||
},
|
||||
addRules: {
|
||||
productId: [
|
||||
{ required: true, message: '请输入物料编码', trigger: 'blur' }
|
||||
],
|
||||
productName: [
|
||||
{ required: true, message: '请输入物料名称', trigger: 'blur' }
|
||||
],
|
||||
countedQuantity: [
|
||||
{ required: true, message: '请输入盘点数量', trigger: 'change' }
|
||||
]
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
id: [
|
||||
{ required: true, message: "ID不能为空", trigger: "blur" }
|
||||
],
|
||||
customerNo: [
|
||||
{ required: true, message: "客户编号不能为空", trigger: "blur" }
|
||||
],
|
||||
customerName: [
|
||||
{ required: true, message: "客户名称不能为空", trigger: "blur" }
|
||||
],
|
||||
useable: [
|
||||
{ required: true, message: "是否可用不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
trayCode: [{
|
||||
required: true,
|
||||
message: '请输入托盘码',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
},
|
||||
warehouseOptions:[],
|
||||
queryWarehouseParams:{
|
||||
pageNum:1,
|
||||
pageSize:99
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
this.getList()
|
||||
this.getWarehouseList()
|
||||
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
/** 查询客户管理列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listBasCustomer(this.queryParams).then(response => {
|
||||
this.BasCustomerList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
customerNo: null,
|
||||
customerGroupNo: null,
|
||||
customerName: null,
|
||||
simpleName: null,
|
||||
useable: null,
|
||||
remark: null,
|
||||
businessDepartment: null,
|
||||
salesman: null,
|
||||
mnemonicCode: null,
|
||||
type: null,
|
||||
taxpayerRegistrationNumber: null,
|
||||
organization: null,
|
||||
supCustomer: null,
|
||||
retailInvestor: null,
|
||||
country: null,
|
||||
timeZone: null,
|
||||
dataFormat: null,
|
||||
contactName: null,
|
||||
shipment: null,
|
||||
taxCategory: null
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm")
|
||||
this.handleQuery()
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "添加客户"
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const id = row.id || this.ids
|
||||
getBasCustomer(id).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改客户"
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateBasCustomer(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addBasCustomer(this.form).then(response => {
|
||||
this.$modal.msgSuccess("添加成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
/** 获取仓库列表 */
|
||||
getWarehouseList() {
|
||||
listWarehouse(this.queryWarehouseParams).then(response => {
|
||||
this.warehouseOptions = response.rows;
|
||||
if (this.warehouseOptions.length > 0) {
|
||||
this.handleQuery();
|
||||
}
|
||||
});
|
||||
},
|
||||
async handleTrayChange() {
|
||||
const trayCode = (this.formData.trayCode || '').toString().trim()
|
||||
if (!trayCode) {
|
||||
this.$message.error('请输入托盘条码')
|
||||
return
|
||||
}
|
||||
const warehouseId = (this.formData.warehouseId || '').toString().trim()
|
||||
if (!warehouseId) {
|
||||
this.$message.error('请选择仓库')
|
||||
return
|
||||
}
|
||||
this.loading = true
|
||||
try {
|
||||
const res = await getTrayMaterials({trayCode: trayCode,warehouseId:warehouseId })
|
||||
const rows = Array.isArray(res?.data) ? res.data : (Array.isArray(res?.rows) ? res.rows : [])
|
||||
this.editableRows = rows.map(it => ({
|
||||
stockId: it.stockId,
|
||||
productId: it.productId,
|
||||
productName: it.productName || it.materialDesc,
|
||||
origQuantity: Number(it.outQuantity || 0),
|
||||
countedQuantity: Number(it.outQuantity || 0),
|
||||
isNew: false,
|
||||
inOrOutDId: it.inOrOutDId,
|
||||
jobDetailId: it.jobDetailId,
|
||||
}))
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
openAddDialog() {
|
||||
this.addForm = { productId: '', productName: '', countedQuantity: 0 }
|
||||
this.addOpen = true
|
||||
},
|
||||
confirmAdd() {
|
||||
if (!this.addForm.productId){
|
||||
this.$message.error('请输入物料编码')
|
||||
return
|
||||
}
|
||||
if (!this.addForm.productName){
|
||||
this.$message.error('请输入物料名称')
|
||||
return
|
||||
}
|
||||
if (!this.addForm.countedQuantity){
|
||||
this.$message.error('请输入盘点数量')
|
||||
return
|
||||
}
|
||||
|
||||
this.editableRows.push({
|
||||
productId: this.addForm.productId,
|
||||
productName: this.addForm.productName,
|
||||
origQuantity: 0,
|
||||
countedQuantity: this.addForm.countedQuantity,
|
||||
isNew: true
|
||||
})
|
||||
this.addOpen = false
|
||||
},
|
||||
async submitCheck() {
|
||||
const code = (this.formData.trayCode || '').toString().trim()
|
||||
if (!code) {
|
||||
this.$message.error('请输入托盘码')
|
||||
return
|
||||
}
|
||||
/*if (this.savedCheck.length === 0) {
|
||||
this.$message.error('没有已保存的盘点数据')
|
||||
return
|
||||
}*/
|
||||
const payload = {
|
||||
trayCode: code,
|
||||
warehouseId: this.formData.warehouseId,
|
||||
materials: this.editableRows.map(d => ({
|
||||
productId: d.productId,
|
||||
inQuantity: d.countedQuantity,
|
||||
inOrOutDId: d.inOrOutDId,
|
||||
jobDetailId: d.jobDetailId,
|
||||
stockId: d.stockId
|
||||
}))
|
||||
}
|
||||
await confirmPandian(payload).then(() => {
|
||||
this.$message.success('盘点提交成功')
|
||||
this.editableRows = []
|
||||
this.resetForm()
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids
|
||||
this.$modal.confirm('是否确认删除客户编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delBasCustomer(ids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
resetForm() {
|
||||
this.$refs['elForm'].resetFields()
|
||||
this.editableRows = []
|
||||
this.savedCheck = []
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('bas/BasCustomer/export', {
|
||||
...this.queryParams
|
||||
}, `BasCustomer_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/* 统一表单控件宽度 */
|
||||
.el-select,
|
||||
.el-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
232
ruoyi-ui/src/views/rf/pkIn.vue
Normal file
232
ruoyi-ui/src/views/rf/pkIn.vue
Normal file
@@ -0,0 +1,232 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
|
||||
<el-form-item label="仓库" prop="warehouseId">
|
||||
<el-select
|
||||
v-model="formData.warehouseId"
|
||||
placeholder="请选择仓库"
|
||||
clearable
|
||||
:style="{width: '15%'}"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in warehouseOptions"
|
||||
:key="item.warehouseId"
|
||||
:label="item.warehouseName"
|
||||
:value="item.warehouseId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="托盘码" prop="trayCode">
|
||||
<el-input
|
||||
v-model="formData.trayCode"
|
||||
:maxlength="8"
|
||||
show-word-limit
|
||||
placeholder="请输入条码"
|
||||
clearable
|
||||
:style="{width: '15%'}"
|
||||
@change="handleTrayChange"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库子单" prop="stockinDetailId">
|
||||
<el-input
|
||||
v-model="formData.stockinDetailId"
|
||||
placeholder="请输入入库子单"
|
||||
clearable
|
||||
:style="{width: '15%'}"
|
||||
@keyup.enter.native="handleQueryDetail"
|
||||
@change="handleQueryDetail"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-card style="margin-top: 16px;">
|
||||
<div slot="header">托盘已绑定物料</div>
|
||||
<el-table v-if="trayMaterials && trayMaterials.length" :data="trayMaterials" size="small">
|
||||
<el-table-column label="子单编码" align="left" prop="stockinDetailId"/>
|
||||
<el-table-column label="物料名称" align="left" prop="productName"/>
|
||||
<el-table-column label="数量" align="right" prop="quantity"/>
|
||||
</el-table>
|
||||
<el-empty v-else description="暂无数据"></el-empty>
|
||||
</el-card>
|
||||
<el-form-item size="large">
|
||||
<el-button type="primary" @click="submitForm">确认入库</el-button>
|
||||
<el-button @click="resetForm">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
|
||||
<el-dialog :title="'入库子单详情'" :visible.sync="detailOpen" width="1400px" append-to-body>
|
||||
<el-table v-if="detailRow" :data="[detailRow]" size="small">
|
||||
<el-table-column label="子单ID" align="left" prop="stockinDetailId" />
|
||||
<el-table-column label="物料编码" align="left" prop="productId"/>
|
||||
<el-table-column label="物料名称" align="left" prop="productName"/>
|
||||
<el-table-column label="台次" align="left" prop="spare5"/>
|
||||
<el-table-column label="合同号" align="left" prop="spare6"/>
|
||||
<el-table-column label="入库数量" align="right">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="inQuantity" :min="1" :max="remainQty" :step="1" controls-position="right"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="confirmBind">确 定</el-button>
|
||||
<el-button @click="detailOpen=false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getStockInDetail} from '@/api/in/stockInDetail'
|
||||
import { bindTray ,getTrayInfo ,addInJobpk} from '@/api/rf/rf'
|
||||
import {listWarehouse} from "@/api/bas/warehouse";
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
warehouseId: undefined,
|
||||
trayCode: undefined,
|
||||
stockinDetailId: undefined,
|
||||
},
|
||||
detailLoading: false,
|
||||
detailOpen: false,
|
||||
detailRow: null,
|
||||
inQuantity: null,
|
||||
trayMaterials: [],
|
||||
warehouseOptions:[],
|
||||
queryWarehouseParams:{
|
||||
pageNum:1,
|
||||
pageSize:99,
|
||||
warehouseType:2
|
||||
},
|
||||
rules: {
|
||||
warehouseId: [{
|
||||
required: true,
|
||||
message: '请输入仓库号仓库',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
trayCode: [{
|
||||
required: true,
|
||||
message: '请输入条码',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
stockinDetailId: [{
|
||||
required: true,
|
||||
message: '请输入入库子单',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
remainQty() {
|
||||
const plan = this.detailRow && Number(this.detailRow.quantity || 0)
|
||||
const assigned = this.detailRow && Number(this.detailRow.scanNum || 0)
|
||||
const remain = (plan || 0) - (assigned || 0)
|
||||
return remain > 0 ? remain : 0
|
||||
}
|
||||
},
|
||||
watch: {},
|
||||
created() {
|
||||
this.getWarehouseList()
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
/** 获取仓库列表 */
|
||||
getWarehouseList() {
|
||||
listWarehouse(this.queryWarehouseParams).then(response => {
|
||||
this.warehouseOptions = response.rows;
|
||||
if (this.warehouseOptions.length > 0) {
|
||||
this.handleQuery();
|
||||
}
|
||||
});
|
||||
},
|
||||
async handleTrayChange() {
|
||||
const code = (this.formData.trayCode || '').toString().trim()
|
||||
if (!code) {
|
||||
this.trayMaterials = []
|
||||
return
|
||||
}
|
||||
const res = await getTrayInfo(code)
|
||||
this.trayMaterials = res.data || res.rows || []
|
||||
},
|
||||
async handleQueryDetail() {
|
||||
const id = (this.formData.stockinDetailId || '').toString().trim()
|
||||
if (!id) return
|
||||
this.detailLoading = true
|
||||
try {
|
||||
const res = await getStockInDetail(id)
|
||||
this.detailRow = res.data || null
|
||||
if (!this.detailRow) {
|
||||
this.$message.error('未找到入库子单')
|
||||
return
|
||||
}
|
||||
const remain = this.remainQty
|
||||
this.inQuantity = remain > 0 ? remain : 1
|
||||
this.detailOpen = !!this.detailRow
|
||||
} finally {
|
||||
this.detailLoading = false
|
||||
}
|
||||
},
|
||||
submitForm() {
|
||||
if (!this.formData.warehouseId){
|
||||
this.$message.error('请输入仓库号')
|
||||
return
|
||||
}
|
||||
if (!this.formData.trayCode){
|
||||
this.$message.error('请输入托盘码')
|
||||
return
|
||||
}
|
||||
addInJobpk(this.formData).then(() => {
|
||||
this.$message.success('入库成功')
|
||||
this.resetForm()
|
||||
})
|
||||
},
|
||||
resetForm() {
|
||||
this.$refs['elForm'].resetFields()
|
||||
this.trayMaterials = []
|
||||
},
|
||||
confirmBind() {
|
||||
if (!this.detailRow) return
|
||||
const remain = this.remainQty
|
||||
if (remain <= 0) {
|
||||
this.$message.error('无剩余数量可入库')
|
||||
return
|
||||
}
|
||||
const qty = Number(this.inQuantity || 0)
|
||||
if (!qty || qty < 1) {
|
||||
this.$message.error('请输入入库数量')
|
||||
return
|
||||
}
|
||||
if (qty > remain) {
|
||||
this.$message.error('入库数量不能超过剩余数量')
|
||||
return
|
||||
}
|
||||
if (!this.formData.trayCode){
|
||||
this.$message.error('请输入托盘码')
|
||||
return
|
||||
}
|
||||
if (!this.formData.warehouseId){
|
||||
this.$message.error('请输入仓库号')
|
||||
return
|
||||
}
|
||||
const payload = {
|
||||
trayCode: this.formData.trayCode,
|
||||
stockinDetailId: this.formData.stockinDetailId,
|
||||
inQuantity: qty,
|
||||
warehouseId: this.formData.warehouseId
|
||||
}
|
||||
bindTray(payload).then(() => {
|
||||
this.$message.success('绑定成功')
|
||||
this.detailOpen = false
|
||||
this.handleTrayChange()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
Reference in New Issue
Block a user