Compare commits

..

No commits in common. "2caa3e0fa0938b82d5b769d8c690457e405ebab0" and "9ac544098039100a556ed61e0c781bab8294d10e" have entirely different histories.

16 changed files with 580 additions and 1608 deletions

View File

@ -20,7 +20,6 @@
"pinia": "^2.1.7", "pinia": "^2.1.7",
"pinia-plugin-persistedstate": "^3.2.1", "pinia-plugin-persistedstate": "^3.2.1",
"vue": "^3.4.15", "vue": "^3.4.15",
"vue-draggable-plus": "^0.6.1",
"vue-router": "^4.2.5" "vue-router": "^4.2.5"
}, },
"devDependencies": { "devDependencies": {

View File

@ -31,7 +31,7 @@ importers:
version: 3.5.4 version: 3.5.4
naive-ui: naive-ui:
specifier: ^2.37.3 specifier: ^2.37.3
version: 2.37.3(vue@3.5.31(typescript@5.9.3)) version: 2.44.1(vue@3.5.31(typescript@5.9.3))
pinia: pinia:
specifier: ^2.1.7 specifier: ^2.1.7
version: 2.3.1(typescript@5.9.3)(vue@3.5.31(typescript@5.9.3)) version: 2.3.1(typescript@5.9.3)(vue@3.5.31(typescript@5.9.3))
@ -41,9 +41,6 @@ importers:
vue: vue:
specifier: ^3.4.15 specifier: ^3.4.15
version: 3.5.31(typescript@5.9.3) 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: vue-router:
specifier: ^4.2.5 specifier: ^4.2.5
version: 4.6.4(vue@3.5.31(typescript@5.9.3)) version: 4.6.4(vue@3.5.31(typescript@5.9.3))
@ -82,10 +79,6 @@ packages:
engines: {node: '>=6.0.0'} engines: {node: '>=6.0.0'}
hasBin: true hasBin: true
'@babel/runtime@7.29.7':
resolution: {integrity: sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==}
engines: {node: '>=6.9.0'}
'@babel/types@7.29.0': '@babel/types@7.29.0':
resolution: {integrity: sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==} resolution: {integrity: sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==}
engines: {node: '>=6.9.0'} engines: {node: '>=6.9.0'}
@ -276,42 +269,36 @@ packages:
engines: {node: '>= 10.0.0'} engines: {node: '>= 10.0.0'}
cpu: [arm] cpu: [arm]
os: [linux] os: [linux]
libc: [glibc]
'@parcel/watcher-linux-arm-musl@2.5.6': '@parcel/watcher-linux-arm-musl@2.5.6':
resolution: {integrity: sha512-Ve3gUCG57nuUUSyjBq/MAM0CzArtuIOxsBdQ+ftz6ho8n7s1i9E1Nmk/xmP323r2YL0SONs1EuwqBp2u1k5fxg==} resolution: {integrity: sha512-Ve3gUCG57nuUUSyjBq/MAM0CzArtuIOxsBdQ+ftz6ho8n7s1i9E1Nmk/xmP323r2YL0SONs1EuwqBp2u1k5fxg==}
engines: {node: '>= 10.0.0'} engines: {node: '>= 10.0.0'}
cpu: [arm] cpu: [arm]
os: [linux] os: [linux]
libc: [musl]
'@parcel/watcher-linux-arm64-glibc@2.5.6': '@parcel/watcher-linux-arm64-glibc@2.5.6':
resolution: {integrity: sha512-f2g/DT3NhGPdBmMWYoxixqYr3v/UXcmLOYy16Bx0TM20Tchduwr4EaCbmxh1321TABqPGDpS8D/ggOTaljijOA==} resolution: {integrity: sha512-f2g/DT3NhGPdBmMWYoxixqYr3v/UXcmLOYy16Bx0TM20Tchduwr4EaCbmxh1321TABqPGDpS8D/ggOTaljijOA==}
engines: {node: '>= 10.0.0'} engines: {node: '>= 10.0.0'}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
libc: [glibc]
'@parcel/watcher-linux-arm64-musl@2.5.6': '@parcel/watcher-linux-arm64-musl@2.5.6':
resolution: {integrity: sha512-qb6naMDGlbCwdhLj6hgoVKJl2odL34z2sqkC7Z6kzir8b5W65WYDpLB6R06KabvZdgoHI/zxke4b3zR0wAbDTA==} resolution: {integrity: sha512-qb6naMDGlbCwdhLj6hgoVKJl2odL34z2sqkC7Z6kzir8b5W65WYDpLB6R06KabvZdgoHI/zxke4b3zR0wAbDTA==}
engines: {node: '>= 10.0.0'} engines: {node: '>= 10.0.0'}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
libc: [musl]
'@parcel/watcher-linux-x64-glibc@2.5.6': '@parcel/watcher-linux-x64-glibc@2.5.6':
resolution: {integrity: sha512-kbT5wvNQlx7NaGjzPFu8nVIW1rWqV780O7ZtkjuWaPUgpv2NMFpjYERVi0UYj1msZNyCzGlaCWEtzc+exjMGbQ==} resolution: {integrity: sha512-kbT5wvNQlx7NaGjzPFu8nVIW1rWqV780O7ZtkjuWaPUgpv2NMFpjYERVi0UYj1msZNyCzGlaCWEtzc+exjMGbQ==}
engines: {node: '>= 10.0.0'} engines: {node: '>= 10.0.0'}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
libc: [glibc]
'@parcel/watcher-linux-x64-musl@2.5.6': '@parcel/watcher-linux-x64-musl@2.5.6':
resolution: {integrity: sha512-1JRFeC+h7RdXwldHzTsmdtYR/Ku8SylLgTU/reMuqdVD7CtLwf0VR1FqeprZ0eHQkO0vqsbvFLXUmYm/uNKJBg==} resolution: {integrity: sha512-1JRFeC+h7RdXwldHzTsmdtYR/Ku8SylLgTU/reMuqdVD7CtLwf0VR1FqeprZ0eHQkO0vqsbvFLXUmYm/uNKJBg==}
engines: {node: '>= 10.0.0'} engines: {node: '>= 10.0.0'}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
libc: [musl]
'@parcel/watcher-win32-arm64@2.5.6': '@parcel/watcher-win32-arm64@2.5.6':
resolution: {integrity: sha512-3ukyebjc6eGlw9yRt678DxVF7rjXatWiHvTXqphZLvo7aC5NdEgFufVwjFfY51ijYEWpXbqF5jtrK275z52D4Q==} resolution: {integrity: sha512-3ukyebjc6eGlw9yRt678DxVF7rjXatWiHvTXqphZLvo7aC5NdEgFufVwjFfY51ijYEWpXbqF5jtrK275z52D4Q==}
@ -369,79 +356,66 @@ packages:
resolution: {integrity: sha512-L+34Qqil+v5uC0zEubW7uByo78WOCIrBvci69E7sFASRl0X7b/MB6Cqd1lky/CtcSVTydWa2WZwFuWexjS5o6g==} resolution: {integrity: sha512-L+34Qqil+v5uC0zEubW7uByo78WOCIrBvci69E7sFASRl0X7b/MB6Cqd1lky/CtcSVTydWa2WZwFuWexjS5o6g==}
cpu: [arm] cpu: [arm]
os: [linux] os: [linux]
libc: [glibc]
'@rollup/rollup-linux-arm-musleabihf@4.60.1': '@rollup/rollup-linux-arm-musleabihf@4.60.1':
resolution: {integrity: sha512-n83O8rt4v34hgFzlkb1ycniJh7IR5RCIqt6mz1VRJD6pmhRi0CXdmfnLu9dIUS6buzh60IvACM842Ffb3xd6Gg==} resolution: {integrity: sha512-n83O8rt4v34hgFzlkb1ycniJh7IR5RCIqt6mz1VRJD6pmhRi0CXdmfnLu9dIUS6buzh60IvACM842Ffb3xd6Gg==}
cpu: [arm] cpu: [arm]
os: [linux] os: [linux]
libc: [musl]
'@rollup/rollup-linux-arm64-gnu@4.60.1': '@rollup/rollup-linux-arm64-gnu@4.60.1':
resolution: {integrity: sha512-Nql7sTeAzhTAja3QXeAI48+/+GjBJ+QmAH13snn0AJSNL50JsDqotyudHyMbO2RbJkskbMbFJfIJKWA6R1LCJQ==} resolution: {integrity: sha512-Nql7sTeAzhTAja3QXeAI48+/+GjBJ+QmAH13snn0AJSNL50JsDqotyudHyMbO2RbJkskbMbFJfIJKWA6R1LCJQ==}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
libc: [glibc]
'@rollup/rollup-linux-arm64-musl@4.60.1': '@rollup/rollup-linux-arm64-musl@4.60.1':
resolution: {integrity: sha512-+pUymDhd0ys9GcKZPPWlFiZ67sTWV5UU6zOJat02M1+PiuSGDziyRuI/pPue3hoUwm2uGfxdL+trT6Z9rxnlMA==} resolution: {integrity: sha512-+pUymDhd0ys9GcKZPPWlFiZ67sTWV5UU6zOJat02M1+PiuSGDziyRuI/pPue3hoUwm2uGfxdL+trT6Z9rxnlMA==}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
libc: [musl]
'@rollup/rollup-linux-loong64-gnu@4.60.1': '@rollup/rollup-linux-loong64-gnu@4.60.1':
resolution: {integrity: sha512-VSvgvQeIcsEvY4bKDHEDWcpW4Yw7BtlKG1GUT4FzBUlEKQK0rWHYBqQt6Fm2taXS+1bXvJT6kICu5ZwqKCnvlQ==} resolution: {integrity: sha512-VSvgvQeIcsEvY4bKDHEDWcpW4Yw7BtlKG1GUT4FzBUlEKQK0rWHYBqQt6Fm2taXS+1bXvJT6kICu5ZwqKCnvlQ==}
cpu: [loong64] cpu: [loong64]
os: [linux] os: [linux]
libc: [glibc]
'@rollup/rollup-linux-loong64-musl@4.60.1': '@rollup/rollup-linux-loong64-musl@4.60.1':
resolution: {integrity: sha512-4LqhUomJqwe641gsPp6xLfhqWMbQV04KtPp7/dIp0nzPxAkNY1AbwL5W0MQpcalLYk07vaW9Kp1PBhdpZYYcEw==} resolution: {integrity: sha512-4LqhUomJqwe641gsPp6xLfhqWMbQV04KtPp7/dIp0nzPxAkNY1AbwL5W0MQpcalLYk07vaW9Kp1PBhdpZYYcEw==}
cpu: [loong64] cpu: [loong64]
os: [linux] os: [linux]
libc: [musl]
'@rollup/rollup-linux-ppc64-gnu@4.60.1': '@rollup/rollup-linux-ppc64-gnu@4.60.1':
resolution: {integrity: sha512-tLQQ9aPvkBxOc/EUT6j3pyeMD6Hb8QF2BTBnCQWP/uu1lhc9AIrIjKnLYMEroIz/JvtGYgI9dF3AxHZNaEH0rw==} resolution: {integrity: sha512-tLQQ9aPvkBxOc/EUT6j3pyeMD6Hb8QF2BTBnCQWP/uu1lhc9AIrIjKnLYMEroIz/JvtGYgI9dF3AxHZNaEH0rw==}
cpu: [ppc64] cpu: [ppc64]
os: [linux] os: [linux]
libc: [glibc]
'@rollup/rollup-linux-ppc64-musl@4.60.1': '@rollup/rollup-linux-ppc64-musl@4.60.1':
resolution: {integrity: sha512-RMxFhJwc9fSXP6PqmAz4cbv3kAyvD1etJFjTx4ONqFP9DkTkXsAMU4v3Vyc5BgzC+anz7nS/9tp4obsKfqkDHg==} resolution: {integrity: sha512-RMxFhJwc9fSXP6PqmAz4cbv3kAyvD1etJFjTx4ONqFP9DkTkXsAMU4v3Vyc5BgzC+anz7nS/9tp4obsKfqkDHg==}
cpu: [ppc64] cpu: [ppc64]
os: [linux] os: [linux]
libc: [musl]
'@rollup/rollup-linux-riscv64-gnu@4.60.1': '@rollup/rollup-linux-riscv64-gnu@4.60.1':
resolution: {integrity: sha512-QKgFl+Yc1eEk6MmOBfRHYF6lTxiiiV3/z/BRrbSiW2I7AFTXoBFvdMEyglohPj//2mZS4hDOqeB0H1ACh3sBbg==} resolution: {integrity: sha512-QKgFl+Yc1eEk6MmOBfRHYF6lTxiiiV3/z/BRrbSiW2I7AFTXoBFvdMEyglohPj//2mZS4hDOqeB0H1ACh3sBbg==}
cpu: [riscv64] cpu: [riscv64]
os: [linux] os: [linux]
libc: [glibc]
'@rollup/rollup-linux-riscv64-musl@4.60.1': '@rollup/rollup-linux-riscv64-musl@4.60.1':
resolution: {integrity: sha512-RAjXjP/8c6ZtzatZcA1RaQr6O1TRhzC+adn8YZDnChliZHviqIjmvFwHcxi4JKPSDAt6Uhf/7vqcBzQJy0PDJg==} resolution: {integrity: sha512-RAjXjP/8c6ZtzatZcA1RaQr6O1TRhzC+adn8YZDnChliZHviqIjmvFwHcxi4JKPSDAt6Uhf/7vqcBzQJy0PDJg==}
cpu: [riscv64] cpu: [riscv64]
os: [linux] os: [linux]
libc: [musl]
'@rollup/rollup-linux-s390x-gnu@4.60.1': '@rollup/rollup-linux-s390x-gnu@4.60.1':
resolution: {integrity: sha512-wcuocpaOlaL1COBYiA89O6yfjlp3RwKDeTIA0hM7OpmhR1Bjo9j31G1uQVpDlTvwxGn2nQs65fBFL5UFd76FcQ==} resolution: {integrity: sha512-wcuocpaOlaL1COBYiA89O6yfjlp3RwKDeTIA0hM7OpmhR1Bjo9j31G1uQVpDlTvwxGn2nQs65fBFL5UFd76FcQ==}
cpu: [s390x] cpu: [s390x]
os: [linux] os: [linux]
libc: [glibc]
'@rollup/rollup-linux-x64-gnu@4.60.1': '@rollup/rollup-linux-x64-gnu@4.60.1':
resolution: {integrity: sha512-77PpsFQUCOiZR9+LQEFg9GClyfkNXj1MP6wRnzYs0EeWbPcHs02AXu4xuUbM1zhwn3wqaizle3AEYg5aeoohhg==} resolution: {integrity: sha512-77PpsFQUCOiZR9+LQEFg9GClyfkNXj1MP6wRnzYs0EeWbPcHs02AXu4xuUbM1zhwn3wqaizle3AEYg5aeoohhg==}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
libc: [glibc]
'@rollup/rollup-linux-x64-musl@4.60.1': '@rollup/rollup-linux-x64-musl@4.60.1':
resolution: {integrity: sha512-5cIATbk5vynAjqqmyBjlciMJl1+R/CwX9oLk/EyiFXDWd95KpHdrOJT//rnUl4cUcskrd0jCCw3wpZnhIHdD9w==} resolution: {integrity: sha512-5cIATbk5vynAjqqmyBjlciMJl1+R/CwX9oLk/EyiFXDWd95KpHdrOJT//rnUl4cUcskrd0jCCw3wpZnhIHdD9w==}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
libc: [musl]
'@rollup/rollup-openbsd-x64@4.60.1': '@rollup/rollup-openbsd-x64@4.60.1':
resolution: {integrity: sha512-cl0w09WsCi17mcmWqqglez9Gk8isgeWvoUZ3WiJFYSR3zjBQc2J5/ihSjpl+VLjPqjQ/1hJRcqBfLjssREQILw==} resolution: {integrity: sha512-cl0w09WsCi17mcmWqqglez9Gk8isgeWvoUZ3WiJFYSR3zjBQc2J5/ihSjpl+VLjPqjQ/1hJRcqBfLjssREQILw==}
@ -476,9 +450,6 @@ packages:
'@types/estree@1.0.8': '@types/estree@1.0.8':
resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==}
'@types/katex@0.16.8':
resolution: {integrity: sha512-trgaNyfU+Xh2Tc+ABIb44a5AYUpicB3uwirOioeOkNPPbmgRNtcWyDeeFRzjPZENO9Vq8gvVqfhaaXWLlevVwg==}
'@types/lodash-es@4.17.12': '@types/lodash-es@4.17.12':
resolution: {integrity: sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==} resolution: {integrity: sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==}
@ -488,9 +459,6 @@ packages:
'@types/node@20.19.37': '@types/node@20.19.37':
resolution: {integrity: sha512-8kzdPJ3FsNsVIurqBs7oodNnCEVbni9yUEkaHbgptDACOPW04jimGagZ51E6+lXUwJjgnBw+hyko/lkFWCldqw==} resolution: {integrity: sha512-8kzdPJ3FsNsVIurqBs7oodNnCEVbni9yUEkaHbgptDACOPW04jimGagZ51E6+lXUwJjgnBw+hyko/lkFWCldqw==}
'@types/sortablejs@1.15.9':
resolution: {integrity: sha512-7HP+rZGE2p886PKV9c9OJzLBI6BBJu1O7lJGYnPyG3fS4/duUCcngkNCjsLwIMV+WMqANe3tt4irrXHSIe68OQ==}
'@vicons/ionicons5@0.12.0': '@vicons/ionicons5@0.12.0':
resolution: {integrity: sha512-Iy1EUVRpX0WWxeu1VIReR1zsZLMc4fqpt223czR+Rpnrwu7pt46nbnC2ycO7ItI/uqDLJxnbcMC7FujKs9IfFA==} resolution: {integrity: sha512-Iy1EUVRpX0WWxeu1VIReR1zsZLMc4fqpt223czR+Rpnrwu7pt46nbnC2ycO7ItI/uqDLJxnbcMC7FujKs9IfFA==}
@ -595,14 +563,13 @@ packages:
csstype@3.2.3: csstype@3.2.3:
resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==}
date-fns-tz@2.0.1: date-fns-tz@3.2.0:
resolution: {integrity: sha512-fJCG3Pwx8HUoLhkepdsP7Z5RsucUi+ZBOxyM5d0ZZ6c4SdYustq0VMmOu6Wf7bli+yS/Jwp91TOCqn9jMcVrUA==} resolution: {integrity: sha512-sg8HqoTEulcbbbVXeg84u5UnlsQa8GS5QXMqjjYIhS4abEVVKIUwe0/l/UhrZdKaL/W5eWZNlbTeEIiOXTcsBQ==}
peerDependencies: peerDependencies:
date-fns: 2.x date-fns: ^3.0.0 || ^4.0.0
date-fns@2.30.0: date-fns@4.1.0:
resolution: {integrity: sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==} resolution: {integrity: sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==}
engines: {node: '>=0.11'}
de-indent@1.0.2: de-indent@1.0.2:
resolution: {integrity: sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==} resolution: {integrity: sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==}
@ -751,8 +718,9 @@ packages:
muggle-string@0.3.1: muggle-string@0.3.1:
resolution: {integrity: sha512-ckmWDJjphvd/FvZawgygcUeQCxzvohjFO5RxTjj4eq8kw359gFF3E1brjfI+viLMxss5JrHTDRHZvu2/tuy0Qg==} resolution: {integrity: sha512-ckmWDJjphvd/FvZawgygcUeQCxzvohjFO5RxTjj4eq8kw359gFF3E1brjfI+viLMxss5JrHTDRHZvu2/tuy0Qg==}
naive-ui@2.37.3: naive-ui@2.44.1:
resolution: {integrity: sha512-aUkHFXVIluSi8Me+npbcsdv1NYhVMj5t9YaruoCESlqmfqspj+R2QHEVXkTtUI1kQwVrABMCtAGq/wountqjZA==} resolution: {integrity: sha512-reo8Esw0p58liZwbUutC7meW24Xbn3EwNv91zReWKm2W4JPu+zfgJRn/F7aO0BFmvN+h2brA2M5lRvYqLq4kuA==}
engines: {node: '>=20'}
peerDependencies: peerDependencies:
vue: ^3.0.0 vue: ^3.0.0
@ -888,15 +856,6 @@ packages:
'@vue/composition-api': '@vue/composition-api':
optional: true 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: vue-router@4.6.4:
resolution: {integrity: sha512-Hz9q5sa33Yhduglwz6g9skT8OBPii+4bFn88w6J+J4MfEo4KRRpmiNG/hHHkdbRFlLBOqxN8y8gf2Fb0MTUgVg==} resolution: {integrity: sha512-Hz9q5sa33Yhduglwz6g9skT8OBPii+4bFn88w6J+J4MfEo4KRRpmiNG/hHHkdbRFlLBOqxN8y8gf2Fb0MTUgVg==}
peerDependencies: peerDependencies:
@ -937,8 +896,6 @@ snapshots:
dependencies: dependencies:
'@babel/types': 7.29.0 '@babel/types': 7.29.0
'@babel/runtime@7.29.7': {}
'@babel/types@7.29.0': '@babel/types@7.29.0':
dependencies: dependencies:
'@babel/helper-string-parser': 7.27.1 '@babel/helper-string-parser': 7.27.1
@ -1165,8 +1122,6 @@ snapshots:
'@types/estree@1.0.8': {} '@types/estree@1.0.8': {}
'@types/katex@0.16.8': {}
'@types/lodash-es@4.17.12': '@types/lodash-es@4.17.12':
dependencies: dependencies:
'@types/lodash': 4.17.24 '@types/lodash': 4.17.24
@ -1177,8 +1132,6 @@ snapshots:
dependencies: dependencies:
undici-types: 6.21.0 undici-types: 6.21.0
'@types/sortablejs@1.15.9': {}
'@vicons/ionicons5@0.12.0': {} '@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))': '@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))':
@ -1315,13 +1268,11 @@ snapshots:
csstype@3.2.3: {} csstype@3.2.3: {}
date-fns-tz@2.0.1(date-fns@2.30.0): date-fns-tz@3.2.0(date-fns@4.1.0):
dependencies: dependencies:
date-fns: 2.30.0 date-fns: 4.1.0
date-fns@2.30.0: date-fns@4.1.0: {}
dependencies:
'@babel/runtime': 7.29.7
de-indent@1.0.2: {} de-indent@1.0.2: {}
@ -1473,18 +1424,17 @@ snapshots:
muggle-string@0.3.1: {} muggle-string@0.3.1: {}
naive-ui@2.37.3(vue@3.5.31(typescript@5.9.3)): naive-ui@2.44.1(vue@3.5.31(typescript@5.9.3)):
dependencies: dependencies:
'@css-render/plugin-bem': 0.15.14(css-render@0.15.14) '@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)) '@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': 4.17.24
'@types/lodash-es': 4.17.12 '@types/lodash-es': 4.17.12
async-validator: 4.2.5 async-validator: 4.2.5
css-render: 0.15.14 css-render: 0.15.14
csstype: 3.2.3 csstype: 3.2.3
date-fns: 2.30.0 date-fns: 4.1.0
date-fns-tz: 2.0.1(date-fns@2.30.0) date-fns-tz: 3.2.0(date-fns@4.1.0)
evtd: 0.2.4 evtd: 0.2.4
highlight.js: 11.11.1 highlight.js: 11.11.1
lodash: 4.17.23 lodash: 4.17.23
@ -1609,10 +1559,6 @@ snapshots:
dependencies: dependencies:
vue: 3.5.31(typescript@5.9.3) 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)): vue-router@4.6.4(vue@3.5.31(typescript@5.9.3)):
dependencies: dependencies:
'@vue/devtools-api': 6.6.4 '@vue/devtools-api': 6.6.4

View File

@ -50,37 +50,30 @@ export interface OrderItem {
// 生产订单 API // 生产订单 API
export const orderItemApi = { export const orderItemApi = {
// 分页查询 // 分页查询
page(params: any) { //{ page: number; pageSize: number; code?: string; projectId?: number; beginTime?: string; endTime?: string } page(params: { page: number; pageSize: number; code?: string; projectId?: number; beginTime?: string; endTime?: string }) {
return request({ url: '/biz/orderItem/page', method: 'get', params }) return request({ url: '/biz/orderItem/page', method: 'get', params })
}, },
// 获取详情 // 获取详情
detail(id: any) { detail(id: string) {
return request({ url: `/biz/orderItem/${id}`, method: 'get' }) return request({ url: `/biz/orderItem/${id}`, method: 'get' })
}, },
// 新增 // 新增
create(data: any) { //OrderItem create(data: OrderItem) {
return request({ url: '/biz/orderItem', method: 'post', data }) return request({ url: '/biz/orderItem', method: 'post', data })
}, },
// 修改 // 修改
update(data: any) { update(data: OrderItem) {
return request({ url: '/biz/orderItem', method: 'put', data }) return request({ url: '/biz/orderItem', method: 'put', data })
}, },
// 删除 // 删除
delete(ids: any) { delete(ids: string[]) {
return request({ url: `/biz/orderItem/${ids.join(',')}`, method: 'delete' }) 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 }) { export(params?: { ids?: string[]; code?: string; projectId?: number; beginTime?: string; endTime?: string }) {
const p: Record<string, any> = {} const p: Record<string, any> = {}

View File

@ -39,7 +39,7 @@ export interface OrderProcessPlan {
// 工序计划 API // 工序计划 API
export const orderProcessPlanApi = { export const orderProcessPlanApi = {
// 分页查询 // 分页查询
page(params:any) { //{ page: number; pageSize: number; id?: number; name?: string; code?: string; orderItemId?: number } page(params: { page: number; pageSize: number; id?: number; name?: string; code?: string; orderItemId?: number }) {
return request({ url: '/biz/orderProcessPlan/page', method: 'get', params }) return request({ url: '/biz/orderProcessPlan/page', method: 'get', params })
}, },
@ -49,12 +49,12 @@ export const orderProcessPlanApi = {
}, },
// 新增 // 新增
create(data: any) { create(data: OrderProcessPlan) {
return request({ url: '/biz/orderProcessPlan', method: 'post', data }) return request({ url: '/biz/orderProcessPlan', method: 'post', data })
}, },
// 修改 // 修改
update(data: any) { update(data: OrderProcessPlan) {
return request({ url: '/biz/orderProcessPlan', method: 'put', data }) return request({ url: '/biz/orderProcessPlan', method: 'put', data })
}, },
@ -63,11 +63,6 @@ export const orderProcessPlanApi = {
return request({ url: `/biz/orderProcessPlan/${ids.join(',')}`, method: 'delete' }) return request({ url: `/biz/orderProcessPlan/${ids.join(',')}`, method: 'delete' })
}, },
//派工
assignWork(data: any) {
return request({ url: '/biz/orderProcessPlan/assignWork', method: 'put', data })
},
// 导出 // 导出
export(params?: { ids?: string[]; id?: number; name?: string; code?: string; orderItemId?: number }) { export(params?: { ids?: string[]; id?: number; name?: string; code?: string; orderItemId?: number }) {
const p: Record<string, any> = {} const p: Record<string, any> = {}

View File

@ -47,19 +47,10 @@ export function mytasks(params:any) {
} }
//派工数据统计 //派工数据统计
export function workload(params?:any) { export function workload(params:any) {
return request({ return request({
url: `/mes/dispatch/workload`, url: `/mes/dispatch/workload`,
method: 'get', method: 'get',
params params
}) })
} }
//报检
export function inspectio(data:any) {
return request({
url: `/mes/dispatch/qc`,
method: 'put',
data
})
}

View File

@ -861,9 +861,7 @@ function handleUserAction(key: string) {
positiveText: '确定', positiveText: '确定',
negativeText: '取消', negativeText: '取消',
onPositiveClick: () => { onPositiveClick: () => {
userStore.logout().then(() => { userStore.logout()
userStore.setinit(true)
})
message.success('已退出登录') message.success('已退出登录')
} }
}) })

View File

@ -1,6 +1,6 @@
import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router' import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router'
import { useUserStore } from '@/stores/user' import { useUserStore } from '@/stores/user'
//import type { MenuInfo } from '@/api/auth' import type { MenuInfo } from '@/api/auth'
// 动态导入所有页面组件 // 动态导入所有页面组件
const modules = import.meta.glob('/src/views/**/*.vue') const modules = import.meta.glob('/src/views/**/*.vue')
@ -118,10 +118,16 @@ const routes: RouteRecordRaw[] = [
}, },
//运营管理 //运营管理
{ {
path: 'biz/product', path: 'biz/orderItem',
name: 'product', name: 'orderItem',
component: () => import('@/views/biz/product/index.vue'), component: () => import('@/views/biz/orderItem/index.vue'),
meta: { title: '商品管理', icon: 'ListOutline' } meta: { title: '生产订单', icon: 'ListOutline' }
},
{
path: 'biz/orderProcessPlan',
name: 'orderProcessPlan',
component: () => import('@/views/biz/orderProcessPlan/index.vue'),
meta: { title: '工序计划', icon: 'ListOutline' }
}, },
{ {
path: 'biz/user', path: 'biz/user',
@ -203,8 +209,14 @@ const routes: RouteRecordRaw[] = [
component: () => import('@/views/test/test/index.vue'), component: () => import('@/views/test/test/index.vue'),
meta: { title: '测试菜单', icon: 'StarOutline' } meta: { title: '测试菜单', icon: 'StarOutline' }
}, },
// 开发工具
{ {
path: 'biz/submitLog',
name: 'submitLog',
component: () => import('@/views/biz/submitLog/index.vue'),
meta: { title: '派工工单汇报记录', icon: 'ListOutline' }
},
{
// 开发工具
path: 'tool/gen', path: 'tool/gen',
name: 'ToolGen', name: 'ToolGen',
component: () => import('@/views/tool/gen/index.vue'), component: () => import('@/views/tool/gen/index.vue'),
@ -219,14 +231,9 @@ const routes: RouteRecordRaw[] = [
} }
] ]
}, },
// {
// path: '/:pathMatch(.*)',
// name: 'NotFound',
// component: () => import('@/views/error/404.vue'),
// meta: { title: '404', requiresAuth: false }
// }
{ {
path: '/:pathMatch(.*)', path: '/:pathMatch(.*)*',
name: 'NotFound',
component: () => import('@/views/error/404.vue'), component: () => import('@/views/error/404.vue'),
meta: { title: '404', requiresAuth: false } meta: { title: '404', requiresAuth: false }
} }
@ -243,9 +250,10 @@ const addedRouteNames = new Set<string>()
/** /**
* *
*/ */
export function addDynamicRoutes(menus: any) { //MenuInfo[] export function addDynamicRoutes(menus: MenuInfo[]) {
//console.log('[动态路由] 开始处理菜单:', menus) console.log('[动态路由] 开始处理菜单:', menus)
const addRoutes = (menuList: any) => { //MenuInfo[]
const addRoutes = (menuList: MenuInfo[]) => {
for (const menu of menuList) { for (const menu of menuList) {
// 只处理菜单类型(type=2),且有 path // 只处理菜单类型(type=2),且有 path
if (menu.type === 2 && menu.path) { if (menu.type === 2 && menu.path) {
@ -257,12 +265,12 @@ export function addDynamicRoutes(menus: any) { //MenuInfo[]
const pathExists = existingRoutes.some(r => r.path === '/' + menuPath || r.path === menuPath) const pathExists = existingRoutes.some(r => r.path === '/' + menuPath || r.path === menuPath)
if (pathExists) { if (pathExists) {
// console.log(`[动态路由] 跳过(已存在): ${menuPath}`) console.log(`[动态路由] 跳过(已存在): ${menuPath}`)
continue continue
} }
if (addedRouteNames.has(routeName)) { if (addedRouteNames.has(routeName)) {
//console.log(`[动态路由] 跳过(已添加): ${menuPath}`) console.log(`[动态路由] 跳过(已添加): ${menuPath}`)
continue continue
} }
@ -288,7 +296,7 @@ export function addDynamicRoutes(menus: any) { //MenuInfo[]
const componentPath = `/src/views/${componentName}.vue` const componentPath = `/src/views/${componentName}.vue`
const component = modules[componentPath] const component = modules[componentPath]
//console.log(`[动态路由] 处理: path=${menuPath}, component=${componentPath}, 组件存在=${!!component}`) console.log(`[动态路由] 处理: path=${menuPath}, component=${componentPath}, 组件存在=${!!component}`)
if (component) { if (component) {
router.addRoute('Layout', { router.addRoute('Layout', {
@ -302,9 +310,9 @@ export function addDynamicRoutes(menus: any) { //MenuInfo[]
} }
}) })
addedRouteNames.add(routeName) addedRouteNames.add(routeName)
//console.log(`[动态路由] ✓ 添加成功: ${menuPath}`) console.log(`[动态路由] ✓ 添加成功: ${menuPath}`)
} else { } else {
//console.warn(`[动态路由] ✗ 组件不存在: ${componentPath}`) console.warn(`[动态路由] ✗ 组件不存在: ${componentPath}`)
} }
} }
} }
@ -317,7 +325,7 @@ export function addDynamicRoutes(menus: any) { //MenuInfo[]
} }
addRoutes(menus) addRoutes(menus)
//console.log('[动态路由] 当前所有路由:', router.getRoutes().map(r => r.path)) console.log('[动态路由] 当前所有路由:', router.getRoutes().map(r => r.path))
} }
/** /**
@ -332,59 +340,42 @@ export function resetRouter() {
addedRouteNames.clear() addedRouteNames.clear()
} }
// 路由守卫 // 路由守卫
router.beforeEach(async (to, _from, next) => { router.beforeEach(async (to, _from, next) => {
console.log('路由测试');
const userStore = useUserStore() const userStore = useUserStore()
//document.title = `${to.meta.title || ''} - CSY Admin` //document.title = `${to.meta.title || ''} - CSY Admin`
console.log('开始动态路由11', to.meta, _from);
if (to.meta.requiresAuth === false) {
if (!userStore.token) {
//next({ name: 'Login', query: { redirect: to.fullPath } })
next() next()
return return
} }
console.log('开始动态路由2222', to.meta, _from);
if (userStore.init) { if (!userStore.token) {
next({ name: 'Login', query: { redirect: to.fullPath } })
return
}
if (!userStore.user) {
try { try {
console.log('开始动态路由4444', userStore.user, to.meta, _from);
await userStore.getInfo() await userStore.getInfo()
// 添加动态路由(只添加新的,不影响已有的) // 添加动态路由(只添加新的,不影响已有的)
addDynamicRoutes(userStore.menus) addDynamicRoutes(userStore.menus)
//userStore.setinit(false)
userStore.init = false
next({ ...to, replace: true }) next({ ...to, replace: true })
//return return
} catch (error) { } catch (error) {
userStore.logout() userStore.logout()
userStore.init = false
//userStore.setinit(true)
next({ name: 'Login' }) next({ name: 'Login' })
//return return
} }
}else{
next()
} }
// if (!userStore.user) { next()
// 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 export default router

View File

@ -11,17 +11,11 @@ export const useUserStore = defineStore('user', () => {
const permissions = ref<string[]>([]) const permissions = ref<string[]>([])
const menus = ref<MenuInfo[]>([]) const menus = ref<MenuInfo[]>([])
const init = ref<any>(true)
// 计算属性 // 计算属性
const isLogin = computed(() => !!token.value) const isLogin = computed(() => !!token.value)
const nickname = computed(() => user.value?.nickname || user.value?.username || '') const nickname = computed(() => user.value?.nickname || user.value?.username || '')
const avatar = computed(() => user.value?.avatar || '') const avatar = computed(() => user.value?.avatar || '')
function setinit(v:any) {
init.value = v
}
// 登录 // 登录
async function login(params: LoginParams) { async function login(params: LoginParams) {
const res = await authApi.login(params) const res = await authApi.login(params)
@ -52,8 +46,6 @@ export const useUserStore = defineStore('user', () => {
permissions.value = [] permissions.value = []
menus.value = [] menus.value = []
init.value = true
// 重置路由 // 重置路由
resetRouter() resetRouter()
@ -91,8 +83,6 @@ export const useUserStore = defineStore('user', () => {
isLogin, isLogin,
nickname, nickname,
avatar, avatar,
init,
setinit,
login, login,
getInfo, getInfo,
logout, logout,

View File

@ -1,15 +0,0 @@
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}`
}

View File

@ -1,63 +0,0 @@
<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>

View File

@ -7,8 +7,8 @@
<n-form-item label="物料编码"> <n-form-item label="物料编码">
<n-input v-model:value="searchForm.code" placeholder="请输入物料编码" clearable /> <n-input v-model:value="searchForm.code" placeholder="请输入物料编码" clearable />
</n-form-item> </n-form-item>
<n-form-item label="项目名称"> <n-form-item label="产品id">
<n-input v-model:value="searchForm.projectName" placeholder="请输入产品名称" clearable /> <n-input v-model:value="searchForm.projectId" placeholder="请输入产品id" clearable />
</n-form-item> </n-form-item>
<n-form-item label="开始时间"> <n-form-item label="开始时间">
<n-date-picker v-model:value="searchForm.beginTime" type="datetime" clearable /> <n-date-picker v-model:value="searchForm.beginTime" type="datetime" clearable />
@ -34,11 +34,7 @@
<!-- 工具栏 --> <!-- 工具栏 -->
<div class="table-toolbar"> <div class="table-toolbar">
<n-space> <n-space>
<n-button <n-button type="primary" @click="handleAdd">
size="small"
type="primary"
@click="handleAdd"
>
<template #icon><n-icon><AddOutline /></n-icon></template> <template #icon><n-icon><AddOutline /></n-icon></template>
新增/补单 新增/补单
</n-button> </n-button>
@ -58,189 +54,56 @@
</div> </div>
<!-- 表格 --> <!-- 表格 -->
<!-- <n-data-table
:columns="columns"
:data="tableData"
:loading="loading"
:pagination="pagination"
:row-key="(row) => row.id" :row-key="(row) => row.id"
:scroll-x="1200" :scroll-x="1200"
@update:page="handlePageChange" @update:page="handlePageChange"
@update:page-size="handlePageSizeChange" @update:page-size="handlePageSizeChange"
@update:checked-row-keys="handleCheck" @update:checked-row-keys="handleCheck"
:pagination="pagination"
-->
<n-data-table
size="small"
remote
striped
:border="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-card>
<!-- 新增/编辑弹窗 --> <!-- 新增/编辑弹窗 -->
<n-modal <n-modal v-model:show="modalVisible" preset="card" :title="modalTitle" style="width: 600px">
v-model:show="modalVisible" <n-form ref="formRef" :model="formData" :rules="formRules" label-placement="left" label-width="100px">
preset="card" <n-form-item label="生产令号" path="productionCode">
:title="modalTitle" <n-input v-model:value="formData.productionCode" placeholder="请输入生产令号" />
style="width: 900px" </n-form-item>
:mask-closable="false" <n-form-item label="物料名称" path="name">
> <n-input v-model:value="formData.name" placeholder="请输入物料名称" readonly />
<n-form </n-form-item>
ref="formRef" <n-form-item label="物料编码" path="code">
:model="formData" <n-input v-model:value="formData.code" placeholder="请输入物料编码" readonly />
:rules="formRules" </n-form-item>
label-placement="left" <n-form-item label="产品序列" path="sort">
label-width="120px" <n-input v-model:value="formData.sort" placeholder="请输入产品序列" readonly />
> </n-form-item>
<n-grid :cols="2"> <n-form-item label="生产数量" path="quantity">
<!-- <n-gi> <n-input v-model:value="formData.quantity" placeholder="请输入生产数量" readonly />
<n-form-item label="生产令号" path="productionCode"> </n-form-item>
<n-input v-if="formData.id" v-model:value="formData.productionCode" placeholder="请输入生产令号" /> <n-form-item label="产品名称" path="projectName">
<n-input v-else v-model:value="formData.productionCode" @input="gongxu" placeholder="请输入生产令号" /> <n-input v-model:value="formData.projectName" placeholder="请输入产品名称" readonly />
</n-form-item> </n-form-item>
</n-gi> --> <n-form-item label="是否半成品" path="sfProduct">
<n-gi> <n-input v-model:value="formData.sfProduct" placeholder="请输入是否半成品, 1是 0不是" />
<n-form-item label="项目名称" path="projectName"> </n-form-item>
<n-input v-if="formData.id" v-model:value="formData.projectName" disabled placeholder="请选择项目名称" /> <n-form-item label="是否采购" path="procurement">
<n-input v-else v-model:value="formData.projectName" placeholder="请选择产品名称" /> <n-input v-model:value="formData.procurement" placeholder="请输入是否采购, 1是 0不是" />
</n-form-item> </n-form-item>
</n-gi> <n-form-item label="预计开始时间" path="beginTime">
<n-gi> <n-date-picker v-model:value="formData.beginTime" type="datetime" clearable style="width: 100%" />
<n-form-item label="物料编码" path="code"> </n-form-item>
<n-input v-if="formData.id" v-model:value="formData.code" disabled placeholder="请选择物料编码" /> <n-form-item label="预计结束时间" path="endTime">
<n-input v-else v-model:value="formData.code" placeholder="请选择物料编码" /> <n-date-picker v-model:value="formData.endTime" type="datetime" clearable style="width: 100%" />
</n-form-item> </n-form-item>
</n-gi> <n-form-item label="派工接收人" path="assingWorkId">
<n-gi> <n-input v-model:value="formData.assingWorkId" placeholder="请输入派工接收人" />
<n-form-item label="物料名称" path="name"> </n-form-item>
<n-input v-model:value="formData.name" placeholder="请输入物料名称" />
</n-form-item>
</n-gi>
<n-gi>
<n-form-item label="产品序列" path="sort">
<n-input v-if="formData.id" v-model:value="formData.sort" placeholder="请输入产品序列" />
<n-input v-else v-model:value="formData.sort" placeholder="请输入产品序列" />
</n-form-item>
</n-gi>
<n-gi>
<n-form-item label="生产数量" path="quantity">
<n-input v-if="formData.id" v-model:value="formData.quantity" disabled placeholder="请输入生产数量" />
<n-input v-else v-model:value="formData.quantity" 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> </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="i"
class="cursor-move"
:style="{
height: '40px',
background:isEven(i)?'#fff':'#f3f3f3'
}"
>
<td>{{ n.code }}{{n.sort}}</td>
<td>{{ n.name }}</td>
<td>{{ n.orderItemName }}</td>
<td>
<n-date-picker
v-model:value="n.beginTime"
type="datetime"
style="width: 100%;"
/>
</td>
<td>
<n-date-picker
v-model:value="n.endTime"
type="datetime"
style="width: 100%;"
/>
</td>
</tr>
</tbody>
</table>
</VueDraggable>
</template>
<template #footer> <template #footer>
<n-space justify="end"> <n-space justify="end">
<n-button @click="modalVisible = false">取消</n-button> <n-button @click="modalVisible = false">取消</n-button>
@ -249,63 +112,8 @@
</template> </template>
</n-modal> </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.name" disabled />
</n-form-item>
<n-form-item label="指派员工" path="userid">
<!-- <n-select
v-model:value="dispatchform.userid"
:options="yglist"
clearable
placeholder="请选择员工"
/> -->
<n-select
v-model:value="dispatchform.userid"
filterable
placeholder="请输入用户名称搜索"
:options="yglist"
:loading="loadingRef"
clearable
remote
:clear-filter-after-select="false"
@search="slehand"
/>
<!-- <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-space vertical>
<n-alert type="info"> <n-alert type="info">
<template #header>导入说明</template> <template #header>导入说明</template>
@ -333,77 +141,31 @@
<template #footer> <template #footer>
<n-button @click="importModalVisible = false">关闭</n-button> <n-button @click="importModalVisible = false">关闭</n-button>
</template> </template>
</n-modal> --> </n-modal>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { import { ref, reactive, h, onMounted } from 'vue'
ref, import { NButton, NSpace, NIcon, NUpload, useMessage, useDialog, type DataTableColumns, type UploadCustomRequestOptions } from 'naive-ui'
reactive, import { SearchOutline, RefreshOutline, AddOutline, TrashOutline, CreateOutline, CloudUploadOutline, DownloadOutline } from '@vicons/ionicons5'
h, import { orderItemApi, type OrderItem } from '@/api/orderItem'
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'
import { userApi } from '@/api/system'
const message = useMessage() const message = useMessage()
const dialog = useDialog() const dialog = useDialog()
const userStore = useUserStore()
function isEven(num:any) {
return num % 2 == 0
}
//
const hasPermission = (permission: string) => userStore.hasPermission(permission)
// //
const searchForm = reactive<any>({ const searchForm = reactive({
code: '', code: '',
projectName: '', projectId: null as number | null,
beginTime: null as number | null, beginTime: null as number | null,
endTime: null as number | null, endTime: null as number | null,
}) })
// //
const tableData = ref<any>([]) const tableData = ref<OrderItem[]>([])
const loading = ref(false) const loading = ref(false)
const selectedIds = ref<any>([]) const selectedIds = ref<number[]>([])
const pagination = reactive({ const pagination = reactive({
page: 1, page: 1,
pageSize: 10, pageSize: 10,
@ -412,36 +174,34 @@ const pagination = reactive({
pageSizes: [10, 20, 50] pageSizes: [10, 20, 50]
}) })
// //
const modalVisible = ref(false) const modalVisible = ref(false)
const modalTitle = ref('') const modalTitle = ref('')
const importModalVisible = ref(false) const importModalVisible = ref(false)
const formRef = ref() const formRef = ref()
const defaultFormData = { const defaultFormData: OrderItem = {
id: '', id: undefined,
productionCode:'', productionCode:'',
name: '', name: '',
code: '', code: '',
sort: '', sort: undefined,
quantity: '', quantity: undefined,
projectId: '', projectId: undefined,
projectName:'', projectName:'',
parentId: '', parentId: undefined,
sfProduct: '', sfProduct: undefined,
procurement: '', procurement: undefined,
beginTime: null, beginTime: undefined,
endTime: null, endTime: undefined,
actualStartTime: null, actualStartTime: undefined,
actualEndTime: null, actualEndTime: undefined,
assingWorkId: '', assingWorkId: '',
assingWorkTime: null, assingWorkTime: undefined,
assingWorkOperationId: '', assingWorkOperationId: '',
assingWorkOperationTime: null, assingWorkOperationTime: undefined,
starter: '', starter: undefined,
} }
const formData = reactive<any>({ ...defaultFormData }) const formData = reactive<OrderItem>({ ...defaultFormData })
// //使 // //使
@ -450,155 +210,41 @@ const formRules = {
} }
// //
const columns = [ const columns: DataTableColumns<OrderItem> = [
// { { type: 'selection' },
// type: 'selection' { title: '产品名称', key: 'projectName' },
// }, { title: '物料名称', key: 'name' },
{ { title: '物料编码', key: 'code' },
align:'center', { title: '产品序列', key: 'sort' },
minWidth: 150, { title: '生产数量', key: 'quantity' },
title: '产品名称', { title: '是否半成品', key: 'sfProduct' },
key: 'projectName' { title: '是否采购', key: 'procurement' },
}, { title: '开始时间', key: 'beginTime' },
{ { title: '结束时间', key: 'endTime' },
align:'center', { title: '实际开始时间', key: 'actualStartTime' },
minWidth: 150, { title: '实际结束时间', key: 'actualEndTime' },
title: '物料名称', { title: '派工操作人', key: 'assingWorkOperationName' },
key: 'name' { title: '派工操作时间', key: 'assingWorkOperationTime' },
}, { title: '派工接收人', key: 'assingWorkName' },
{ { title: '派工时间', key: 'assingWorkTime' },
align:'center', { title: '是否开工', key: 'starter' },
minWidth: 150, { title: '备注', key: 'remark' },
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: 'createTime', width: 100 },
// { title: '', key: 'createBy' }, // { title: '', key: 'createBy' },
{ {
align:'center',
title: '操作', title: '操作',
key: 'actions', key: 'actions',
width: 140, width: 140,
fixed: 'right', fixed: 'right',
render(row:any) { render(row) {
return h('div', { style: { display: 'flex', alignItems: 'center', gap: '8px', flexWrap: 'nowrap' } }, [
const buttons:any = [] h(NButton, { size: 'small', quaternary: true, onClick: () => handleEdit(row) }, {
default: () => [h(NIcon, null, { default: () => h(CreateOutline) }), ' 编辑']
if(hasPermission('biz:orderItem:edit')){ }),
buttons.push(h(NButton, { h(NButton, { size: 'small', quaternary: true, type: 'error', onClick: () => handleDelete(row) }, {
size: 'small', default: () => [h(NIcon, null, { default: () => h(TrashOutline) }), ' 派工']
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) }), ' ']
// })
// ])
} }
} }
] ]
@ -610,10 +256,10 @@ async function loadData() {
const res = await orderItemApi.page({ const res = await orderItemApi.page({
page: pagination.page, page: pagination.page,
pageSize: pagination.pageSize, pageSize: pagination.pageSize,
code: searchForm.code, code: searchForm.code || undefined,
projectId: searchForm.projectId, projectId: searchForm.projectId || undefined,
beginTime: searchForm.beginTime, beginTime: searchForm.beginTime || undefined,
endTime: searchForm.endTime endTime: searchForm.endTime || undefined,
}) })
tableData.value = res.list tableData.value = res.list
pagination.itemCount = res.total pagination.itemCount = res.total
@ -632,7 +278,7 @@ function handleSearch() {
function handleReset() { function handleReset() {
searchForm.code = '' searchForm.code = ''
searchForm.projectId = '' searchForm.projectId = null
searchForm.beginTime = null searchForm.beginTime = null
@ -658,44 +304,16 @@ function handleCheck(keys: Array<string | number>) {
selectedIds.value = keys as 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')
// }
// //
function handleAdd() { function handleAdd() {
modalTitle.value = '新增生产订单' modalTitle.value = '新增生产订单'
Object.assign(formData, defaultFormData) Object.assign(formData, defaultFormData)
modalVisible.value = true modalVisible.value = true
planList.value.splice(0)
} }
// //
function handleEdit(row: OrderItem) { function handleEdit(row: OrderItem) {
modalTitle.value = '编辑生产订单' modalTitle.value = '编辑生产订单'
modalVisible.value = true
planList.value.splice(0)
Object.assign(formData, row) Object.assign(formData, row)
if (formData.beginTime && typeof formData.beginTime === 'string') { if (formData.beginTime && typeof formData.beginTime === 'string') {
formData.beginTime = new Date(formData.beginTime.replace(' ', 'T')).getTime() formData.beginTime = new Date(formData.beginTime.replace(' ', 'T')).getTime()
@ -718,12 +336,11 @@ function handleEdit(row: OrderItem) {
if (formData.assingWorkOperationTime && typeof formData.assingWorkOperationTime === 'string') { if (formData.assingWorkOperationTime && typeof formData.assingWorkOperationTime === 'string') {
formData.assingWorkOperationTime = new Date(formData.assingWorkOperationTime.replace(' ', 'T')).getTime() formData.assingWorkOperationTime = new Date(formData.assingWorkOperationTime.replace(' ', 'T')).getTime()
} }
modalVisible.value = true
} }
// //
async function handleSubmit() { async function handleSubmit() {
await formRef.value?.validate() await formRef.value?.validate()
try { try {
const submitData = { ...formData } as OrderItem const submitData = { ...formData } as OrderItem
@ -748,21 +365,11 @@ async function handleSubmit() {
if (typeof submitData.assingWorkOperationTime === 'number') { if (typeof submitData.assingWorkOperationTime === 'number') {
submitData.assingWorkOperationTime = new Date(submitData.assingWorkOperationTime).toISOString().slice(0, 19).replace('T', ' ') submitData.assingWorkOperationTime = new Date(submitData.assingWorkOperationTime).toISOString().slice(0, 19).replace('T', ' ')
} }
if (submitData.id) { if (submitData.id) {
await orderItemApi.update(submitData) await orderItemApi.update(submitData)
message.success('修改成功') message.success('修改成功')
} else { } else {
let savedata = Object.assign( await orderItemApi.create(submitData)
{},
submitData,
{
planList:planList.value
}
)
await orderItemApi.create(savedata)
message.success('新增成功') message.success('新增成功')
} }
modalVisible.value = false modalVisible.value = false
@ -772,88 +379,6 @@ async function handleSubmit() {
} }
} }
//
let dispatchmodal = ref(false)
let dispatchform = reactive<any>({
id:'',
name:'',
userid:'',
username:''
})
let yglist = ref<any>([])
const dispatchrules = {
userid:[{ required: true, message: '请选择员工', trigger: 'blur' }]
}
let dispatchLoading = ref(false)
let dispatchddbtn = ref(false)
const dispatchformRef = ref()
let loadingRef = ref(false)
function slehand(v?:any) {
loadingRef.value = true
userApi.page({
page: 1,
pageSize: 100,
username: v,
}).then((rps:any) =>{
if(rps.list && rps.list.length > 0){
yglist.value = rps.list.map((n:any) => {
return {
label:n.username,
value:n.id+''
}
})
}
console.log(yglist.value,'12')
loadingRef.value = false
}).catch(() => {
loadingRef.value = false
})
}
function disphand(v:any){
dispatchmodal.value = true
dispatchformRef.value?.restoreValidation()
dispatchform.id = v.id
dispatchform.name = v.name
dispatchform.userid = ''
slehand()
}
function dispatchSubmit() {
console.log(dispatchform.userid,'dispatchform.userid')
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) { function handleDelete(row: OrderItem) {
dialog.warning({ dialog.warning({

View File

@ -4,18 +4,18 @@
<!-- 搜索表单 --> <!-- 搜索表单 -->
<div class="search-form"> <div class="search-form">
<n-form inline :model="searchForm" label-placement="left"> <n-form inline :model="searchForm" label-placement="left">
<!-- <n-form-item label="主键"> <n-form-item label="主键">
<n-input v-model:value="searchForm.id" placeholder="请输入主键" clearable /> <n-input v-model:value="searchForm.id" placeholder="请输入主键" clearable />
</n-form-item> --> </n-form-item>
<n-form-item label="工序名称"> <n-form-item label="工序名称">
<n-input v-model:value="searchForm.name" placeholder="请输入工序名称" clearable /> <n-input v-model:value="searchForm.name" placeholder="请输入工序名称" clearable />
</n-form-item> </n-form-item>
<n-form-item label="工序编码"> <n-form-item label="工序编码">
<n-input v-model:value="searchForm.code" placeholder="请输入工序编码" clearable /> <n-input v-model:value="searchForm.code" placeholder="请输入工序编码" clearable />
</n-form-item> </n-form-item>
<!-- <n-form-item label="生产订单"> <n-form-item label="生产订单id">
<n-input v-model:value="searchForm.orderItemId" placeholder="请输入生产订单id" clearable /> <n-input v-model:value="searchForm.orderItemId" placeholder="请输入生产订单id" clearable />
</n-form-item> --> </n-form-item>
<n-form-item> <n-form-item>
<n-space> <n-space>
<n-button type="primary" @click="handleSearch"> <n-button type="primary" @click="handleSearch">
@ -34,160 +34,97 @@
<!-- 工具栏 --> <!-- 工具栏 -->
<div class="table-toolbar"> <div class="table-toolbar">
<n-space> <n-space>
<n-button type="primary" @click="handleAdd" size="small"> <n-button type="primary" @click="handleAdd">
<template #icon><n-icon><AddOutline /></n-icon></template> <template #icon><n-icon><AddOutline /></n-icon></template>
新增 新增
</n-button> </n-button>
<n-button type="error" :disabled="selectedIds.length === 0" @click="handleBatchDelete" size="small"> <n-button @click="importModalVisible = true">
<template #icon><n-icon><CloudUploadOutline /></n-icon></template>
导入
</n-button>
<n-button @click="handleExport">
<template #icon><n-icon><DownloadOutline /></n-icon></template>
导出{{ selectedIds.length > 0 ? `(${selectedIds.length})` : '' }}
</n-button>
<n-button type="error" :disabled="selectedIds.length === 0" @click="handleBatchDelete">
<template #icon><n-icon><TrashOutline /></n-icon></template> <template #icon><n-icon><TrashOutline /></n-icon></template>
删除 删除
</n-button> </n-button>
</n-space> </n-space>
<n-button-group size="large">
<n-button type="success" @click="importModalVisible = true" size="small">
<template #icon><n-icon><CloudUploadOutline /></n-icon></template>
导入
</n-button>
<n-button @click="handleExport" size="small">
<template #icon><n-icon><DownloadOutline /></n-icon></template>
导出{{ selectedIds.length > 0 ? `(${selectedIds.length})` : '' }}
</n-button>
</n-button-group>
</div> </div>
<!-- 表格 --> <!-- 表格 -->
<n-data-table <n-data-table
size="small"
remote
:border="false"
:single-line="false"
striped
:columns="columns" :columns="columns"
:data="tableData" :data="tableData"
:loading="loading" :loading="loading"
/> :pagination="pagination"
<div class="pagination-container" style="display: flex; justify-content: flex-end; margin-top: 12px"> :row-key="(row) => row.id"
<n-pagination :scroll-x="1200"
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>
<!-- :pagination="pagination"
:row-key="(row:any) => row.id"
@update:page="handlePageChange" @update:page="handlePageChange"
@update:page-size="handlePageSizeChange" @update:page-size="handlePageSizeChange"
@update:checked-row-keys="handleCheck" @update:checked-row-keys="handleCheck"
--> />
</n-card> </n-card>
<!-- 新增/编辑弹窗 --> <!-- 新增/编辑弹窗 -->
<n-modal <n-modal v-model:show="modalVisible" preset="card" :title="modalTitle" style="width: 600px">
v-model:show="modalVisible" <n-form ref="formRef" :model="formData" :rules="formRules" label-placement="left" label-width="100px">
preset="card" <n-form-item label="工序名称" path="name">
:title="modalTitle" <n-input v-model:value="formData.name" placeholder="请输入工序名称" />
style="width: 800px" </n-form-item>
> <n-form-item label="工序编码" path="code">
<n-form <n-input v-model:value="formData.code" placeholder="请输入工序编码" />
ref="formRef" </n-form-item>
:model="formData" <n-form-item label="工序顺序" path="sort">
:rules="formRules" <n-input v-model:value="formData.sort" placeholder="请输入工序顺序" />
label-placement="left" </n-form-item>
label-width="120px" <n-form-item label="生产订单id" path="orderItemId">
> <n-input v-model:value="formData.orderItemId" placeholder="请输入生产订单id" />
<n-grid :cols="2"> </n-form-item>
<n-gi> <n-form-item label="生产开始时间" path="beginTime">
<n-form-item label="工序名称" path="name"> <n-date-picker v-model:value="formData.beginTime" type="datetime" clearable style="width: 100%" />
<n-input v-model:value="formData.name" placeholder="请输入工序名称" /> </n-form-item>
</n-form-item> <n-form-item label="生产结束时间" path="endTime">
</n-gi> <n-date-picker v-model:value="formData.endTime" type="datetime" clearable style="width: 100%" />
<n-gi> </n-form-item>
<n-form-item label="工序编码" path="code"> <n-form-item label="是否采购" path="procurement">
<n-input v-model:value="formData.code" placeholder="请输入工序编码" /> <n-radio-group v-model:value="formData.procurement">
</n-form-item> <n-space>
</n-gi> <n-radio v-for="opt in procurementOptions" :key="opt.value" :value="opt.value">{{ opt.label }}</n-radio>
<n-gi> </n-space>
<n-form-item label="工序顺序" path="sort"> </n-radio-group>
<n-input v-model:value="formData.sort" placeholder="请输入工序顺序" /> </n-form-item>
</n-form-item> <n-form-item label="是否委外" path="outsource">
</n-gi> <n-radio-group v-model:value="formData.outsource">
<n-gi> <n-space>
<n-form-item label="生产订单id" path="orderItemId"> <n-radio v-for="opt in outsourceOptions" :key="opt.value" :value="opt.value">{{ opt.label }}</n-radio>
<n-input v-model:value="formData.orderItemId" placeholder="请输入生产订单id" /> </n-space>
</n-form-item> </n-radio-group>
</n-gi> </n-form-item>
<n-gi> <n-form-item label="生产总数" path="quantity">
<n-form-item label="生产开始时间" path="beginTime"> <n-input v-model:value="formData.quantity" placeholder="请输入生产总数" />
<n-date-picker v-model:value="formData.beginTime" type="datetime" clearable style="width: 100%" /> </n-form-item>
</n-form-item> <n-form-item label="转入数量" path="transferNum">
</n-gi> <n-input v-model:value="formData.transferNum" placeholder="请输入转入数量" />
<n-gi> </n-form-item>
<n-form-item label="生产结束时间" path="endTime"> <n-form-item label="转出数量" path="transferOutNum">
<n-date-picker v-model:value="formData.endTime" type="datetime" clearable style="width: 100%" /> <n-input v-model:value="formData.transferOutNum" placeholder="请输入转出数量" />
</n-form-item> </n-form-item>
</n-gi> <n-form-item label="是否质检" path="qualityInspection">
<n-gi> <n-radio-group v-model:value="formData.qualityInspection">
<n-form-item label="是否采购" path="procurement"> <n-space>
<n-radio-group v-model:value="formData.procurement"> <n-radio v-for="opt in qualityInspectionOptions" :key="opt.value" :value="opt.value">{{ opt.label }}</n-radio>
<n-space> </n-space>
<n-radio v-for="opt in procurementOptions" :key="opt.value" :value="opt.value">{{ opt.label }}</n-radio> </n-radio-group>
</n-space> </n-form-item>
</n-radio-group> <n-form-item label="是否直接入库" path="storageEntry">
</n-form-item> <n-radio-group v-model:value="formData.storageEntry">
</n-gi> <n-space>
<n-gi> <n-radio v-for="opt in storageEntryOptions" :key="opt.value" :value="opt.value">{{ opt.label }}</n-radio>
<n-form-item label="是否委外" path="outsource"> </n-space>
<n-radio-group v-model:value="formData.outsource"> </n-radio-group>
<n-space> </n-form-item>
<n-radio v-for="opt in outsourceOptions" :key="opt.value" :value="opt.value">{{ opt.label }}</n-radio>
</n-space>
</n-radio-group>
</n-form-item>
</n-gi>
<n-gi>
<n-form-item label="生产总数" path="quantity">
<n-input v-model:value="formData.quantity" placeholder="请输入生产总数" />
</n-form-item>
</n-gi>
<n-gi>
<n-form-item label="转入数量" path="transferNum">
<n-input v-model:value="formData.transferNum" placeholder="请输入转入数量" />
</n-form-item>
</n-gi>
<n-gi>
<n-form-item label="转出数量" path="transferOutNum">
<n-input v-model:value="formData.transferOutNum" placeholder="请输入转出数量" />
</n-form-item>
</n-gi>
<n-gi>
<n-form-item label="是否质检" path="qualityInspection">
<n-radio-group v-model:value="formData.qualityInspection">
<n-space>
<n-radio v-for="opt in qualityInspectionOptions" :key="opt.value" :value="opt.value">{{ opt.label }}</n-radio>
</n-space>
</n-radio-group>
</n-form-item>
</n-gi>
<n-gi>
<n-form-item label="是否直接入库" path="storageEntry">
<n-radio-group v-model:value="formData.storageEntry">
<n-space>
<n-radio v-for="opt in storageEntryOptions" :key="opt.value" :value="opt.value">{{ opt.label }}</n-radio>
</n-space>
</n-radio-group>
</n-form-item>
</n-gi>
</n-grid>
</n-form> </n-form>
<template #footer> <template #footer>
<n-space justify="end"> <n-space justify="end">
@ -197,138 +134,6 @@
</template> </template>
</n-modal> </n-modal>
<!--派工弹框-->
<n-modal
v-model:show="dispatchmodal"
title="派工"
preset="card"
style="width: 800px"
:mask-closable="false"
>
<n-form
ref="dispatchformRef"
:model="dispatchform"
label-placement="left"
:inline="true"
:rules="dispatchrules"
label-width="80"
>
<n-grid :cols="2">
<n-gi>
<n-form-item label="工序名称">
<n-input v-model:value="dispatchform.name" disabled />
</n-form-item>
</n-gi>
<n-gi>
<n-form-item label="生产数量">
<n-input v-model:value="dispatchform.quantity" disabled />
</n-form-item>
</n-gi>
<n-gi>
<n-form-item label="开始时间">
<n-input v-model:value="dispatchform.beginTime" disabled />
</n-form-item>
</n-gi>
<n-gi>
<n-form-item label="结束时间">
<n-input v-model:value="dispatchform.endTime" disabled />
</n-form-item>
</n-gi>
<!-- <pgitem
v-for="(n,i) in dispatchform.userlist"
:obj="n"
:index="i"
@addhand="addpgnum"
@delehand="deletenum(i)"
/> -->
<n-gi :span="24">
<pgitem
v-for="(n,i) in dispatchform.list"
:obj="n"
:index="i"
:key="i"
listname="list"
@addhand="addpgnum"
@delehand="deletenum(i)"
/>
<!-- <n-grid :cols="8">
<template v-for="(n,i) in dispatchform.userlist">
<n-gi :span="8">
<n-form-item
label="指派员工"
:rule="{
required: true,
message: '请选择员工',
trigger: 'blur'
}"
>
<n-select
v-model:value="n.id"
filterable
placeholder="请输入用户名称搜索"
:options="yglist"
:loading="loadingRef"
clearable
remote
:clear-filter-after-select="false"
@search="slehand"
/>
</n-form-item>
</n-gi>
<n-gi :span="8">
<n-form-item
label="数量"
:rule="{
required: true,
message: `请输入数量`,
trigger: ['input', 'blur'],
}"
>
<n-input v-model:value="n.num" />
</n-form-item>
</n-gi>
<n-gi :span="8" style="padding-left:10px;">
<n-icon
v-if="i == 0"
size="25"
style="padding-top: 5px;cursor: pointer;" color="#1060c9"
@click="addpgnum"
>
<AddOutline />
</n-icon>
<n-icon
v-else
size="18"
style="padding:7px 0 0 2px;cursor: pointer;" color="#d03050"
@click="deletenum(i)"
>
<TrashOutline />
</n-icon>
</n-gi>
</template>
</n-grid> -->
</n-gi>
</n-grid>
</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-space vertical>
@ -363,55 +168,21 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { import { ref, reactive, h, onMounted } from 'vue'
ref, import { NButton, NSpace, NIcon, NUpload, useMessage, useDialog, type DataTableColumns, type UploadCustomRequestOptions } from 'naive-ui'
reactive, import { SearchOutline, RefreshOutline, AddOutline, TrashOutline, CreateOutline, CloudUploadOutline, DownloadOutline } from '@vicons/ionicons5'
h, import { orderProcessPlanApi, type OrderProcessPlan } from '@/api/orderProcessPlan'
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 {
orderProcessPlanApi,
type OrderProcessPlan
} from '@/api/orderProcessPlan'
import { dictDataApi } from '@/api/org' import { dictDataApi } from '@/api/org'
import Pgitem from './pgitem.vue'
//import { userApi } from '@/api/system'
import { useUserStore } from '@/stores/user'
const userStore = useUserStore()
//
const hasPermission = (permission: string) => userStore.hasPermission(permission)
const message = useMessage() const message = useMessage()
const dialog = useDialog() const dialog = useDialog()
// //
const searchForm = reactive<any>({ const searchForm = reactive({
id: '', id: null as number | null,
name: '', name: '',
code: '', code: '',
orderItemId: '', orderItemId: null as number | null,
}) })
// //
@ -431,22 +202,22 @@ const modalVisible = ref(false)
const modalTitle = ref('') const modalTitle = ref('')
const importModalVisible = ref(false) const importModalVisible = ref(false)
const formRef = ref() const formRef = ref()
const defaultFormData = { const defaultFormData: OrderProcessPlan = {
name: '', name: '',
code: '', code: '',
sort: '', sort: undefined,
orderItemId: '', orderItemId: undefined,
beginTime: null, beginTime: undefined,
endTime: null, endTime: undefined,
procurement: '', procurement: undefined,
outsource: '', outsource: undefined,
quantity: '', quantity: undefined,
transferNum: '', transferNum: undefined,
transferOutNum: '', transferOutNum: undefined,
qualityInspection: '', qualityInspection: undefined,
storageEntry: '', storageEntry: undefined,
} }
const formData = reactive<any>({ ...defaultFormData }) const formData = reactive<OrderProcessPlan>({ ...defaultFormData })
// //使 // //使
const procurementOptions = ref<{ label: string; value: any }[]>([]) const procurementOptions = ref<{ label: string; value: any }[]>([])
@ -459,100 +230,40 @@ const formRules = {
} }
// //
const columns = [ const columns: DataTableColumns<OrderProcessPlan> = [
// { type: 'selection' }, { type: 'selection' },
{ { title: '主键', key: 'id' },
align:'center', { title: '工序名称', key: 'name' },
minWidth: 150, { title: '工序编码', key: 'code' },
title: '工序名称', { title: '工序顺序', key: 'sort' },
key: 'name' { title: '生产订单id', key: 'orderItemId' },
}, { title: '生产开始时间', key: 'beginTime' },
{ { title: '生产结束时间', key: 'endTime' },
align:'center', { title: '是否采购', key: 'procurement',
minWidth: 150,
title: '工序编码',
key: 'code'
},
{
align:'center',
minWidth: 150,
title: '工序顺序',
key: 'sort'
},
// {
// align:'center',
// minWidth: 150,
// title: 'id',
// key: 'orderItemId'
// },
{
align:'center',
minWidth: 150,
title: '生产开始时间',
key: 'beginTime'
},
{
align:'center',
minWidth: 150,
title: '生产结束时间',
key: 'endTime'
},
{
align:'center',
minWidth: 150,
title: '是否采购',
key: 'procurement',
render(row) { render(row) {
const val = row.procurement const val = row.procurement
const opt = procurementOptions.value.find(o => o.value === val || String(o.value) === String(val)) const opt = procurementOptions.value.find(o => o.value === val || String(o.value) === String(val))
return opt ? opt.label : (val ?? '-') return opt ? opt.label : (val ?? '-')
} }
}, },
{ { title: '是否委外', key: 'outsource',
align:'center',
minWidth: 150,
title: '是否委外',
key: 'outsource',
render(row) { render(row) {
const val = row.outsource const val = row.outsource
const opt = outsourceOptions.value.find(o => o.value === val || String(o.value) === String(val)) const opt = outsourceOptions.value.find(o => o.value === val || String(o.value) === String(val))
return opt ? opt.label : (val ?? '-') return opt ? opt.label : (val ?? '-')
} }
}, },
{ { title: '生产总数', key: 'quantity' },
align:'center', { title: '转入数量', key: 'transferNum' },
minWidth: 150, { title: '转出数量', key: 'transferOutNum' },
title: '生产总数', { title: '是否质检', key: 'qualityInspection',
key: 'quantity'
},
{
align:'center',
minWidth: 150,
title: '转入数量',
key: 'transferNum'
},
{
align:'center',
minWidth: 150,
title: '转出数量',
key: 'transferOutNum'
},
{
align:'center',
minWidth: 150,
title: '是否质检',
key: 'qualityInspection',
render(row) { render(row) {
const val = row.qualityInspection const val = row.qualityInspection
const opt = qualityInspectionOptions.value.find(o => o.value === val || String(o.value) === String(val)) const opt = qualityInspectionOptions.value.find(o => o.value === val || String(o.value) === String(val))
return opt ? opt.label : (val ?? '-') return opt ? opt.label : (val ?? '-')
} }
}, },
{ { title: '是否直接入库', key: 'storageEntry',
align:'center',
minWidth: 150,
title: '是否直接入库',
key: 'storageEntry',
render(row) { render(row) {
const val = row.storageEntry const val = row.storageEntry
const opt = storageEntryOptions.value.find(o => o.value === val || String(o.value) === String(val)) const opt = storageEntryOptions.value.find(o => o.value === val || String(o.value) === String(val))
@ -560,45 +271,19 @@ const columns = [
} }
}, },
{ {
align:'center',
title: '操作', title: '操作',
key: 'actions', key: 'actions',
width: 140, width: 140,
fixed: 'right', fixed: 'right',
render(row) { render(row) {
return h('div', { style: { display: 'flex', alignItems: 'center', gap: '8px', flexWrap: 'nowrap' } }, [
const buttons:any = [] h(NButton, { size: 'small', quaternary: true, onClick: () => handleEdit(row) }, {
default: () => [h(NIcon, null, { default: () => h(CreateOutline) }), ' 编辑']
if(hasPermission('biz:orderItem:edit')){ }),
buttons.push(h(NButton, { h(NButton, { size: 'small', quaternary: true, type: 'error', onClick: () => handleDelete(row) }, {
size: 'small', default: () => [h(NIcon, null, { default: () => h(TrashOutline) }), ' 删除']
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) }), ' ']
// })
// ])
} }
} }
] ]
@ -610,10 +295,10 @@ async function loadData() {
const res = await orderProcessPlanApi.page({ const res = await orderProcessPlanApi.page({
page: pagination.page, page: pagination.page,
pageSize: pagination.pageSize, pageSize: pagination.pageSize,
id: searchForm.id, id: searchForm.id || undefined,
name: searchForm.name, name: searchForm.name || undefined,
code: searchForm.code, code: searchForm.code || undefined,
orderItemId: searchForm.orderItemId orderItemId: searchForm.orderItemId || undefined,
}) })
tableData.value = res.list tableData.value = res.list
pagination.itemCount = res.total pagination.itemCount = res.total
@ -630,13 +315,13 @@ function handleSearch() {
// //
function handleReset() { function handleReset() {
searchForm.id = '' searchForm.id = null
searchForm.name = '' searchForm.name = ''
searchForm.code = '' searchForm.code = ''
searchForm.orderItemId = '' searchForm.orderItemId = null
handleSearch() handleSearch()
} }
@ -666,7 +351,7 @@ function handleAdd() {
} }
// //
function handleEdit(row:any) { function handleEdit(row: OrderProcessPlan) {
modalTitle.value = '编辑工序计划' modalTitle.value = '编辑工序计划'
Object.assign(formData, row) Object.assign(formData, row)
if (formData.beginTime && typeof formData.beginTime === 'string') { if (formData.beginTime && typeof formData.beginTime === 'string') {
@ -685,7 +370,7 @@ function handleEdit(row:any) {
async function handleSubmit() { async function handleSubmit() {
await formRef.value?.validate() await formRef.value?.validate()
try { try {
const submitData = { ...formData } const submitData = { ...formData } as OrderProcessPlan
if (typeof submitData.beginTime === 'number') { if (typeof submitData.beginTime === 'number') {
submitData.beginTime = new Date(submitData.beginTime).toISOString().slice(0, 19).replace('T', ' ') submitData.beginTime = new Date(submitData.beginTime).toISOString().slice(0, 19).replace('T', ' ')
} }
@ -709,110 +394,6 @@ async function handleSubmit() {
} }
} }
//
let dispatchmodal = ref(false)
let dispatchform = reactive<any>({
id:'',
name:'',
beginTime:'',
endTime:'',
userid:'',
quantity:'',
list:[{
userId:'',
quantity:''
}],
username:''
})
//let yglist = ref<any>([])
const dispatchrules = {
// userid:[
// {
// required: true,
// message: '',
// trigger: 'blur'
// }
// {
// required: true,
// validator(rule:any,value: any) {
// if(value.length == 0){
// return new Error('')
// }
// return true
// },
// trigger: ['blur']
// }
// ]
}
let dispatchLoading = ref(false)
let dispatchddbtn = ref(false)
const dispatchformRef = ref()
let loadingRef = ref(false)
function addpgnum() {
dispatchform.list.push({
userId:'',
quantity:''
})
}
function deletenum(index:any) {
dispatchform.list.splice(index,1)
}
function disphand(v:any){
dispatchmodal.value = true
dispatchformRef.value?.restoreValidation()
dispatchform.id = v.id
dispatchform.name = v.name
dispatchform.beginTime = v.beginTime
dispatchform.endTime = v.endTime
dispatchform.quantity = v.quantity
dispatchform.userid = ''
dispatchform.list = [{
userId:'',
quantity:''
}]
//slehand()
}
function dispatchSubmit() {
let total = 0
dispatchform.list.forEach((n:any) => {
total = n.quantity*1+total
})
dispatchformRef.value?.validate((v:any) => {
if(!v){
if(total != dispatchform.quantity){
message.error('派工总数量需等于生产总数',{
duration:4000
})
}else{
orderProcessPlanApi.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: OrderProcessPlan) { function handleDelete(row: OrderProcessPlan) {
dialog.warning({ dialog.warning({

View File

@ -1,125 +0,0 @@
<template>
<n-grid>
<n-gi :span="10">
<n-form-item
label="指派员工"
:path="`${listname}[${index}].userId`"
:rule="{
required: true,
message: '请选择员工',
trigger: 'blur'
}"
>
<!--multiple-->
<n-select
v-model:value="obj.userId"
filterable
placeholder="请输入用户名称搜索"
:options="yglist"
:loading="loadingRef"
clearable
remote
:clear-filter-after-select="false"
@search="slehand"
/>
</n-form-item>
</n-gi>
<n-gi :span="10">
<n-form-item
label="数量"
:path="`${listname}[${index}].quantity`"
:rule="{
required: true,
message: `请输入数量`,
trigger: 'blur',
}"
>
<n-input v-model:value="obj.quantity" />
</n-form-item>
</n-gi>
<n-gi :span="4" style="padding-left:10px;">
<n-icon
v-if="index == 0"
size="25"
style="padding-top: 5px;cursor: pointer;" color="#1060c9"
@click="addpgnum"
>
<AddOutline />
</n-icon>
<n-icon
v-else
size="18"
style="padding:7px 0 0 2px;cursor: pointer;" color="#d03050"
@click="deletenum(index)"
>
<TrashOutline />
</n-icon>
</n-gi>
</n-grid>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { userApi } from '@/api/system'
import {
AddOutline,
TrashOutline,
} from '@vicons/ionicons5'
const props = withDefaults(defineProps<{
listname:any
obj:any,
index:any
}>(), {
obj:{}
})
const emit = defineEmits<{
addhand:[],
delehand:[index:any],
update: [index:any,obj:any]
}>()
// function updatehand() {
// emit('update')
// }
function addpgnum() {
emit('addhand')
}
function deletenum(index:any){
emit('delehand',index)
}
let yglist = ref<any>([])
let loadingRef = ref(false)
function slehand(v?:any) {
loadingRef.value = true
yglist.value.splice(0)
// dispatchform.userlist = [{
// id:'',
// num:''
// }]
userApi.page({
page: 1,
pageSize: 100,
username: v,
}).then((rps:any) =>{
if(rps.list && rps.list.length > 0){
yglist.value = rps.list.map((n:any) => {
return {
label:n.username,
value:n.id+''
}
})
}
console.log(yglist.value,'12')
loadingRef.value = false
}).catch(() => {
loadingRef.value = false
})
}
slehand()
</script>

View File

@ -115,7 +115,7 @@
<!-- 新增/编辑弹窗 --> <!-- 新增/编辑弹窗 -->
<n-modal <n-modal
v-model:show="editmodal" v-model:show="editmodal"
title="编辑派工" title="编辑派工"
preset="card" preset="card"
style="width: 800px" style="width: 800px"
:mask-closable="false" :mask-closable="false"
@ -128,7 +128,7 @@
label-width="80" label-width="80"
class="modal-form" class="modal-form"
> >
<n-grid :cols="2"> <n-grid :cols="2" :x-gap="16">
<!-- <n-gi> <!-- <n-gi>
<n-form-item label="工序编号" path="processName"> <n-form-item label="工序编号" path="processName">
<n-input v-model:value="formData.processName" placeholder="请输入用户名" :disabled="!!formData.id" /> <n-input v-model:value="formData.processName" placeholder="请输入用户名" :disabled="!!formData.id" />
@ -136,22 +136,22 @@
</n-gi> --> </n-gi> -->
<n-gi> <n-gi>
<n-form-item label="工序名称" path="processName"> <n-form-item label="工序名称" path="processName">
<n-input v-model:value="formData.processName" placeholder="请输入工序名称" /> <n-input v-model:value="formData.processName" placeholder="请输入用户名" />
</n-form-item> </n-form-item>
</n-gi> </n-gi>
<n-gi> <n-gi>
<n-form-item label="工人名称" path="stringUserName"> <n-form-item label="工人名称" path="stringUserName">
<n-input v-model:value="formData.stringUserName" placeholder="请选择工人" /> <n-input v-model:value="formData.stringUserName" placeholder="请输入用户名" />
</n-form-item> </n-form-item>
</n-gi> </n-gi>
<n-gi> <n-gi>
<n-form-item label="数" path="quantity"> <n-form-item label="数" path="quantity">
<n-input v-model:value="formData.quantity" placeholder="请输入数量" /> <n-input v-model:value="formData.quantity" placeholder="请输入用户名" />
</n-form-item> </n-form-item>
</n-gi> </n-gi>
<n-gi> <n-gi>
<n-form-item label="是否返工" path="rework"> <n-form-item label="是否返工" path="rework">
<n-input v-model:value="formData.rework" placeholder="请输入" /> <n-input v-model:value="formData.rework" placeholder="请输入用户名" />
</n-form-item> </n-form-item>
</n-gi> </n-gi>
<!-- <n-gi> <!-- <n-gi>
@ -160,7 +160,7 @@
</n-form-item> </n-form-item>
</n-gi> --> </n-gi> -->
<n-gi> <n-gi>
<n-form-item label="完成数" path="completedQuantity"> <n-form-item label="完成数" path="completedQuantity">
<n-input v-model:value="formData.completedQuantity" placeholder="请输入用户名" :disabled="!!formData.id" /> <n-input v-model:value="formData.completedQuantity" placeholder="请输入用户名" :disabled="!!formData.id" />
</n-form-item> </n-form-item>
</n-gi> </n-gi>
@ -194,14 +194,8 @@
:rules="reassrules" :rules="reassrules"
label-placement="top" label-placement="top"
label-width="80" label-width="80"
class="modal-form"
> >
<n-form-item label="工序编号">
<n-input v-model:value="gxobg.id" disabled />
</n-form-item>
<n-form-item label="工序名称">
<n-input v-model:value="gxobg.name" disabled />
</n-form-item>
<n-form-item label="工人名称" path=""> <n-form-item label="工人名称" path="">
<n-input v-model:value="reassform.userid" placeholder="请选择员工" /> <n-input v-model:value="reassform.userid" placeholder="请选择员工" />
</n-form-item> </n-form-item>
@ -217,7 +211,7 @@
:loading="reassLoading" :loading="reassLoading"
@click="reassSubmit" @click="reassSubmit"
:disabled="reassdisedbtn" :disabled="reassdisedbtn"
>确定</n-button> >保存</n-button>
</n-space> </n-space>
</template> </template>
</n-modal> </n-modal>
@ -235,13 +229,9 @@
:model="pauseform" :model="pauseform"
label-placement="top" label-placement="top"
label-width="80" label-width="80"
class="modal-form"
> >
<n-form-item label="工序编号">
<n-input v-model:value="gxobg.id" disabled />
</n-form-item>
<n-form-item label="工序名称">
<n-input v-model:value="gxobg.name" disabled />
</n-form-item>
<n-form-item label="暂停原因" path="reason"> <n-form-item label="暂停原因" path="reason">
<n-input type="textarea" v-model:value="pauseform.reason" placeholder="请输入暂停原因" /> <n-input type="textarea" v-model:value="pauseform.reason" placeholder="请输入暂停原因" />
</n-form-item> </n-form-item>
@ -254,7 +244,7 @@
:loading="submitLoading" :loading="submitLoading"
@click="pauseSubmit" @click="pauseSubmit"
:disabled="disedbtn" :disabled="disedbtn"
>确定</n-button> >保存</n-button>
</n-space> </n-space>
</template> </template>
</n-modal> </n-modal>
@ -296,7 +286,7 @@ import {
editdiswor, editdiswor,
transfer, transfer,
pauseresume, pauseresume,
//workload workload
} from '@/api/production' } from '@/api/production'
//const dialog = useDialog() //const dialog = useDialog()
@ -559,7 +549,7 @@ const formData = reactive<any>({
const rules = { const rules = {
processName: [{ required: true, message: '请输工序名称', trigger: 'blur' }], processName: [{ required: true, message: '请输工序名称', trigger: 'blur' }],
quantity: [{ required: true, message: '请输入数', trigger: 'blur' }] quantity: [{ required: true, message: '请输入数', trigger: 'blur' }]
} }
// //
@ -640,8 +630,6 @@ function handleSubmit() {
}) })
} }
let gxobg = reactive<any>({})
// //
let reassignmodal = ref(false) let reassignmodal = ref(false)
@ -662,10 +650,6 @@ let reassLoading = ref(false)
let reassdisedbtn = ref(false) let reassdisedbtn = ref(false)
function handlreass(n:any) { function handlreass(n:any) {
gxobg.name = n.processName
gxobg.id = n.processId
reassignmodal.value = true reassignmodal.value = true
reassLoading.value = false reassLoading.value = false
reassdisedbtn.value = false reassdisedbtn.value = false
@ -712,10 +696,6 @@ const pauseformRef = ref()
let pauseisedbtn = ref(false) let pauseisedbtn = ref(false)
function handlpause(n:any) { function handlpause(n:any) {
gxobg.name = n.processName
gxobg.id = n.processId
pausemodal.value = true pausemodal.value = true
pauseLoading.value = false pauseLoading.value = false
pauseisedbtn.value = false pauseisedbtn.value = false
@ -764,7 +744,7 @@ function pauseSubmit() {
onMounted(() => { onMounted(() => {
getlist() getlist()
//workload() workload()
}) })
</script> </script>

View File

@ -15,7 +15,9 @@
<n-form-item-gi :span="6" label="工序名称"> <n-form-item-gi :span="6" label="工序名称">
<n-input v-model:value="searchForm.processName" placeholder="请输入工序名称" clearable /> <n-input v-model:value="searchForm.processName" placeholder="请输入工序名称" clearable />
</n-form-item-gi> </n-form-item-gi>
<n-form-item-gi :span="6" label="工人名称">
<n-input v-model:value="searchForm.stringUserName" placeholder="请输入工人名称" clearable />
</n-form-item-gi>
<!-- <n-form-item-gi :span="6" label="数里"> <!-- <n-form-item-gi :span="6" label="数里">
<n-input v-model:value="searchForm.processId" placeholder="请输入数里" clearable /> <n-input v-model:value="searchForm.processId" placeholder="请输入数里" clearable />
</n-form-item-gi> --> </n-form-item-gi> -->
@ -110,45 +112,109 @@
</div> </div>
</n-card> </n-card>
<!--暂停恢复弹框--> <!-- 新增/编辑弹窗 -->
<n-modal <n-modal
v-model:show="pausemodal" v-model:show="editmodal"
title="报检" title="编辑派工"
preset="card" preset="card"
style="width: 400px" style="width: 800px"
:mask-closable="false" :mask-closable="false"
> >
<n-form <n-form
ref="pauseformRef" ref="formRef"
:model="pauseform" :model="formData"
:rules="pauserules" :rules="rules"
label-placement="top" label-placement="left"
label-width="80" label-width="80"
class="modal-form"
> >
<n-form-item label="工序编号"> <n-grid :cols="2" :x-gap="16">
<n-input v-model:value="gxobg.id" disabled /> <!-- <n-gi>
</n-form-item> <n-form-item label="工序编号" path="processName">
<n-form-item label="工序名称"> <n-input v-model:value="formData.processName" placeholder="请输入用户名" :disabled="!!formData.id" />
<n-input v-model:value="gxobg.name" disabled />
</n-form-item>
<n-form-item label="报检数量" path="qcNum">
<n-input v-model:value="pauseform.qcNum" placeholder="请输入报检数量" />
</n-form-item> </n-form-item>
</n-gi> -->
<n-gi>
<n-form-item label="工序名称" path="processName">
<n-input v-model:value="formData.processName" placeholder="请输入用户名" />
</n-form-item>
</n-gi>
<n-gi>
<n-form-item label="工人名称" path="stringUserName">
<n-input v-model:value="formData.stringUserName" placeholder="请输入用户名" />
</n-form-item>
</n-gi>
<n-gi>
<n-form-item label="数里" path="quantity">
<n-input v-model:value="formData.quantity" placeholder="请输入用户名" />
</n-form-item>
</n-gi>
<n-gi>
<n-form-item label="是否返工" path="rework">
<n-input v-model:value="formData.rework" placeholder="请输入用户名" />
</n-form-item>
</n-gi>
<!-- <n-gi>
<n-form-item label="返工次数" path="username">
<n-input v-model:value="formData.username" placeholder="请输入用户名" :disabled="!!formData.id" />
</n-form-item>
</n-gi> -->
<n-gi>
<n-form-item label="完成数里" path="completedQuantity">
<n-input v-model:value="formData.completedQuantity" placeholder="请输入用户名" :disabled="!!formData.id" />
</n-form-item>
</n-gi>
</n-grid>
</n-form> </n-form>
<template #footer> <template #footer>
<n-space justify="end"> <n-space justify="end">
<n-button @click="pausemodal = false">取消</n-button> <n-button @click="editmodal = false">取消</n-button>
<n-button <n-button
type="primary" type="primary"
:loading="pauseLoading" :loading="submitLoading"
@click="pauseSubmit" @click="handleSubmit"
:disabled="pauseisedbtn" :disabled="disedbtn"
>保存</n-button> >保存</n-button>
</n-space> </n-space>
</template> </template>
</n-modal> </n-modal>
<!--改派弹框-->
<n-modal
v-model:show="reassignmodal"
title="改派"
preset="card"
style="width: 400px"
:mask-closable="false"
>
<n-form
ref="reassformRef"
:model="reassform"
:rules="reassrules"
label-placement="top"
label-width="80"
class="modal-form"
>
<n-form-item label="工人名称" path="">
<n-input v-model:value="reassform.userid" placeholder="请选择员工" />
</n-form-item>
<n-form-item label="改派原因" path="reason">
<n-input type="textarea" v-model:value="reassform.reason" placeholder="请输入改派原因" />
</n-form-item>
</n-form>
<template #footer>
<n-space justify="end">
<n-button @click="reassignmodal = false">取消</n-button>
<n-button
type="primary"
:loading="reassLoading"
@click="reassSubmit"
:disabled="reassdisedbtn"
>保存</n-button>
</n-space>
</template>
</n-modal>
</div> </div>
</template> </template>
@ -159,7 +225,6 @@ import {
reactive, reactive,
h, h,
onMounted, onMounted,
watch,
} from 'vue' } from 'vue'
@ -169,11 +234,11 @@ import {
NSpace, NSpace,
NPagination, NPagination,
NGrid, NGrid,
// NGi, NGi,
NTag, NTag,
useMessage, useMessage,
//useDialog, //useDialog,
//type FormInst, type FormInst,
} from 'naive-ui' } from 'naive-ui'
import { import {
@ -185,7 +250,9 @@ import { useUserStore } from '@/stores/user'
import { import {
mytasks, mytasks,
inspectio editdiswor,
transfer,
pauseresume
} from '@/api/production' } from '@/api/production'
//const dialog = useDialog() //const dialog = useDialog()
@ -202,8 +269,9 @@ const hasPermission = (permission: string) => userStore.hasPermission(permission
const searchForm = reactive({ const searchForm = reactive({
page: 1, page: 1,
pageSize: 20, pageSize: 20,
processId:'', // processId:'',
processName:'', // processName:'',
// stringUserName:''
}) })
@ -317,7 +385,7 @@ const columns = [
}, },
{ {
align:'center', align:'center',
title: '质检打回数', title: '质检打回数',
key: 'qualityReturnNum', key: 'qualityReturnNum',
minWidth: 150 minWidth: 150
}, },
@ -376,30 +444,79 @@ const columns = [
align:'center', align:'center',
title: '操作', title: '操作',
key: 'actions', key: 'actions',
width: 100, width: 200,
fixed: 'right', fixed: 'right',
render(row:any) { render(row:any) {
const buttons:any = [] const buttons:any = [
if(hasPermission('biz:assingWork:edit')){ // h(NButton, {
buttons.push(h(NButton, { // size: 'small',
size: 'small', // type:'warning',
type:'primary', // ghost:true,
ghost:true, // onClick: () => handleEdit(row) },
onClick: () => { handlpause(row) } }, // //{ default: () => [h(NIcon, null, { default: () => h(CreateOutline) }), ' ' ]}
//{ default: () => [h(NIcon, null, { default: () => h(CreateOutline) }), ' ' ]} // { default: () => ''}
{ default: () => '报检'} // )
)) ]
}
// if(hasPermission('biz:assingWork: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:assingWork:transfer')){
// buttons.push(h(NButton, {
// size: 'small',
// type:'success',
// ghost:true,
// onClick: () => { handlreass(row) } },
// { default: () => ''}
// ))
// }
// if(hasPermission('biz:assingWork:pauseResume')){
// buttons.push(h(NButton, {
// size: 'small',
// type:'warning',
// ghost:true,
// onClick:()=>{ handlpause(row) }
// },
// { default: () => ''}
// ))
// }
// buttons.push(
// )
return buttons.length > 0 ? h(NSpace, {justify:'center'}, { default: () => buttons }) : '-' return buttons.length > 0 ? h(NSpace, {justify:'center'}, { default: () => buttons }) : '-'
} }
} }
] ]
//
const editmodal = ref(false)
const formRef = ref<FormInst | null>(null)
const submitLoading = ref(false)
const formData = reactive<any>({
id:'',
processName:'', //
userId:'', //id
stringUserName:'', //
quantity:'', //
rework:'', //
reworkNum:'', //
completedQuantity:'', //
})
const rules = {
processName: [{ required: true, message: '请输工序名称', trigger: 'blur' }],
quantity: [{ required: true, message: '请输入数里', trigger: 'blur' }]
}
// //
function search() { function search() {
@ -413,6 +530,7 @@ function search() {
function reset() { function reset() {
searchForm.processId ='' searchForm.processId =''
searchForm.processName = '' searchForm.processName = ''
searchForm.stringUserName = ''
} }
// //
@ -440,48 +558,117 @@ function handlePageSizeChange(pageSize: number) {
} }
let gxobg = reactive<any>({}) //
let disedbtn = ref(false)
function handleEdit(n:any) {
editmodal.value = true
submitLoading.value = false
disedbtn.value = false
formRef.value?.restoreValidation()
formData.id = n.id
formData.processName = n.processName
// formData.userId = '' //id
// formData.stringUserName = '' //
// formData.quantity = '' //
// formData.rework = '' //
// formData.reworkNum = '' //
// formData.completedQuantity = '' //
}
function handleSubmit() {
formRef.value?.validate(v => {
if(!v){
submitLoading.value = true
disedbtn.value = true
editdiswor(formData).then(() => {
message.success('保存成功!')
setTimeout(()=> {
editmodal.value = false
submitLoading.value = false
disedbtn.value = false
getlist()
},1000)
}).catch(() => {
disedbtn.value = false
submitLoading.value = false
})
}
})
}
//
let reassignmodal = ref(false)
const reassformRef = ref()
let reassform = reactive<any>({
// userId:'', //id
// stringUserName:'', //
id:'', //id
reason:'', //
userid:456 //Id
})
const reassrules = {
userid: [{ required: true, message: '请选择员工', trigger: 'blur' }]
}
let reassLoading = ref(false)
let reassdisedbtn = ref(false)
function handlreass(n:any) {
reassignmodal.value = true
reassLoading.value = false
reassdisedbtn.value = false
reassformRef.value?.restoreValidation()
reassform.id = n.id
reassform.reason = ''
reassform.userid = 456
}
function reassSubmit() {
reassformRef.value?.validate((v:any) => {
if(!v){
reassLoading.value = true
reassdisedbtn.value = true
transfer(reassform).then(() => {
message.success('操作成功!')
setTimeout(()=> {
reassignmodal.value = false
reassLoading.value = false
reassdisedbtn.value = false
getlist()
},1000)
}).catch(() => {
reassdisedbtn.value = false
reassLoading.value = false
})
}
})
}
///
//
let pausemodal = ref(false) let pausemodal = ref(false)
let pauseform = reactive<any>({ let pauseform = reactive<any>({
id:'', id:'',
qcNum:'' status:'', //012
reason:'' //
}) })
const pauseformRef = ref() const pauseformRef = ref()
const pauserules = {
qcNum: [
{ required: true, message: '请输报检数量', trigger: 'blur' },
{
validator(rule:any,value: any) {
if(value > pauseform.qcNum){
return new Error(`报检数量最大为${pauseform.qcNum}`)
}
return true
},
trigger: ['blur']
}
]
}
watch(()=>pauseform.qcNum,v => {
pauseform.qcNum = v.replace(/[^\d]/g,'')
})
let pauseLoading = ref(false) let pauseLoading = ref(false)
let pauseisedbtn = ref(false) let pauseisedbtn = ref(false)
function handlpause(n:any) { function handlpause(n:any) {
gxobg.id = n.id
gxobg.name = n.name
pausemodal.value = true pausemodal.value = true
pauseLoading.value = false pauseLoading.value = false
pauseisedbtn.value = false pauseisedbtn.value = false
pauseformRef.value?.restoreValidation() pauseformRef.value?.restoreValidation()
pauseform.id = n.id pauseform.id = n.id
pauseform.qcNum = `${n.quantity}` pauseform.reason = ''
pauseform.status = n.staus
} }
@ -490,7 +677,7 @@ function pauseSubmit() {
if(!v){ if(!v){
pauseLoading.value = true pauseLoading.value = true
pauseisedbtn.value = true pauseisedbtn.value = true
inspectio(Object.assign({},pauseform,{qcNum:pauseform.qcNum*1})).then(() => { pauseresume(pauseform).then(() => {
message.success('操作成功!') message.success('操作成功!')
setTimeout(()=> { setTimeout(()=> {
pausemodal.value = false pausemodal.value = false

View File

@ -21,7 +21,6 @@ export default defineConfig({
proxy: { proxy: {
'/api': { '/api': {
target:'http://192.168.6.107:8080', //'http://192.168.5.230:8888', target:'http://192.168.6.107:8080', //'http://192.168.5.230:8888',
//target:'http://192.168.5.230:8888',
changeOrigin: true changeOrigin: true
}, },
'/druid': { '/druid': {