修改
This commit is contained in:
parent
7d61f2213d
commit
0ac481b11a
@ -20,6 +20,7 @@
|
||||
"pinia": "^2.1.7",
|
||||
"pinia-plugin-persistedstate": "^3.2.1",
|
||||
"vue": "^3.4.15",
|
||||
"vue-draggable-plus": "^0.6.1",
|
||||
"vue-router": "^4.2.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@ -31,7 +31,7 @@ importers:
|
||||
version: 3.5.4
|
||||
naive-ui:
|
||||
specifier: ^2.37.3
|
||||
version: 2.44.1(vue@3.5.31(typescript@5.9.3))
|
||||
version: 2.37.3(vue@3.5.31(typescript@5.9.3))
|
||||
pinia:
|
||||
specifier: ^2.1.7
|
||||
version: 2.3.1(typescript@5.9.3)(vue@3.5.31(typescript@5.9.3))
|
||||
@ -41,6 +41,9 @@ importers:
|
||||
vue:
|
||||
specifier: ^3.4.15
|
||||
version: 3.5.31(typescript@5.9.3)
|
||||
vue-draggable-plus:
|
||||
specifier: ^0.6.1
|
||||
version: 0.6.1(@types/sortablejs@1.15.9)
|
||||
vue-router:
|
||||
specifier: ^4.2.5
|
||||
version: 4.6.4(vue@3.5.31(typescript@5.9.3))
|
||||
@ -79,6 +82,10 @@ packages:
|
||||
engines: {node: '>=6.0.0'}
|
||||
hasBin: true
|
||||
|
||||
'@babel/runtime@7.29.7':
|
||||
resolution: {integrity: sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==}
|
||||
engines: {node: '>=6.9.0'}
|
||||
|
||||
'@babel/types@7.29.0':
|
||||
resolution: {integrity: sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==}
|
||||
engines: {node: '>=6.9.0'}
|
||||
@ -269,36 +276,42 @@ packages:
|
||||
engines: {node: '>= 10.0.0'}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@parcel/watcher-linux-arm-musl@2.5.6':
|
||||
resolution: {integrity: sha512-Ve3gUCG57nuUUSyjBq/MAM0CzArtuIOxsBdQ+ftz6ho8n7s1i9E1Nmk/xmP323r2YL0SONs1EuwqBp2u1k5fxg==}
|
||||
engines: {node: '>= 10.0.0'}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@parcel/watcher-linux-arm64-glibc@2.5.6':
|
||||
resolution: {integrity: sha512-f2g/DT3NhGPdBmMWYoxixqYr3v/UXcmLOYy16Bx0TM20Tchduwr4EaCbmxh1321TABqPGDpS8D/ggOTaljijOA==}
|
||||
engines: {node: '>= 10.0.0'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@parcel/watcher-linux-arm64-musl@2.5.6':
|
||||
resolution: {integrity: sha512-qb6naMDGlbCwdhLj6hgoVKJl2odL34z2sqkC7Z6kzir8b5W65WYDpLB6R06KabvZdgoHI/zxke4b3zR0wAbDTA==}
|
||||
engines: {node: '>= 10.0.0'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@parcel/watcher-linux-x64-glibc@2.5.6':
|
||||
resolution: {integrity: sha512-kbT5wvNQlx7NaGjzPFu8nVIW1rWqV780O7ZtkjuWaPUgpv2NMFpjYERVi0UYj1msZNyCzGlaCWEtzc+exjMGbQ==}
|
||||
engines: {node: '>= 10.0.0'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@parcel/watcher-linux-x64-musl@2.5.6':
|
||||
resolution: {integrity: sha512-1JRFeC+h7RdXwldHzTsmdtYR/Ku8SylLgTU/reMuqdVD7CtLwf0VR1FqeprZ0eHQkO0vqsbvFLXUmYm/uNKJBg==}
|
||||
engines: {node: '>= 10.0.0'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@parcel/watcher-win32-arm64@2.5.6':
|
||||
resolution: {integrity: sha512-3ukyebjc6eGlw9yRt678DxVF7rjXatWiHvTXqphZLvo7aC5NdEgFufVwjFfY51ijYEWpXbqF5jtrK275z52D4Q==}
|
||||
@ -356,66 +369,79 @@ packages:
|
||||
resolution: {integrity: sha512-L+34Qqil+v5uC0zEubW7uByo78WOCIrBvci69E7sFASRl0X7b/MB6Cqd1lky/CtcSVTydWa2WZwFuWexjS5o6g==}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rollup/rollup-linux-arm-musleabihf@4.60.1':
|
||||
resolution: {integrity: sha512-n83O8rt4v34hgFzlkb1ycniJh7IR5RCIqt6mz1VRJD6pmhRi0CXdmfnLu9dIUS6buzh60IvACM842Ffb3xd6Gg==}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@rollup/rollup-linux-arm64-gnu@4.60.1':
|
||||
resolution: {integrity: sha512-Nql7sTeAzhTAja3QXeAI48+/+GjBJ+QmAH13snn0AJSNL50JsDqotyudHyMbO2RbJkskbMbFJfIJKWA6R1LCJQ==}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rollup/rollup-linux-arm64-musl@4.60.1':
|
||||
resolution: {integrity: sha512-+pUymDhd0ys9GcKZPPWlFiZ67sTWV5UU6zOJat02M1+PiuSGDziyRuI/pPue3hoUwm2uGfxdL+trT6Z9rxnlMA==}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@rollup/rollup-linux-loong64-gnu@4.60.1':
|
||||
resolution: {integrity: sha512-VSvgvQeIcsEvY4bKDHEDWcpW4Yw7BtlKG1GUT4FzBUlEKQK0rWHYBqQt6Fm2taXS+1bXvJT6kICu5ZwqKCnvlQ==}
|
||||
cpu: [loong64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rollup/rollup-linux-loong64-musl@4.60.1':
|
||||
resolution: {integrity: sha512-4LqhUomJqwe641gsPp6xLfhqWMbQV04KtPp7/dIp0nzPxAkNY1AbwL5W0MQpcalLYk07vaW9Kp1PBhdpZYYcEw==}
|
||||
cpu: [loong64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@rollup/rollup-linux-ppc64-gnu@4.60.1':
|
||||
resolution: {integrity: sha512-tLQQ9aPvkBxOc/EUT6j3pyeMD6Hb8QF2BTBnCQWP/uu1lhc9AIrIjKnLYMEroIz/JvtGYgI9dF3AxHZNaEH0rw==}
|
||||
cpu: [ppc64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rollup/rollup-linux-ppc64-musl@4.60.1':
|
||||
resolution: {integrity: sha512-RMxFhJwc9fSXP6PqmAz4cbv3kAyvD1etJFjTx4ONqFP9DkTkXsAMU4v3Vyc5BgzC+anz7nS/9tp4obsKfqkDHg==}
|
||||
cpu: [ppc64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@rollup/rollup-linux-riscv64-gnu@4.60.1':
|
||||
resolution: {integrity: sha512-QKgFl+Yc1eEk6MmOBfRHYF6lTxiiiV3/z/BRrbSiW2I7AFTXoBFvdMEyglohPj//2mZS4hDOqeB0H1ACh3sBbg==}
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rollup/rollup-linux-riscv64-musl@4.60.1':
|
||||
resolution: {integrity: sha512-RAjXjP/8c6ZtzatZcA1RaQr6O1TRhzC+adn8YZDnChliZHviqIjmvFwHcxi4JKPSDAt6Uhf/7vqcBzQJy0PDJg==}
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@rollup/rollup-linux-s390x-gnu@4.60.1':
|
||||
resolution: {integrity: sha512-wcuocpaOlaL1COBYiA89O6yfjlp3RwKDeTIA0hM7OpmhR1Bjo9j31G1uQVpDlTvwxGn2nQs65fBFL5UFd76FcQ==}
|
||||
cpu: [s390x]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rollup/rollup-linux-x64-gnu@4.60.1':
|
||||
resolution: {integrity: sha512-77PpsFQUCOiZR9+LQEFg9GClyfkNXj1MP6wRnzYs0EeWbPcHs02AXu4xuUbM1zhwn3wqaizle3AEYg5aeoohhg==}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rollup/rollup-linux-x64-musl@4.60.1':
|
||||
resolution: {integrity: sha512-5cIATbk5vynAjqqmyBjlciMJl1+R/CwX9oLk/EyiFXDWd95KpHdrOJT//rnUl4cUcskrd0jCCw3wpZnhIHdD9w==}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@rollup/rollup-openbsd-x64@4.60.1':
|
||||
resolution: {integrity: sha512-cl0w09WsCi17mcmWqqglez9Gk8isgeWvoUZ3WiJFYSR3zjBQc2J5/ihSjpl+VLjPqjQ/1hJRcqBfLjssREQILw==}
|
||||
@ -450,6 +476,9 @@ packages:
|
||||
'@types/estree@1.0.8':
|
||||
resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==}
|
||||
|
||||
'@types/katex@0.16.8':
|
||||
resolution: {integrity: sha512-trgaNyfU+Xh2Tc+ABIb44a5AYUpicB3uwirOioeOkNPPbmgRNtcWyDeeFRzjPZENO9Vq8gvVqfhaaXWLlevVwg==}
|
||||
|
||||
'@types/lodash-es@4.17.12':
|
||||
resolution: {integrity: sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==}
|
||||
|
||||
@ -459,6 +488,9 @@ packages:
|
||||
'@types/node@20.19.37':
|
||||
resolution: {integrity: sha512-8kzdPJ3FsNsVIurqBs7oodNnCEVbni9yUEkaHbgptDACOPW04jimGagZ51E6+lXUwJjgnBw+hyko/lkFWCldqw==}
|
||||
|
||||
'@types/sortablejs@1.15.9':
|
||||
resolution: {integrity: sha512-7HP+rZGE2p886PKV9c9OJzLBI6BBJu1O7lJGYnPyG3fS4/duUCcngkNCjsLwIMV+WMqANe3tt4irrXHSIe68OQ==}
|
||||
|
||||
'@vicons/ionicons5@0.12.0':
|
||||
resolution: {integrity: sha512-Iy1EUVRpX0WWxeu1VIReR1zsZLMc4fqpt223czR+Rpnrwu7pt46nbnC2ycO7ItI/uqDLJxnbcMC7FujKs9IfFA==}
|
||||
|
||||
@ -563,13 +595,14 @@ packages:
|
||||
csstype@3.2.3:
|
||||
resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==}
|
||||
|
||||
date-fns-tz@3.2.0:
|
||||
resolution: {integrity: sha512-sg8HqoTEulcbbbVXeg84u5UnlsQa8GS5QXMqjjYIhS4abEVVKIUwe0/l/UhrZdKaL/W5eWZNlbTeEIiOXTcsBQ==}
|
||||
date-fns-tz@2.0.1:
|
||||
resolution: {integrity: sha512-fJCG3Pwx8HUoLhkepdsP7Z5RsucUi+ZBOxyM5d0ZZ6c4SdYustq0VMmOu6Wf7bli+yS/Jwp91TOCqn9jMcVrUA==}
|
||||
peerDependencies:
|
||||
date-fns: ^3.0.0 || ^4.0.0
|
||||
date-fns: 2.x
|
||||
|
||||
date-fns@4.1.0:
|
||||
resolution: {integrity: sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==}
|
||||
date-fns@2.30.0:
|
||||
resolution: {integrity: sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==}
|
||||
engines: {node: '>=0.11'}
|
||||
|
||||
de-indent@1.0.2:
|
||||
resolution: {integrity: sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==}
|
||||
@ -718,9 +751,8 @@ packages:
|
||||
muggle-string@0.3.1:
|
||||
resolution: {integrity: sha512-ckmWDJjphvd/FvZawgygcUeQCxzvohjFO5RxTjj4eq8kw359gFF3E1brjfI+viLMxss5JrHTDRHZvu2/tuy0Qg==}
|
||||
|
||||
naive-ui@2.44.1:
|
||||
resolution: {integrity: sha512-reo8Esw0p58liZwbUutC7meW24Xbn3EwNv91zReWKm2W4JPu+zfgJRn/F7aO0BFmvN+h2brA2M5lRvYqLq4kuA==}
|
||||
engines: {node: '>=20'}
|
||||
naive-ui@2.37.3:
|
||||
resolution: {integrity: sha512-aUkHFXVIluSi8Me+npbcsdv1NYhVMj5t9YaruoCESlqmfqspj+R2QHEVXkTtUI1kQwVrABMCtAGq/wountqjZA==}
|
||||
peerDependencies:
|
||||
vue: ^3.0.0
|
||||
|
||||
@ -856,6 +888,15 @@ packages:
|
||||
'@vue/composition-api':
|
||||
optional: true
|
||||
|
||||
vue-draggable-plus@0.6.1:
|
||||
resolution: {integrity: sha512-FbtQ/fuoixiOfTZzG3yoPl4JAo9HJXRHmBQZFB9x2NYCh6pq0TomHf7g5MUmpaDYv+LU2n6BPq2YN9sBO+FbIg==}
|
||||
peerDependencies:
|
||||
'@types/sortablejs': ^1.15.0
|
||||
'@vue/composition-api': '*'
|
||||
peerDependenciesMeta:
|
||||
'@vue/composition-api':
|
||||
optional: true
|
||||
|
||||
vue-router@4.6.4:
|
||||
resolution: {integrity: sha512-Hz9q5sa33Yhduglwz6g9skT8OBPii+4bFn88w6J+J4MfEo4KRRpmiNG/hHHkdbRFlLBOqxN8y8gf2Fb0MTUgVg==}
|
||||
peerDependencies:
|
||||
@ -896,6 +937,8 @@ snapshots:
|
||||
dependencies:
|
||||
'@babel/types': 7.29.0
|
||||
|
||||
'@babel/runtime@7.29.7': {}
|
||||
|
||||
'@babel/types@7.29.0':
|
||||
dependencies:
|
||||
'@babel/helper-string-parser': 7.27.1
|
||||
@ -1122,6 +1165,8 @@ snapshots:
|
||||
|
||||
'@types/estree@1.0.8': {}
|
||||
|
||||
'@types/katex@0.16.8': {}
|
||||
|
||||
'@types/lodash-es@4.17.12':
|
||||
dependencies:
|
||||
'@types/lodash': 4.17.24
|
||||
@ -1132,6 +1177,8 @@ snapshots:
|
||||
dependencies:
|
||||
undici-types: 6.21.0
|
||||
|
||||
'@types/sortablejs@1.15.9': {}
|
||||
|
||||
'@vicons/ionicons5@0.12.0': {}
|
||||
|
||||
'@vitejs/plugin-vue@5.2.4(vite@5.4.21(@types/node@20.19.37)(sass@1.98.0))(vue@3.5.31(typescript@5.9.3))':
|
||||
@ -1268,11 +1315,13 @@ snapshots:
|
||||
|
||||
csstype@3.2.3: {}
|
||||
|
||||
date-fns-tz@3.2.0(date-fns@4.1.0):
|
||||
date-fns-tz@2.0.1(date-fns@2.30.0):
|
||||
dependencies:
|
||||
date-fns: 4.1.0
|
||||
date-fns: 2.30.0
|
||||
|
||||
date-fns@4.1.0: {}
|
||||
date-fns@2.30.0:
|
||||
dependencies:
|
||||
'@babel/runtime': 7.29.7
|
||||
|
||||
de-indent@1.0.2: {}
|
||||
|
||||
@ -1424,17 +1473,18 @@ snapshots:
|
||||
|
||||
muggle-string@0.3.1: {}
|
||||
|
||||
naive-ui@2.44.1(vue@3.5.31(typescript@5.9.3)):
|
||||
naive-ui@2.37.3(vue@3.5.31(typescript@5.9.3)):
|
||||
dependencies:
|
||||
'@css-render/plugin-bem': 0.15.14(css-render@0.15.14)
|
||||
'@css-render/vue3-ssr': 0.15.14(vue@3.5.31(typescript@5.9.3))
|
||||
'@types/katex': 0.16.8
|
||||
'@types/lodash': 4.17.24
|
||||
'@types/lodash-es': 4.17.12
|
||||
async-validator: 4.2.5
|
||||
css-render: 0.15.14
|
||||
csstype: 3.2.3
|
||||
date-fns: 4.1.0
|
||||
date-fns-tz: 3.2.0(date-fns@4.1.0)
|
||||
date-fns: 2.30.0
|
||||
date-fns-tz: 2.0.1(date-fns@2.30.0)
|
||||
evtd: 0.2.4
|
||||
highlight.js: 11.11.1
|
||||
lodash: 4.17.23
|
||||
@ -1559,6 +1609,10 @@ snapshots:
|
||||
dependencies:
|
||||
vue: 3.5.31(typescript@5.9.3)
|
||||
|
||||
vue-draggable-plus@0.6.1(@types/sortablejs@1.15.9):
|
||||
dependencies:
|
||||
'@types/sortablejs': 1.15.9
|
||||
|
||||
vue-router@4.6.4(vue@3.5.31(typescript@5.9.3)):
|
||||
dependencies:
|
||||
'@vue/devtools-api': 6.6.4
|
||||
|
||||
@ -50,30 +50,37 @@ export interface OrderItem {
|
||||
// 生产订单 API
|
||||
export const orderItemApi = {
|
||||
// 分页查询
|
||||
page(params: { page: number; pageSize: number; code?: string; projectId?: number; beginTime?: string; endTime?: string }) {
|
||||
page(params: any) { //{ page: number; pageSize: number; code?: string; projectId?: number; beginTime?: string; endTime?: string }
|
||||
return request({ url: '/biz/orderItem/page', method: 'get', params })
|
||||
},
|
||||
|
||||
// 获取详情
|
||||
detail(id: string) {
|
||||
detail(id: any) {
|
||||
return request({ url: `/biz/orderItem/${id}`, method: 'get' })
|
||||
},
|
||||
|
||||
// 新增
|
||||
create(data: OrderItem) {
|
||||
create(data: any) { //OrderItem
|
||||
return request({ url: '/biz/orderItem', method: 'post', data })
|
||||
},
|
||||
|
||||
// 修改
|
||||
update(data: OrderItem) {
|
||||
update(data: any) {
|
||||
return request({ url: '/biz/orderItem', method: 'put', data })
|
||||
},
|
||||
|
||||
// 删除
|
||||
delete(ids: string[]) {
|
||||
delete(ids: any) {
|
||||
return request({ url: `/biz/orderItem/${ids.join(',')}`, method: 'delete' })
|
||||
},
|
||||
|
||||
//派工
|
||||
assignWork(data: any) {
|
||||
return request({ url: '/biz/orderItem/assignWork', method: 'post', data })
|
||||
},
|
||||
//根据生产编号查询预生产订单
|
||||
preCreation(data: any) {
|
||||
return request({ url: '/biz/orderItem/preCreation', method: 'post', data })
|
||||
},
|
||||
// 导出
|
||||
export(params?: { ids?: string[]; code?: string; projectId?: number; beginTime?: string; endTime?: string }) {
|
||||
const p: Record<string, any> = {}
|
||||
|
||||
@ -861,7 +861,9 @@ function handleUserAction(key: string) {
|
||||
positiveText: '确定',
|
||||
negativeText: '取消',
|
||||
onPositiveClick: () => {
|
||||
userStore.logout()
|
||||
userStore.logout().then(() => {
|
||||
userStore.setinit(true)
|
||||
})
|
||||
message.success('已退出登录')
|
||||
}
|
||||
})
|
||||
|
||||
@ -118,9 +118,9 @@ const routes: RouteRecordRaw[] = [
|
||||
},
|
||||
//运营管理
|
||||
{
|
||||
path: 'biz/orderItem',
|
||||
path: 'biz/product',
|
||||
name: 'product',
|
||||
component: () => import('@/views/biz/orderItem/index.vue'),
|
||||
component: () => import('@/views/biz/product/index.vue'),
|
||||
meta: { title: '商品管理', icon: 'ListOutline' }
|
||||
},
|
||||
{
|
||||
@ -219,9 +219,14 @@ const routes: RouteRecordRaw[] = [
|
||||
}
|
||||
]
|
||||
},
|
||||
// {
|
||||
// path: '/:pathMatch(.*)',
|
||||
// name: 'NotFound',
|
||||
// component: () => import('@/views/error/404.vue'),
|
||||
// meta: { title: '404', requiresAuth: false }
|
||||
// }
|
||||
{
|
||||
path: '/:pathMatch(.*)',
|
||||
name: 'NotFound',
|
||||
component: () => import('@/views/error/404.vue'),
|
||||
meta: { title: '404', requiresAuth: false }
|
||||
}
|
||||
@ -327,35 +332,59 @@ export function resetRouter() {
|
||||
addedRouteNames.clear()
|
||||
}
|
||||
|
||||
|
||||
// 路由守卫
|
||||
router.beforeEach(async (to, _from, next) => {
|
||||
const userStore = useUserStore()
|
||||
|
||||
|
||||
//document.title = `${to.meta.title || ''} - CSY Admin`
|
||||
if (to.meta.requiresAuth === false) {
|
||||
|
||||
|
||||
if (!userStore.token) {
|
||||
//next({ name: 'Login', query: { redirect: to.fullPath } })
|
||||
next()
|
||||
return
|
||||
}
|
||||
|
||||
if (!userStore.token) {
|
||||
next({ name: 'Login', query: { redirect: to.fullPath } })
|
||||
return
|
||||
}
|
||||
|
||||
if (!userStore.user) {
|
||||
try {
|
||||
if (userStore.init) {
|
||||
try {
|
||||
await userStore.getInfo()
|
||||
// 添加动态路由(只添加新的,不影响已有的)
|
||||
addDynamicRoutes(userStore.menus)
|
||||
//userStore.setinit(false)
|
||||
userStore.init = false
|
||||
next({ ...to, replace: true })
|
||||
return
|
||||
//return
|
||||
} catch (error) {
|
||||
userStore.logout()
|
||||
userStore.init = false
|
||||
//userStore.setinit(true)
|
||||
next({ name: 'Login' })
|
||||
return
|
||||
//return
|
||||
}
|
||||
}else{
|
||||
next()
|
||||
}
|
||||
next()
|
||||
|
||||
// if (!userStore.user) {
|
||||
// try {
|
||||
// await userStore.getInfo()
|
||||
// // 添加动态路由(只添加新的,不影响已有的)
|
||||
// addDynamicRoutes(userStore.menus)
|
||||
// next({ ...to, replace: true })
|
||||
// return
|
||||
// } catch (error) {
|
||||
// userStore.logout()
|
||||
// next({ name: 'Login' })
|
||||
// return
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (to.meta.requiresAuth === false) {
|
||||
// next()
|
||||
// return
|
||||
// }
|
||||
|
||||
})
|
||||
|
||||
export default router
|
||||
|
||||
@ -11,11 +11,17 @@ export const useUserStore = defineStore('user', () => {
|
||||
const permissions = ref<string[]>([])
|
||||
const menus = ref<MenuInfo[]>([])
|
||||
|
||||
const init = ref<any>(true)
|
||||
|
||||
// 计算属性
|
||||
const isLogin = computed(() => !!token.value)
|
||||
const nickname = computed(() => user.value?.nickname || user.value?.username || '')
|
||||
const avatar = computed(() => user.value?.avatar || '')
|
||||
|
||||
function setinit(v:any) {
|
||||
init.value = v
|
||||
}
|
||||
|
||||
// 登录
|
||||
async function login(params: LoginParams) {
|
||||
const res = await authApi.login(params)
|
||||
@ -46,6 +52,8 @@ export const useUserStore = defineStore('user', () => {
|
||||
permissions.value = []
|
||||
menus.value = []
|
||||
|
||||
init.value = true
|
||||
|
||||
// 重置路由
|
||||
resetRouter()
|
||||
|
||||
@ -83,6 +91,8 @@ export const useUserStore = defineStore('user', () => {
|
||||
isLogin,
|
||||
nickname,
|
||||
avatar,
|
||||
init,
|
||||
setinit,
|
||||
login,
|
||||
getInfo,
|
||||
logout,
|
||||
|
||||
15
src/utils/tool.ts
Normal file
15
src/utils/tool.ts
Normal file
@ -0,0 +1,15 @@
|
||||
export function getaDtetime(timestamp:any) {
|
||||
const date = new Date(timestamp)
|
||||
|
||||
|
||||
const year = date.getFullYear()
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(date.getDate()).padStart(2, '0')
|
||||
|
||||
const hour = String(date.getHours()).padStart(2, '0')
|
||||
const minute = String(date.getMinutes()).padStart(2, '0')
|
||||
const second = String(date.getSeconds()).padStart(2, '0')
|
||||
|
||||
|
||||
return `${year}-${month}-${day} ${hour}:${minute}:${second}`
|
||||
}
|
||||
62
src/views/biz/orderItem/gxitem.vue
Normal file
62
src/views/biz/orderItem/gxitem.vue
Normal file
@ -0,0 +1,62 @@
|
||||
<template>
|
||||
<tr
|
||||
:key="obj.name"
|
||||
class="cursor-move"
|
||||
:style="{
|
||||
height: '40px',
|
||||
background:isEven(index)?'#fff':'#f3f3f3'
|
||||
}"
|
||||
>
|
||||
<td>{{ obj.code }}{{ obj.sort}}</td>
|
||||
<td>{{ obj.name }}</td>
|
||||
<td>{{ obj.orderItemName }}</td>
|
||||
<td>
|
||||
<n-date-picker
|
||||
v-model:value="beginTime"
|
||||
type="datetime"
|
||||
placeholder="请选择开始时间"
|
||||
@update:value="updatehand"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
style="width: 100%;"
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<n-date-picker
|
||||
v-model:value="endTime"
|
||||
type="datetime"
|
||||
placeholder="请选择结束时间"
|
||||
@update:value="updatehand"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
style="width: 100%;"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { getaDtetime } from '@/utils/tool'
|
||||
const props = withDefaults(defineProps<{
|
||||
obj:any,
|
||||
index:any
|
||||
}>(), {
|
||||
obj:{}
|
||||
})
|
||||
|
||||
const emit = defineEmits<{
|
||||
update: [index:any,obj:any]
|
||||
}>()
|
||||
|
||||
let beginTime = ref<any>(null)
|
||||
let endTime = ref<any>(null)
|
||||
|
||||
function isEven(num:any) {
|
||||
return num % 2 == 0
|
||||
}
|
||||
|
||||
function updatehand() {
|
||||
emit('update',props.index,Object.assign(props.obj,{
|
||||
beginTime:beginTime.value?getaDtetime(beginTime.value):null,
|
||||
endTime:endTime.value?getaDtetime(endTime.value):null
|
||||
}))
|
||||
}
|
||||
</script>
|
||||
@ -7,8 +7,8 @@
|
||||
<n-form-item label="物料编码">
|
||||
<n-input v-model:value="searchForm.code" placeholder="请输入物料编码" clearable />
|
||||
</n-form-item>
|
||||
<n-form-item label="产品id">
|
||||
<n-input v-model:value="searchForm.projectId" placeholder="请输入产品id" clearable />
|
||||
<n-form-item label="产品名称">
|
||||
<n-input v-model:value="searchForm.projectName" placeholder="请输入产品名称" clearable />
|
||||
</n-form-item>
|
||||
<n-form-item label="开始时间">
|
||||
<n-date-picker v-model:value="searchForm.beginTime" type="datetime" clearable />
|
||||
@ -34,7 +34,11 @@
|
||||
<!-- 工具栏 -->
|
||||
<div class="table-toolbar">
|
||||
<n-space>
|
||||
<n-button type="primary" @click="handleAdd">
|
||||
<n-button
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="handleAdd"
|
||||
>
|
||||
<template #icon><n-icon><AddOutline /></n-icon></template>
|
||||
新增/补单
|
||||
</n-button>
|
||||
@ -54,56 +58,179 @@
|
||||
</div>
|
||||
|
||||
<!-- 表格 -->
|
||||
<n-data-table
|
||||
:columns="columns"
|
||||
:data="tableData"
|
||||
:loading="loading"
|
||||
:pagination="pagination"
|
||||
<!--
|
||||
:row-key="(row) => row.id"
|
||||
:scroll-x="1200"
|
||||
@update:page="handlePageChange"
|
||||
@update:page-size="handlePageSizeChange"
|
||||
@update:checked-row-keys="handleCheck"
|
||||
:pagination="pagination"
|
||||
-->
|
||||
<n-data-table
|
||||
size="small"
|
||||
remote
|
||||
:bordere="false"
|
||||
:single-line="false"
|
||||
:columns="columns"
|
||||
:data="tableData"
|
||||
:loading="loading"
|
||||
/>
|
||||
<div class="pagination-container" style="display: flex; justify-content: flex-end; margin-top: 12px">
|
||||
<n-pagination
|
||||
v-model:page="pagination.page"
|
||||
v-model:page-size="pagination.pageSize"
|
||||
:item-count="pagination.itemCount"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
show-size-picker
|
||||
show-quick-jumper
|
||||
@update:page="handlePageChange"
|
||||
@update:page-size="handlePageSizeChange"
|
||||
>
|
||||
<template #prefix>
|
||||
共 {{ pagination.itemCount }} 条
|
||||
</template>
|
||||
</n-pagination>
|
||||
</div>
|
||||
</n-card>
|
||||
|
||||
<!-- 新增/编辑弹窗 -->
|
||||
<n-modal v-model:show="modalVisible" preset="card" :title="modalTitle" style="width: 600px">
|
||||
<n-form ref="formRef" :model="formData" :rules="formRules" label-placement="left" label-width="100px">
|
||||
<n-form-item label="生产令号" path="productionCode">
|
||||
<n-input v-model:value="formData.productionCode" placeholder="请输入生产令号" />
|
||||
</n-form-item>
|
||||
<n-form-item label="物料名称" path="name">
|
||||
<n-input v-model:value="formData.name" placeholder="请输入物料名称" readonly />
|
||||
</n-form-item>
|
||||
<n-form-item label="物料编码" path="code">
|
||||
<n-input v-model:value="formData.code" placeholder="请输入物料编码" readonly />
|
||||
</n-form-item>
|
||||
<n-form-item label="产品序列" path="sort">
|
||||
<n-input v-model:value="formData.sort" placeholder="请输入产品序列" readonly />
|
||||
</n-form-item>
|
||||
<n-form-item label="生产数量" path="quantity">
|
||||
<n-input v-model:value="formData.quantity" placeholder="请输入生产数量" readonly />
|
||||
</n-form-item>
|
||||
<n-form-item label="产品名称" path="projectName">
|
||||
<n-input v-model:value="formData.projectName" placeholder="请输入产品名称" readonly />
|
||||
</n-form-item>
|
||||
<n-form-item label="是否半成品" path="sfProduct">
|
||||
<n-input v-model:value="formData.sfProduct" placeholder="请输入是否半成品, 1是 0不是" />
|
||||
</n-form-item>
|
||||
<n-form-item label="是否采购" path="procurement">
|
||||
<n-input v-model:value="formData.procurement" placeholder="请输入是否采购, 1是 0不是" />
|
||||
</n-form-item>
|
||||
<n-form-item label="预计开始时间" path="beginTime">
|
||||
<n-date-picker v-model:value="formData.beginTime" type="datetime" clearable style="width: 100%" />
|
||||
</n-form-item>
|
||||
<n-form-item label="预计结束时间" path="endTime">
|
||||
<n-date-picker v-model:value="formData.endTime" type="datetime" clearable style="width: 100%" />
|
||||
</n-form-item>
|
||||
<n-form-item label="派工接收人" path="assingWorkId">
|
||||
<n-input v-model:value="formData.assingWorkId" placeholder="请输入派工接收人" />
|
||||
</n-form-item>
|
||||
<n-modal
|
||||
v-model:show="modalVisible"
|
||||
preset="card"
|
||||
:title="modalTitle"
|
||||
style="width: 900px"
|
||||
>
|
||||
<n-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-placement="left"
|
||||
label-width="120px"
|
||||
>
|
||||
<n-grid :cols="2">
|
||||
<n-gi>
|
||||
<n-form-item label="生产令号" path="productionCode">
|
||||
<n-input v-model:value="formData.productionCode" @input="gongxu" placeholder="请输入生产令号" />
|
||||
</n-form-item>
|
||||
</n-gi>
|
||||
<n-gi>
|
||||
<n-form-item label="物料名称" path="name">
|
||||
<n-input v-model:value="formData.name" placeholder="请输入物料名称" />
|
||||
</n-form-item>
|
||||
</n-gi>
|
||||
<n-gi>
|
||||
<n-form-item label="物料编码" path="code">
|
||||
<n-input v-if="formData.productionCode" v-model:value="formData.code" placeholder="请输入物料编码" />
|
||||
<n-input v-else v-model:value="formData.code" placeholder="请输入物料编码" disabled />
|
||||
</n-form-item>
|
||||
</n-gi>
|
||||
<n-gi>
|
||||
<n-form-item label="产品序列" path="sort">
|
||||
<n-input v-if="formData.productionCode" v-model:value="formData.sort" placeholder="请输入产品序列" />
|
||||
<n-input v-else v-model:value="formData.sort" placeholder="请输入产品序列" disabled />
|
||||
</n-form-item>
|
||||
</n-gi>
|
||||
<n-gi>
|
||||
<n-form-item label="生产数量" path="quantity">
|
||||
<n-input v-if="formData.productionCode" v-model:value="formData.quantity" placeholder="请输入生产数量" />
|
||||
<n-input v-else v-model:value="formData.quantity" placeholder="请输入生产数量" disabled />
|
||||
</n-form-item>
|
||||
</n-gi>
|
||||
<n-gi>
|
||||
<n-form-item label="产品名称" path="projectName">
|
||||
<n-input v-if="formData.productionCode" v-model:value="formData.projectName" placeholder="请输入产品名称" />
|
||||
<n-input v-else v-model:value="formData.projectName" placeholder="请输入产品名称" disabled />
|
||||
</n-form-item>
|
||||
</n-gi>
|
||||
<n-gi>
|
||||
<n-form-item label="是否半成品" path="sfProduct">
|
||||
<n-radio-group v-model:value="formData.sfProduct" name="radiogroup">
|
||||
<n-space>
|
||||
<n-radio :value="1">是</n-radio>
|
||||
<n-radio :value="0">否</n-radio>
|
||||
</n-space>
|
||||
</n-radio-group>
|
||||
</n-form-item>
|
||||
</n-gi>
|
||||
<n-gi>
|
||||
<n-form-item label="是否采购" path="procurement">
|
||||
<!-- <n-input v-model:value="formData.procurement" placeholder="请输入是否采购, 1是 0不是" /> -->
|
||||
<n-radio-group v-model:value="formData.procurement" name="radiogroup">
|
||||
<n-space>
|
||||
<n-radio :value="1">是</n-radio>
|
||||
<n-radio :value="0">否</n-radio>
|
||||
</n-space>
|
||||
</n-radio-group>
|
||||
</n-form-item>
|
||||
</n-gi>
|
||||
<n-gi>
|
||||
<n-form-item label="预计开始时间" path="beginTime">
|
||||
<n-date-picker v-model:value="formData.beginTime" type="datetime" clearable style="width: 100%" />
|
||||
</n-form-item>
|
||||
</n-gi>
|
||||
<n-gi>
|
||||
<n-form-item label="预计结束时间" path="endTime">
|
||||
<n-date-picker v-model:value="formData.endTime" type="datetime" clearable style="width: 100%" />
|
||||
</n-form-item>
|
||||
</n-gi>
|
||||
<n-gi>
|
||||
<n-form-item label="派工接收人" path="assingWorkId">
|
||||
<n-input v-model:value="formData.assingWorkId" placeholder="请输入派工接收人" />
|
||||
</n-form-item>
|
||||
</n-gi>
|
||||
</n-grid>
|
||||
</n-form>
|
||||
<template v-if="planList.length > 0">
|
||||
<n-divider title-placement="left" size="small">可拖动工序排序</n-divider>
|
||||
<VueDraggable
|
||||
v-model="planList"
|
||||
target=".sort-target"
|
||||
:animation="150"
|
||||
@end="tuozChange"
|
||||
>
|
||||
<table style="width: 100%;text-align: center;">
|
||||
<thead>
|
||||
<tr style="height: 30px;background: #e5e7eb;">
|
||||
<th>订单名称</th>
|
||||
<th>工序编码</th>
|
||||
<th>工序名称</th>
|
||||
<th>开始时间</th>
|
||||
<th>结束时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="sort-target">
|
||||
<gxitem
|
||||
v-for="(n,i) in planList"
|
||||
:obj="n"
|
||||
:index="i"
|
||||
@update="gxupdata"
|
||||
/>
|
||||
<!-- <tr v-for="(n,i) in planList" :key="n.name" class="cursor-move" :style="{
|
||||
height: '40px',
|
||||
}">
|
||||
<td>{{ n.code }}{{n.}}</td>
|
||||
<td>{{ n.name }}</td>
|
||||
<td>{{ n.orderItemName }}</td>
|
||||
<td>
|
||||
<n-date-picker
|
||||
v-model:value="gxsdate"
|
||||
type="datetime"
|
||||
style="width: 100%;"
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<n-date-picker
|
||||
v-model:value="gxsdate1"
|
||||
type="datetime"
|
||||
style="width: 100%;"
|
||||
/>
|
||||
</td>
|
||||
</tr> -->
|
||||
</tbody>
|
||||
</table>
|
||||
</VueDraggable>
|
||||
</template>
|
||||
|
||||
<template #footer>
|
||||
<n-space justify="end">
|
||||
<n-button @click="modalVisible = false">取消</n-button>
|
||||
@ -112,8 +239,49 @@
|
||||
</template>
|
||||
</n-modal>
|
||||
|
||||
<!--派工弹框-->
|
||||
<n-modal
|
||||
v-model:show="dispatchmodal"
|
||||
title="派工"
|
||||
preset="card"
|
||||
style="width: 400px"
|
||||
:mask-closable="false"
|
||||
>
|
||||
<n-form
|
||||
ref="dispatchformRef"
|
||||
:model="dispatchform"
|
||||
:rules="dispatchrules"
|
||||
label-placement="top"
|
||||
label-width="80"
|
||||
>
|
||||
<n-form-item label="产品名称">
|
||||
<n-input v-model:value="dispatchform.id" disabled />
|
||||
</n-form-item>
|
||||
<n-form-item label="指派员工" path="userid">
|
||||
<n-select
|
||||
v-model:value="dispatchform.userid"
|
||||
:options="yglist"
|
||||
clearable
|
||||
placeholder="请选择员工"
|
||||
/>
|
||||
<!-- <n-input v-model:value="dispatchform.userid" placeholder="请选择员工" /> -->
|
||||
</n-form-item>
|
||||
</n-form>
|
||||
<template #footer>
|
||||
<n-space justify="end">
|
||||
<n-button size="small" @click="dispatchmodal = false">取消</n-button>
|
||||
<n-button
|
||||
size="small"
|
||||
type="primary"
|
||||
:loading="dispatchLoading"
|
||||
@click="dispatchSubmit"
|
||||
:disabled="dispatchddbtn"
|
||||
>确定</n-button>
|
||||
</n-space>
|
||||
</template>
|
||||
</n-modal>
|
||||
<!-- 导入弹窗 -->
|
||||
<n-modal v-model:show="importModalVisible" preset="card" title="导入生产订单" style="width: 500px">
|
||||
<!-- <n-modal v-model:show="importModalVisible" preset="card" title="导入生产订单" style="width: 500px">
|
||||
<n-space vertical>
|
||||
<n-alert type="info">
|
||||
<template #header>导入说明</template>
|
||||
@ -141,31 +309,72 @@
|
||||
<template #footer>
|
||||
<n-button @click="importModalVisible = false">关闭</n-button>
|
||||
</template>
|
||||
</n-modal>
|
||||
</n-modal> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, h, onMounted } from 'vue'
|
||||
import { NButton, NSpace, NIcon, NUpload, useMessage, useDialog, type DataTableColumns, type UploadCustomRequestOptions } from 'naive-ui'
|
||||
import { SearchOutline, RefreshOutline, AddOutline, TrashOutline, CreateOutline, CloudUploadOutline, DownloadOutline } from '@vicons/ionicons5'
|
||||
import { orderItemApi, type OrderItem } from '@/api/orderItem'
|
||||
import {
|
||||
ref,
|
||||
reactive,
|
||||
h,
|
||||
onMounted
|
||||
} from 'vue'
|
||||
import {
|
||||
NButton,
|
||||
NSpace,
|
||||
NIcon,
|
||||
//NUpload,
|
||||
useMessage,
|
||||
useDialog,
|
||||
//type DataTableColumns,
|
||||
type UploadCustomRequestOptions
|
||||
} from 'naive-ui'
|
||||
import {
|
||||
SearchOutline,
|
||||
RefreshOutline,
|
||||
AddOutline,
|
||||
//TrashOutline,
|
||||
//CreateOutline,
|
||||
// CloudUploadOutline,
|
||||
// DownloadOutline
|
||||
} from '@vicons/ionicons5'
|
||||
import {
|
||||
orderItemApi,
|
||||
type OrderItem
|
||||
} from '@/api/orderItem'
|
||||
|
||||
import { useUserStore } from '@/stores/user'
|
||||
|
||||
import { VueDraggable } from 'vue-draggable-plus'
|
||||
|
||||
import Gxitem from './gxitem.vue'
|
||||
|
||||
const message = useMessage()
|
||||
const dialog = useDialog()
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
|
||||
|
||||
|
||||
// 权限检查
|
||||
const hasPermission = (permission: string) => userStore.hasPermission(permission)
|
||||
|
||||
// 搜索表单
|
||||
const searchForm = reactive({
|
||||
const searchForm = reactive<any>({
|
||||
code: '',
|
||||
projectId: null as number | null,
|
||||
projectName: '',
|
||||
beginTime: null as number | null,
|
||||
endTime: null as number | null,
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 表格数据
|
||||
const tableData = ref<OrderItem[]>([])
|
||||
const tableData = ref<any>([])
|
||||
const loading = ref(false)
|
||||
const selectedIds = ref<number[]>([])
|
||||
const selectedIds = ref<any>([])
|
||||
const pagination = reactive({
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
@ -174,34 +383,36 @@ const pagination = reactive({
|
||||
pageSizes: [10, 20, 50]
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 弹窗
|
||||
const modalVisible = ref(false)
|
||||
const modalTitle = ref('')
|
||||
const importModalVisible = ref(false)
|
||||
const formRef = ref()
|
||||
const defaultFormData: OrderItem = {
|
||||
id: undefined,
|
||||
const defaultFormData = {
|
||||
id: '',
|
||||
productionCode:'',
|
||||
name: '',
|
||||
code: '',
|
||||
sort: undefined,
|
||||
quantity: undefined,
|
||||
projectId: undefined,
|
||||
sort: '',
|
||||
quantity: '',
|
||||
projectId: '',
|
||||
projectName:'',
|
||||
parentId: undefined,
|
||||
sfProduct: undefined,
|
||||
procurement: undefined,
|
||||
beginTime: undefined,
|
||||
endTime: undefined,
|
||||
actualStartTime: undefined,
|
||||
actualEndTime: undefined,
|
||||
parentId: '',
|
||||
sfProduct: '',
|
||||
procurement: '',
|
||||
beginTime: null,
|
||||
endTime: null,
|
||||
actualStartTime: null,
|
||||
actualEndTime: null,
|
||||
assingWorkId: '',
|
||||
assingWorkTime: undefined,
|
||||
assingWorkTime: null,
|
||||
assingWorkOperationId: '',
|
||||
assingWorkOperationTime: undefined,
|
||||
starter: undefined,
|
||||
assingWorkOperationTime: null,
|
||||
starter: '',
|
||||
}
|
||||
const formData = reactive<OrderItem>({ ...defaultFormData })
|
||||
const formData = reactive<any>({ ...defaultFormData })
|
||||
|
||||
// 字典选项(下拉框/单选框/复选框关联字典时使用)
|
||||
|
||||
@ -210,41 +421,155 @@ const formRules = {
|
||||
}
|
||||
|
||||
// 表格列
|
||||
const columns: DataTableColumns<OrderItem> = [
|
||||
{ type: 'selection' },
|
||||
{ title: '产品名称', key: 'projectName' },
|
||||
{ title: '物料名称', key: 'name' },
|
||||
{ title: '物料编码', key: 'code' },
|
||||
{ title: '产品序列', key: 'sort' },
|
||||
{ title: '生产数量', key: 'quantity' },
|
||||
{ title: '是否半成品', key: 'sfProduct' },
|
||||
{ title: '是否采购', key: 'procurement' },
|
||||
{ title: '开始时间', key: 'beginTime' },
|
||||
{ title: '结束时间', key: 'endTime' },
|
||||
{ title: '实际开始时间', key: 'actualStartTime' },
|
||||
{ title: '实际结束时间', key: 'actualEndTime' },
|
||||
{ title: '派工操作人', key: 'assingWorkOperationName' },
|
||||
{ title: '派工操作时间', key: 'assingWorkOperationTime' },
|
||||
{ title: '派工接收人', key: 'assingWorkName' },
|
||||
{ title: '派工时间', key: 'assingWorkTime' },
|
||||
{ title: '是否开工', key: 'starter' },
|
||||
{ title: '备注', key: 'remark' },
|
||||
const columns = [
|
||||
{
|
||||
type: 'selection'
|
||||
},
|
||||
{
|
||||
align:'center',
|
||||
minWidth: 150,
|
||||
title: '产品名称',
|
||||
key: 'projectName'
|
||||
},
|
||||
{
|
||||
align:'center',
|
||||
minWidth: 150,
|
||||
title: '物料名称',
|
||||
key: 'name'
|
||||
},
|
||||
{
|
||||
align:'center',
|
||||
minWidth: 150,
|
||||
title: '物料编码',
|
||||
key: 'code'
|
||||
},
|
||||
{
|
||||
align:'center',
|
||||
minWidth: 150,
|
||||
title: '产品序列',
|
||||
key: 'sort'
|
||||
},
|
||||
{
|
||||
align:'center',
|
||||
minWidth: 150,
|
||||
title: '生产数量',
|
||||
key: 'quantity'
|
||||
},
|
||||
{
|
||||
align:'center',
|
||||
minWidth: 150,
|
||||
title: '是否半成品',
|
||||
key: 'sfProduct'
|
||||
},
|
||||
{
|
||||
align:'center',
|
||||
minWidth: 150,
|
||||
title: '是否采购',
|
||||
key: 'procurement'
|
||||
},
|
||||
{
|
||||
align:'center',
|
||||
minWidth: 150,
|
||||
title: '开始时间',
|
||||
key: 'beginTime'
|
||||
},
|
||||
{
|
||||
align:'center',
|
||||
minWidth: 150,
|
||||
title: '结束时间',
|
||||
key: 'endTime'
|
||||
},
|
||||
{
|
||||
align:'center',
|
||||
minWidth: 150,
|
||||
title: '实际开始时间',
|
||||
key: 'actualStartTime'
|
||||
},
|
||||
{
|
||||
align:'center',
|
||||
minWidth: 150,
|
||||
title: '实际结束时间',
|
||||
key: 'actualEndTime'
|
||||
},
|
||||
{
|
||||
align:'center',
|
||||
minWidth: 150,
|
||||
title: '派工操作人',
|
||||
key: 'assingWorkOperationName'
|
||||
},
|
||||
// {
|
||||
// align:'center',
|
||||
// minWidth: 150,
|
||||
// title: '派工操作时间',
|
||||
// key: 'assingWorkOperationTime'
|
||||
// },
|
||||
{
|
||||
align:'center',
|
||||
minWidth: 150,
|
||||
title: '派工接收人',
|
||||
key: 'assingWorkName'
|
||||
},
|
||||
{
|
||||
align:'center',
|
||||
minWidth: 150,
|
||||
title: '派工时间',
|
||||
key: 'assingWorkTime'
|
||||
},
|
||||
{
|
||||
align:'center',
|
||||
minWidth: 150,
|
||||
title: '是否开工',
|
||||
key: 'starter'
|
||||
},
|
||||
{
|
||||
align:'center',
|
||||
minWidth: 150,
|
||||
title: '备注',
|
||||
key: 'remark'
|
||||
},
|
||||
// { title: '创建时间', key: 'createTime', width: 100 },
|
||||
// { title: '创建人', key: 'createBy' },
|
||||
{
|
||||
align:'center',
|
||||
title: '操作',
|
||||
key: 'actions',
|
||||
width: 140,
|
||||
fixed: 'right',
|
||||
render(row) {
|
||||
return h('div', { style: { display: 'flex', alignItems: 'center', gap: '8px', flexWrap: 'nowrap' } }, [
|
||||
h(NButton, { size: 'small', quaternary: true, onClick: () => handleEdit(row) }, {
|
||||
default: () => [h(NIcon, null, { default: () => h(CreateOutline) }), ' 编辑']
|
||||
}),
|
||||
h(NButton, { size: 'small', quaternary: true, type: 'error', onClick: () => handleDelete(row) }, {
|
||||
default: () => [h(NIcon, null, { default: () => h(TrashOutline) }), ' 派工']
|
||||
})
|
||||
])
|
||||
render(row:any) {
|
||||
|
||||
const buttons:any = []
|
||||
|
||||
if(hasPermission('biz:orderItem:edit')){
|
||||
buttons.push(h(NButton, {
|
||||
size: 'small',
|
||||
type:'primary',
|
||||
ghost:true,
|
||||
onClick: () => { handleEdit(row) } },
|
||||
//{ default: () => [h(NIcon, null, { default: () => h(CreateOutline) }), ' 编辑' ]}
|
||||
{ default: () => '编辑'}
|
||||
))
|
||||
}
|
||||
if(hasPermission('biz:orderItem:assign')){
|
||||
buttons.push(h(NButton, {
|
||||
size: 'small',
|
||||
type:'success',
|
||||
ghost:true,
|
||||
onClick: () => { disphand(row) } },
|
||||
{ default: () => '派工'}
|
||||
))
|
||||
}
|
||||
|
||||
return buttons.length > 0 ? h(NSpace, {justify:'center'}, { default: () => buttons }) : '-'
|
||||
|
||||
|
||||
// return h('div', { style: { display: 'flex', alignItems: 'center', gap: '8px', flexWrap: 'nowrap' } }, [
|
||||
// h(NButton, { size: 'small', quaternary: true, onClick: () => handleEdit(row) }, {
|
||||
// default: () => [h(NIcon, null, { default: () => h(CreateOutline) }), ' 编辑']
|
||||
// }),
|
||||
// h(NButton, { size: 'small', quaternary: true, type: 'error', onClick: () => handleDelete(row) }, {
|
||||
// default: () => [h(NIcon, null, { default: () => h(TrashOutline) }), ' 派工']
|
||||
// })
|
||||
// ])
|
||||
}
|
||||
}
|
||||
]
|
||||
@ -256,10 +581,10 @@ async function loadData() {
|
||||
const res = await orderItemApi.page({
|
||||
page: pagination.page,
|
||||
pageSize: pagination.pageSize,
|
||||
code: searchForm.code || undefined,
|
||||
projectId: searchForm.projectId || undefined,
|
||||
beginTime: searchForm.beginTime || undefined,
|
||||
endTime: searchForm.endTime || undefined,
|
||||
code: searchForm.code,
|
||||
projectId: searchForm.projectId,
|
||||
beginTime: searchForm.beginTime,
|
||||
endTime: searchForm.endTime
|
||||
})
|
||||
tableData.value = res.list
|
||||
pagination.itemCount = res.total
|
||||
@ -278,7 +603,7 @@ function handleSearch() {
|
||||
function handleReset() {
|
||||
searchForm.code = ''
|
||||
|
||||
searchForm.projectId = null
|
||||
searchForm.projectId = ''
|
||||
|
||||
searchForm.beginTime = null
|
||||
|
||||
@ -304,16 +629,48 @@ function handleCheck(keys: Array<string | number>) {
|
||||
selectedIds.value = keys as number[]
|
||||
}
|
||||
|
||||
//工序
|
||||
//根据生产令号查询工序
|
||||
let planList = ref<any>([])
|
||||
function gongxu(){
|
||||
if(formData.productionCode){
|
||||
planList.value.splice(0)
|
||||
orderItemApi.preCreation({productionCode:formData.productionCode}).then((rps:any) => {
|
||||
planList.value = rps.planList?rps.planList:[]
|
||||
})
|
||||
}else{
|
||||
planList.value.splice(0)
|
||||
}
|
||||
}
|
||||
|
||||
function tuozChange() {
|
||||
console.log(planList.value)
|
||||
}
|
||||
|
||||
function gxupdata(v:any) {
|
||||
console.log(planList.value,'planList')
|
||||
console.log(v,'gx')
|
||||
}
|
||||
|
||||
let gxsdate = ref(null)
|
||||
|
||||
let gxsdate1 = ref(null)
|
||||
|
||||
|
||||
// 新增
|
||||
function handleAdd() {
|
||||
modalTitle.value = '新增生产订单'
|
||||
|
||||
Object.assign(formData, defaultFormData)
|
||||
modalVisible.value = true
|
||||
planList.value.splice(0)
|
||||
}
|
||||
|
||||
// 编辑
|
||||
function handleEdit(row: OrderItem) {
|
||||
modalTitle.value = '编辑生产订单'
|
||||
modalVisible.value = true
|
||||
planList.value.splice(0)
|
||||
Object.assign(formData, row)
|
||||
if (formData.beginTime && typeof formData.beginTime === 'string') {
|
||||
formData.beginTime = new Date(formData.beginTime.replace(' ', 'T')).getTime()
|
||||
@ -336,11 +693,13 @@ function handleEdit(row: OrderItem) {
|
||||
if (formData.assingWorkOperationTime && typeof formData.assingWorkOperationTime === 'string') {
|
||||
formData.assingWorkOperationTime = new Date(formData.assingWorkOperationTime.replace(' ', 'T')).getTime()
|
||||
}
|
||||
modalVisible.value = true
|
||||
|
||||
}
|
||||
|
||||
// 提交
|
||||
async function handleSubmit() {
|
||||
|
||||
console.log(planList.value,'planList')
|
||||
await formRef.value?.validate()
|
||||
try {
|
||||
const submitData = { ...formData } as OrderItem
|
||||
@ -365,11 +724,20 @@ async function handleSubmit() {
|
||||
if (typeof submitData.assingWorkOperationTime === 'number') {
|
||||
submitData.assingWorkOperationTime = new Date(submitData.assingWorkOperationTime).toISOString().slice(0, 19).replace('T', ' ')
|
||||
}
|
||||
|
||||
let savedata = Object.assign(
|
||||
{},
|
||||
submitData,
|
||||
{
|
||||
planList:planList.value
|
||||
}
|
||||
)
|
||||
|
||||
if (submitData.id) {
|
||||
await orderItemApi.update(submitData)
|
||||
await orderItemApi.update(savedata)
|
||||
message.success('修改成功')
|
||||
} else {
|
||||
await orderItemApi.create(submitData)
|
||||
await orderItemApi.create(savedata)
|
||||
message.success('新增成功')
|
||||
}
|
||||
modalVisible.value = false
|
||||
@ -379,6 +747,68 @@ async function handleSubmit() {
|
||||
}
|
||||
}
|
||||
|
||||
//派工
|
||||
let dispatchmodal = ref(false)
|
||||
let dispatchform = reactive<any>({
|
||||
id:'',
|
||||
userid:''
|
||||
})
|
||||
|
||||
let yglist = ref<any>([
|
||||
{
|
||||
label: '张三',
|
||||
value: '1'
|
||||
},
|
||||
{
|
||||
label: '李四',
|
||||
value: '2'
|
||||
}
|
||||
])
|
||||
|
||||
const dispatchrules = {
|
||||
userid:[{ required: true, message: '请选择员工', trigger: 'blur' }]
|
||||
}
|
||||
let dispatchLoading = ref(false)
|
||||
let dispatchddbtn = ref(false)
|
||||
|
||||
const dispatchformRef = ref()
|
||||
|
||||
function disphand(v:any){
|
||||
dispatchmodal.value = true
|
||||
dispatchformRef.value?.restoreValidation()
|
||||
dispatchform.id = v.id
|
||||
dispatchform.userid = ''
|
||||
}
|
||||
|
||||
function dispatchSubmit() {
|
||||
dispatchformRef.value?.validate((v:any) => {
|
||||
if(!v){
|
||||
// dispatchLoading.value = true
|
||||
// dispatchddbtn.value = true
|
||||
// message.success('操作成功!')
|
||||
// setTimeout(()=> {
|
||||
// dispatchmodal.value = false
|
||||
// dispatchform.value = false
|
||||
// dispatchLoading.value = false
|
||||
// dispatchddbtn.value = false
|
||||
// loadData()
|
||||
// },1000)
|
||||
orderItemApi.assignWork(dispatchform).then(() => {
|
||||
message.success('操作成功!')
|
||||
setTimeout(()=> {
|
||||
dispatchmodal.value = false
|
||||
dispatchLoading.value = false
|
||||
dispatchddbtn.value = false
|
||||
loadData()
|
||||
},1000)
|
||||
}).catch(() => {
|
||||
dispatchddbtn.value = false
|
||||
dispatchLoading.value = false
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 删除
|
||||
function handleDelete(row: OrderItem) {
|
||||
dialog.warning({
|
||||
|
||||
@ -559,7 +559,7 @@ const formData = reactive<any>({
|
||||
|
||||
const rules = {
|
||||
processName: [{ required: true, message: '请输工序名称', trigger: 'blur' }],
|
||||
quantity: [{ required: true, message: '请输入数里', trigger: 'blur' }]
|
||||
quantity: [{ required: true, message: '请输入数量', trigger: 'blur' }]
|
||||
}
|
||||
|
||||
//搜索数据
|
||||
|
||||
Loading…
Reference in New Issue
Block a user