Merge remote-tracking branch 'origin/master'

This commit is contained in:
猫猫guowen
2025-08-21 11:19:11 +08:00
15 changed files with 354 additions and 62 deletions

View File

@@ -4,10 +4,13 @@
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
export default { export default {
globalData: {
config: {}
},
onLaunch: function() { onLaunch: function() {
this.initApp() this.initApp()
}, },
onShow: function() { onShow: function() {
// 检查应用状态,确保从后台恢复时状态一致 // 检查应用状态,确保从后台恢复时状态一致
this.checkAppState() this.checkAppState()
}, },
@@ -30,27 +33,36 @@
} }
}, },
checkAppState() { checkAppState() {
// 检查Token状态和页面导航栈状态
console.log('应用从后台切换到前台,检查应用状态')
// 检查Token状态和页面导航栈状态
console.log('应用从后台切换到前台,检查应用状态') // 获取当前页面路径,判断是否在登录页
// 检查Token状态 const pages = getCurrentPages()
if (!getToken()) { const currentPage = pages[pages.length - 1]
console.log('Token不存在,提示并跳转到登录页') const currentPagePath = currentPage ? currentPage.route : ''
uni.showToast({
icon: 'none', // 如果当前页面是登录页,则不检查token
title: '登录已过期,请重新登录' if (currentPagePath === 'pages/login') {
}) console.log('当前已在登录页面,不进行token检查')
setTimeout(() => { return
uni.reLaunch({ url: loginPage }) }
}, 1500)
} else { // 检查Token状态
console.log('Token存在,不做操作') if (!getToken()) {
} console.log('Token不存在,提示并跳转到登录页')
uni.showToast({
// 注意:应用从后台切换到前台的逻辑已在permission.js中处理 icon: 'none',
// 这里不需要重复处理,保留此方法以便未来扩展 title: '登录已过期,请重新登录'
} })
setTimeout(() => {
uni.reLaunch({ url: '/pages/login' })
}, 1500)
} else {
console.log('Token存在,不做操作')
}
}
} }
} }

View File

@@ -44,6 +44,11 @@
"desc": "Cycle Count, Spot Check" "desc": "Cycle Count, Spot Check"
} }
}, },
"tabBar": {
"workbench": "Workbench",
"task": "Task",
"mine": "Mine"
},
"login": { "login": {
"title": "Login", "title": "Login",
"username": "Username", "username": "Username",
@@ -94,6 +99,16 @@
"settingsSaved": "Settings saved", "settingsSaved": "Settings saved",
"saveSettingsFailed": "Failed to save settings" "saveSettingsFailed": "Failed to save settings"
}, },
"spaceAnalysis": {
"warehouse": "Warehouse:",
"warehousePlaceholder": "Please select a warehouse",
"cargoSpaceStatus": "Cargo Space Status Distribution",
"aisleStatistics": "Aisle Inbound/Outbound Statistics",
"quantity": "Quantity",
"inboundQuantity": "Inbound Quantity",
"outboundQuantity": "Outbound Quantity",
"aisle": "Aisle"
},
"task": { "task": {
"list": { "list": {
"all": "All", "all": "All",
@@ -450,4 +465,5 @@
"getInventoryListFailed": "Failed to get inventory list" "getInventoryListFailed": "Failed to get inventory list"
} }
} }
} }

View File

@@ -44,6 +44,11 @@
"desc": "周期盘点、抽查" "desc": "周期盘点、抽查"
} }
}, },
"tabBar": {
"workbench": "工作台",
"task": "任务",
"mine": "我的"
},
"login": { "login": {
"title": "登录", "title": "登录",
"username": "用户名", "username": "用户名",
@@ -94,6 +99,16 @@
"settingsSaved": "设置已保存", "settingsSaved": "设置已保存",
"saveSettingsFailed": "保存设置失败" "saveSettingsFailed": "保存设置失败"
}, },
"spaceAnalysis": {
"warehouse": "仓库:",
"warehousePlaceholder": "请选择仓库",
"cargoSpaceStatus": "货位状态分布",
"aisleStatistics": "巷道出入库统计",
"quantity": "数量",
"inboundQuantity": "入库数量",
"outboundQuantity": "出库数量",
"aisle": "巷道"
},
"task": { "task": {
"list": { "list": {
"all": "全部", "all": "全部",
@@ -451,4 +466,5 @@
"getInventoryListFailed": "获取库存列表失败" "getInventoryListFailed": "获取库存列表失败"
} }
} }
} }

View File

@@ -1,5 +1,5 @@
{ {
"name" : "若依移动端", "name" : "手持机",
"appid" : "__UNI__A2DE016", "appid" : "__UNI__A2DE016",
"description" : "", "description" : "",
"versionName" : "1.1.0", "versionName" : "1.1.0",

View File

@@ -2,12 +2,12 @@
<view class="container"> <view class="container">
<view class="warehouse-selector"> <view class="warehouse-selector">
<uni-forms> <uni-forms>
<uni-forms-item label="仓库:"> <uni-forms-item :label="$t('spaceAnalysis.warehouse')">
<uni-data-select <uni-data-select
v-model="selectedWarehouseId" v-model="selectedWarehouseId"
:localdata="warehouseList" :localdata="warehouseList"
:clear="false" :clear="false"
placeholder="请选择仓库" :placeholder="$t('spaceAnalysis.warehousePlaceholder')"
@change="handleWarehouseChange" @change="handleWarehouseChange"
/> />
</uni-forms-item> </uni-forms-item>
@@ -58,7 +58,7 @@ export default {
}, },
pieOpts: { pieOpts: {
title: { title: {
name: '货位状态分布', name: this.$t('spaceAnalysis.cargoSpaceStatus'),
fontSize: 15 fontSize: 15
}, },
legend: { legend: {
@@ -86,7 +86,7 @@ export default {
}, },
columnOpts: { columnOpts: {
title: { title: {
name: '巷道出入库统计', name: this.$t('spaceAnalysis.aisleStatistics'),
fontSize: 15 fontSize: 15
}, },
legend: { legend: {
@@ -96,7 +96,7 @@ export default {
fontSize: 12 fontSize: 12
}, },
yAxis: { yAxis: {
name: '数量', name: this.$t('spaceAnalysis.quantity'),
fontSize: 12 fontSize: 12
}, },
extra: { extra: {
@@ -159,12 +159,12 @@ export default {
if (res.code === 200 && res.data) { if (res.code === 200 && res.data) {
// 更新柱状图数据 // 更新柱状图数据
this.columnData = { this.columnData = {
categories: ['1巷道'], categories: [`1${this.$t('spaceAnalysis.aisle')}`],
series: [{ series: [{
name: '入库数量', name: this.$t('spaceAnalysis.inboundQuantity'),
data:[res.data["in"]] data:[res.data["in"]]
},{ },{
name: '出库数量', name: this.$t('spaceAnalysis.outboundQuantity'),
data:[res.data["out"]] data:[res.data["out"]]
}] }]
} }

View File

@@ -78,7 +78,8 @@
</template> </template>
<script> <script>
import { getPrepareTask } from '@/api/search/job.js' import { getPrepareTask } from '@/api/search/job'
export default { export default {
data() { data() {
return { return {

View File

@@ -874,17 +874,6 @@ public class PdaServiceImp implements PdaService {
BasContainerDetails basContainer = basContainerDetails1.get(0); BasContainerDetails basContainer = basContainerDetails1.get(0);
return agvRequest(basContainer.getContainerId(), startPoint, endPoint); return agvRequest(basContainer.getContainerId(), startPoint, endPoint);
//
// String result = HttpUtil.post("http://192.168.1.100:8080/agv/api/receiveAgvMoveJob", "startPoint=" + startPoint + "&endPoint=" + endPoint + "&containerCode=" + basContainer.getContainerId());
// //接口的返回结果为AjaxResult,从result中获取code
//
// //获取code
// int code = JSONObject.parseObject(result).getIntValue("code");
// if (code == 200) {
// return AjaxResult.success(result);
// } else {
// return AjaxResult.warn(JSONObject.parseObject(result).getString("msg"));
// }
} }

View File

@@ -99,6 +99,7 @@ public class SysLoginController
public AjaxResult changeLanguage(String lang) public AjaxResult changeLanguage(String lang)
{ {
return AjaxResult.success(); return AjaxResult.success();
} }
} }

View File

@@ -3811,6 +3811,8 @@ export default {
}, },
// ***************客户管理************** // ***************客户管理**************
basCustomer: { basCustomer: {
customerManagement:'客户管理',
customerNo: '客户编号', customerNo: '客户编号',
customerGroupNo: '客户基本分类', customerGroupNo: '客户基本分类',
customerName: '客户名称', customerName: '客户名称',

View File

@@ -332,6 +332,7 @@ export default {
}, },
// ***************出库单据管理************** // ***************出库单据管理**************
outStockoutManage: { outStockoutManage: {
customerManagement:'客户管理',
stockoutId: '出库单编号', stockoutId: '出库单编号',
outType: '出库类型', outType: '出库类型',
status: '单据状态', status: '单据状态',
@@ -3811,6 +3812,7 @@ export default {
}, },
// ***************客户管理************** // ***************客户管理**************
basCustomer: { basCustomer: {
customerManagement:'客户管理',
customerNo: '客户编号', customerNo: '客户编号',
customerGroupNo: '客户基本分类', customerGroupNo: '客户基本分类',
customerName: '客户名称', customerName: '客户名称',

View File

@@ -332,6 +332,7 @@ export default {
}, },
// ***************出库单据管理************** // ***************出库单据管理**************
outStockoutManage: { outStockoutManage: {
stockoutId: '出库单编号', stockoutId: '出库单编号',
outType: '出库类型', outType: '出库类型',
status: '单据状态', status: '单据状态',
@@ -3811,6 +3812,7 @@ export default {
}, },
// ***************客户管理************** // ***************客户管理**************
basCustomer: { basCustomer: {
customerManagement:'客户管理',
customerNo: '客户编号', customerNo: '客户编号',
customerGroupNo: '客户基本分类', customerGroupNo: '客户基本分类',
customerName: '客户名称', customerName: '客户名称',

View File

@@ -6,7 +6,7 @@
</div> </div>
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row> <el-row>
<el-col :span="8"> <el-col :span="6">
<el-form-item :label="$t('receiveStockinAdd.warehouse')" prop="warehouseId"> <el-form-item :label="$t('receiveStockinAdd.warehouse')" prop="warehouseId">
<el-select v-model="form.warehouseId" :placeholder="$t('receiveStockinAdd.selectWarehouse')"> <el-select v-model="form.warehouseId" :placeholder="$t('receiveStockinAdd.selectWarehouse')">
<el-option <el-option
@@ -18,16 +18,14 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="6">
<el-form-item :label="$t('receiveStockinAdd.supplier')" prop="supplierId"> <el-form-item :label="$t('receiveStockinAdd.supplier')" prop="supplierId">
<el-select v-model="form.supplierId" :placeholder="$t('receiveStockinAdd.selectSupplier')"> <el-input
<el-option v-model="form.supplierName"
v-for="item in supplierOptions" :placeholder="$t('receiveStockinAdd.selectSupplier')"
:key="item.id" @click.native="openSupplierSelector"
:label="item.simpleName" readonly
:value="item.supplierNo" />
/>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="8"> <!-- <el-col :span="8">
@@ -35,7 +33,7 @@
<el-input v-model="form.batchNo" placeholder="请输入批次号" /> <el-input v-model="form.batchNo" placeholder="请输入批次号" />
</el-form-item> </el-form-item>
</el-col>--> </el-col>-->
<el-col :span="8"> <el-col :span="6">
<el-form-item :label="$t('receiveStockinAdd.remark')" prop="remark"> <el-form-item :label="$t('receiveStockinAdd.remark')" prop="remark">
<el-input v-model="form.remark" :placeholder="$t('receiveStockinAdd.inputRemark')"/> <el-input v-model="form.remark" :placeholder="$t('receiveStockinAdd.inputRemark')"/>
</el-form-item> </el-form-item>
@@ -202,6 +200,67 @@
<el-button @click="upload.open = false">{{ $t('receiveStockinAdd.cancel') }}</el-button> <el-button @click="upload.open = false">{{ $t('receiveStockinAdd.cancel') }}</el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 供应商选择对话框 -->
<el-dialog title="选择供应商" :visible.sync="supplierDialog" width="800px" append-to-body>
<el-form :model="supplierQueryParams" ref="supplierQueryForm" :inline="true">
<el-form-item label="供应商编号" prop="supplierNo">
<el-input
v-model="supplierQueryParams.supplierNo"
placeholder="请输入供应商编号"
clearable
size="small"
@keyup.enter.native="handleSupplierQuery"
/>
</el-form-item>
<el-form-item label="供应商名称" prop="supplierName">
<el-input
v-model="supplierQueryParams.supplierName"
placeholder="请输入供应商名称"
clearable
size="small"
@keyup.enter.native="handleSupplierQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleSupplierQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetSupplierQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table
ref="supplierTable"
v-loading="supplierLoading"
:data="supplierList"
border
@row-click="handleSupplierRowClick"
highlight-current-row
style="width: 100%"
>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column label="供应商编号" align="center" prop="supplierNo" />
<el-table-column label="供应商名称" align="center" prop="supplierName" />
<el-table-column label="简称" align="center" prop="simpleName" />
<el-table-column label="是否可用" align="center" prop="useable">
<template slot-scope="scope">
<dict-tag :options="dict.type.is_available" :value="scope.row.useable"/>
</template>
</el-table-column>
</el-table>
<pagination
v-show="supplierTotal > 0"
:total="supplierTotal"
:page.sync="supplierQueryParams.pageNum"
:limit.sync="supplierQueryParams.pageSize"
@pagination="getSupplierList"
/>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirmSelectSupplier">确定</el-button>
<el-button @click="cancelSelectSupplier">取消</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
@@ -215,13 +274,14 @@ import {listWarehouse} from "@/api/bas/warehouse"
export default { export default {
name: "InAdd", name: "InAdd",
dicts: ['sys_normal_disable', 'is_active', 'storage_cond'], dicts: ['sys_normal_disable', 'is_active', 'storage_cond', 'is_available'],
data() { data() {
return { return {
// 表单参数 // 表单参数
form: { form: {
warehouseId: undefined, warehouseId: undefined,
supplierId: undefined, supplierId: undefined,
supplierName: undefined,
remark: undefined, remark: undefined,
totalQuantity: 0, totalQuantity: 0,
totalAmount: 0, totalAmount: 0,
@@ -245,6 +305,24 @@ export default {
warehouseOptions: [], warehouseOptions: [],
// 供应商选项 // 供应商选项
supplierOptions: [], supplierOptions: [],
// 供应商选择对话框
supplierDialog: false,
// 供应商列表
supplierList: [],
// 选中的供应商
selectedSupplier: null,
// 供应商总数
supplierTotal: 0,
// 供应商加载状态
supplierLoading: false,
// 供应商查询参数
supplierQueryParams: {
pageNum: 1,
pageSize: 10,
supplierNo: null,
supplierName: null
},
// 物料列表 // 物料列表
productList: [], productList: [],
// 物料选择对话框 // 物料选择对话框
@@ -311,12 +389,64 @@ export default {
this.productLoading = false; this.productLoading = false;
}); });
}, },
/** 获取供应商列表 */ /** 获取供应商列表(下拉框选项) */
getSupplierList() { getSupplierList() {
listBasSupplier().then(response => { listBasSupplier().then(response => {
this.supplierOptions = response.rows; this.supplierOptions = response.rows;
}); });
}, },
/** 打开供应商选择对话框 */
openSupplierSelector() {
this.getSupplierListForDialog();
this.supplierDialog = true;
},
/** 获取供应商列表(对话框数据) */
getSupplierListForDialog() {
this.supplierLoading = true;
listBasSupplier(this.supplierQueryParams).then(response => {
this.supplierList = response.rows;
this.supplierTotal = response.total;
this.supplierLoading = false;
});
},
/** 供应商查询 */
handleSupplierQuery() {
this.supplierQueryParams.pageNum = 1;
this.getSupplierListForDialog();
},
/** 重置供应商查询 */
resetSupplierQuery() {
this.resetForm("supplierQueryForm");
// this.supplierQueryParams.useable = "0";
this.handleSupplierQuery();
},
/** 供应商行点击事件 */
handleSupplierRowClick(row) {
this.selectedSupplier = row;
this.$refs.supplierTable.setCurrentRow(row);
},
/** 确认选择供应商 */
confirmSelectSupplier() {
if (!this.selectedSupplier) {
this.$modal.msgError("请选择一个供应商");
return;
}
this.form.supplierId = this.selectedSupplier.supplierNo;
this.form.supplierName = this.selectedSupplier.supplierName;
this.supplierDialog = false;
},
/** 取消选择供应商 */
cancelSelectSupplier() {
this.selectedSupplier = null;
this.supplierDialog = false;
},
/** 添加物料按钮操作 */ /** 添加物料按钮操作 */
handleAddProduct() { handleAddProduct() {
@@ -393,6 +523,7 @@ export default {
this.form = { this.form = {
warehouseId: undefined, warehouseId: undefined,
supplierId: undefined, supplierId: undefined,
supplierName: undefined,
remark: undefined, remark: undefined,
totalQuantity: 0, totalQuantity: 0,
totalAmount: 0, totalAmount: 0,
@@ -402,6 +533,8 @@ export default {
// 重置计数器 // 重置计数器
this.totalQuantity = 0; this.totalQuantity = 0;
this.totalAmount = 0; this.totalAmount = 0;
// 清空选中的供应商
this.selectedSupplier = null;
// 重置表单校验结果 // 重置表单校验结果
this.$refs["form"].resetFields(); this.$refs["form"].resetFields();

View File

@@ -9,7 +9,7 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="$t('inReceiveStockin.materialDesc')" prop="stockSource"><!--物料描述--> <el-form-item :label="$t('inReceiveStockin.materialDesc')" prop="materialDesc"><!--物料描述-->
<el-input <el-input
v-model="queryParams.materialDesc" v-model="queryParams.materialDesc"
:placeholder="$t('inReceiveStockin.inputMaterialDesc')" :placeholder="$t('inReceiveStockin.inputMaterialDesc')"
@@ -36,7 +36,6 @@
<el-select <el-select
v-model="queryParams.status" v-model="queryParams.status"
:placeholder="$t('inReceiveStockin.selectStatus')" :placeholder="$t('inReceiveStockin.selectStatus')"
clearable
@change="handleQuery" @change="handleQuery"
> >
<el-option <el-option
@@ -327,7 +326,8 @@ export default {
departmentNo: null, departmentNo: null,
customerNo: null, customerNo: null,
classNo: null, classNo: null,
supplierNo: null supplierNo: null,
materialDesc: null
}, },
queryDetailParams: { queryDetailParams: {
pageNum: 1, pageNum: 1,
@@ -391,7 +391,8 @@ export default {
departmentNo: null, departmentNo: null,
customerNo: null, customerNo: null,
classNo: null, classNo: null,
supplierNo: null supplierNo: null,
materialDesc: null
} }
this.resetForm("form") this.resetForm("form")
}, },

View File

@@ -14,9 +14,11 @@
</el-form-item> </el-form-item>
<el-form-item :label="$t('addOutStockout.customer')" prop="customerNo" required><!--客户--> <el-form-item :label="$t('addOutStockout.customer')" prop="customerNo" required><!--客户-->
<el-input <el-input
v-model="formData.customerNo" v-model="formData.customerName"
:placeholder="$t('addOutStockout.inputCustomerNo')" :placeholder="$t('addOutStockout.inputCustomerNo')"
clearable clearable
@click.native="openCustomerSelector"
readonly
/> />
</el-form-item> </el-form-item>
<el-form-item :label="$t('addOutStockout.documentType')" prop="outType" required><!--单据类型--> <el-form-item :label="$t('addOutStockout.documentType')" prop="outType" required><!--单据类型-->
@@ -105,17 +107,68 @@
<el-button @click="cancelSelectMaterials">{{$t('addOutStockout.cancel')}}<!--取 消--></el-button> <el-button @click="cancelSelectMaterials">{{$t('addOutStockout.cancel')}}<!--取 消--></el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 选择客户弹窗 -->
<el-dialog :title="$t('basCustomer.customerManagement')" :visible.sync="customerDialog" width="800px" append-to-body>
<el-form :model="customerQueryParams" ref="customerQueryForm" size="small" :inline="true" label-width="100px">
<el-form-item :label="$t('basCustomer.customerNo')" prop="customerNo"><!--客户编号-->
<el-input
v-model="customerQueryParams.customerNo"
:placeholder="$t('basCustomer.inputCustomerNo')"
clearable
@keyup.enter.native="handleCustomerQuery"
/>
</el-form-item>
<el-form-item :label="$t('basCustomer.customerName')" prop="customerName"><!--客户名称-->
<el-input
v-model="customerQueryParams.customerName"
:placeholder="$t('basCustomer.inputCustomerName')"
clearable
@keyup.enter.native="handleCustomerQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleCustomerQuery">{{$t('addOutStockout.search')}}<!--搜索--></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetCustomerQuery">{{$t('addOutStockout.reset')}}<!--重置--></el-button>
</el-form-item>
</el-form>
<el-table ref="customerTable" v-loading="customerLoading" :data="customerList" @row-click="handleCustomerRowClick" highlight-current-row>
<el-table-column :label="$t('basCustomer.customerNo')" align="left" prop="customerNo" /><!--客户编号-->
<el-table-column :label="$t('basCustomer.customerName')" align="left" prop="customerName" /><!--客户名称-->
<!-- <el-table-column :label="$t('basCustomer.simpleName')" align="left" prop="simpleName" />客户简称 -->
<el-table-column :label="$t('basCustomer.useable')" align="left" prop="useable">
<template slot-scope="scope">
<dict-tag :options="dict.type.is_available" :value="scope.row.useable"/>
</template>
</el-table-column><!--是否可用-->
</el-table>
<pagination
v-show="customerTotal > 0"
:total="customerTotal"
:page.sync="customerQueryParams.pageNum"
:limit.sync="customerQueryParams.pageSize"
@pagination="getCustomerList"
/>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirmSelectCustomer">{{$t('addOutStockout.confirm')}}<!--确 定--></el-button>
<el-button @click="cancelSelectCustomer">{{$t('addOutStockout.cancel')}}<!--取 消--></el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { listProductAndStock,saveOutStock } from "@/api/out/outStockout"; import { listProductAndStock,saveOutStock } from "@/api/out/outStockout";
import {listWarehouse} from "@/api/bas/warehouse"; import {listWarehouse} from "@/api/bas/warehouse";
import { listBasCustomer } from "@/api/bas/BasCustomer";
import Pagination from "@/components/Pagination"; import Pagination from "@/components/Pagination";
export default { export default {
name: "AddOutStock", name: "AddOutStock",
dicts: ['out_bill_type', 'bill_status'], dicts: ['out_bill_type', 'bill_status', 'is_available'],
components: { components: {
Pagination Pagination
}, },
@@ -124,8 +177,10 @@ export default {
// 遮罩层 // 遮罩层
loading: false, loading: false,
materialLoading: false, materialLoading: false,
customerLoading: false,
// 总条数 // 总条数
total: 0, total: 0,
customerTotal: 0,
// 表单验证规则 // 表单验证规则
rules: { rules: {
warehouseId: [ warehouseId: [
@@ -142,6 +197,7 @@ export default {
formData: { formData: {
warehouseId: null, warehouseId: null,
customerNo: null, customerNo: null,
customerName: null, // 添加客户名称字段,用于显示
outType: null outType: null
}, },
// 仓库选项 // 仓库选项
@@ -164,6 +220,20 @@ export default {
productName: null, productName: null,
quantity: null, quantity: null,
warehouseId: null warehouseId: null
},
// 客户选择弹窗
customerDialog: false,
// 客户列表数据
customerList: [],
// 当前选中的客户
selectedCustomer: null,
// 客户查询参数
customerQueryParams: {
pageNum: 1,
pageSize: 10,
customerNo: null,
customerName: null,
useable: '1' // 默认只查询可用的客户
} }
}; };
}, },
@@ -181,6 +251,51 @@ export default {
this.warehouseOptions = response.rows; this.warehouseOptions = response.rows;
}); });
}, },
/** 打开客户选择弹窗 */
openCustomerSelector() {
this.customerDialog = true;
this.getCustomerList();
},
/** 获取客户列表 */
getCustomerList() {
this.customerLoading = true;
listBasCustomer(this.customerQueryParams).then(response => {
this.customerList = response.rows;
this.customerTotal = response.total;
this.customerLoading = false;
});
},
/** 客户搜索按钮操作 */
handleCustomerQuery() {
this.customerQueryParams.pageNum = 1;
this.getCustomerList();
},
/** 客户重置按钮操作 */
resetCustomerQuery() {
this.resetForm("customerQueryForm");
this.customerQueryParams.useable = '1'; // 保持默认只查询可用的客户
this.handleCustomerQuery();
},
/** 客户行点击事件 */
handleCustomerRowClick(row) {
this.selectedCustomer = row;
this.$refs['customerTable']?.setCurrentRow(row);
},
/** 确认选择客户 */
confirmSelectCustomer() {
if (!this.selectedCustomer) {
this.$modal.msgError(this.$t('basCustomer.pleaseSelectCustomer'));
return;
}
this.formData.customerNo = this.selectedCustomer.customerNo;
this.formData.customerName = this.selectedCustomer.customerName;
this.customerDialog = false;
},
/** 取消选择客户 */
cancelSelectCustomer() {
this.selectedCustomer = null;
this.customerDialog = false;
},
/** 打开选择物资弹窗 */ /** 打开选择物资弹窗 */
handleSelectMaterials() { handleSelectMaterials() {
if (!this.formData.warehouseId) { if (!this.formData.warehouseId) {
@@ -289,9 +404,11 @@ export default {
this.formData = { this.formData = {
warehouseId: null, warehouseId: null,
customerNo: null, customerNo: null,
customerName: null,
outType: null outType: null
}; };
this.materialList = []; this.materialList = [];
this.selectedCustomer = null;
}, },
/** 重新建单 */ /** 重新建单 */
handleReload() { handleReload() {