初次对接
This commit is contained in:
parent
55aac6feb2
commit
db1fdc5e18
@ -2,4 +2,4 @@
|
||||
ENV = development
|
||||
|
||||
# 本地环境接口地址
|
||||
VITE_API_URL = http://localhost:8888/
|
||||
VITE_API_URL = http://8.134.66.212:90
|
@ -2,4 +2,4 @@
|
||||
ENV = production
|
||||
|
||||
# 线上环境接口地址
|
||||
VITE_API_URL = https://lyt-top.gitee.io/vue-next-admin-preview/
|
||||
VITE_API_URL = http://8.134.66.212:90
|
56
src/api/list/index.ts
Normal file
56
src/api/list/index.ts
Normal file
@ -0,0 +1,56 @@
|
||||
import request from '/@/utils/request';
|
||||
|
||||
export function listApi() {
|
||||
return {
|
||||
//采购订单分页列表
|
||||
getPageList: (data: object) => {
|
||||
return request({
|
||||
url: '/api/Admin/PurchaseOrder/GetPageList',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
},
|
||||
//获取明细列表
|
||||
getPurchaseOrderItemList: (data: object) => {
|
||||
return request({
|
||||
url: '/api/Admin/PurchaseOrder/GetPurchaseOrderItemList',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
},
|
||||
//批量修改最新交期
|
||||
batchSetNewChengNuoJiaoQi: (data: object) => {
|
||||
return request({
|
||||
url: '/api/Admin/PurchaseOrder/BatchSetNewChengNuoJiaoQi',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
},
|
||||
//批量修改承诺交期
|
||||
batchSetChengNuoJiaoQi: (data: object) => {
|
||||
return request({
|
||||
url: '/api/Admin/PurchaseOrder/BatchSetChengNuoJiaoQi',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
},
|
||||
//生成发货通知单
|
||||
batchAddInvoiceOrder: (data: object) => {
|
||||
return request({
|
||||
url: '/api/Admin/PurchaseOrder/BatchAddInvoiceOrder',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
//发货通知单分页列表
|
||||
invoiceOrderGetPageList: (data: object) => {
|
||||
return request({
|
||||
url: '/api/Admin/InvoiceOrder/GetPageList',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
},
|
||||
};
|
||||
}
|
@ -9,9 +9,9 @@ import request from '/@/utils/request';
|
||||
*/
|
||||
export function useLoginApi() {
|
||||
return {
|
||||
signIn: (data: object) => {
|
||||
login: (data: object) => {
|
||||
return request({
|
||||
url: '/user/signIn',
|
||||
url: '/api/Admin/Login/Login',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
|
@ -38,7 +38,7 @@ export default {
|
||||
BusinessType: "单据类型",
|
||||
OrderCreator: "制单人",
|
||||
DocStatus2: "单据状态",
|
||||
ReceivingDate: "收料日期",
|
||||
ReceivingDate: "发货日期",
|
||||
Comments3: "备注",
|
||||
MaterialCode2: "物料编码",
|
||||
MaterialName2: "物料名称",
|
||||
|
@ -119,7 +119,7 @@ export const dynamicRoutes: Array<RouteRecordRaw> = [
|
||||
isKeepAlive: true,
|
||||
isAffix: false,
|
||||
isIframe: false,
|
||||
roles: ['admin'],
|
||||
roles: ['admin', 'common'],
|
||||
icon: 'iconfont icon-xitongshezhi',
|
||||
},
|
||||
children: [
|
||||
@ -134,7 +134,7 @@ export const dynamicRoutes: Array<RouteRecordRaw> = [
|
||||
isKeepAlive: true,
|
||||
isAffix: false,
|
||||
isIframe: false,
|
||||
roles: ['admin'],
|
||||
roles: ['admin', 'common'],
|
||||
icon: 'iconfont icon-caidan',
|
||||
},
|
||||
},
|
||||
@ -149,7 +149,7 @@ export const dynamicRoutes: Array<RouteRecordRaw> = [
|
||||
isKeepAlive: true,
|
||||
isAffix: false,
|
||||
isIframe: false,
|
||||
roles: ['admin'],
|
||||
roles: ['admin', 'common'],
|
||||
icon: 'ele-ColdDrink',
|
||||
},
|
||||
},
|
||||
@ -164,7 +164,7 @@ export const dynamicRoutes: Array<RouteRecordRaw> = [
|
||||
isKeepAlive: true,
|
||||
isAffix: false,
|
||||
isIframe: false,
|
||||
roles: ['admin'],
|
||||
roles: ['admin', 'common'],
|
||||
icon: 'iconfont icon-icon-',
|
||||
},
|
||||
},
|
||||
@ -179,7 +179,7 @@ export const dynamicRoutes: Array<RouteRecordRaw> = [
|
||||
isKeepAlive: true,
|
||||
isAffix: false,
|
||||
isIframe: false,
|
||||
roles: ['admin'],
|
||||
roles: ['admin', 'common'],
|
||||
icon: 'ele-OfficeBuilding',
|
||||
},
|
||||
},
|
||||
@ -194,7 +194,7 @@ export const dynamicRoutes: Array<RouteRecordRaw> = [
|
||||
isKeepAlive: true,
|
||||
isAffix: false,
|
||||
isIframe: false,
|
||||
roles: ['admin'],
|
||||
roles: ['admin', 'common'],
|
||||
icon: 'ele-SetUp',
|
||||
},
|
||||
},
|
||||
|
116
src/utils/index.ts
Normal file
116
src/utils/index.ts
Normal file
@ -0,0 +1,116 @@
|
||||
import dayjs from 'dayjs';
|
||||
import md5 from 'md5';
|
||||
import { customRef, ref } from "vue"
|
||||
|
||||
/**
|
||||
* 格式化时间
|
||||
*/
|
||||
export function formatTime(
|
||||
date?: string | number | Date | dayjs.Dayjs | null | undefined,
|
||||
template?: string | undefined
|
||||
) {
|
||||
return dayjs(date).format(template);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 格式化时间
|
||||
*/
|
||||
export function timeAgo(
|
||||
date?: string | number | Date | dayjs.Dayjs | null | undefined,
|
||||
template?: string
|
||||
) {
|
||||
const d = dayjs(date).valueOf();
|
||||
const now = Date.now();
|
||||
const diff = (now - d) / 1000;
|
||||
if (diff < 3600) {
|
||||
return Math.ceil(diff / 60) + '分钟前';
|
||||
} else if (diff < 3600 * 24) {
|
||||
return Math.ceil(diff / 3600) + '小时前';
|
||||
} else {
|
||||
return formatTime(date, template);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* md5加密
|
||||
*/
|
||||
export function md5Encryption(
|
||||
message: string | Buffer | number[] | Uint8Array
|
||||
) {
|
||||
const KEY = md5('LULU Derivation');
|
||||
return md5(KEY + md5(message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 类型检查
|
||||
*/
|
||||
|
||||
export function typeCheck(param: any) {
|
||||
return Object.prototype.toString.call(param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量修改stage
|
||||
*/
|
||||
export function mutateState(state: AnyObject, payload: AnyObject) {
|
||||
if (
|
||||
typeCheck(state) === '[object Object]' &&
|
||||
typeCheck(payload) === '[object Object]'
|
||||
) {
|
||||
for (const key in payload) {
|
||||
state[key] = payload[key];
|
||||
}
|
||||
} else {
|
||||
console.error('expected plain Object');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 防抖
|
||||
*/
|
||||
export function debounceRef (data:any, delay = 300){
|
||||
let timer: NodeJS.Timeout | null = null;
|
||||
return delay == null
|
||||
?
|
||||
ref(data)
|
||||
:
|
||||
customRef((track, trigger) => {
|
||||
return {
|
||||
get () {
|
||||
track()
|
||||
return data
|
||||
},
|
||||
set (value) {
|
||||
if(timer != null){
|
||||
clearTimeout(timer)
|
||||
timer = null
|
||||
}
|
||||
timer = setTimeout(() => {
|
||||
data = value;
|
||||
trigger()
|
||||
}, delay)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//计算两个时间之间的时间差 多少天时分秒
|
||||
export function timeFn(d1: string,d2: string) {//di作为一个变量传进来
|
||||
//如果时间格式是正确的,那下面这一步转化时间格式就可以不用了
|
||||
var dateBegin = new Date(d1.replace(/-/g, "/"));//将-转化为/,使用new Date
|
||||
var dateEnd = new Date(d2.replace(/-/g, "/"));//获取当前时间
|
||||
var dateDiff = dateEnd.getTime() - dateBegin.getTime();//时间差的毫秒数
|
||||
var dayDiff = Math.floor(dateDiff / (24 * 3600 * 1000));//计算出相差天数
|
||||
var leave1=dateDiff%(24*3600*1000) //计算天数后剩余的毫秒数
|
||||
var hours=Math.floor(leave1/(3600*1000))//计算出小时数
|
||||
//计算相差分钟数
|
||||
var leave2=leave1%(3600*1000) //计算小时数后剩余的毫秒数
|
||||
var minutes=Math.floor(leave2/(60*1000))//计算相差分钟数
|
||||
//计算相差秒数
|
||||
var leave3=leave2%(60*1000) //计算分钟数后剩余的毫秒数
|
||||
var seconds=Math.round(leave3/1000)
|
||||
console.log(" 相差 "+dayDiff+"天 "+hours+"小时 "+minutes+" 分钟"+seconds+" 秒")
|
||||
console.log(dateDiff+"时间差的毫秒数",dayDiff+"计算出相差天数",leave1+"计算天数后剩余的毫秒数"
|
||||
,hours+"计算出小时数",minutes+"计算相差分钟数",seconds+"计算相差秒数");
|
||||
}
|
@ -48,7 +48,7 @@ import { initBackEndControlRoutes } from '/@/router/backEnd';
|
||||
import { Session } from '/@/utils/storage';
|
||||
import { formatAxis } from '/@/utils/formatTime';
|
||||
import { NextLoading } from '/@/utils/loading';
|
||||
|
||||
import { useLoginApi } from '../../../api/login/index'
|
||||
// 定义变量内容
|
||||
const { t } = useI18n();
|
||||
const storesThemeConfig = useThemeConfig();
|
||||
@ -58,8 +58,8 @@ const router = useRouter();
|
||||
const state = reactive({
|
||||
isShowPassword: false,
|
||||
ruleForm: {
|
||||
userName: 'admin',
|
||||
password: '123456',
|
||||
userName: 'abc',
|
||||
password: '123',
|
||||
code: '1234',
|
||||
},
|
||||
loading: {
|
||||
@ -72,10 +72,16 @@ const currentTime = computed(() => {
|
||||
return formatAxis(new Date());
|
||||
});
|
||||
// 登录
|
||||
const onSignIn = async () => {
|
||||
const onSignIn = () => {
|
||||
state.loading.signIn = true;
|
||||
useLoginApi().login({
|
||||
userName: state.ruleForm.userName,
|
||||
passWord: state.ruleForm.password,
|
||||
}).then( async (res:any) => {
|
||||
console.log(res)
|
||||
if(res.data !== null){
|
||||
// 存储 token 到浏览器缓存
|
||||
Session.set('token', Math.random().toString(36).substr(0));
|
||||
Session.set('token', res.data);
|
||||
// 模拟数据,对接接口时,记得删除多余代码及对应依赖的引入。用于 `/src/stores/userInfo.ts` 中不同用户登录判断(模拟数据)
|
||||
Cookies.set('userName', state.ruleForm.userName);
|
||||
if (!themeConfig.value.isRequestRoutes) {
|
||||
@ -89,6 +95,9 @@ const onSignIn = async () => {
|
||||
// 执行完 initBackEndControlRoutes,再执行 signInSuccess
|
||||
signInSuccess(isNoPower);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
};
|
||||
// 登录成功后的跳转
|
||||
const signInSuccess = (isNoPower: boolean | undefined) => {
|
||||
|
@ -1,10 +1,19 @@
|
||||
<template>
|
||||
<div class="system-user-container layout-padding">
|
||||
<el-card class="layout-padding-auto" shadow="hover">
|
||||
<avue-crud ref="crudRef" :data="state.data" :option="state.option" v-model:page="state.page">
|
||||
<avue-crud
|
||||
ref="crudRef"
|
||||
:data="state.data"
|
||||
:option="state.option"
|
||||
v-model:page="state.page"
|
||||
v-model:search="state.formData"
|
||||
@on-load="onLoadFun"
|
||||
@search-change="searchChange"
|
||||
@search-reset="resetChange"
|
||||
>
|
||||
<template #menu>
|
||||
<div class="btnList">
|
||||
<el-button type="text" icon="el-icon-pie-chart" @click="toPurchaseDetails">查看详情</el-button>
|
||||
<!-- <el-button type="text" icon="el-icon-pie-chart" @click="toPurchaseDetails">查看详情</el-button>-->
|
||||
<el-button type="text" icon="el-icon-pie-chart" @click="state.selectedDataShow = true">查看单据</el-button>
|
||||
</div>
|
||||
</template>
|
||||
@ -19,9 +28,9 @@ import { reactive, onMounted,computed } from 'vue';
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import selectedData from './selectedData.vue'
|
||||
import {listApi} from "/@/api/list";
|
||||
const router = useRouter()
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const { locale, t } = useI18n();
|
||||
const { t } = useI18n();
|
||||
|
||||
// 定义变量内容
|
||||
const state = reactive({
|
||||
@ -41,56 +50,59 @@ const state = reactive({
|
||||
searchMenuSpan:6,
|
||||
addBtn:false,
|
||||
column: [
|
||||
{ label: computed(() => t('message.list.PONumber2')), prop: 'FBillNo', width: 200,search: true },
|
||||
{ label: computed(() => t('message.list.SupplierCode2')), prop: 'FSupplierId', width: 200,search: true },
|
||||
{ label: computed(() => t('message.list.SupplierName2')), prop: 'FSupplyName', width: 200,search: true },
|
||||
{ label: '采购订单号', prop: 'purchaseOrderFBillNo', width: 200,search: true },
|
||||
{ label: '发货单号', prop: 'sheet', width: 200,search: true },
|
||||
{ label: computed(() => t('message.list.PONumber2')), prop: 'fBillNo', width: 200,search: true },
|
||||
{ label: computed(() => t('message.list.SupplierCode2')), prop: 'supplierId', width: 200,search: true },
|
||||
{ label: computed(() => t('message.list.SupplierName2')), prop: 'supplierName', width: 200,search: true },
|
||||
{ label: computed(() => t('message.list.Buyer2')), prop: 'FPurchaserId', width: 200,search: true },
|
||||
{ label: computed(() => t('message.list.ReceiveOrg')), prop: 'FStockOrgId', width: 200,search: true },
|
||||
{ label: computed(() => t('message.list.BusinessType')), prop: 'FBillTypeID', width: 200,search: true },
|
||||
{ label: computed(() => t('message.list.OrderCreator')), prop: 'FCreatorId', width: 200,search: true },
|
||||
// { label: computed(() => t('message.list.ReceiveOrg')), prop: 'FStockOrgId', width: 200,search: true },
|
||||
// { label: computed(() => t('message.list.BusinessType')), prop: 'FBillTypeID', width: 200,search: true },
|
||||
// { label: computed(() => t('message.list.OrderCreator')), prop: 'FCreatorId', width: 200,search: true },
|
||||
{ label: computed(() => t('message.list.DocStatus2')), prop: 'FDocumentStatus', width: 200,search: true },
|
||||
{ label: computed(() => t('message.list.ReceivingDate')), prop: 'FDate', width: 200,search: true,type: 'datetime', searchSpan: 12,searchRange: true,},
|
||||
{ label: computed(() => t('message.list.Comments3')), prop: 'FRemarks', width: 200 },
|
||||
{ label: computed(() => t('message.list.ReceivingDate')), prop: 'fDate', width: 200,search: true,type: 'datetime', searchSpan: 12,searchRange: true,},
|
||||
// { label: computed(() => t('message.list.Comments3')), prop: 'FRemarks', width: 200 },
|
||||
],
|
||||
},
|
||||
data: [
|
||||
{
|
||||
FBillNo: '005828',
|
||||
FSupplierId: '005828',
|
||||
FSupplyName: '美塞斯',
|
||||
FPurchaserId: '采购甲',
|
||||
FStockOrgId: '不知道',
|
||||
FBillTypeID:'111',
|
||||
FCreatorId: '制单人甲',
|
||||
FDate: '2050/10/31',
|
||||
FDocumentStatus: '已验收',
|
||||
FRemarks: '数据是假的',
|
||||
},
|
||||
|
||||
],
|
||||
selectedDataShow:false
|
||||
data: [],
|
||||
selectedDataShow:false,
|
||||
formData:{}
|
||||
});
|
||||
const toPurchaseDetails = () => {
|
||||
router.push({
|
||||
path: '/materialReceiptNoticePurchaseDetails',
|
||||
})
|
||||
}
|
||||
const onLoadFun = (e:any) => {
|
||||
state.page.currentPage = e.currentPage
|
||||
state.page.pageSize = e.pageSize
|
||||
getList()
|
||||
}
|
||||
const searchChange = (params:any, done:any) => {
|
||||
console.log(params)
|
||||
done()
|
||||
if(params.fDate?.length){
|
||||
console.log(11111)
|
||||
}
|
||||
}
|
||||
const resetChange = () => {
|
||||
|
||||
}
|
||||
const getList = () => {
|
||||
listApi().invoiceOrderGetPageList({
|
||||
...state.formData,
|
||||
pageSize:state.page.pageSize,
|
||||
page:state.page.currentPage,
|
||||
}).then((res:any) => {
|
||||
if(res.resultCode === 0){
|
||||
state.data = res.data.dataList
|
||||
state.page.total = res.data.total
|
||||
}
|
||||
})
|
||||
}
|
||||
// 页面加载时
|
||||
onMounted(() => {
|
||||
for (let i = 0; i < 9; i++){
|
||||
state.data.push({
|
||||
FBillNo: '005828',
|
||||
FSupplierId: '005828',
|
||||
FSupplyName: '美塞斯',
|
||||
FPurchaserId: '采购甲',
|
||||
FStockOrgId: '不知道',
|
||||
FBillTypeID:'111',
|
||||
FCreatorId: '制单人甲',
|
||||
FDate: '2050/10/31',
|
||||
FDocumentStatus: '已验收',
|
||||
FRemarks: '数据是假的',
|
||||
},)
|
||||
}
|
||||
getList()
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -1,9 +1,21 @@
|
||||
<template>
|
||||
<div class="system-user-container layout-padding">
|
||||
<el-card class="layout-padding-auto" shadow="hover">
|
||||
<avue-crud ref="crudRef" :data="state.data" :option="state.option" v-model:page="state.page">
|
||||
<template #menu>
|
||||
<el-button type="text" icon="el-icon-pie-chart" @click="toPurchaseDetails">查看</el-button>
|
||||
<avue-crud
|
||||
ref="crudRef"
|
||||
:data="state.data"
|
||||
:option="state.option"
|
||||
v-model:page="state.page"
|
||||
v-model:search="state.formData"
|
||||
@on-load="onLoadFun"
|
||||
@search-change="searchChange"
|
||||
@search-reset="resetChange"
|
||||
>
|
||||
<template #status>
|
||||
<div>未发货</div>
|
||||
</template>
|
||||
<template #menu="{row}">
|
||||
<el-button type="text" icon="el-icon-pie-chart" @click="toPurchaseDetails(row)">查看</el-button>
|
||||
</template>
|
||||
</avue-crud>
|
||||
</el-card>
|
||||
@ -11,12 +23,16 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {reactive, onMounted, computed} from 'vue';
|
||||
import {reactive, onMounted, computed,defineProps} from 'vue';
|
||||
import { formatTime } from '../../utils/index'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { listApi } from '../../api/list/index'
|
||||
import { useI18n } from 'vue-i18n';
|
||||
const { locale, t } = useI18n();
|
||||
const router = useRouter()
|
||||
const props = defineProps({
|
||||
|
||||
})
|
||||
// 定义变量内容
|
||||
const state = reactive({
|
||||
page: {
|
||||
@ -31,68 +47,68 @@ const state = reactive({
|
||||
delBtn: false,
|
||||
editBtn: false,
|
||||
align: 'center',
|
||||
searchLabelWidth:130,
|
||||
searchLabelWidth:100,
|
||||
searchMenuSpan:6,
|
||||
addBtn:false,
|
||||
column: [
|
||||
{ label: computed(() => t('message.list.PONumber')), prop: 'FBillNo', width: 200,search: true },
|
||||
{ label: computed(() => t('message.list.SupplierCode')), prop: 'FSupplierId', width: 200,search: true },
|
||||
{ label: computed(() => t('message.list.SupplierName')), prop: 'FSupplyName', width: 200,search: true },
|
||||
{ label: computed(() => t('message.list.Buyer')), prop: 'FPurchaserId', width: 200,search: true },
|
||||
{ label: computed(() => t('message.list.SettlementMode')), prop: 'FSettleModeId', width: 200,search: true },
|
||||
{ label: computed(() => t('message.list.Currency')), prop: 'FSettleCurrId', width: 200,search: true },
|
||||
{ label: computed(() => t('message.list.PaymentTerms')), prop: 'FPayConditionId', width: 200,search: true },
|
||||
{ label: computed(() => t('message.list.ExchangeRateType')), prop: 'FExchangeTypeId', width: 200 },
|
||||
{ label: computed(() => t('message.list.ExchangeRate')), prop: 'FExchangeRate', width: 200 },
|
||||
{ label: computed(() => t('message.list.OrderCreater')), prop: 'FCreatorId', width: 200,search: true },
|
||||
{ label: computed(() => t('message.list.DocStatus')), prop: 'FDocumentStatus', width: 200,search: true },
|
||||
{ label: computed(() => t('message.list.PurchaseDate')), prop: 'FDate', width: 200,search: true,type: 'datetime', searchSpan: 12,searchRange: true,},
|
||||
{ label: computed(() => t('message.list.Comments')), prop: 'FRemarks', width: 200 },
|
||||
{ label: computed(() => t('message.list.PONumber')), prop: 'fBillNo', width: 200,search: true },
|
||||
{ label: computed(() => t('message.list.SupplierCode')), prop: 'supplierId', width: 200 },
|
||||
{ label: computed(() => t('message.list.SupplierName')), prop: 'supplierName', width: 200 },
|
||||
{ label: computed(() => t('message.list.Buyer')), prop: 'purchaser', width: 200 },
|
||||
{ label: computed(() => t('message.list.SettlementMode')), prop: 'paymentMethod', width: 200,search: true },
|
||||
{ label: computed(() => t('message.list.Currency')), prop: 'settlementCcurrency', width: 200,search: true },
|
||||
{ label: computed(() => t('message.list.PaymentTerms')), prop: 'paymentTerms', width: 200 },
|
||||
{ label: computed(() => t('message.list.ExchangeRateType')), prop: 'exchangeRateType', width: 200,search: true },
|
||||
{ label: computed(() => t('message.list.ExchangeRate')), prop: 'exchangeRate', width: 200 },
|
||||
{ label: computed(() => t('message.list.OrderCreater')), prop: 'creater', width: 200 },
|
||||
{ label: computed(() => t('message.list.DocStatus')), prop: 'status', width: 200,search: true,type: 'select'},
|
||||
{ label: computed(() => t('message.list.PurchaseDate')), prop: 'fDate', width: 200,search: true,type: 'datetime', searchSpan: 12,searchRange: true,},
|
||||
{ label: computed(() => t('message.list.Comments')), prop: 'remark', width: 200 },
|
||||
],
|
||||
},
|
||||
data: [
|
||||
{
|
||||
FBillNo: '005828',
|
||||
FSupplierId: '005828',
|
||||
FSupplyName: '美塞斯',
|
||||
FPurchaserId: '采购甲',
|
||||
FSettleModeId: '金砖支付系统结算',
|
||||
FSettleCurrId: 'RMB',
|
||||
FPayConditionId: '到付',
|
||||
FExchangeTypeId: '亚洲汇率',
|
||||
FExchangeRate: '1:20',
|
||||
FCreatorId: '制单人甲',
|
||||
FDocumentStatus: '已验收',
|
||||
FDate: '2050/10/31',
|
||||
FRemarks: '数据是假的',
|
||||
},
|
||||
|
||||
],
|
||||
data: [],
|
||||
formData:{}
|
||||
});
|
||||
const toPurchaseDetails = () => {
|
||||
|
||||
const onLoadFun = (e:any) => {
|
||||
state.page.currentPage = e.currentPage
|
||||
state.page.pageSize = e.pageSize
|
||||
getList()
|
||||
}
|
||||
const searchChange = (params:any, done:any) => {
|
||||
console.log(params)
|
||||
done()
|
||||
if(params.fDate?.length){
|
||||
console.log(11111)
|
||||
}
|
||||
}
|
||||
const resetChange = () => {
|
||||
|
||||
}
|
||||
const toPurchaseDetails = (item:any) => {
|
||||
console.log(item)
|
||||
router.push({
|
||||
path: '/purchaseDetails',
|
||||
query:{
|
||||
topId:item.fiD
|
||||
}
|
||||
})
|
||||
}
|
||||
const getList = () => {
|
||||
listApi().getPageList({
|
||||
...state.formData,
|
||||
pageSize:state.page.pageSize,
|
||||
page:state.page.currentPage,
|
||||
}).then((res:any) => {
|
||||
if(res.resultCode === 0){
|
||||
state.data = res.data.dataList
|
||||
state.page.total = res.data.total
|
||||
}
|
||||
})
|
||||
}
|
||||
// 页面加载时
|
||||
onMounted(() => {
|
||||
for (let i = 0; i < 9; i++){
|
||||
state.data.push({
|
||||
FBillNo: '005828',
|
||||
FSupplierId: '005828',
|
||||
FSupplyName: '美塞斯',
|
||||
FPurchaserId: '采购甲',
|
||||
FSettleModeId: '金砖支付系统结算',
|
||||
FSettleCurrId: 'RMB',
|
||||
FPayConditionId: '到付',
|
||||
FExchangeTypeId: '亚洲汇率',
|
||||
FExchangeRate: '1:20',
|
||||
FCreatorId: '制单人甲',
|
||||
FDocumentStatus: '已验收',
|
||||
FDate: '2050/10/31',
|
||||
FRemarks: '数据是假的',
|
||||
})
|
||||
}
|
||||
getList()
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -1,7 +1,11 @@
|
||||
<template>
|
||||
<div class="system-user-container layout-padding">
|
||||
<el-card class="layout-padding-auto" shadow="hover">
|
||||
<avue-crud ref="crudRef" :data="state.data" :option="state.option" v-model:page="state.page" @selection-change="selectionChange">
|
||||
<avue-crud
|
||||
ref="crudRef"
|
||||
:data="state.data"
|
||||
:option="state.option"
|
||||
@selection-change="selectionChange">
|
||||
<template #menu-left>
|
||||
<div class="menu-left" @click="selectedDataShowFun">
|
||||
<span >已选中 <span style="color: #3edc95; font-size: 18px">{{ state.selectedData.length }}</span> 条数据</span >
|
||||
@ -13,7 +17,7 @@
|
||||
</avue-crud>
|
||||
</el-card>
|
||||
<selectedData :showes="state.selectedDataShow" :listData="state.selectedData" @generateDocuments="generateDocumentsFun"/>
|
||||
<receipt :showes="state.receiptShow"/>
|
||||
<!-- <receipt :showes="state.receiptShow"/>-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -23,6 +27,9 @@ import { ArrowRight } from '@element-plus/icons-vue';
|
||||
import selectedData from './selectedData.vue'
|
||||
import receipt from './receipt.vue'
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import {listApi} from "/@/api/list";
|
||||
import { useRoute } from 'vue-router'
|
||||
const route = useRoute()
|
||||
const { locale, t } = useI18n();
|
||||
// 定义变量内容
|
||||
const state = reactive({
|
||||
@ -45,29 +52,23 @@ const state = reactive({
|
||||
searchMenuSpan: 6,
|
||||
addBtn: false,
|
||||
column: [
|
||||
{ label: computed(() => t('message.list.MaterialCode')), prop: 'FMaterialId', width: 200, search: true },
|
||||
{ label: computed(() => t('message.list.MaterialName')), prop: 'FMaterialName', width: 200, search: true },
|
||||
{ label: computed(() => t('message.list.Specification')), prop: 'FModel', width: 200, search: true },
|
||||
{ label: computed(() => t('message.list.MaterialCode')), prop: 'materialCode', width: 200, search: true },
|
||||
{ label: computed(() => t('message.list.MaterialName')), prop: 'materialName', width: 200, search: true },
|
||||
{ label: computed(() => t('message.list.Specification')), prop: 'specificationModel', width: 200, search: true },
|
||||
{ label: computed(() => t('message.list.PurchaseUnit')), prop: 'FUnitId', width: 200, search: true },
|
||||
{ label: computed(() => t('message.list.QTY')), prop: 'FPrice', width: 200 },
|
||||
{ label: computed(() => t('message.list.UP')), prop: 'FTaxPrice', width: 200 },
|
||||
{ label: computed(() => t('message.list.TotalAmount')), prop: 'FEntryAmount', width: 200 },
|
||||
{ label: computed(() => t('message.list.TotalAmountTaxInclusive')), prop: 'FAllAmount', width: 200 },
|
||||
{ label: '采购数量', prop: 'qty', width: 200 },
|
||||
{ label: '处理中数量', prop: 'processingQty', width: 200 },
|
||||
{ label: '已发货数量', prop: 'sendedQty', width: 200 },
|
||||
{ label: '未发货数量', prop: 'notSendQty', width: 200 },
|
||||
{ label: '本次发货数量', prop: 'nowSendQty', width: 200 },
|
||||
{ label: computed(() => t('message.list.UP')), prop: 'unitPrice', width: 200 },
|
||||
{ label:'价税合计(含税金额', prop: 'amount1', width: 200 },
|
||||
{ label: computed(() => t('message.list.TotalAmount')), prop: 'amount2', width: 200 },
|
||||
{ label: computed(() => t('message.list.AccumulatedReceiptQTY')), prop: 'FReceiveQty', width: 200 },
|
||||
{
|
||||
label: computed(() => t('message.list.DemondDate')),
|
||||
prop: 'FDeliveryDate',
|
||||
width: 200,
|
||||
search: true,
|
||||
type: 'datetime',
|
||||
searchSpan: 12,
|
||||
searchRange: true,
|
||||
searchLabelWidth: 150,
|
||||
},
|
||||
{ label: computed(() => t('message.list.TaxAmount')), prop: 'TaxAmount', width: 200 },
|
||||
{ label: computed(() => t('message.list.TaxAmount')), prop: 'taxAmount', width: 200 },
|
||||
{
|
||||
label: computed(() => t('message.list.CommittedDeliveryDate')),
|
||||
prop: 'FSupDueDate',
|
||||
prop: 'chengNuoJiaoQi',
|
||||
width: 200,
|
||||
search: true,
|
||||
type: 'datetime',
|
||||
@ -77,7 +78,7 @@ const state = reactive({
|
||||
},
|
||||
{
|
||||
label: computed(() => t('message.list.LatestCommittedDeliveryDate')),
|
||||
prop: 'FSupDueNewDate',
|
||||
prop: 'newChengNuoJiaoQi',
|
||||
width: 200,
|
||||
search: true,
|
||||
type: 'datetime',
|
||||
@ -85,29 +86,14 @@ const state = reactive({
|
||||
searchRange: true,
|
||||
searchLabelWidth: 150,
|
||||
},
|
||||
{ label: computed(() => t('message.list.Comments2')), prop: 'FNote', width: 200 },
|
||||
{ label: computed(() => t('message.list.Comments2')), prop: 'remark', width: 200 },
|
||||
],
|
||||
},
|
||||
data: [
|
||||
{
|
||||
FMaterialId: '004785',
|
||||
FMaterialName: '我也不知道是什么东西',
|
||||
FModel: '这是什么型号',
|
||||
FUnitId: '美塞斯',
|
||||
FPrice: '10000000$',
|
||||
FTaxPrice: '10000000$',
|
||||
FEntryAmount: '10000000$',
|
||||
FAllAmount: '10000000$',
|
||||
FReceiveQty: '10',
|
||||
FDeliveryDate: '2025/10/31',
|
||||
FSupDueNewDate: '2025/10/31',
|
||||
FSupDueDate: '2025/10/31',
|
||||
TaxAmount: '10000000$',
|
||||
},
|
||||
],
|
||||
data: [],
|
||||
selectedData:[],
|
||||
selectedDataShow:false,
|
||||
receiptShow:false
|
||||
receiptShow:false,
|
||||
topId:''
|
||||
});
|
||||
const selectionChange = (list:any) => {
|
||||
nextTick( () => {
|
||||
@ -119,29 +105,23 @@ const generateDocumentsFun = () => {
|
||||
state.receiptShow = !state.receiptShow
|
||||
}
|
||||
const selectedDataShowFun = () => {
|
||||
// = state.selectionList
|
||||
state.selectedDataShow = !state.selectedDataShow
|
||||
}
|
||||
// 页面加载时
|
||||
onMounted(() => {
|
||||
for (let i = 0; i < 9; i++){
|
||||
state.data.push({
|
||||
FMaterialId: '004785' + i,
|
||||
FMaterialName: '我也不知道是什么东西',
|
||||
FModel: '这是什么型号',
|
||||
FUnitId: '美塞斯',
|
||||
FPrice: '10000000$',
|
||||
FTaxPrice: '10000000$',
|
||||
FEntryAmount: '10000000$',
|
||||
FAllAmount: '10000000$',
|
||||
FReceiveQty: '10',
|
||||
FDeliveryDate: '2025/10/31',
|
||||
FSupDueNewDate: '2025/10/31',
|
||||
FSupDueDate: '2025/10/31',
|
||||
TaxAmount: '10000000$',
|
||||
state.topId = route.query.topId as string
|
||||
getList()
|
||||
})
|
||||
const getList = () => {
|
||||
listApi().getPurchaseOrderItemList({
|
||||
fid:state.topId
|
||||
}).then((res:any) => {
|
||||
if(res.resultCode === 0){
|
||||
state.data = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
@ -1,31 +1,59 @@
|
||||
<template>
|
||||
<el-dialog :model-value="props.showes" width="70%">
|
||||
<avue-crud ref="crudRef" :data="props.listData" :option="state.option"></avue-crud>
|
||||
<avue-crud
|
||||
ref="crudRef"
|
||||
:data="props.listData"
|
||||
:option="state.option"
|
||||
>
|
||||
<template #nowSendQty="{row}">
|
||||
<div style="display: flex;align-items: center;justify-content: center">
|
||||
<el-input-number v-model="row.nowSendQty" :min="1"/>
|
||||
</div>
|
||||
</template>
|
||||
<template #chengNuoJiaoQi="{row}">
|
||||
<div style="display: flex;align-items: center;justify-content: center">
|
||||
<el-date-picker v-model="row.chengNuoJiaoQi" type="date" size="large" style="width: 100%" format="YYYY/MM/DD"
|
||||
value-format="YYYY-MM-DD" @change="chengNuoJiaoQiChange(row)"/>
|
||||
</div>
|
||||
</template>
|
||||
<template #newChengNuoJiaoQi="{row}">
|
||||
<div style="display: flex;align-items: center;justify-content: center">
|
||||
<el-date-picker v-model="row.newChengNuoJiaoQi" type="date" size="large" style="width: 100%" format="YYYY/MM/DD"
|
||||
value-format="YYYY-MM-DD" @change="newChengNuoJiaoQiChange(row)"/>
|
||||
</div>
|
||||
</template>
|
||||
</avue-crud>
|
||||
<div class="btnList">
|
||||
<el-button type="primary" @click="emits('generateDocuments')">生成通知单</el-button>
|
||||
<el-button type="primary" @click="batchAddInvoiceOrderFun">生成通知单</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { defineProps, reactive, defineEmits, computed } from 'vue';
|
||||
const emits = defineEmits(['generateDocuments'])
|
||||
import { listApi } from '../../api/list/index'
|
||||
const emits = defineEmits(['generateDocuments']);
|
||||
import { useI18n } from 'vue-i18n';
|
||||
const { locale, t } = useI18n();
|
||||
import {ElMessage} from "element-plus";
|
||||
const { t } = useI18n();
|
||||
const props = defineProps({
|
||||
listData: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
default: () => [],
|
||||
},
|
||||
showes: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
const state = reactive({
|
||||
dialogVisible: true,
|
||||
data: [],
|
||||
show:true,
|
||||
formData: {},
|
||||
option: {
|
||||
tip: false,
|
||||
selection: true,
|
||||
selection: false,
|
||||
index: true,
|
||||
menu: false,
|
||||
menuWidth: 150,
|
||||
@ -37,50 +65,81 @@ const state = reactive({
|
||||
searchMenuSpan: 6,
|
||||
addBtn: false,
|
||||
column: [
|
||||
{ label: computed(() => t('message.list.MaterialCode')), prop: 'FMaterialId', width: 200, search: true },
|
||||
{ label: computed(() => t('message.list.MaterialName')), prop: 'FMaterialName', width: 200, search: true },
|
||||
{ label: computed(() => t('message.list.Specification')), prop: 'FModel', width: 200, search: true },
|
||||
{ label: computed(() => t('message.list.PurchaseUnit')), prop: 'FUnitId', width: 200, search: true },
|
||||
{ label: computed(() => t('message.list.QTY')), prop: 'FPrice', width: 200 },
|
||||
{ label: computed(() => t('message.list.UP')), prop: 'FTaxPrice', width: 200 },
|
||||
{ label: computed(() => t('message.list.TotalAmount')), prop: 'FEntryAmount', width: 200 },
|
||||
{ label: computed(() => t('message.list.TotalAmountTaxInclusive')), prop: 'FAllAmount', width: 200 },
|
||||
{ label: computed(() => t('message.list.MaterialCode')), prop: 'materialCode', width: 200 },
|
||||
{ label: computed(() => t('message.list.MaterialName')), prop: 'materialName', width: 200 },
|
||||
{ label: computed(() => t('message.list.Specification')), prop: 'specificationModel', width: 200 },
|
||||
{ label: computed(() => t('message.list.PurchaseUnit')), prop: 'FUnitId', width: 200 },
|
||||
{ label: '采购数量', prop: 'qty', width: 200 },
|
||||
{ label: '处理中数量', prop: 'processingQty', width: 200 },
|
||||
{ label: '已发货数量', prop: 'sendedQty', width: 200 },
|
||||
{ label: '未发货数量', prop: 'notSendQty', width: 200 },
|
||||
{ label: '本次发货数量', prop: 'nowSendQty', width: 200,fixed:true },
|
||||
{ label: computed(() => t('message.list.UP')), prop: 'amount1', width: 200 },
|
||||
{ label: computed(() => t('message.list.TotalAmount')), prop: 'amount2', width: 200 },
|
||||
{ label: computed(() => t('message.list.AccumulatedReceiptQTY')), prop: 'FReceiveQty', width: 200 },
|
||||
{
|
||||
label: computed(() => t('message.list.DemondDate')),
|
||||
prop: 'FDeliveryDate',
|
||||
width: 200,
|
||||
search: true,
|
||||
type: 'datetime',
|
||||
searchSpan: 12,
|
||||
searchRange: true,
|
||||
searchLabelWidth: 150,
|
||||
},
|
||||
{ label: computed(() => t('message.list.TaxAmount')), prop: 'TaxAmount', width: 200 },
|
||||
{
|
||||
label: computed(() => t('message.list.CommittedDeliveryDate')),
|
||||
prop: 'FSupDueDate',
|
||||
width: 200,
|
||||
search: true,
|
||||
type: 'datetime',
|
||||
searchSpan: 12,
|
||||
searchRange: true,
|
||||
searchLabelWidth: 150,
|
||||
},
|
||||
{ label: computed(() => t('message.list.TaxAmount')), prop: 'taxAmount', width: 200 },
|
||||
{ label: computed(() => t('message.list.CommittedDeliveryDate')), prop: 'chengNuoJiaoQi',
|
||||
width: 200, type: 'datetime', searchSpan: 12, searchRange: true, searchLabelWidth: 150,fixed:true },
|
||||
{
|
||||
label: computed(() => t('message.list.LatestCommittedDeliveryDate')),
|
||||
prop: 'FSupDueNewDate',
|
||||
prop: 'newChengNuoJiaoQi',
|
||||
width: 200,
|
||||
search: true,
|
||||
type: 'datetime',
|
||||
searchSpan: 12,
|
||||
searchRange: true,
|
||||
searchLabelWidth: 150,
|
||||
fixed:true
|
||||
},
|
||||
{ label: computed(() => t('message.list.Comments2')), prop: 'FNote', width: 200 },
|
||||
{ label: computed(() => t('message.list.Comments2')), prop: 'remark', width: 200 },
|
||||
],
|
||||
},
|
||||
topId: '',
|
||||
});
|
||||
const chengNuoJiaoQiChange = (item:any) => {
|
||||
listApi().batchSetChengNuoJiaoQi([{
|
||||
id:item.id,
|
||||
newTime:item.chengNuoJiaoQi
|
||||
}]).then((res:any) => {
|
||||
if(res.resultCode === 0){
|
||||
ElMessage.success('操作成功');
|
||||
}
|
||||
if(res.resultCode === -1){
|
||||
ElMessage.success(res.errorMessage);
|
||||
}
|
||||
})
|
||||
}
|
||||
const newChengNuoJiaoQiChange = (item:any) => {
|
||||
listApi().batchSetNewChengNuoJiaoQi([{
|
||||
id:item.id,
|
||||
newTime:item.newChengNuoJiaoQi
|
||||
}]).then((res:any) => {
|
||||
if(res.resultCode === 0){
|
||||
ElMessage.success('操作成功');
|
||||
}
|
||||
if(res.resultCode === -1){
|
||||
ElMessage.success(res.errorMessage);
|
||||
}
|
||||
})
|
||||
}
|
||||
const batchAddInvoiceOrderFun = () => {
|
||||
console.log(props.listData)
|
||||
let arr:any = []
|
||||
props.listData.forEach((item:any) => {
|
||||
arr.push({
|
||||
id:item.id,
|
||||
qty:item.nowSendQty
|
||||
})
|
||||
})
|
||||
listApi().batchAddInvoiceOrder(arr).then((res:any) => {
|
||||
if(res.resultCode === 0){
|
||||
ElMessage.success('操作成功');
|
||||
emits('generateDocuments')
|
||||
}
|
||||
if(res.resultCode === -1){
|
||||
ElMessage.success(res.errorMessage);
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.btnList {
|
||||
|
@ -29,7 +29,7 @@ const viteConfig = defineConfig((mode: ConfigEnv) => {
|
||||
hmr: true,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'https://daogoufestival.site.zhongwangyingtong.com',
|
||||
target: 'http://8.134.66.212:90',
|
||||
ws: true,
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, ''),
|
||||
|
Loading…
x
Reference in New Issue
Block a user