mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-04-15 13:46:36 +08:00
完善采购订单供应商下拉列表
This commit is contained in:
@@ -283,6 +283,12 @@
|
||||
<param name="ids"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.ERP.SupplierController.GetList">
|
||||
<summary>
|
||||
全查
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.ERP.SupplierController.PageList(Yi.Framework.DtoModel.ERP.Supplier.SupplierGetListInput,Yi.Framework.Common.Models.PageParModel)">
|
||||
<summary>
|
||||
分页查
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Org.BouncyCastle.Asn1.IsisMtt.X509;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using Yi.Framework.Common.Models;
|
||||
using Yi.Framework.DtoModel.ERP.Supplier;
|
||||
using Yi.Framework.Interface.ERP;
|
||||
using Yi.Framework.Service.ERP;
|
||||
|
||||
namespace Yi.Framework.ApiMicroservice.Controllers.ERP
|
||||
{
|
||||
@@ -17,6 +18,18 @@ namespace Yi.Framework.ApiMicroservice.Controllers.ERP
|
||||
_supplierService = supplierService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 全查
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<Result> GetList()
|
||||
{
|
||||
var result = await _supplierService.GetListAsync();
|
||||
return Result.Success().SetData(result);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 分页查
|
||||
/// </summary>
|
||||
|
||||
Binary file not shown.
@@ -15,6 +15,8 @@ namespace Yi.Framework.DtoModel.ERP.Purchase
|
||||
public string Buyer { get; set; } = string.Empty;
|
||||
public long TotalMoney { get; set; }
|
||||
public long PaidMoney { get; set; }
|
||||
|
||||
public string SupplierName { get; set; } = string.Empty;
|
||||
public PurchaseStateEnum PurchaseState { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@ namespace Yi.Framework.DtoModel.ERP.Purchase
|
||||
public DateTime? NeedTime { get; set; }
|
||||
public string Buyer { get; set; } = string.Empty;
|
||||
|
||||
public long SupplierId { get; set; }
|
||||
|
||||
public List<PurchaseDetailsCreateUpdateInput>? PurchaseDetails { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Yi.Framework.Model.Base
|
||||
{
|
||||
public class Entity<Key> : IEntity<Key>
|
||||
{
|
||||
public Key Id { get; set; }=default(Key)!;
|
||||
public Key Id { get; set; }
|
||||
|
||||
public object[] GetKeys()
|
||||
{
|
||||
|
||||
@@ -27,6 +27,11 @@ namespace Yi.Framework.Model.ERP.Entitys
|
||||
/// </summary>
|
||||
public Guid? TenantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供应商id
|
||||
/// </summary>
|
||||
public long SupplierId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 采购单号
|
||||
/// </summary>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NEST" Version="7.16.0" />
|
||||
<PackageReference Include="SqlSugarCore" Version="5.1.3.30" />
|
||||
<PackageReference Include="SqlSugarCore" Version="5.1.3.43-preview03" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -30,10 +30,11 @@ namespace Yi.Framework.Service.ERP
|
||||
{
|
||||
RefAsync<int> totalNumber = 0;
|
||||
var data = await Repository._DbQueryable
|
||||
//.WhereIF(input.Code is not null,u=>u.Code.Contains(input.Code))
|
||||
//.WhereIF(input.Name is not null, u => u.Name.Contains(input.Name))
|
||||
.LeftJoin<SupplierEntity>((p, s) => p.SupplierId == s.Id)
|
||||
.WhereIF(input.Code is not null, u => u.Code.Contains(input.Code))
|
||||
.Select((p, s) => new PurchaseGetListOutput { SupplierName = s.Name },true)
|
||||
.ToPageListAsync(page.PageNum, page.PageSize, totalNumber);
|
||||
return new PageModel<List<PurchaseGetListOutput>> { Total = totalNumber.Value, Data = await MapToGetListOutputDtosAsync(data) };
|
||||
return new PageModel<List<PurchaseGetListOutput>> { Total = totalNumber.Value, Data = data };
|
||||
}
|
||||
|
||||
public override async Task<PurchaseGetListOutput> CreateAsync(PurchaseCreateInput input)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System;
|
||||
using Ubiety.Dns.Core.Common;
|
||||
|
||||
namespace Yi.Framework.WebCore.CommonExtend
|
||||
{
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 全查询
|
||||
export function allData() {
|
||||
return request({
|
||||
url: '/supplier/getList',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 分页查询
|
||||
export function listData(query) {
|
||||
return request({
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<!-----------------------这里开始就是数据表单的全部列------------------------>
|
||||
<el-table-column label="采购单号" align="center" prop="code" />
|
||||
|
||||
<el-table-column label="供应商" align="center" prop="name" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="供应商" align="center" prop="supplierName" :show-overflow-tooltip="true" />
|
||||
|
||||
<el-table-column label="需求时间" align="center" prop="needTime" :show-overflow-tooltip="true" />
|
||||
|
||||
@@ -136,9 +136,22 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :offset="8" :span="8">
|
||||
<el-form-item label="采购单员" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入采购单员" /> </el-form-item>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商" prop="supplierName">
|
||||
<el-select v-model="form.supplierId" filterable placeholder="请选择供应商">
|
||||
<el-option
|
||||
v-for="item in supplierList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="采购单员" prop="buyer">
|
||||
<el-input v-model="form.buyer" placeholder="请输入采购单员" /> </el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
@@ -166,11 +179,11 @@
|
||||
<el-table :data="form.purchaseDetails" border style="width: 100%">
|
||||
|
||||
<el-table-column width="90">
|
||||
<template #default>
|
||||
<el-button icon="Delete" type="danger" size="small">删除</el-button>
|
||||
<template #default="scope">
|
||||
<el-button @click="delMaterialRow(scope.$index)" icon="Delete" type="danger" size="small">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column type="index" label="序号" width="60" />
|
||||
<el-table-column prop="materialName" label="物料" width="180" />
|
||||
<el-table-column prop="materialUnit" label="单位" width="180" />
|
||||
<el-table-column prop="unitPrice" label="单价" width="180" >
|
||||
@@ -258,7 +271,10 @@ import {
|
||||
addData,
|
||||
updateData,
|
||||
} from "@/api/erp/purchaseApi";
|
||||
|
||||
import
|
||||
{
|
||||
allData as supplierlAllData
|
||||
} from "@/api/erp/supplierApi";
|
||||
import {
|
||||
listData as materialListData
|
||||
} from "@/api/erp/materialApi";
|
||||
@@ -273,6 +289,8 @@ const materialList= ref([]);
|
||||
const materialTotal = ref(0);
|
||||
const materialMultipleSelection=ref([]);
|
||||
|
||||
//选择框供应商
|
||||
const supplierList=ref([]);
|
||||
|
||||
|
||||
const dataList = ref([]);
|
||||
@@ -287,6 +305,7 @@ const title = ref("");
|
||||
const dateRange = ref([]);
|
||||
const data = reactive({
|
||||
form: {
|
||||
supplierId:undefined,
|
||||
totalMoney:0,
|
||||
purchaseDetails:[]
|
||||
},
|
||||
@@ -463,6 +482,12 @@ function materialCancel()
|
||||
openMaterial.value=false
|
||||
}
|
||||
|
||||
/** 删除物料行 */
|
||||
function delMaterialRow(index)
|
||||
{
|
||||
|
||||
form.value.purchaseDetails.splice(index, 1);
|
||||
}
|
||||
// watch(data.form, (newValue, oldValue) => {
|
||||
// console.log(newValue.purchaseDetails,999)
|
||||
// }
|
||||
@@ -477,7 +502,17 @@ const showTotalMoney =computed(()=>{
|
||||
return res;
|
||||
})
|
||||
|
||||
//-------------这里开始是供货商的数据-----------
|
||||
/** 供货商查询列表 */
|
||||
function getSupplierList() {
|
||||
supplierlAllData().then(
|
||||
(response) => {
|
||||
supplierList.value = response.data;
|
||||
}
|
||||
);
|
||||
}
|
||||
getList();
|
||||
getSupplierList();
|
||||
</script>
|
||||
<style scoped>
|
||||
.form-add-btn{
|
||||
|
||||
Reference in New Issue
Block a user