master
leo 3 years ago
commit 35277458a5

@ -0,0 +1,7 @@
{
"plugins": [
[
"@babel/plugin-transform-runtime"
]
]
}

@ -0,0 +1,33 @@
"use strict";
module.exports = {
types: [
{ value: "✨", name: "特性: 一个新的特性" },
{ value: "🐛", name: "修复: 修复一个Bug" },
{ value: "📝", name: "文档: 变更的只有文档" },
{ value: "💄", name: "格式: 空格, 分号等格式修复" },
{ value: "♻️", name: "重构: 代码重构,注意和特性、修复区分开" },
{ value: "🌀", name: "样式: 样式的调整" },
{ value: "⚡️", name: "性能: 提升性能" },
{ value: "✅", name: "测试: 添加一个测试" },
{ value: "🔧", name: "工具: 开发工具变动(构建、脚手架工具等)" },
{ value: "⏪", name: "回滚: 代码回退" },
{ value: "⬆️", name: "升级: 依赖升级" },
{ value: "⬇️", name: "降级: 依赖降级" },
],
scopes: [
{ name: "component" },
],
messages: {
type: "选择一种你的提交类型:",
scope: "选择一个scope (可选):",
customScope: "Denote the SCOPE of this change:",
subject: "短说明:\n",
body: '长说明,使用"|"换行(可选)\n',
breaking: "非兼容性说明 (可选):\n",
footer: "关联关闭的issue例如#31, #34(可选):\n",
confirmCommit: "确定提交说明?",
},
allowCustomScopes: true,
allowBreakingChanges: ["特性", "修复"],
subjectLimit: 100,
};

1
.gitignore vendored

@ -0,0 +1 @@
node_modules

@ -0,0 +1 @@
shamefully-hoist=true

@ -0,0 +1,15 @@
{
// 使 IntelliSense
//
// 访: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "针对 localhost 启动 Chrome",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 就眠儀式
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

@ -0,0 +1,31 @@
# Info
This template should help get you started developing with Vue 3 and Typescript in Vite.
## Get Started
```
yarn install
```
```
npm run dev
```
[`<script setup>`](https://github.com/vuejs/rfcs/pull/227) is a feature that is currently in RFC stage. To get proper IDE support for the syntax, use [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) instead of Vetur (and disable Vetur).
## Type Support For `.vue` Imports in TS
Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can use the following:
### If Using Volar
Run `Volar: Switch TS Plugin on/off` from VSCode command palette.
### If Using Vetur
1. Install and add `@vuedx/typescript-plugin-vue` to the [plugins section](https://www.typescriptlang.org/tsconfig#plugins) in `tsconfig.json`
2. Delete `src/shims-vue.d.ts` as it is no longer needed to provide module info to Typescript
3. Open `src/main.ts` in VSCode
4. Open the VSCode command palette
5. Search and run "Select TypeScript version" -> "Use workspace version"

6
auto-imports.d.ts vendored

@ -0,0 +1,6 @@
// Generated by 'unplugin-auto-import'
// We suggest you to commit this file into source control
declare global {
const layer: typeof import('@layui/layer-vue')['layer']
}
export {}

57
components.d.ts vendored

@ -0,0 +1,57 @@
// generated by unplugin-vue-components
// We suggest you to commit this file into source control
// Read more: https://github.com/vuejs/core/pull/3399
import '@vue/runtime-core'
declare module '@vue/runtime-core' {
export interface GlobalComponents {
DarkIcon: typeof import('./src/components/DarkIcon.vue')['default']
LayBody: typeof import('@layui/layui-vue')['LayBody']
LayButton: typeof import('@layui/layui-vue')['LayButton']
LayCard: typeof import('@layui/layui-vue')['LayCard']
LayCheckbox: typeof import('@layui/layui-vue')['LayCheckbox']
LayCol: typeof import('@layui/layui-vue')['LayCol']
LayCollapse: typeof import('@layui/layui-vue')['LayCollapse']
LayCollapseItem: typeof import('@layui/layui-vue')['LayCollapseItem']
LayColorPicker: typeof import('@layui/layui-vue')['LayColorPicker']
LayConfigProvider: typeof import('@layui/layui-vue')['LayConfigProvider']
LayContainer: typeof import('@layui/layui-vue')['LayContainer']
LayDatePicker: typeof import('@layui/layui-vue')['LayDatePicker']
LayDropdown: typeof import('@layui/layui-vue')['LayDropdown']
LayDropdownMenu: typeof import('@layui/layui-vue')['LayDropdownMenu']
LayDropdownMenuItem: typeof import('@layui/layui-vue')['LayDropdownMenuItem']
LayFooter: typeof import('@layui/layui-vue')['LayFooter']
LayForm: typeof import('@layui/layui-vue')['LayForm']
LayFormItem: typeof import('@layui/layui-vue')['LayFormItem']
LayFullscreen: typeof import('@layui/layui-vue')['LayFullscreen']
LayHeader: typeof import('@layui/layui-vue')['LayHeader']
LayIcon: typeof import('@layui/icons-vue')['LayIcon']
LayInput: typeof import('@layui/layui-vue')['LayInput']
LayLayer: typeof import('@layui/layer-vue')['LayLayer']
LayLayout: typeof import('@layui/layui-vue')['LayLayout']
LayLogo: typeof import('@layui/layui-vue')['LayLogo']
LayMenu: typeof import('@layui/layui-vue')['LayMenu']
LayMenuItem: typeof import('@layui/layui-vue')['LayMenuItem']
LayProgress: typeof import('@layui/layui-vue')['LayProgress']
LayQuote: typeof import('@layui/layui-vue')['LayQuote']
LayRadio: typeof import('@layui/layui-vue')['LayRadio']
LayRow: typeof import('@layui/layui-vue')['LayRow']
LayScroll: typeof import('@layui/layui-vue')['LayScroll']
LaySelect: typeof import('@layui/layui-vue')['LaySelect']
LaySelectOption: typeof import('@layui/layui-vue')['LaySelectOption']
LaySide: typeof import('@layui/layui-vue')['LaySide']
LaySubMenu: typeof import('@layui/layui-vue')['LaySubMenu']
LaySwitch: typeof import('@layui/layui-vue')['LaySwitch']
LayTab: typeof import('@layui/layui-vue')['LayTab']
LayTabItem: typeof import('@layui/layui-vue')['LayTabItem']
LayTable: typeof import('@layui/layui-vue')['LayTable']
LayTextarea: typeof import('@layui/layui-vue')['LayTextarea']
LayTooltip: typeof import('@layui/layui-vue')['LayTooltip']
LayUpload: typeof import('@layui/layui-vue')['LayUpload']
LightIcon: typeof import('./src/components/LightIcon.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
}
}
export {}

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
import{v as n}from"./index.b3f8b7f1.js";async function r(a){var t=[];return await n.post("/api/Common/GetBasicList",{FType:a}).then(e=>{t=e.Data.sort(function(s,o){return s.FOrder>o.FOrder})}),t}async function u(a,t){let e=0;return await n.post("/api/"+t+"/GetDataModel",a).then(s=>{e=s.Data}),e}async function l(a,t){let e=0;return await n.post("/api/"+t+"/UpdateDataModel",a).then(s=>{e=s.Data}),e}async function c(a,t){let e=0;return await n.post("/api/"+t+"/InsertDataModel",a).then(s=>{e=s.Data}),e}async function p(a,t){let e=0;return await n.post("/api/"+t+"/DeleteDataById",{FID:a.FID||a}).then(s=>{e=s.Data}),e}async function D(a,t){a=a||{FPageIndex:1,FPageSize:10};let e={};return await n.post("/api/"+t+"/GetPageList",a).then(s=>{e=s}),e}async function f(a,t){let e={};return await n.post("/api/"+t+"/Save",a).then(s=>{e=s}),e}async function m(a){let t="";return await n.post("/api/Common/GetTempFile",{FType:a||1}).then(e=>{t=e.Data}),t}async function C(a){let t={};return await n.post("/api/Common/CheckIsHasPower",a).then(e=>{t=e.Data}),t}async function d(a){let t={};return await n.post("/api/Common/GetDataCodeList",a).then(e=>{t=e.Data}),t}async function h(){let a={};return await n.post("/api/Common/GetConfigList",{}).then(t=>{a=t.Data}),a}async function y(a){let t={};return await n.post("/api/Common/GetConfigValue",{FID:a}).then(e=>{t=e.Data}),t}async function g(a){let t={};return await n.post("/api/Common/StateDataCode",{FID:a}).then(e=>{t=e.Data}),t}async function w(a){let t={};return await n.post("/api/Common/DeleteDataCode",{FID:a}).then(e=>{t=e.Data}),t}async function F(a){let t={};return await n.post("/api/Common/ChangeDataCode",a).then(e=>{t=e.Data}),t}export{u as a,d as b,r as c,f as d,C as e,m as f,D as g,p as h,c as i,F as j,h as k,w as l,y as m,g as s,l as u};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
import{v as o}from"./index.b3f8b7f1.js";async function c(){var t=[];return await o.post("/api/Factory/GetFactoryList").then(a=>{t=a.Data}),t}async function i(t,a){let e=0;return await o.post("/api/Factory/CheckHasCode",{FID:t,FCode:a}).then(r=>{e=r.Data}),e}export{i as c,c as g};

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
import{_ as C,r as h,u as k,g as w,a as L,o as r,c as p,w as n,b as H,d as s,e as t,t as i,f as D,h as S,n as N,F as z,i as T,j as P,k as E,l as M,m as A,p as B,q as I,s as V}from"./index.b3f8b7f1.js";/* empty css */import{g as $}from"./common.d8f31935.js";const O={setup(){let a=[{title:"\u9500\u552E\u53F7",key:"FSaleCode",align:"center"},{title:"\u53D1\u8D77\u65F6\u95F4",key:"FAddDate",align:"center",width:"182px"},{title:"\u5F53\u524D\u6D41\u7A0B",key:"FName",align:"center",width:"200px"},{title:"\u4E8B\u9879\u72B6\u6001",key:"FState",align:"center",width:"98px"},{title:"\u4EFB\u52A1\u6765\u6E90",key:"FDesc",align:"center"}];const o=h([]),l=h([" "," "," "," "]),e=h(""),f=k(),_=h([]);return{topCount:l,dataColumn:a,dataList:o,tableHeight:e,routerInfo:f,fastList:_}},mounted(){this._getHomeTopCount();let a=parseInt(this.$refs["lay-row3-div"].offsetHeight)-100;this.tableHeight=a+"px",this._getHomeFast(),this._getHomeNeed(a/40)},methods:{async _getHomeTopCount(){this.topCount=await w()||[0,0,0,0]},async _getHomeFast(){let a=await L({}),o=[];a.forEach(l=>{l.FChild.forEach(e=>{e.FName.indexOf("\u5168\u90E8")==-1&&e.FName.indexOf("\u7BA1\u7406")==-1&&o.length<8&&o.push(e)})}),this.fastList=o},async _getHomeNeed(a){let o={FPageIndex:1,FPageSize:Math.floor(a)};o.FPageSize=o.FPageSize<5?5:o.FPageSize;let l=await $(o,"Task");l.Data.List=l.Data.List||[],l.Data.List.forEach(e=>{e.FAddDate=e.FAddDate==null?"":this.dateFormat(e.FAddDate),e.FState=e.FState==2?"\u5DF2\u5B8C\u6210":"\u8FDB\u884C\u4E2D"}),this.dataList=l.Data.List||[]},dateFormat(a){return a.replace("T"," ").split(".")[0]},_goToMore(a){let o="";a==-1?o="/need/all":o=this.fastList[a].FRemark,this.routerInfo.push(o)}}},R=t("div",{class:"height20"},null,-1),j={class:"home-box1"},q={class:"icon"},G={class:"desc"},J={class:"count"},K=t("label",null,"\u672A\u5B8C\u4EE3\u529E\u4E8B\u9879",-1),Q={class:"home-box1"},U={class:"icon c1"},W={class:"desc"},X={class:"count"},Y=t("label",null,"\u4ECA\u65E5\u65B0\u589E\u5F85\u529E",-1),Z={class:"home-box1"},tt={class:"icon c2"},et={class:"desc"},ot={class:"count"},st=t("label",null,"\u534F\u540C\u8DEF\u7EBF",-1),at={class:"home-box1"},nt={class:"icon c3"},lt={class:"desc"},ct={class:"count"},it=t("label",null,"\u6211\u53C2\u4E0E\u7684\u8DEF\u7EBF",-1),_t=t("div",{class:"height10"},null,-1),dt={class:"lay-row2"},ht=t("h1",null,"\u5FEB\u6377\u5165\u53E3",-1),rt=["title"],ut={class:"lay-row3"},mt={class:"lay-row3-div",ref:"lay-row3-div"},pt={class:"home-box3"},ft=t("h1",null,"\u6700\u65B0\u5F85\u529E\u4E8B\u9879",-1);function gt(a,o,l,e,f,_){const F=P,d=E,c=M,g=A,y=B,b=I,v=V,x=H;return r(),p(x,{class:"home-layout"},{default:n(()=>[s(y,null,{default:n(()=>[s(F,{fluid:"true",style:{padding:"10px"}}),R,s(g,{space:"10"},{default:n(()=>[s(c,{md:"6"},{default:n(()=>[t("div",j,[t("p",q,[s(d,{type:"layui-icon-note",size:"26px"})]),t("p",G,[t("label",J,i(e.topCount[0]),1),K])])]),_:1}),s(c,{md:"6"},{default:n(()=>[t("div",Q,[t("p",U,[s(d,{type:"layui-icon-form",size:"26px"})]),t("p",W,[t("label",X,i(e.topCount[1]),1),Y])])]),_:1}),s(c,{md:"6"},{default:n(()=>[t("div",Z,[t("p",tt,[s(d,{type:"layui-icon-slider",size:"26px"})]),t("p",et,[t("label",ot,i(e.topCount[2]),1),st])])]),_:1}),s(c,{md:"6"},{default:n(()=>[t("div",at,[t("p",nt,[s(d,{type:"layui-icon-download-circle",size:"26px"})]),t("p",lt,[t("label",ct,i(e.topCount[3]),1),it])])]),_:1})]),_:1})]),_:1}),s(y,{class:"layui-header2"},{default:n(()=>[_t,t("div",dt,[s(g,{space:"10"},{default:n(()=>[s(c,{md:"24"},{default:n(()=>[ht]),_:1}),(r(!0),D(z,null,S(e.fastList,(u,m)=>(r(),p(c,{md:"3",key:m,onClick:yt=>_._goToMore(m)},{default:n(()=>[t("div",{class:N("home-box2 c"+m),title:u.FName},i(u.FName),11,rt)]),_:2},1032,["onClick"]))),128))]),_:1})])]),_:1}),s(v,null,{default:n(()=>[t("div",ut,[t("div",mt,[t("div",pt,[t("h2",{onClick:o[0]||(o[0]=u=>_._goToMore(-1))},"\u70B9\u51FB\u67E5\u770B\u66F4\u591A\u5F85\u529E\u4E8B\u9879"),ft]),e.tableHeight!=""?(r(),p(b,{key:0,height:e.tableHeight,columns:e.dataColumn,dataSource:e.dataList},null,8,["height","columns","dataSource"])):T("",!0)],512)])]),_:1})]),_:1})}var xt=C(O,[["render",gt]]);export{xt as default};

@ -0,0 +1 @@
.height20{height:20px;display:block}.height10{height:10px;display:block}.height30{height:30px;display:block}.home-layout .layui-header{text-align:center;min-height:148px;height:auto;background-color:unset;overflow-x:hidden}.home-layout .layui-header2{min-height:194px}.home-layout .layui-body{display:flex;align-items:center;justify-content:center;margin:10px auto;overflow-x:hidden}.home-box1{width:70%;display:inline-block;text-align:center;line-height:100px;height:100px;border-radius:4px;overflow:hidden}.home-box1 p{display:inline-block;height:100px;overflow:hidden;position:relative;border-radius:4px 0 0 4px;color:#fff}.home-box1 .icon{width:40%;background:#FD4D4F}.home-box1 .icon.c1{background:#32BDB6}.home-box1 .icon.c2{background:#AAEB0E}.home-box1 .icon.c3{background:#597CF4}.home-box1 .desc{width:calc(60% - 2px);background:#FFF;color:#444;padding:20px 0;height:58px;color:#595959;border:1px solid rgba(187,187,187,100);border-radius:0 4px 4px 0}.home-box1 .desc label{display:block;line-height:28px}.home-box1 .desc .count{font-size:24px}.lay-row2{background:#fff;width:95%;display:block;overflow:hidden;margin:0 auto;padding:20px}.lay-row2 h1{color:#101010;font-weight:700;text-align:left;margin-bottom:5px}.home-box2{height:94px;width:110px;display:block;background:#000;line-height:94px;border-radius:4px;cursor:pointer;margin-bottom:10px;color:#fff;font-size:12px}.home-box2.c0{background:#36cfca}.home-box2.c1{background:#597cf4}.home-box2.c2{background:#e99d42}.home-box2.c3{background:#36cf3c}.home-box2.c4{background:#F4595c}.home-box2.c5{background:#31BDEC}.home-box2.c6{background:#FF5722}.home-box2.c7{background:#AAEB0E}.lay-row3{background:#fff;width:95%;display:block;overflow:hidden;margin:0 auto;padding:0 20px 20px;height:calc(100% - 40px)}.lay-row3-div{display:block;overflow:hidden;margin-bottom:20px;clear:both;height:100%}.lay-row3 .home-box3{height:60px;line-height:60px;margin-top:4px}.lay-row3 .home-box3 h1{font-weight:700;display:inline-block}.lay-row3 .home-box3 h2{font-weight:400;color:#168add;display:inline-block;float:right;font-size:14px;margin-right:2px;cursor:pointer}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
.layui-collapse{border-width:1px;border-style:solid;border-radius:2px}.layui-colla-content,.layui-colla-item{border-top-width:1px;border-top-style:solid}.layui-colla-item:first-child{border-top:none}.layui-colla-title{position:relative;height:42px;line-height:42px;padding:0 15px 0 35px;color:#333;background-color:var(--global-neutral-color-1);cursor:pointer;font-size:14px;overflow:hidden}.layui-colla-content{padding:10px 15px;line-height:1.6;color:#666}.layui-colla-icon{position:absolute;left:15px;top:0;font-size:14px}

@ -0,0 +1 @@
.layui-radio[size=lg] .layui-form-radio>i{font-size:24px}.layui-radio[size=md] .layui-form-radio>i{font-size:22px}.layui-radio[size=sm] .layui-form-radio>i{font-size:20px}.layui-radio[size=xs] .layui-form-radio>i{font-size:18px}.layui-radio input[type=radio]{display:none}.layui-form-radio,.layui-form-radio *{display:inline-block;vertical-align:middle}.layui-form-radio{line-height:28px;margin:6px 10px 0 0;padding-right:10px;cursor:pointer;font-size:0}.layui-form-radio *{font-size:14px}.layui-form-radio>i{margin-right:8px;font-size:22px;color:var(--global-neutral-color-8)}.layui-form-radio:hover *,.layui-form-radioed,.layui-form-radioed>i{color:var(--global-checked-color)}.layui-radio-disabled>i{color:var(--global-neutral-color-3)!important}.layui-radio-disabled *{color:var(--global-neutral-color-8)!important}

@ -0,0 +1 @@
import r from"./all.b1b3f398.js";import{_ as n,r as p,J as e,o as m,c as s}from"./index.b3f8b7f1.js";/* empty css *//* empty css */import"./all.b6bc6e53.js";/* empty css */import"./common.d8f31935.js";import"./factory.c30f2aec.js";import"./materialType.f34aeb6a.js";import"./package.94c98454.js";/* empty css */const c={components:{AllData:r},setup(){return{dataInfoObj:p(2)}}};function i(o,f,l,t,_,d){const a=e("AllData");return m(),s(a,{dataInfoObj:t.dataInfoObj},null,8,["dataInfoObj"])}var B=n(c,[["render",i]]);export{B as default};

@ -0,0 +1 @@
import r from"./all.b1b3f398.js";import{_ as n,r as p,J as e,o as c,c as m}from"./index.b3f8b7f1.js";/* empty css *//* empty css */import"./all.b6bc6e53.js";/* empty css */import"./common.d8f31935.js";import"./factory.c30f2aec.js";import"./materialType.f34aeb6a.js";import"./package.94c98454.js";/* empty css */const s={components:{AllData:r},setup(){return{dataInfoObj:p(1)}}};function i(o,f,l,t,_,d){const a=e("AllData");return c(),m(a,{dataInfoObj:t.dataInfoObj},null,8,["dataInfoObj"])}var v=n(s,[["render",i]]);export{v as default};

@ -0,0 +1 @@
import{_ as e}from"./index.b3f8b7f1.js";const r={name:"log.vue"};function o(t,a,n,s,_,c){return" 111 "}var f=e(r,[["render",o]]);export{f as default};

@ -0,0 +1 @@
.content-box[data-v-36abbda6]{height:744px;display:block;position:relative;clear:both;float:none}.edit-box[data-v-36abbda6]{display:block;width:99%;text-align:center;margin:0 auto;clear:both;float:none}.edit-info[data-v-36abbda6]{margin:20px .75% 10px 0;width:47%;padding-left:1%;padding-right:1%;display:inline-block}.edit-info+.edit-info[data-v-36abbda6]{margin-left:.75%;margin-right:0}.layui-form-item[data-v-36abbda6]{margin-bottom:16px}.content-box[data-v-cde57ee0]{height:400px;margin:20px 10px;display:block;position:relative;clear:both;float:none}

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
import{v as n}from"./index.b3f8b7f1.js";async function r(t){let a={};return await n.post("/api/MaterialType/GetInfoData",t||{}).then(e=>{a=e.Data}),a}async function i(t){let a=0;return await n.post("/api/MaterialType/ChangeInfoData",t).then(e=>{a=e.Data||0}),a}export{i as c,r as g};

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
.edit-info[data-v-35b794fc]{padding-right:30px;margin:20px auto;overflow:hidden}.empty-small2[data-v-35b794fc]{margin:0 auto 20px;display:block}.layui-form-item[data-v-35b794fc]{margin-bottom:16px;width:46%;float:left;display:block;clear:initial}.layui-form-item[data-v-35b794fc]:nth-child(even){float:right}.edit-info[data-v-ad53da44]{width:90%;padding-right:30px;margin:30px auto 10px}.menuBtn[data-v-ad53da44]{display:block;text-align:center;width:96%;margin:20px auto}.empty-small2[data-v-ad53da44]{max-width:96%;margin:0 auto}.empty-small2>.layui-btn[data-v-ad53da44]{margin-bottom:16px}.note[data-v-ad53da44]{color:#999;font-size:12px;margin:12px auto 2px;text-align:right}.edit-info[data-v-26720406]{margin:0 28px;display:block;clear:both;float:none;overflow:auto;height:290px}.float-clear[data-v-26720406]{overflow:hidden;display:block;clear:both;float:none;height:0}.menuBtn[data-v-26720406]{display:block;text-align:center;width:96%;margin:10px auto}.empty-small2[data-v-26720406]{max-width:96%;margin:20px auto;display:block}.empty-small2>.layui-btn[data-v-26720406]{margin-bottom:16px}.note[data-v-26720406]{color:#999;font-size:12px;margin:12px auto 2px;text-align:right}

@ -0,0 +1 @@
import{v as n}from"./index.b3f8b7f1.js";async function i(t){let a={};return await n.post("/api/Package/GetPackageChildList",t).then(e=>{a=e}),a}async function s(t){let a=0;return await n.post("/api/Package/DeletePackageChild",{FID:t}).then(e=>{a=e.Data}),a}async function o(t){let a=0;return await n.post("/api/Package/GetPackageInfo",t).then(e=>{a=e.Data}),a}async function l(t){let a=0;return await n.post("/api/Package/UpdatePackageData",t).then(e=>{a=e.Data}),a}async function u(t){let a=0;return await n.post("/api/Package/DockMDMCode",t).then(e=>{a=e.Data}),a}async function p(t){let a=0;return await n.post("/api/Package/NoSupplyPackageChild",t).then(e=>{a=e.Data}),a}export{i as a,s as b,u as d,o as g,p as n,l as u};

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
:root{--textarea-border-radius: var(--global-border-radius);--textarea-border-color: var(--global-neutral-color-3)}.layui-textarea{border-width:1px;border-style:solid;background-color:#fff;color:#000000d9;border-radius:var(--textarea-border-radius);border-color:var(--textarea-border-color);display:block;width:100%;height:auto;line-height:20px;min-height:100px;padding:6px 10px;resize:vertical;position:relative}.layui-textarea-wrapper{position:relative}.layui-textarea:hover{border-color:#eee!important}.layui-textarea:focus{border-color:#d2d2d2!important}.layui-textarea-clear{position:absolute;color:#00000073;right:10px;top:10px}.layui-textarea::-webkit-input-placeholder{line-height:1.3}.layui-texterea-count{text-align:right;color:inherit;white-space:nowrap;pointer-events:none;margin-top:4px}.power-box[data-v-41fb242c]{display:block;height:75vh}.tab-box[data-v-41fb242c]{max-width:96%;margin:20px auto 0}.menuBtn[data-v-41fb242c]{display:block;text-align:center;width:96%;position:absolute;bottom:38px}.mb4[data-v-41fb242c],.mb5[data-v-41fb242c]{position:relative;margin-top:70px}.view-box[data-v-41fb242c]{padding-left:16px;display:block}.layui-checkbox[data-v-41fb242c]{margin-bottom:16px;display:inline-block}

@ -0,0 +1 @@
.dataInfo[data-v-dcc53da0]{max-width:90%;margin:30px auto;padding-right:30px;overflow-y:auto}.layui-item33[data-v-03d64be6]{width:90%;padding-right:30px;margin:30px auto 10px;display:block;overflow:auto;position:relative;clear:both}.menuBtn[data-v-03d64be6]{display:block;text-align:center;width:96%;margin:20px auto}.empty-small2[data-v-03d64be6]{max-width:96%;margin:0 auto}.empty-small2>.layui-btn[data-v-03d64be6]{margin-bottom:16px}.title-materail[data-v-03d64be6]{margin:8px 10px 0 0;vertical-align:middle;text-align:right}.data-materail[data-v-03d64be6]{margin:0 20px 0 0}

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
import{S as p}from"./all.b6bc6e53.js";import{_ as r,r as a,J as n,o as s,c}from"./index.b3f8b7f1.js";/* empty css *//* empty css *//* empty css */import"./common.d8f31935.js";import"./factory.c30f2aec.js";import"./materialType.f34aeb6a.js";import"./package.94c98454.js";/* empty css */const m={components:{AllData:p},setup(){return{pageTypeObj:a(2)}}};function i(o,l,_,t,f,u){const e=n("AllData");return s(),c(e,{pageTypeObj:t.pageTypeObj},null,8,["pageTypeObj"])}var A=r(m,[["render",i]]);export{A as default};

File diff suppressed because one or more lines are too long

BIN
dist/favicon.ico vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

133
dist/index.html vendored

@ -0,0 +1,133 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>配方物料协同系统</title>
<style>
.loader-main {
position: fixed;
width: 100%;
height: 100%;
background-color: whitesmoke;
z-index: 9999999;
}
.loader {
width: 50px;
height: 50px;
margin: 30px auto 40px;
margin-top: 20%;
position: relative;
z-index: 999999;
background-color: whitesmoke;
}
.loader:before {
content: "";
width: 50px;
height: 7px;
border-radius: 50%;
background: #000;
opacity: 0.1;
position: absolute;
top: 59px;
left: 0;
animation: shadow 0.5s linear infinite;
}
.loader:after {
content: "";
width: 50px;
height: 50px;
border-radius: 3px;
background-color: #5fb878;
position: absolute;
top: 0;
left: 0;
animation: loading 0.5s linear infinite;
}
@-webkit-keyframes loading {
17% {
border-bottom-right-radius: 3px;
}
25% {
transform: translateY(9px) rotate(22.5deg);
}
50% {
transform: translateY(18px) scale(1, 0.9) rotate(45deg);
border-bottom-right-radius: 40px;
}
75% {
transform: translateY(9px) rotate(67.5deg);
}
100% {
transform: translateY(0) rotate(90deg);
}
}
@keyframes loading {
17% {
border-bottom-right-radius: 3px;
}
25% {
transform: translateY(9px) rotate(22.5deg);
}
50% {
transform: translateY(18px) scale(1, 0.9) rotate(45deg);
border-bottom-right-radius: 40px;
}
75% {
transform: translateY(9px) rotate(67.5deg);
}
100% {
transform: translateY(0) rotate(90deg);
}
}
@-webkit-keyframes shadow {
0%,
100% {
transform: scale(1, 1);
}
50% {
transform: scale(1.2, 1);
}
}
@keyframes shadow {
0%,
100% {
transform: scale(1, 1);
}
50% {
transform: scale(1.2, 1);
}
}
</style>
<script type="module" crossorigin src="/assets/index.b3f8b7f1.js"></script>
<link rel="stylesheet" href="/assets/index.51079297.css">
</head>
<body>
<div id="app">
<div class="loader-main">
<div class="loader"></div>
</div>
</div>
</body>
</html>

@ -0,0 +1,131 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>配方物料协同系统</title>
<style>
.loader-main {
position: fixed;
width: 100%;
height: 100%;
background-color: whitesmoke;
z-index: 9999999;
}
.loader {
width: 50px;
height: 50px;
margin: 30px auto 40px;
margin-top: 20%;
position: relative;
z-index: 999999;
background-color: whitesmoke;
}
.loader:before {
content: "";
width: 50px;
height: 7px;
border-radius: 50%;
background: #000;
opacity: 0.1;
position: absolute;
top: 59px;
left: 0;
animation: shadow 0.5s linear infinite;
}
.loader:after {
content: "";
width: 50px;
height: 50px;
border-radius: 3px;
background-color: #5fb878;
position: absolute;
top: 0;
left: 0;
animation: loading 0.5s linear infinite;
}
@-webkit-keyframes loading {
17% {
border-bottom-right-radius: 3px;
}
25% {
transform: translateY(9px) rotate(22.5deg);
}
50% {
transform: translateY(18px) scale(1, 0.9) rotate(45deg);
border-bottom-right-radius: 40px;
}
75% {
transform: translateY(9px) rotate(67.5deg);
}
100% {
transform: translateY(0) rotate(90deg);
}
}
@keyframes loading {
17% {
border-bottom-right-radius: 3px;
}
25% {
transform: translateY(9px) rotate(22.5deg);
}
50% {
transform: translateY(18px) scale(1, 0.9) rotate(45deg);
border-bottom-right-radius: 40px;
}
75% {
transform: translateY(9px) rotate(67.5deg);
}
100% {
transform: translateY(0) rotate(90deg);
}
}
@-webkit-keyframes shadow {
0%,
100% {
transform: scale(1, 1);
}
50% {
transform: scale(1.2, 1);
}
}
@keyframes shadow {
0%,
100% {
transform: scale(1, 1);
}
50% {
transform: scale(1.2, 1);
}
}
</style>
</head>
<body>
<div id="app">
<div class="loader-main">
<div class="loader"></div>
</div>
</div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>

5436
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -0,0 +1,39 @@
{
"name": "layui-vue-admin",
"version": "1.0.0",
"scripts": {
"dev": "vite",
"build": "vue-tsc --noEmit --skipLibCheck && vite build",
"serve": "vite preview",
"commit": "git add . && git-cz && git push"
},
"dependencies": {
"@babel/runtime": "^7.18.9",
"@layui/layui-vue": "^1.6.4",
"axios": "^0.24.0",
"commitizen": "^4.2.4",
"pinia": "^2.0.9",
"pinia-plugin-persist": "^1.0.0",
"vue": "^3.2.47",
"vue-router": "^4.0.12"
},
"devDependencies": {
"@babel/plugin-transform-runtime": "^7.18.9",
"@types/node": "^18.6.2",
"@vitejs/plugin-vue": "^2.2.0",
"@vue/compiler-sfc": "^3.2.33",
"cz-customizable": "^6.6.0",
"less": "^4.1.2",
"typescript": "^4.5.4",
"unplugin-auto-import": "^0.7.2",
"unplugin-layui-vue-resolver": "^0.0.12",
"unplugin-vue-components": "^0.19.9",
"vite": "^2.8.0",
"vue-tsc": "^0.29.8"
},
"config": {
"commitizen": {
"path": "node_modules/cz-customizable"
}
}
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -0,0 +1,223 @@
<template>
<router-view></router-view>
</template>
<style>
#app {
height: 100%;
}
body {
height: 100%;
}
html {
height: 100%;
}
.layui-disabled,
.layui-disabled:hover {
color: var(--global-neutral-color-8) !important;
}
.layui-laypage-skip .layui-input-number {
min-width: 50px;
}
textarea {
resize: none !important;
}
.layui-empty {
text-align: center;
min-height: 220px;
padding: 60px 0 40px;
}
.empty-small1 .layui-empty {
padding: 41px 0 20px;
}
.empty-small2 .layui-empty {
padding: 6px 0 15px;
}
.empty-small3 .layui-empty {
min-height: 200px;
}
.empty-small3 .layui-empty img {
max-height: 150px;
margin-top: 12px;
}
.empty-small3 .layui-empty .layui-empty-description {
margin-top: -20px;
}
.search-box {
display: block;
clear: both;
border: 1px solid #eee;
padding: 30px 10px 0;
}
.search-items .layui-form-item {
float: left;
clear: inherit;
}
.search-btn {
display: block;
text-align: right;
margin-right: 21px;
}
.layui-form-select {
display: inline-block;
}
.search-items .layui-input,
.search-items .layui-form-label,
.search-items .layui-form-select {
line-height: 30px !important;
height: 30px !important;
}
.search-items .layui-input-wrapper,
.search-items input {
line-height: 28px !important;
height: 28px !important;
}
.search-items .layui-form-label {
color: #666;
}
.search-items .layui-input {
color: #555;
}
.layui-btn {
position: relative;
}
.layui-upload-wrap {
width: 100%;
height: 100%;
position: absolute !important;
left: 0;
top: 0;
opacity: 0;
overflow: hidden;
}
.layui-tab .layui-tab-title {
background: whitesmoke !important;
border-bottom: 4px solid #fff;
}
.layui-tab .layui-this,
.layui-fluid {
background: #fff !important;
}
.layui-table,
.layui-table-view {
margin-top: 0 !important;
}
.color666 .layui-form-label {
color: #666;
}
.color999 .layui-disabled,
.color999 .layui-disabled:hover {
color: #999 !important;
}
.layui-tab-content {
padding-bottom: 0;
}
/* 包材子项添加的时候 */
.table-box240 .layui-table-main {
max-height: 240px;
}
.table-box240 .layui-input {
height: 28px !important;
}
.table-box240 .layui-table-cell {
padding: 4px 8px !important;
}
.table-box240 .layui-input input {
text-align: center;
padding-left: 0;
}
.table-box240 .layui-input {
height: 28px !important;
}
.table-box240 .layui-btn {
margin: 0 5px !important;
}
/* 大进度条,小的时候显示美观 */
.layui-progress-big {
overflow: hidden;
}
.row-select .layui-form-select {
width: 100% !important;
}
.row-select td {
overflow: inherit;
}
.layui-progress-big .layui-progress-text {
color: #555 !important;
}
.layui-item33 .layui-form-item {
min-width: 33.3%;
float: left;
clear: initial;
}
.layui-item50 .layui-form-item {
min-width: 50%;
float: left;
clear: initial;
}
.sale-note {
width: 100% !important;
}
.sale-note .layui-input {
display: none !important;
}
.sale-note .layui-anim {
top: 0 !important;
display: block !important;
}
.layui-header .layui-nav .layui-nav-item>a * {
color: #393d49 !important;
}
.layui-inline[title='导出'],
.layui-inline[title='打印'] {
display: none !important;
}
.layui-select {
max-width: 100%;
}
</style>

@ -0,0 +1,165 @@
import http from '../http';
//获取导航菜单
export async function getMenuList(param) {
var menuList = [];
param = param || { FPageSize: 20 };
await http.post('/api/Common/GetPageList', param).then((data) => {
menuList = data.Data.List.filter(s => s.FParentID == -1).sort(function(a, b) {
return a.FOrder > b.FOrder;
});
menuList.forEach((item) => {
item.FChild = (data.Data.List.filter(s => s.FParentID == item.FID) || []).sort(function(a, b) {
return a.FOrder > b.FOrder;
});
});
});
return menuList;
}
//获取配置集合
export async function getBasicList(typeId) {
var dataList = [];
await http.post('/api/Common/GetBasicList', { FType: typeId }).then((data) => {
dataList = data.Data.sort(function(a, b) { return a.FOrder > b.FOrder; });
});
return dataList;
}
//获取信息
export async function getDataModel(dataInfo, controller) {
let result = 0;
await http.post('/api/' + controller + '/GetDataModel', dataInfo).then((data) => {
result = data.Data;
});
return result;
}
//修改信息
export async function updateDataInfo(dataInfo, controller) {
let result = 0;
await http.post('/api/' + controller + '/UpdateDataModel', dataInfo).then((data) => {
result = data.Data;
});
return result;
}
//新增信息
export async function insertDataInfo(dataInfo, controller) {
let result = 0;
await http.post('/api/' + controller + '/InsertDataModel', dataInfo).then((data) => {
result = data.Data;
});
return result;
}
//删除信息
export async function deleteDataById(dataId, controller) {
let result = 0;
await http.post('/api/' + controller + '/DeleteDataById', { FID: dataId.FID || dataId }).then((data) => {
result = data.Data;
});
return result;
}
//获取分页
export async function getPageList(param, controller) {
param = param || { FPageIndex: 1, FPageSize: 10 };
let result = {};
await http.post('/api/' + controller + '/GetPageList', param).then((data) => {
result = data;
});
return result;
}
export async function GetFormulaPageList(param, controller) {
param = param || { FPageIndex: 1, FPageSize: 10 };
let result = {};
await http.post('/api/' + controller + '/GetFormulaPageList', param).then((data) => {
result = data;
});
return result;
}
//保存
export async function commonSave(param, controller) {
let result = {};
await http.post('/api/' + controller + '/Save', param).then((data) => {
result = data;
});
return result;
}
//获取模板信息
export async function getTempFile(type) {
let result = "";
await http.post('/api/Common/GetTempFile', { FType: type || 1 }).then((data) => {
result = data.Data;
});
return result;
}
//验证用户权限
export async function checkIsHasPower(inData) {
let result = {};
await http.post('/api/Common/CheckIsHasPower', inData).then((data) => {
result = data.Data;
});
return result;
}
//获取数据选择值
export async function getDataCode(inData) {
let result = {};
await http.post('/api/Common/GetDataCodeList', inData).then((data) => {
result = data.Data;
});
return result;
}
//获取配置集合
export async function getConfigList() {
let result = {};
await http.post('/api/Common/GetConfigList', {}).then((data) => {
result = data.Data;
});
return result;
}
//获取系统配置值
export async function getConfigValue(dataId) {
let result = {};
await http.post('/api/Common/GetConfigValue', { FID: dataId }).then((data) => {
result = data.Data;
});
return result;
}
//修改数据值状态
export async function stateDataCode(dataId) {
let result = {};
await http.post('/api/Common/StateDataCode', { FID: dataId }).then((data) => {
result = data.Data;
});
return result;
}
//删除数据值
export async function deleteDataCode(dataId) {
let result = {};
await http.post('/api/Common/DeleteDataCode', { FID: dataId }).then((data) => {
result = data.Data;
});
return result;
}
//设置系统配置值
export async function changeDataCode(inData) {
let result = {};
await http.post('/api/Common/ChangeDataCode', inData).then((data) => {
result = data.Data;
});
return result;
}

@ -0,0 +1,19 @@
import http from '../http';
//获取工厂集合
export async function getFactoryList() {
var dataList = [];
await http.post('/api/Factory/GetFactoryList').then((data) => {
dataList = data.Data;
});
return dataList;
}
//验证工厂代码是否重复
export async function checkHasCode(id, code) {
let result = 0;
await http.post('/api/Factory/CheckHasCode', { FID: id, FCode: code }).then((data) => {
result = data.Data;
});
return result;
}

@ -0,0 +1,10 @@
import http from '../http';
//对接SAP配方同步
export async function dockSapFormula(param) {
let result = 0;
await http.post('/api/Formula/DockSapFormula', param || {}).then((data) => {
result = data.Data;
});
return result;
}

@ -0,0 +1,47 @@
import http from '../http';
//删除物料信息
export async function deleteDataById(dataId) {
let result = 0;
await http.post('/api/Material/DeleteDataById', { FID: dataId }).then((data) => {
result = data.Data;
});
return result;
}
//对接SAP物料同步
export async function dockSapMaterial(param) {
let result = 0;
await http.post('/api/Material/DockSapMaterial', param || {}).then((data) => {
result = data.Data;
});
return result;
}
//下载视图
export async function DownMateialView(param) {
let result = [];
await http.post('/api/Material/DownMateialView', param).then((data) => {
result = data;
});
return result;
}
//下载SAP视图
export async function DownSAP(param) {
let result = [];
await http.post('/api/Material/DownSAP', param).then((data) => {
result = data;
});
return result;
}
//下载全部视图
export async function DownViewAll(param) {
let result = [];
await http.post('/api/Material/DownViewAll', param).then((data) => {
result = data;
});
return result;
}

@ -0,0 +1,21 @@
import http from '../http';
//获取信息数据
export async function getInfoData(param) {
let result = {};
await http.post('/api/MaterialType/GetInfoData', param || {}).then((data) => {
result = data.Data;
});
return result;
}
//修改信息数据
export async function changeInfoData(param) {
let result = 0;
await http.post('/api/MaterialType/ChangeInfoData', param).then((data) => {
result = data.Data || 0;
});
return result;
}

@ -0,0 +1,55 @@
import http from '../http';
//获取子项集合
export async function getPackageChildList(param) {
let result = {};
await http.post('/api/Package/GetPackageChildList', param).then((data) => {
result = data;
});
return result;
}
//删除子项信息
export async function deletePackageChild(dataId) {
let result = 0;
await http.post('/api/Package/DeletePackageChild', { FID: dataId }).then((data) => {
result = data.Data;
});
return result;
}
//获取包材信息
export async function getPackageInfo(param) {
let result = 0;
await http.post('/api/Package/GetPackageInfo', param).then((data) => {
result = data.Data;
});
return result;
}
//操作包材信息
export async function updatePackageData(param) {
let result = 0;
await http.post('/api/Package/UpdatePackageData', param).then((data) => {
result = data.Data;
});
return result;
}
//对接子项代码
export async function dockMDMCode(param) {
let result = 0;
await http.post('/api/Package/DockMDMCode', param).then((data) => {
result = data.Data;
});
return result;
}
//不补充包材信息
export async function noSupplyPackageChild(param) {
let result = 0;
await http.post('/api/Package/NoSupplyPackageChild', param).then((data) => {
result = data.Data;
});
return result;
}

@ -0,0 +1,28 @@
import http from '../http';
//物料组复核
export async function reviewMaterialGroup(params: any) {
let result = {};
await http.post('/api/Task/ReviewMaterialGroup', params).then((data) => {
result = data.Data;
});
return result;
}
//组编号申请
export async function dockMaterialGroup(params: any) {
let result = {};
await http.post('/api/Task/DockMaterialGroup', params).then((data) => {
result = data.Data;
});
return result;
}
//确认流程完成
export async function sureTeamWork(teamId: number) {
let result = 0;
await http.post('/api/Task/SureTeamWork', { FTeamID: teamId }).then((data) => {
result = data.Data;
});
return result;
}

@ -0,0 +1,40 @@
import http from '../http';
//获取协同集合
export async function getTeamworkPageList(param) {
param = param || { FPageIndex: 1, FPageSize: 10 };
let result = {};
await http.post('/api/Teamwork/GetTeamworkPageList', param).then((data) => {
result = data;
});
return result;
}
//获取流程集合
export async function getTeamProcessList(teamId) {
let param = { FPageIndex: 1, FPageSize: 999, FTeamID: teamId };
let result = [];
await http.post('/api/Teamwork/GetTeamProcessList', param).then((data) => {
result = data.Data.List || [];
});
return result;
}
//获取协同视图信息
export async function getTeamworkView(param) {
let result = {};
await http.post('/api/Teamwork/GetTeamworkView', param).then((data) => {
result = data.Data;
});
return result;
}
//下载BOM
export async function downloadBOM(teamId) {
let param = { FTeamID: teamId };
let result = [];
await http.post('/api/Teamwork/DockDownBomData', param).then((data) => {
result = data;
});
return result;
}

@ -0,0 +1,134 @@
import http from '../http';
//获取导航菜单
export async function getMenuList(param) {
var menuList = [];
await http.post('/api/User/GetMenuList', param).then((data) => {
menuList = data.Data.filter(s => s.FParentID == -1).sort(function(a, b) {
return a.FOrder > b.FOrder;
});
menuList.forEach((item) => {
item.FChild = (data.Data.filter(s => s.FParentID == item.FID) || []).sort(function(a, b) {
return a.FOrder > b.FOrder;
});
});
});
return menuList;
}
//获取角色集合(分页)
export async function getRolePageList(param) {
param = param || { FPageIndex: 1, FPageSize: 10 };
let result = {};
await http.post('/api/User/GetRolePageList', param).then((data) => {
result = data;
});
return result;
}
//获取角色集合
export async function getRoleList() {
var dataList = [];
await http.post('/api/User/GetRoleList').then((data) => {
dataList = data.Data;
});
return dataList;
}
//修改角色
export async function updateRoleModel(dataInfo, controller) {
let result = 0;
await http.post('/api/User/UpdateRoleModel', dataInfo).then((data) => {
result = data.Data;
});
return result;
}
//新增角色
export async function insertRoleModel(dataInfo, controller) {
let result = 0;
await http.post('/api/User/InsertRoleModel', dataInfo).then((data) => {
result = data.Data;
});
return result;
}
//删除角色信息
export async function deleteRoleModel(dataId) {
let result = 0;
await http.post('/api/User/DeleteRoleModel', { FID: dataId }).then((data) => {
result = data.Data;
});
return result;
}
//获取权限信息(非菜单)
export async function getBasicRoleList(dataInfo) {
let result = [];
await http.post('/api/User/GetBasicRoleList', dataInfo).then((data) => {
result = data.Data;
});
return result;
}
//保存权限信息
export async function saveRolePower(dataInfo) {
let result = 0;
await http.post('/api/User/SaveRolePower', dataInfo).then((data) => {
result = data.Data;
});
return result;
}
//登出用户信息
export async function loginOut(dataInfo) {
let result = "";
await http.post('/api/User/LoginOut', dataInfo || {}).then((data) => {
result = data.Data;
});
return result;
}
//获取首页数量
export async function getHomeTopCount(dataInfo) {
let result = "";
await http.post('/api/User/GetHomeTopCount', dataInfo || {}).then((data) => {
result = data.Data;
});
return result;
}
//获取用户权限
export async function GetPower(dataInfo) {
let result="";
if(typeof(dataInfo.FID)=="undefined")
{
return result;
}
await http.post('/api/User/GetPower?userid='+dataInfo.FID,{}).then((data)=>{
result=data.Data;
});
return result;
}
export async function CreatePower(list) {
//alert(JSON.stringify(list));
let result="";
await http.post('/api/User/CreatePower',{list:list}).then((data)=>{
result=data.Data;
})
return result;
}
export async function GetPowerList() {
let result="";
await http.post('/api/User/GetPowerList').then((data)=>{
result=data.Data;
})
return result;
}

@ -0,0 +1,29 @@
import http from '../http';
//根据协同ID获取物料视图
export async function getListByTeamId(params) {
let result = {};
await http.post('/api/View/GetListByTeamId', params).then((data) => {
result = data.Data;
});
return result;
}
//保存视图编辑的内容
export async function updateBatchById(params) {
let result = {};
await http.post('/api/View/UpdateBatchById', params).then((data) => {
result = data;
});
return result;
}
//保存视图编辑的内容
export async function updateBatchById2(params) {
let result = {};
await http.post('/api/View/UpdateBatchById2', params).then((data) => {
result = data;
});
return result;
}

@ -0,0 +1,92 @@
import axios from 'axios'
import { layer } from '@layui/layer-vue'
const config = {
timeout: 600000,
//baseURL: "http://124.222.104.55:58178/",
baseURL: "http://localhost:58178/",
// baseURL: "http://plm-pw-test.hbflavor.com:81/",
headers: {
'Content-Type': 'application/json;charset=UTF-8',
},
async: false
}
// let userToken = "";
// let userToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJGSUQiOjIsIkZVc2VyIjoib2F0ZXN0MiIsIkZOYW1lIjoi5rWL6K-V5bel5Y6CIiwiRkV4cGlyZVRpbWUiOiIyMDIzLTAxLTE3IDIwOjIwOjA1In0.ZNN-fVE1JJ3tN82pM9DylqqMMpMUVLZWJKTBwz8M3bU"
let userToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJGSUQiOjIsIkZVc2VyIjoib2F0ZXN0MSIsIkZOYW1lIjoi6ZmI5YevX1RFU1QiLCJGRXhwaXJlVGltZSI6IjIwMjMtMDQtMTcgMjA6MjQ6MTYifQ.v00Pm6eqVNlA-TRTBAsmVPw1z7ZbO1Fd0S4mUi-_uzI"
//获取上传信息
export function getUploadInfo(param: any) {
let temps = param.url;
param.url = config.baseURL + temps
if (temps[0] == "/" && config.baseURL[config.baseURL.length - 1] == "/") {
param.url = param.url.replace("/" + temps, temps);
}
param.headers = param.headers || {};
param.headers.token = localStorage.getItem('token') || userToken;
param.headers.ticket = getQueryString("ticket") || getQueryString("token") || "";
return param;
};
export const getQueryString = (name: string) => {
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
var r = window.location.search.substr(1).match(reg);
if (r != null) {
return decodeURIComponent(r[2]);
}
return null;
}
class Http {
service: any;
constructor(config: any) {
this.service = axios.create(config)
/* 请求拦截 */
this.service.interceptors.request.use((config: any) => {
config.headers.token = localStorage.getItem('token') || userToken;
config.headers.ticket = getQueryString("ticket") || getQueryString("token") || "";
return config;
}, error => {
console.log("error");
return Promise.reject(error);
});
/* 响应拦截 */
this.service.interceptors.response.use((response: any) => {
const data = response.data;
console.log(data)
let ticket = data.Ticket || "";
if (ticket && ticket.length > 10) {
let index = ticket.indexOf("http");
if (index != -1 && index < 5) window.location.href = ticket;
else localStorage.setItem('token', ticket);
}
if (data.Code != "200") {
let message = data.Message || `接口异常`;
if (layer) {
layer.msg(message, { time: 3000, icon: 2 });
} else {
alert(message);
}
return data;
}
else {
return data;
}
}, error => {
layer.msg(error, { time: 3000, icon: 2 });
return Promise.reject(error)
});
}
/* GET 方法 */
get<T>(url: string, params?: object, _object = {}): Promise<any> {
return this.service.get(url, { params, ..._object });
}
/* POST 方法 */
post<T>(url: string, params?: object, _object = {}): Promise<any> {
return this.service.post(url, params, _object);
}
}
export default new Http(config);

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

@ -0,0 +1,24 @@
<template>
<svg xmlns="http://www.w3.org/2000/svg" fill="rgba(60, 60, 60, .7)" aria-hidden="true" focusable="false"
viewBox="0 0 24 24" class="vt-switch-appearance-sun">
<path
d="M12,18c-3.3,0-6-2.7-6-6s2.7-6,6-6s6,2.7,6,6S15.3,18,12,18zM12,8c-2.2,0-4,1.8-4,4c0,2.2,1.8,4,4,4c2.2,0,4-1.8,4-4C16,9.8,14.2,8,12,8z">
</path>
<path d="M12,4c-0.6,0-1-0.4-1-1V1c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,3.6,12.6,4,12,4z"></path>
<path d="M12,24c-0.6,0-1-0.4-1-1v-2c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,23.6,12.6,24,12,24z"></path>
<path
d="M5.6,6.6c-0.3,0-0.5-0.1-0.7-0.3L3.5,4.9c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C6.2,6.5,5.9,6.6,5.6,6.6z">
</path>
<path
d="M19.8,20.8c-0.3,0-0.5-0.1-0.7-0.3l-1.4-1.4c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C20.3,20.7,20,20.8,19.8,20.8z">
</path>
<path d="M3,13H1c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S3.6,13,3,13z"></path>
<path d="M23,13h-2c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S23.6,13,23,13z"></path>
<path
d="M4.2,20.8c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C4.7,20.7,4.5,20.8,4.2,20.8z">
</path>
<path
d="M18.4,6.6c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C18.9,6.5,18.6,6.6,18.4,6.6z">
</path>
</svg>
</template>

@ -0,0 +1,8 @@
<template>
<svg xmlns="http://www.w3.org/2000/svg" fill="rgba(60, 60, 60, .7)" aria-hidden="true" focusable="false"
viewBox="0 0 24 24" class="vt-switch-appearance-moon">
<path
d="M12.1,22c-0.3,0-0.6,0-0.9,0c-5.5-0.5-9.5-5.4-9-10.9c0.4-4.8,4.2-8.6,9-9c0.4,0,0.8,0.2,1,0.5c0.2,0.3,0.2,0.8-0.1,1.1c-2,2.7-1.4,6.4,1.3,8.4c2.1,1.6,5,1.6,7.1,0c0.3-0.2,0.7-0.3,1.1-0.1c0.3,0.2,0.5,0.6,0.5,1c-0.2,2.7-1.5,5.1-3.6,6.8C16.6,21.2,14.4,22,12.1,22zM9.3,4.4c-2.9,1-5,3.6-5.2,6.8c-0.4,4.4,2.8,8.3,7.2,8.7c2.1,0.2,4.2-0.4,5.8-1.8c1.1-0.9,1.9-2.1,2.4-3.4c-2.5,0.9-5.3,0.5-7.5-1.1C9.2,11.4,8.1,7.7,9.3,4.4z">
</path>
</svg>
</template>

@ -0,0 +1,210 @@
<template>
<lay-config-provider :themeVariable="appStore.themeVariable" :theme="appStore.theme">
<lay-layout :class="[collapseState ? 'collapse' : '']">
<!-- side -->
<lay-side :width="sideWidth">
<lay-logo v-if="collapseState" style="color:#fff;"></lay-logo>
<lay-logo v-else style="color:#fff;">配方物料协同系统</lay-logo>
<lay-scroll style="height: calc(100% - 62px)">
<global-menu :collapse="collapseState"></global-menu>
</lay-scroll>
</lay-side>
<lay-layout style="width:0">
<!-- header -->
<lay-header style="position: relative;">
<lay-menu class="layui-layout-left" @mouseleave="navBarOpacity=0,navBarWidth=0">
<lay-menu-item @click="collapse" @mouseenter="mouseenter($event)">
<lay-icon v-if="collapseState" type="layui-icon-spread-left"></lay-icon>
<lay-icon v-else type="layui-icon-shrink-right"></lay-icon>
</lay-menu-item>
<lay-menu-item @click="refresh" @mouseenter="mouseenter($event)">
<lay-icon type="layui-icon-refresh-one"></lay-icon>
</lay-menu-item>
</lay-menu>
<lay-menu class="layui-layout-right" @mouseleave="navBarOpacity=0,navBarWidth=0">
<lay-menu-item>
<a href="javascript:void(0)">
<lay-switch class="switch" v-model="appStore.theme" onswitch-value="dark"
unswitch-value="light" onswitch-color="rgba(255, 255, 255, 0.05)"
unswitch-color="rgba(255, 255, 255, 0.05)" style="display:inline-flex">
<template #onswitch-icon>
<light-icon></light-icon>
</template>
<template #unswitch-icon>
<dark-icon></dark-icon>
</template>
</lay-switch>
</a>
</lay-menu-item>
<lay-menu-item @mouseenter="mouseenter($event)">
<lay-fullscreen v-slot="{ enter, exit, isFullscreen }">
<lay-icon type="layui-icon-screen-full" v-if="!isFullscreen" @click="enter()">
</lay-icon>
<lay-icon type="layui-icon-screen-restore" v-else @click="exit()"></lay-icon>
</lay-fullscreen>
</lay-menu-item>
<!-- <lay-dropdown @mouseenter="mouseenter($event)">
<lay-menu-item>
<lay-icon type="layui-icon-notice"></lay-icon>
</lay-menu-item>
<template #content> 内容 </template>
</lay-dropdown> -->
<lay-dropdown @mouseenter="mouseenter($event)">
<lay-menu-item>
<lay-icon type="layui-icon-username"></lay-icon>
</lay-menu-item>
<template #content>
<lay-dropdown-menu>
<!-- <lay-dropdown-menu-item>用户信息</lay-dropdown-menu-item> -->
<lay-dropdown-menu-item @click="_loginOutSure"> </lay-dropdown-menu-item>
</lay-dropdown-menu>
</template>
</lay-dropdown>
<lay-menu-item @click="changeVisible" @mouseenter="mouseenter($event)">
<lay-icon type="layui-icon-more-vertical"></lay-icon>
</lay-menu-item>
</lay-menu>
<span class="layui-nav-bar" style="top: 0;left:unset"
:style="{opacity: navBarOpacity,width:navBarWidth+'px',left:navBarLeft+'px'}"></span>
</lay-header>
<!-- content -->
<lay-body>
<global-tab style="height: 42px;"></global-tab>
<global-content></global-content>
</lay-body>
<lay-footer></lay-footer>
</lay-layout>
</lay-layout>
<global-setup v-model="visible"></global-setup>
</lay-config-provider>
</template>
<script lang="ts">
import {
ref
} from "vue";
import DarkIcon from "../components/DarkIcon.vue"
import LightIcon from "../components/LightIcon.vue"
import {
layer
} from '@layui/layer-vue'
import {
useAppStore
} from "../store/app";
import {
loginOut
} from "../../src/api/api/user";
import GlobalSetup from "./Global/GlobalSetup.vue";
import GlobalContent from "./Global/GlobalContent.vue";
import GlobalTab from "./Global/GlobalTab.vue";
import GlobalMenu from "./Global/GlobalMenu.vue";
import '@layui/layui-vue/es/checkbox/index.css';
export default {
components: {
GlobalSetup,
GlobalContent,
GlobalTab,
GlobalMenu,
DarkIcon,
LightIcon
},
setup() {
const appStore = useAppStore();
const collapseState = ref(false);
const visible = ref(false);
const sideWidth = ref("230px");
const changeVisible = function() {
visible.value = !visible.value;
};
//
const collapse = function() {
collapseState.value = !collapseState.value;
sideWidth.value = collapseState.value ? "60px" : "230px";
};
//
const refresh = function() {
appStore.routerAlive = false;
setTimeout(function() {
appStore.routerAlive = true;
}, 500);
};
const navBarOpacity = ref(0)
const navBarWidth = ref(0)
const navBarLeft = ref(0)
const mouseenter = (e: MouseEvent) => {
navBarOpacity.value = 1
// @ts-ignore
navBarWidth.value = e.target.offsetWidth
// @ts-ignore
navBarLeft.value = e.target.offsetLeft + e.target.parentNode.offsetLeft
}
// return instance
return {
sideWidth,
changeVisible,
collapseState,
collapse,
appStore,
refresh,
visible,
mouseenter,
navBarOpacity,
navBarWidth,
navBarLeft
};
},
methods: {
_loginOutSure() {
let $this = this;
layer.confirm("您确定要注销吗?", {
title: "提示",
btn: [{
text: '确定',
callback: function(id) {
layer.close(id);
$this.__loginOutSure();
}
},
{
text: '取消',
callback: function(id) {
layer.close(id);
}
}
]
});
},
async __loginOutSure() {
let idx = layer.load(2);
let result = await loginOut({});
localStorage.removeItem('token');
setTimeout((item) => {
window.location.href = result;
layer.close(idx);
}, 500);
}
}
};
</script>
<style>
.layui-layout .layui-header .layui-form-switch {
border: 1px solid rgba(60, 60, 60, 0.29);
background-color: #f1f1f1 !important;
margin-top: -8px;
}
.layui-layout .layui-header .layui-form-switch svg {
position: absolute;
width: 12px;
height: 12px;
top: 3px;
left: 3px;
}
</style>

@ -0,0 +1,3 @@
<template>
<router-view></router-view>
</template>

@ -0,0 +1,26 @@
<template>
<div class="global-content">
<router-view v-if="appStore.routerAlive"></router-view>
</div>
</template>
<script lang="ts">
export default {
name: "GlobalContent"
}
</script>
<script lang="ts" setup>
import Vue from 'vue'
import {
useAppStore
} from "../../store/app";
const appStore = useAppStore();
</script>
<style scoped>
.global-content {
height: calc(100% - 42px);
overflow: auto;
}
</style>

@ -0,0 +1,81 @@
<template>
<lay-menu v-model:selectedKey="selectKey" v-model:openKeys="openKeys" :collapse="collapse" :tree="isTree"
:level="appStore.level" :inverted="appStore.inverted">
<view v-for="(mItem,mIndex) in menuList">
<lay-sub-menu v-if="mItem['FChild'].length>0" :id="mItem['FRemark']||mIndex">
<template #icon>
<lay-icon :type="mItem['FIcon']||'layui-icon-home'"></lay-icon>
</template>
<template #title> {{mItem['FName']}} </template>
<view v-if="mItem['FChild'].length>0" v-for="(cItem,cIndex) in mItem['FChild']">
<lay-menu-item :id="cItem['FRemark']">
<template #icon>
<lay-icon :type="cItem['FIcon']||'layui-icon-home'"></lay-icon>
</template>
<template #title> {{cItem['FName']}} </template>
</lay-menu-item>
</view>
</lay-sub-menu>
<lay-menu-item v-else :id="mItem['FRemark']||mIndex">
<template #icon>
<lay-icon :type="mItem['FIcon']||'layui-icon-home'"></lay-icon>
</template>
<template #title> {{mItem['FName']}} </template>
</lay-menu-item>
</view>
</lay-menu>
</template>
<script lang="ts">
import {
ref
} from 'vue';
import {
getMenuList
} from "../../api/api/user"
export default {
name: "GlobalMenu",
data() {
const menuList = ref([]);
return {
menuList
}
},
mounted() {
getMenuList(null).then((data: Array < Object > ) => {
this.menuList = data || [];
});
}
};
</script>
<script lang="ts" setup>
import {
useRoute,
useRouter
} from "vue-router";
import {
watch
} from "vue";
import {
useAppStore
} from "../../store/app";
const appStore = useAppStore();
interface MenuProps {
collapse: boolean;
}
const props = withDefaults(defineProps < MenuProps > (), {
collapse: false,
});
const route = useRoute();
const routers = useRouter();
const selectKey = ref(route.path);
const openKeys = ref(["0"]);
const isTree = ref(true);
watch(route, (val) => {
selectKey.value = route.path;
});
watch(selectKey, (val) => {
routers.push(val);
});
</script>

@ -0,0 +1,80 @@
<template>
<lay-layer title="更多设置" type="drawer" area="360px" v-model="visible">
<div class="global-setup">
<!-- 颜色 -->
<template v-for="(themeVariableName, index) in themeVariableNames" :key="index">
<lay-color-picker v-model="appStore.themeVariable[themeVariableName]"></lay-color-picker>
</template>
<!-- 其他 -->
<global-setup-item label="多选项卡">
<lay-switch v-model="appStore.tab"></lay-switch>
</global-setup-item>
<global-setup-item label="菜单层级">
<lay-switch v-model="appStore.level"></lay-switch>
</global-setup-item>
<global-setup-item label="菜单反选">
<lay-switch v-model="appStore.inverted"></lay-switch>
</global-setup-item>
</div>
</lay-layer>
</template>
<script lang="ts">
export default {
name: "GlobalSetup",
};
</script>
<script lang="ts" setup>
import {
useAppStore
} from "../../store/app";
import {
ref,
watch
} from "vue";
import globalSetupItem from "./GlobalSetupItem.vue";
const appStore = useAppStore();
const emits = defineEmits(["update:modelValue"]);
interface SetupProps {
modelValue: boolean;
}
const props = withDefaults(defineProps < SetupProps > (), {
modelValue: false,
});
const visible = ref(props.modelValue);
watch(visible, (val) => {
emits("update:modelValue", val);
});
watch(
() => props.modelValue,
(val) => {
visible.value = val;
}
);
const themeVariableNames = [
"--global-primary-color",
"--global-normal-color",
"--global-warm-color",
"--global-danger-color",
"--global-checked-color",
];
</script>
<style>
.global-setup {
padding: 10px;
}
.global-setup .layui-colorpicker {
margin-right: 10px;
}
</style>

@ -0,0 +1,43 @@
<template>
<div class="global-setup-item">
<div class="global-setup-item-label">
{{ label }}
</div>
<div class="global-setup-item-extra">
<slot></slot>
</div>
</div>
</template>
<script lang="ts">
import Vue from "vue";
export default {
name: "GlobalSetupItem",
};
</script>
<script lang="ts" setup>
interface SetupItemProps {
label: string;
}
const props = withDefaults(defineProps < SetupItemProps > (), {
label: "标题",
});
</script>
<style scoped>
.global-setup-item {
height: 60px;
line-height: 60px;
padding: 0px 10px;
}
.global-setup-item-label {
float: left;
}
.global-setup-item-extra {
float: right;
}
</style>

@ -0,0 +1,88 @@
<template>
<lay-tab v-if="appStore.tab" :modelValue="route.path" :allowClose="allowClose" @change="change" @close="close">
<template :key="tab" v-for="tab in tabs">
<lay-tab-item :id="tab['id']" :title="tab['title']" :closable="tab['closable']"></lay-tab-item>
</template>
</lay-tab>
</template>
<script lang="ts">
export default {
name: "GlobalTab"
}
</script>
<script lang="ts" setup>
import {
ref,
watch
} from "vue";
import {
useRoute,
useRouter
} from "vue-router";
import {
useAppStore
} from "../../store/app";
const router = useRouter();
const route = useRoute();
const appStore = useAppStore();
const allowClose = ref(true);
let defaults = [];
defaults.push({
"title": "首页",
"id": "/",
"closable": false
});
if (route.path != "/" && route.path != "/index") {
let find = {
"title": "",
"id": route.path,
"closable": true
};
let title = "";
router.options.routes.forEach((r1) => {
if (find.id == r1.path) {
find["title"] = (r1.children.length > 0 ? r1.children[0].meta["title"] : r1.meta[
"title"]) as string;
} else {
r1.children.forEach((r2) => {
if (find.id == r2.path) find["title"] = (r2.meta["title"]) as string;
});
}
})
if (find["title"] != "") defaults.push(find);
}
const tabs = ref(defaults);
const change = function(id: string) {
router.push(id);
};
const close = function(path: string) {
tabs.value = tabs.value.filter((ele) => ele['id'] != path);
//
let chose = tabs.value.find(s => s['id'] == route['path']);
if (chose == null && tabs.value.length > 0) {
change(tabs.value[tabs.value.length - 1]['id'])
}
};
watch(route, function() {
if (route.path != "/" && route.path != "/index") {
let bool = false;
tabs.value.forEach((tab) => {
if (tab['id'] === route['path']) {
bool = true;
}
});
if (!bool) {
tabs.value.push({
id: route.fullPath,
title: route.meta.title
});
}
}
});
</script>

@ -0,0 +1,10 @@
import { createApp } from 'vue'
import Router from './router'
import Store from './store'
import App from './App.vue'
import './styles/index.css'
createApp(App)
.use(Store)
.use(Router)
.mount('#app');

@ -0,0 +1,11 @@
import { createRouter, createWebHashHistory } from 'vue-router'
import routes from './module/base-routes'
const router = createRouter({
// 使用 hash 模式构建路由( url中带 # 号的那种)
history: createWebHashHistory(),
// 使用 history 模式构建路由 url 中没有 # 号,但生产环境需要特殊配置)
// history: createWebHistory(),
routes
})
export default router

@ -0,0 +1,117 @@
import BaseLayout from '../../layouts/BaseLayout.vue';
export default [
{
path: '/',
component: BaseLayout,
meta: { title: '首页' },
children: [
{
path: '/index',
component: () => import('../../views/Home/home.vue'),
meta: { title: '首页', icon: "" },
},
{
path: '/',
component: () => import('../../views/Home/home.vue'),
meta: { title: '首页', icon: "" },
}
]
},
{
path: '/need',
component: BaseLayout,
meta: { title: '待办事项' },
children: [
{
path: '/need/all',
component: () => import('../../views/Need/all.vue'),
meta: { title: '全部事项', icon: "" },
},
{
path: '/need/unfinish',
component: () => import('../../views/Need/unfinish.vue'),
meta: { title: '未完事项', icon: "" },
}
]
}, {
path: '/team',
component: BaseLayout,
meta: { title: '协同路线' },
children: [
{
path: '/team/all',
component: () => import('../../views/Team/all.vue'),
meta: { title: '全部路线', icon: "" },
},
{
path: '/team/launch',
component: () => import('../../views/Team/launch.vue'),
meta: { title: '我发起的', icon: "" },
},
{
path: '/team/join',
component: () => import('../../views/Team/join.vue'),
meta: { title: '我参与的', icon: "" },
}
]
}, {
path: '/order',
component: BaseLayout,
meta: { title: '清单管理' },
children: [
{
path: '/order/material',
component: () => import('../../views/Order/material.vue'),
meta: { title: '物料清单', icon: "" },
},
{
path: '/order/formula',
component: () => import('../../views/Order/formula.vue'),
meta: { title: '配方清单', icon: "" },
},
{
path: '/order/package',
component: () => import('../../views/Order/package.vue'),
meta: { title: '包材清单', icon: "" },
},
{
path: '/order/type',
component: () => import('../../views/Order/type.vue'),
meta: { title: '分类清单', icon: "" },
}
]
},
{
path: '/system',
component: BaseLayout,
meta: { title: '系统设置' },
children: [
{
path: '/system/user',
component: () => import('../../views/System/user.vue'),
meta: { title: '用户管理', icon: "" },
},
{
path: '/system/factory',
component: () => import('../../views/System/factory.vue'),
meta: { title: '模式管理', icon: "" },
},
{
path: '/system/role',
component: () => import('../../views/System/role.vue'),
meta: { title: '角色管理', icon: "" },
},
{
path: '/system/config',
component: () => import('../../views/System/config.vue'),
meta: { title: '系统配置', icon: "" },
},
{
path: '/system/log',
component: () => import('../../views/System/log.vue'),
meta: { title: '日志管理', icon: "" },
}
]
}
]

@ -0,0 +1,5 @@
declare module '*.vue' {
import { DefineComponent } from 'vue'
const component: DefineComponent<{}, {}, any>
export default component
}

@ -0,0 +1,33 @@
import { defineStore } from 'pinia'
export const useAppStore = defineStore({
id: 'app',
state: () => {
return {
tab: true,
level: true,
inverted: true,
routerAlive: true,
theme: 'light',
themeVariable: {
"--global-checked-color": "#5fb878",
"--global-primary-color": "#009688",
"--global-normal-color": "#1e9fff",
"--global-danger-color": "#ff5722",
"--global-warm-color": "#ffb800",
} as any,
}
},
persist: {
enabled: true,
strategies: [
{
key: 'tab',
storage: localStorage
}, {
key: 'theme',
storage: localStorage
}
]
}
})

@ -0,0 +1,7 @@
import { createPinia } from 'pinia'
import piniaPluginPersist from 'pinia-plugin-persist'
const store = createPinia();
store.use(piniaPluginPersist);
export default store;

@ -0,0 +1,24 @@
import { defineStore } from 'pinia'
export const useAppStore = defineStore({
id: 'user',
state: () => {
return {
token: {},
userInfo: {},
}
},
persist: {
enabled: true,
strategies: [
{
key: 'token',
storage: localStorage
}, {
key: 'userInfo',
storage: localStorage
}
]
}
})

@ -0,0 +1,123 @@
.lay-config-provider {
height: 100%;
}
.layui-logo {
width: 100%;
font-size: 20px;
border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}
.layui-logo img {
width: 50px;
height: 50px;
}
.layui-body {
overflow-x: hidden;
background-color: whitesmoke;
}
.layui-body > .layui-tab {
margin: 0px;
}
.layui-body > .layui-tab > .layui-tab-content {
padding: 0px;
}
.layui-body > .layui-tab > .layui-tab-head {
width: 100%;
}
.layui-body > .layui-tab > .layui-tab-head > .layui-tab-title {
border: 1px solid whitesmoke;
background-color: white;
border-left: none;
}
.layui-body > .layui-tab > .layui-tab-head > .layui-tab-title > li {
color: dimgray;
font-size: 13.5px;
line-height: 40px;
border-right: 1px solid whitesmoke;
padding-right: 9px;
}
.layui-body > .layui-tab > .layui-tab-head > .layui-tab-title > li.layui-this::after {
border: none;
}
.layui-header {
background: white;
}
.layui-header .layui-nav {
background: transparent;
}
.layui-header .layui-nav.layui-layout-left {
left: 0 !important ;
position: relative !important;
}
.layui-header .layui-nav.layui-layout-right {
display: flex;
align-items: center;
height: 60px;
}
.layui-header .layui-nav.layui-layout-right > li{
height: 60px;
}
.layui-header .layui-nav{
padding: 0;
}
.layui-header .layui-nav * {
color: #393d49;
}
.layui-header .layui-nav .layui-nav-item > a {
padding: 0px 24px;
height: 60px;
}
.layui-side {
z-index: 9999;
width: 230px !important;
background: rgb(34, 36, 37, 98%);
box-shadow: 2px 0 6px rgb(0 21 41 / 35%);
}
.layui-side .layui-nav {
width: 100%;
background-color: transparent;
}
.layui-layout.collapse .layui-logo {
width: 60px;
}
.layui-layout.collapse .layui-side {
width: 60px !important;
}
.layui-layout.collapse .layui-body {
left: 60px;
}
.layui-layout.collapse .layui-header .layui-layout-left {
left: 60px;
}
.layui-layout .layui-logo,
.layui-layout .layui-side,
.layui-layout .layui-body,
.layui-layout .layui-header .layui-layout-left {
transition: all 0.3s;
}
.layui-layout {
height: 100%;
}
.sItem{
display: flex;
}
.sItem .layui-col{
margin-bottom: 15px;
}
.sItem .form-select{
padding:10px;
border: 1px solid #f1f2f1;
width: 100%;
border-radius: 4px;
}
.sItem .layui-icon{
line-height: 40px;
text-align: center;
}
.sItem .layui-col-md7{
margin-right: 15px;
}
.layui-table-main td{
white-space: pre-line!important;
}

@ -0,0 +1 @@
@import url(./admin.css);

@ -0,0 +1,382 @@
<template>
<lay-layout class="home-layout">
<lay-header>
<lay-container fluid="true" style="padding: 10px"></lay-container>
<div class="height20"></div>
<lay-row space="10">
<lay-col md="6">
<div class="home-box1">
<p class="icon">
<lay-icon type="layui-icon-note" size="26px"></lay-icon>
</p>
<p class="desc">
<label class="count">{{ topCount[0] }}</label>
<label>未完代办事项</label>
</p>
</div>
</lay-col>
<lay-col md="6">
<div class="home-box1">
<p class="icon c1">
<lay-icon type="layui-icon-form" size="26px"></lay-icon>
</p>
<p class="desc">
<label class="count">{{ topCount[1] }}</label>
<label>今日新增待办</label>
</p>
</div>
</lay-col>
<lay-col md="6">
<div class="home-box1">
<p class="icon c2">
<lay-icon type="layui-icon-slider" size="26px"></lay-icon>
</p>
<p class="desc">
<label class="count">{{ topCount[2] }}</label>
<label>协同路线</label>
</p>
</div>
</lay-col>
<lay-col md="6">
<div class="home-box1">
<p class="icon c3">
<lay-icon type="layui-icon-download-circle" size="26px"></lay-icon>
</p>
<p class="desc">
<label class="count">{{ topCount[3] }}</label>
<label>我参与的路线</label>
</p>
</div>
</lay-col>
</lay-row>
</lay-header>
<lay-header class="layui-header2">
<div class="height10"></div>
<div class="lay-row2">
<lay-row space="10">
<lay-col md="24">
<h1>快捷入口</h1>
</lay-col>
<lay-col md="3" v-for="(item,index) in fastList" :key="index" @click="_goToMore(index)">
<div :class="'home-box2 c'+index" :title="item.FName">{{item.FName}}</div>
</lay-col>
</lay-row>
</div>
</lay-header>
<lay-body>
<div class="lay-row3">
<div class="lay-row3-div" ref="lay-row3-div">
<div class="home-box3">
<h2 @click="_goToMore(-1)"></h2>
<h1>最新待办事项</h1>
</div>
<lay-table v-if="tableHeight!=''" :height="tableHeight" :columns="dataColumn"
:dataSource="dataList"></lay-table>
</div>
</div>
</lay-body>
</lay-layout>
</template>
<style>
.height20 {
height: 20px;
display: block;
}
.height10 {
height: 10px;
display: block;
}
.height30 {
height: 30px;
display: block;
}
.home-layout .layui-header {
text-align: center;
min-height: 148px;
height: auto;
background-color: unset;
overflow-x: hidden;
}
.home-layout .layui-header2 {
min-height: 194px;
}
.home-layout .layui-body {
display: flex;
align-items: center;
justify-content: center;
margin: 10px auto;
overflow-x: hidden;
}
.home-box1 {
width: 70%;
display: inline-block;
text-align: center;
line-height: 100px;
height: 100px;
border-radius: 4px;
overflow: hidden;
}
.home-box1 p {
display: inline-block;
height: 100px;
overflow: hidden;
position: relative;
border-radius: 4px 0 0 4px;
color: #fff;
}
.home-box1 .icon {
width: 40%;
background: #FD4D4F;
}
.home-box1 .icon.c1 {
background: #32BDB6;
}
.home-box1 .icon.c2 {
background: #AAEB0E;
}
.home-box1 .icon.c3 {
background: #597CF4;
}
.home-box1 .desc {
width: calc(60% - 2px);
background: #FFF;
color: #444;
padding: 20px 0;
height: 58px;
color: #595959;
border: 1px solid rgba(187, 187, 187, 100);
border-radius: 0 4px 4px 0;
}
.home-box1 .desc label {
display: block;
line-height: 28px;
}
.home-box1 .desc .count {
font-size: 24px;
}
.lay-row2 {
background: #fff;
width: 95%;
display: block;
overflow: hidden;
margin: 0 auto;
padding: 20px;
}
.lay-row2 h1 {
color: #101010;
font-weight: bold;
text-align: left;
margin-bottom: 5px;
}
.home-box2 {
height: 94px;
width: 110px;
display: block;
background: #000;
line-height: 94px;
border-radius: 4px;
cursor: pointer;
margin-bottom: 10px;
color: #fff;
font-size: 12px;
}
.home-box2.c0 {
background: #36cfca;
}
.home-box2.c1 {
background: #597cf4;
}
.home-box2.c2 {
background: #e99d42;
}
.home-box2.c3 {
background: #36cf3c;
}
.home-box2.c4 {
background: #F4595c;
}
.home-box2.c5 {
background: #31BDEC;
}
.home-box2.c6 {
background: #FF5722;
}
.home-box2.c7 {
background: #AAEB0E;
}
.lay-row3 {
background: #fff;
width: 95%;
display: block;
overflow: hidden;
margin: 0 auto;
padding: 0 20px 20px;
height: calc(100% - 40px);
}
.lay-row3-div {
display: block;
overflow: hidden;
margin-bottom: 20px;
clear: both;
height: 100%;
}
.lay-row3 .home-box3 {
height: 60px;
line-height: 60px;
margin-top: 4px;
}
.lay-row3 .home-box3 h1 {
font-weight: bold;
display: inline-block;
}
.lay-row3 .home-box3 h2 {
font-weight: 400;
color: #168ADD;
display: inline-block;
float: right;
font-size: 14px;
margin-right: 2px;
cursor: pointer;
}
</style>
<script>
import {
ref
} from "vue";
import {
getHomeTopCount,
getMenuList
} from "/src/api/api/user";
import {
getPageList
} from "/src/api/api/common";
import {
useRouter
} from "vue-router";
export default {
setup() {
let dataColumn = [{
title: "销售号",
key: "FSaleCode",
align: "center"
},
{
title: "发起时间",
key: "FAddDate",
align: "center",
width: "182px"
},
{
title: "当前流程",
key: "FName",
align: "center",
width: "200px"
},
{
title: "事项状态",
key: "FState",
align: "center",
width: "98px"
},
{
title: "任务来源",
key: "FDesc",
align: "center"
}
];
const dataList = ref([]);
const topCount = ref([" ", " ", " ", " "]);
const tableHeight = ref("");
const routerInfo = useRouter();
const fastList = ref([]);
return {
topCount,
dataColumn,
dataList,
tableHeight,
routerInfo,
fastList
}
},
mounted() {
this._getHomeTopCount();
let height = parseInt(this.$refs["lay-row3-div"].offsetHeight) - 100;
this.tableHeight = height + "px";
this._getHomeFast();
this._getHomeNeed(height / 40);
},
methods: {
async _getHomeTopCount() {
this.topCount = await getHomeTopCount() || [0, 0, 0, 0];
},
async _getHomeFast() {
let result = await getMenuList({});
let fastList = [];
result.forEach((first) => {
first.FChild.forEach((second) => {
if (second.FName.indexOf("全部") == -1 && second.FName.indexOf("管理") == -1) {
if (fastList.length < 8) fastList.push(second);
}
});
});
this.fastList = fastList;
},
async _getHomeNeed(count) {
let postData = {
FPageIndex: 1,
FPageSize: Math.floor(count)
}
postData.FPageSize = postData.FPageSize < 5 ? 5 : postData.FPageSize;
let result = await getPageList(postData, "Task");
result.Data.List = result.Data.List || [];
result.Data.List.forEach((item) => {
item.FAddDate = item.FAddDate == null ? "" : this.dateFormat(item.FAddDate);
item.FState = item.FState == 2 ? "已完成" : "进行中";
});
this.dataList = result.Data.List || []
},
//
dateFormat(dataStr) {
return dataStr.replace('T', ' ').split('.')[0];
},
//
_goToMore(index) {
let path = "";
if (index == -1) path = '/need/all';
else path = this.fastList[index].FRemark;
this.routerInfo.push(path);
}
}
}
</script>

@ -0,0 +1,339 @@
<template>
<lay-container fluid="true"
:style="'padding:10px;height:'+(dataInfoObj!=undefined?(dataInfoObj.FHeight+'px'):'auto')">
<lay-row space="10">
<lay-col span="24">
<lay-card>
<lay-form :model="searchObj" class="search-box">
<lay-row class="search-items">
<lay-form-item label="销售号" prop="FSaleCode">
<lay-input v-model="searchObj.FSaleCode"></lay-input>
</lay-form-item>
<lay-form-item label="当前流程" prop="FType">
<lay-select v-model="searchObj.FType">
<lay-select-option v-for="(tIdv,tIdx) in typeList" :key="tIdx" :value="tIdv.FValue"
:label="tIdv.FName"></lay-select-option>
</lay-select>
</lay-form-item>
<lay-form-item v-if="postData.FState!=99" label="事项状态" prop="FState">
<lay-select v-model="searchObj.FState">
<lay-select-option v-for="(tv,tx) in stateList" :key="tx" :value="tv.id"
:label="tv.name"></lay-select-option>
</lay-select>
</lay-form-item>
<lay-form-item label="发起日期" prop="FDateRange">
<lay-date-picker v-model="searchObj.FDateRange" range placeholder="type : date">
</lay-date-picker>
</lay-form-item>
</lay-row>
<lay-form-item class="search-btn">
<lay-button size="sm" type="primary" @click="_clickSearch"></lay-button>
<lay-button size="sm" @click="_clickReset"></lay-button>
</lay-form-item>
</lay-form>
<lay-table v-if="hasLoaded" :columns="dataColumn" id="id" :dataSource="dataList"
v-model:selectedKeys="selectedKeys" :checkbox="checkbox" :default-toolbar="defaultToolbar"
:page="dataList.length>0?pageInfo:null" @change="changePage">
<template v-slot:toolbar>
<lay-button size="sm" @click="_getPageList(false,true)"></lay-button>
</template>
<template v-slot:FStateName="{ data }">
<span v-if="data.FStateName=='已完成'" style="color:#5FB878">{{ data.FStateName }}</span>
<span v-else style="color:#1E9FFF">{{ data.FStateName }}</span>
</template>
<template v-if="dataInfoObj == undefined|| !dataInfoObj.FID" v-slot:operator="{ data }">
<lay-button size="xs" type="primary" @click="_clickSetInfo(data,1)"></lay-button>
</template>
</lay-table>
</lay-card>
</lay-col>
</lay-row>
<lay-layer :area="modelArea[1]" v-model="showEditBox[1]" :title="objInfoObj.FName">
<AddTerm v-if="showEditBox[1]" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></AddTerm>
</lay-layer>
<lay-layer :area="modelArea[2]" v-model="showEditBox[2]" :title="objInfoObj.FName">
<BOMDownload v-if="showEditBox[2]" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></BOMDownload>
</lay-layer>
<lay-layer :area="modelArea[3]" v-model="showEditBox[3]" :title="objInfoObj.FName">
<EditView v-if="showEditBox[3]" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></EditView>
</lay-layer>
<lay-layer :area="modelArea[4]" v-model="showEditBox[4]" :title="objInfoObj.FName">
<AddPackage v-if="showEditBox[4]" :data-info-obj="objInfoObj" @cancelClick="cancelClick"></AddPackage>
</lay-layer>
<lay-layer :area="modelArea[5]" v-model="showEditBox[5]" :title="objInfoObj.FName">
<EditGroup v-if="showEditBox[5]" :data-info-obj="objInfoObj" @cancelClick="cancelClick"></EditGroup>
</lay-layer>
<lay-layer :area="modelArea[6]" v-model="showEditBox[6]" :title="objInfoObj.FName">
<SureView v-if="showEditBox[6]" :data-info-obj="objInfoObj" @cancelClick="cancelClick"></SureView>
</lay-layer>
<lay-layer :area="modelArea[7]" v-model="showEditBox[7]" :title="objInfoObj.FName">
<SureTeam v-if="showEditBox[7]" :data-info-obj="objInfoObj" :objInfoObj="objInfoObj" @cancelClick="cancelClick"></SureTeam>
</lay-layer>
<lay-layer :area="modelArea[8]" v-model="showEditBox[8]" :title="objInfoObj.FName">
<SupplyPackage v-if="showEditBox[8]" :data-info-obj="objInfoObj" @cancelClick="cancelClick"></SupplyPackage>
</lay-layer>
</lay-container>
</template>
<script>
import {
ref,
watch
} from "vue";
import {
getBasicList,
getPageList
} from "/src/api/api/common";
import AddTerm from '../Team/components/AddTerm.vue';
import BOMDownload from "./components/BOMDownload.vue";
import EditView from "./components/EditView.vue";
import AddPackage from "./components/AddPackage.vue";
import SureView from "./components/SureView.vue";
import EditGroup from "./components/EditGroup.vue";
import SureTeam from "./components/SureTeam.vue";
import SupplyPackage from "./components/SupplyPackage.vue";
import '@layui/layui-vue/es/checkbox/index.css';
import '@layui/layui-vue/es/radio/index.css';
export default {
components: {
AddTerm,
BOMDownload,
EditView,
AddPackage,
SureView,
EditGroup,
SureTeam,
SupplyPackage
},
setup() {
let dataColumn = [{
title: "销售号",
key: "FSaleCode",
width: "300px",
align: 'center',
hide: false
},
{
title: "MDM编码",
key: "FMdmCode",
width: "160px",
align: 'center',
hide: false
},
{
title: "试验号",
key: "FTestCode",
width: "160px",
align: 'center',
hide: false
},
{
title: "任务来源",
key: "FDesc",
width: "400px",
align: 'center'
},
{
title: "当前流程",
key: "FName",
width: "180px",
align: 'center'
},
{
title: "发起时间",
key: "FAddDate",
width: "178px",
align: 'center'
},
{
title: "事项状态",
key: "FStateName",
width: "98px",
align: 'center',
customSlot: 'FStateName',
},
{
title: "负责人",
key: "FUserName",
width: "160px",
align: 'center'
},
{
title: "完成时间",
key: "FFinishDate",
width: "178px",
align: 'center',
hide: true
},
{
title: "操作",
key: "operator",
width: "100px",
fixed: "right",
customSlot: 'operator',
align: 'center'
}
];
const selectedKeys = ref(["1"]);
const checkbox = ref(false);
const defaultToolbar = ref(true);
const pageInfo = ref({
total: 0,
limit: 10,
current: 1
});
const dataList = ref([]);
const typeList = ref([]);
const searchObj = ref({});
const postData = ref({});
const showEditBox = ref([false, false, false, false, false, false, false, false, false, false, false, false]);
const modelArea = ref(["70%", "70%", "70%", "86%", "70%", "70%", "70%", "70%", "700px", "70%", "70%"]);
const objInfoObj = ref({});
const editType = ref(1);
const stateList = ref([{
id: 1,
name: "进行中"
}, {
id: 2,
name: "已完成"
}]);
const hasLoaded = ref(false);
return {
selectedKeys,
checkbox,
defaultToolbar,
dataColumn,
dataList,
pageInfo,
searchObj,
postData,
typeList,
showEditBox,
modelArea,
objInfoObj,
editType,
stateList,
hasLoaded
};
},
props: {
dataInfoObj: {
type: Object,
default: () => {},
},
pageTypeObj: {
type: Number,
default: () => 1,
}
},
mounted() {
if (this.dataInfoObj) {
this.dataColumn.pop();
this.dataColumn[0].hide = true;
this.dataColumn[1].hide = true;
this.dataColumn[2].hide = true;
this.dataColumn[7].hide = false;
}
this._getTypeList();
this._getPageList(true);
},
methods: {
changePage(obj) {
this.pageInfo.current = obj.current;
this.pageInfo.limit = obj.limit;
this._getPageList();
},
cancelClick(isRefresh, onlyRefresh) {
if (isRefresh) {
this._getPageList(true);
}
if (onlyRefresh) return false;
for (let i = 0; i < this.showEditBox.length; i++) {
this.showEditBox[i] = false;
}
},
async _getTypeList() {
this.typeList = await getBasicList(33) || [];
},
//
async _getPageList(isFirst, showOk) {
//this.dataList = [];
this.pageInfo.total = 0;
if (isFirst) {
this.pageInfo.current = 1;
this.pageInfo.total = 0;
}
if (this.dataInfoObj && this.dataInfoObj.FID) {
this.postData.FTeamID = this.dataInfoObj.FID;
this.postData.FIsUser = false;
}
if (this.pageTypeObj && this.pageTypeObj == 2) {
this.postData.FState = 99;
}
this.postData.FPageIndex = this.pageInfo.current;
this.postData.FPageSize = this.pageInfo.limit;
let result = await getPageList(this.postData, "Task");
result.Data.List = result.Data.List || [];
result.Data.List.forEach((item) => {
let type = this.typeList.find(s => s.FValue === item.FType);
item.FTypeName = type == null ? "" : type.FName;
let state = this.stateList.find(s => s.id === item.FState)
item.FStateName = state == null ? "" : state.name;
item.FAddDate = item.FAddDate == null ? "" : this.dateFormat(item.FAddDate);
item.FEditDate = item.FEditDate == null ? "" : this.dateFormat(item.FEditDate);
item.FFinishDate = item.FFinishDate == null ? "" : this.dateFormat(item.FFinishDate);
});
this.pageInfo.total = result.Data.Total || 0;
this.dataList = result.Data.List;
this.hasLoaded = true;
},
//
dateFormat(dataStr) {
return dataStr.replace('T', ' ').split('.')[0];
},
_clickSetInfo(data, type) {
for (let i = 0; i < this.showEditBox.length; i++) {
this.showEditBox[i] = false;
}
if (data.FType == 1) {
data.FBoxType = 1; //
} else if (data.FType == 2) {
data.FBoxType = 2; //BOM
} else if (data.FType == 9 || data.FType == 10) {
data.FBoxType = 4; //
} else if ((data.FType >= 3 && data.FType <= 7) || data.FType == 11) {
data.FBoxType = 3; //
} else if (data.FType == 8) {
data.FBoxType = 5; //
} else if (data.FType == 12) {
data.FBoxType = 6; //
} else if (data.FType == 13) {
data.FBoxType = 7; //
} else if (data.FType == 14) {
data.FBoxType = 8; //
} else {
return layer.msg("未知事项类型");
}
this.objInfoObj = data;
this.editType = type;
this.showEditBox[data.FBoxType] = true;
},
//-
_clickSearch() {
this.postData = {};
for (let key in this.searchObj) {
let val = this.searchObj[key];
if (val != null && val !== "") this.postData[key] = val;
}
this._getPageList(true);
},
//-
_clickReset() {
this.searchObj = {};
this._clickSearch();
}
}
}
</script>

@ -0,0 +1,382 @@
<template>
<lay-container style="height:700px;overflow: hidden;">
<view class="empty-small2">
<lay-button v-if="editDataInfo.FAddChild" size="sm" type="normal" @click="editChildData()">
</lay-button>
<div v-else style="margin-top:30px;"></div>
<lay-table class="table-box240" :columns="dataColumn" id="FID" :dataSource="dataList" height="250px">
<template v-if="dataInfoObj.FType!=10" v-slot:operator="{ data }">
<div v-if="dataList.length>0&&dataList[0].FID">
<lay-button size="xs" type="normal" @click="editChildData(data)"></lay-button>
</div>
<div v-else>
<lay-button size="xs" type="normal" @click="editChildData(data)"></lay-button>
<lay-button size="xs" type="danger" @click="_deleteChildData(data)"></lay-button>
</div>
</template>
<template v-else v-slot:operator="{ data }">
<lay-button v-if="data.FMaterialID<1" size="xs" type="danger" @click="_dockEdit(data)">MDM
</lay-button>
</template>
</lay-table>
</view>
<lay-form :model="editDataInfo" class="edit-info layui-item50 color999">
<lay-form-item label-width="140" label="系列" prop="FFactoryCode">
<lay-input v-model="editDataInfo.FFactoryCode"></lay-input>
</lay-form-item>
<lay-form-item label-width="140" label="包规代码" prop="FCode" required >
<lay-input v-model="editDataInfo.FCode" disabled="true"></lay-input>
</lay-form-item>
<lay-form-item label-width="140" label="标准BOM数量(KG)" prop="FBomUnit">
<lay-input v-model="editDataInfo.FBomUnit" dis></lay-input>
</lay-form-item>
<lay-form-item label-width="140" label="包装规格" prop="FSpecs">
<lay-input v-model="editDataInfo.FSpecs"></lay-input>
</lay-form-item>
<lay-form-item label-width="140" label="净重(KG)" prop="FNetWeight">
<lay-input v-model="editDataInfo.FNetWeight" @change="culGrossWeight()"></lay-input>
</lay-form-item>
<lay-form-item label-width="140" label="毛重(KG)" prop="FGrossWeight">
<lay-input v-model="editDataInfo.FGrossWeight" disabled="true"></lay-input>
</lay-form-item>
<lay-form-item label-width="140" label="外形尺寸(MM)" prop="FSize">
<lay-input v-model="editDataInfo.FSize" disabled="true"></lay-input>
</lay-form-item>
<lay-form-item label-width="140" label="体积(m³)" prop="FVolume">
<lay-input v-model="editDataInfo.FVolume" disabled="true"></lay-input>
</lay-form-item>
<lay-form-item label-width="140" label="备注" prop="FCode">
<lay-input v-model="editDataInfo.FRemark" dis></lay-input>
</lay-form-item>
</lay-form>
<view class="menuBtn" v-if="dataInfoObj.FCanEdit==1&&dataInfoObj.FType!=10">
<lay-button type="danger" @click="submitClick"></lay-button>
<lay-button @click="this.$emit('cancelClick')"></lay-button>
</view>
<div class="float-clear"></div>
<lay-layer area="800px" v-model="showEditBox" :title="(itemInfoObj.FID?'查看':'新增')+'子项'">
<PackageItem :dataInfoObj="itemInfoObj" :taskInfoObj="dataInfoObj" @submitClick="editChildSubmit"
@cancelClick="cancelClick"></PackageItem>
</lay-layer>
</lay-container>
</template>
<style scoped>
.edit-info {
margin: 0 28px;
display: block;
display: block;
clear: both;
float: none;
overflow: auto;
height: 290px;
}
.float-clear {
overflow: hidden;
display: block;
clear: both;
float: none;
height: 0;
}
.menuBtn {
display: block;
text-align: center;
width: 96%;
margin: 10px auto;
}
.empty-small2 {
max-width: 96%;
margin: 20px auto;
display: block;
}
.empty-small2>.layui-btn {
margin-bottom: 16px;
}
.note {
color: #999;
font-size: 12px;
margin: 12px auto 2px;
text-align: right;
}
</style>
<script>
import {
ref,
reactive
} from 'vue';
import {
getFactoryList
} from "/src/api/api/factory";
import {
getPackageInfo,
updatePackageData,
dockMDMCode
} from "/src/api/api/package";
import PackageItem from "./PackageItem.vue";
export default {
components: {
PackageItem
},
setup() {
let dataColumn = [{
type: "number",
width: "40px"
}, {
title: "子项代码",
key: "FCode",
width: "170px"
}, {
title: "名称",
key: "FName",
},
{
title: "包材外形尺寸(长*宽*高)(mm)",
key: "FOutSize"
},
{
title: "包材重量(kg)",
key: "FWeight",
width: "130px"
},
{
title: "数量",
key: "FCount",
width: "100px"
},
{
title: "单位",
key: "FUnit",
width: "100px"
},
{
title: "操作",
key: "operator",
width: "140px",
customSlot: 'operator'
}
];
dataColumn.forEach((item) => {
item.align = "center";
});
const dataList = ref([]);
const editDataInfo = ref({});
const factoryList = ref([]);
const showEditBox = ref(false);
const itemInfoObj = ref({});
const isNewItem = ref(false);
return {
editDataInfo,
dataColumn,
dataList,
factoryList,
showEditBox,
itemInfoObj,
isNewItem
}
},
props: {
dataInfoObj: {
type: Object,
default: () => {},
}
},
mounted() {
if (this.dataInfoObj.FState == 2 && this.dataInfoObj.FCanEdit == 2) {
let operator = this.dataColumn.find(s => s.key == "operator");
if (operator != null) this.dataColumn.pop();
}
//this._getFactoryList();
this._getPackageInfo();
},
methods: {
async _getFactoryList() {
let _list = await getFactoryList();
this.factoryList = _list.map(item => {
return {
'label': item.FName,
"value": item.FID,
"code": item.FCode
};
});
},
async _getPackageInfo() {
let result = await getPackageInfo(this.dataInfoObj) || {};
this.editDataInfo = result.Main || {};
this.editDataInfo.FCode = this.editDataInfo.FCode || result.FCode || "";
this.editDataInfo.FTeamID = this.dataInfoObj.FTeamID;
this.dataList = result.List || [];
this.editDataInfo.FAddChild = this.dataInfoObj.FState == 1 && this.dataInfoObj.FCanEdit == 1 && this
.dataInfoObj.FType != 10 && !(this.dataList.length > 0 && this.dataList[0].FID)
},
editChildData(itemData) {
this.isNewItem = itemData === undefined;
this.itemInfoObj = itemData || {};
this.showEditBox = true;
},
editChildSubmit(itemInfo) {
if (this.isNewItem) {
this.dataList.push(itemInfo);
} else {
Object.assign(this.itemInfoObj, itemInfo);
}
//
if (itemInfo.FIsPackageSize == 1) {
//
this.dataList.forEach(d => {
d.FIsPackageSize = 0;
});
//
if (this.isMathExpression(itemInfo.FOutSize)) {
//
this.editDataInfo.FSize = itemInfo.FOutSize;
//
var volume = eval(itemInfo.FOutSize) / 1000000000;
this.editDataInfo.FVolume = volume.toString();
}
}
//
this.culGrossWeight();
this.showEditBox = false;
},
cancelClick(isRefresh) {
this.showEditBox = false;
if (isRefresh) {
this._getPackageInfo();
}
},
_deleteChildData(data) {
let $this = this;
layer.confirm("子项新视图也会删除,你确定要删除此子项吗?", {
title: "提示",
btn: [{
text: '确定',
callback: function(id) {
layer.close(id);
$this.dataList.splice($this.dataList.indexOf(data), 1);
//
$this.culGrossWeight();
}
},
{
text: '取消',
callback: function(id) {
layer.close(id);
}
}
]
});
},
async submitClick() {
let idx = layer.load(2);
this.editDataInfo.FTeamID = this.dataInfoObj.FTeamID;
let postData = JSON.parse(JSON.stringify(this.editDataInfo));
delete postData["FAddDate"];
delete postData["FEditDate"];
delete postData["FDeleted"];
// let factory = this.factoryList.find(s => s.value == postData.FFactoryID)
// postData.FFactoryCode = factory != null ? factory.FCode : "";
postData.FChild = JSON.stringify(this.dataList);
postData.FTaskID = this.dataInfoObj.FID;
let result = await updatePackageData(postData) || -1;
if (result > 0) this.$emit('cancelClick', true);
layer.close(idx);
},
//
_dockEdit(data) {
data.FIsMdm = true;
this.isNewItem = false;
this.itemInfoObj = data;
this.showEditBox = true;
},
async _dockData(data) {
let postData = JSON.parse(JSON.stringify(this.editDataInfo));
if (data != undefined) {
postData.FList = [data];
} else {
postData.FList = this.dataList.filter(s => s.FMaterialID < 0) || [];
}
if (postData.FList.length <= 0) {
return layer.msg('没用需要提交到MDM的子项信息')
}
let idx = layer.load(2);
postData.FList = JSON.stringify(postData.FList);
postData.FTeamID = this.dataInfoObj.FTeamID;
let result = await dockMDMCode(postData);
this._getPackageInfo();
layer.close(idx);
},
//
culGrossWeight() {
//
var grossWeight = 0;
console.log('this.dataList.length', this.dataList.length);
if (this.dataList.length > 0) {
this.dataList.forEach(d => {
var weight = parseFloat(d.FWeight);
if (!isNaN(weight)) {
grossWeight = grossWeight + weight;
}
});
}
// +
var netWeight = parseFloat(this.editDataInfo.FNetWeight)
if (!isNaN(netWeight)) {
grossWeight = grossWeight + netWeight;
}
this.editDataInfo.FGrossWeight = grossWeight.toString();
},
//
isMathExpression(str) {
const regex = /^[\d\+\-\*\/\(\)\.]+$/; //
if (!regex.test(str)) {
return false; //
}
//
let leftBracketCount = 0;
let rightBracketCount = 0;
for (let i = 0; i < str.length; i++) {
if (str[i] === "(") {
leftBracketCount++;
} else if (str[i] === ")") {
rightBracketCount++;
}
}
if (leftBracketCount !== rightBracketCount) {
return false; //
}
// 使
const operators = "+-*/";
for (let i = 0; i < str.length; i++) {
if (operators.includes(str[i])) {
//
if (
(i === 0 || !/\d|\)/.test(str[i - 1])) ||
(i === str.length - 1 || !/\d|\(|/.test(str[i + 1]))
) {
return false; //
}
}
}
//
return true;
}
}
}
</script>

@ -0,0 +1,95 @@
<template>
<lay-container>
<div class="info">
<h3 class="title">新销售号{{dataInfoObj.FSaleCode}}</h3>
<h3 class="title">配方选择{{dataInfoObj.FFormulaName}}</h3>
<h3 class="title">任务来源{{dataInfoObj.FDesc}}</h3>
<lay-button v-if="dataInfoObj.FCanEdit!=2" type="primary" style="margin-top: 20px" :disabled="isDisabled"
@click="_downloadBOM">下载BOM清单</lay-button>
</div>
<OperateLog v-if="editDataInfo.FTeamID" ref="OperateLog" :dataInfoObj="editDataInfo"></OperateLog>
</lay-container>
</template>
<style scoped>
.info {
width: 100%;
text-align: center;
margin: 40px auto 0;
}
.title {
font-weight: bold;
margin-top: 10px;
}
.empty-small2 {
margin: 0 auto 20px;
display: block;
}
</style>
<script>
import {
ref
} from 'vue';
import {
getPageList
} from "/src/api/api/common";
import {
downloadBOM
} from "/src/api/api/teamwork";
import OperateLog from "./OperateLog.vue";
export default {
components: {
OperateLog
},
setup() {
const editDataInfo = ref({});
const isDisabled = ref(false);
return {
editDataInfo,
isDisabled
}
},
props: {
dataInfoObj: {
type: Object,
default: () => {},
}
},
mounted() {
this.editDataInfo = JSON.parse(JSON.stringify(this.dataInfoObj));
console.log(this.editDataInfo)
},
methods: {
cancelClick(isRefresh) {
this.$emit('cancelClick', isRefresh !== undefined ? isRefresh : false);
},
//
dateFormat(dataStr) {
return dataStr.replace('T', ' ').split('.')[0];
},
async _downloadBOM() {
let layerId = layer.load(3);
let result = await downloadBOM(this.dataInfoObj.FTeamID);
layer.close(layerId);
if (result['Code'] === 200) {
if (result['Data'] > 0) {
layer.msg('下载成功', {
icon: 1,
time: 3000
});
this.isDisabled = true;
this.cancelClick(true)
} else {
layer.msg('BOM下载失败请稍后重试', {
icon: 2,
time: 3000
});
this.$refs.OperateLog._getPageList();
}
}
}
}
}
</script>

@ -0,0 +1,137 @@
<template>
<lay-container fluid="true" class="content-box">
<lay-table v-if="dataList.length>0" height="300px" :columns="dataColumn" :data-source="dataList"
:row-style="rowStyle">
<template v-slot:toolbar v-if="dataObj&&dataObj.FState!=2">
<lay-button size="sm" @click="_getGroup" type="danger">获取组编号</lay-button>
</template>
</lay-table>
<OperateLog v-if="dataInfoObj.FTeamID" ref="OperateLog" :dataInfoObj="dataInfoObj"></OperateLog>
</lay-container>
</template>
<style scoped>
.content-box {
margin: 30px 10px;
display: block;
position: relative;
clear: both;
float: none;
height: 664px;
}
</style>
<script>
import {
ref
} from 'vue';
import {
getTeamworkView
} from "/src/api/api/teamwork";
import {
dockMaterialGroup
} from "/src/api/api/task";
import OperateLog from "./OperateLog.vue";
export default {
components: {
OperateLog
},
setup() {
const dataColumn = ref([]);
const dataList = ref([]);
const dataObj = ref({});
const dataColor = ref([]);
let colors = ["1E9FFF", "009688", "393D49", "5FB878"];
const rowStyle = function(row, rowIndex) {
let color = "";
for (let idx = 0; idx < dataColor.value.length; idx++) {
if (rowIndex > dataColor.value[idx]) color = "color:#" + colors[idx];
}
return color;
}
return {
dataColumn,
dataList,
dataColor,
rowStyle,
dataObj
}
},
props: {
dataInfoObj: {
type: Object,
default: () => [],
}
},
mounted() {
this.dataObj = JSON.parse(JSON.stringify(this.dataInfoObj));
console.log(this.dataObj)
this.getViewList();
},
methods: {
async getViewList() {
let postData = {
FTeamID: this.dataObj.FTeamID,
FViewType: 4,
FType: "1"
};
if (this.dataObj.FState == 2) postData.FFinish = 1;
let idx = layer.load(2);
let result = await getTeamworkView(postData);
let tempList = [];
for (let key in result) {
if (tempList.length == 0) tempList.push(result[key]);
};
let dataColumn = [];
let dataList = [];
let dataColor = []
tempList.forEach((item) => {
if (item.length > 0) {
if (dataColumn.length == 0) {
for (let key in item[0]) {
let width = (key.indexOf("描述") != -1 || key == "文本" || key == "物料") ? "280px" :
"130px";
width = key.indexOf("编码") != -1 ? "200px" : width;
dataColumn.push({
key: key,
title: key.split('.').pop(),
align: "center",
width: width
});
}
}
item.forEach((item2) => {
dataList.push(item2);
});
dataColor.push(dataList.length - 1);
}
});
this.dataColumn = dataColumn;
this.dataList = dataList;
this.dataColor = dataColor;
layer.close(idx);
},
async _getGroup() {
let idx = layer.load(2);
try {
let result = await dockMaterialGroup({
FTeamID: this.dataObj.FTeamID
});
if (result > 0) {
layer.msg('获取组编号成功');
this.getViewList();
this.dataObj.FState = 2;
} else {
layer.msg('获取组编号失败');
}
} catch (e) {}
layer.close(idx);
this.$refs.OperateLog._getPageList();
},
cancelClick(isRefresh) {
isRefresh = isRefresh == undefined ? false : isRefresh;
this.$emit('cancelClick', isRefresh);
}
}
}
</script>

@ -0,0 +1,350 @@
<template>
<lay-container fluid="true" class="content-box">
<lay-table class="row-select" v-if="dataColumn.length>0" height="320px" :columns="dataColumn"
:data-source="dataList" :cellStyle="cellStyle" :cellClassName="cellClassName">
<template v-slot:toolbar v-if="dataInfoObj.FCanEdit!=2">
<lay-button size="sm" @click="saveBatch" type="primary" :disabled="editColumn.length===0">保存
</lay-button>
<!-- <lay-button size="sm" type="primary" :class="this.isBomShow ? 'isBomShow' : 'isBomHidden'" @click="changeVisible2">BOM</lay-button>-->
<lay-input :class="this.isShow ? 'isShow' : 'isHidden'" v-model="inputCodeValue" :readonly="true">
<template #prepend>半成品编号</template>
</lay-input>
<lay-input :class="this.isShow ? 'isShow' : 'isHidden'" v-model="inputDescValue" :readonly="true">
<template #prepend>描述</template>
</lay-input>
</template>
<template v-for="item in editColumn" v-slot:[item.key]="{ data }">
<lay-select v-if="item.key=='FTypeID1'" size="sm" v-model="data['FTypeID1']"
@change="_changeType(data,1)" :showEmpty="false">
<lay-select-option v-for="(tIdv,tIdx) in typeList[0]" :key="tIdx" :value="tIdv.FID"
:label="tIdv.FName"></lay-select-option>
</lay-select>
<lay-select v-else-if="item.key=='FTypeID2'" size="sm" v-model="data['FTypeID2']"
@change="_changeType(data,2)" :showEmpty="false">
<lay-select-option v-show="data.FTypeID1==tIdv.FParentID" v-for="(tIdv,tIdx) in typeList[1]"
:key="tIdx" :value="tIdv.FID" :label="tIdv.FName"></lay-select-option>
</lay-select>
<lay-select v-else-if="item.selectType" size="sm" v-model="data[item.key]" :showEmpty="false">
<lay-select-option v-for="(tIdv,tIdx) in selectDataMap['FType'+item.selectTypeId]" :key="tIdx"
:value="tIdv.FValue" :label="tIdv.FName"></lay-select-option>
</lay-select>
<lay-input v-else-if="!item.dataType" size="sm" v-model="data[item.key]"></lay-input>
</template>
</lay-table>
<OperateLog v-if="dataInfoObj.FTeamID" ref="OperateLog" :dataInfoObj="dataInfoObj"></OperateLog>
<!-- <lay-layer title="标题" :move="false" v-model="visible2">-->
<!-- 内容-->
<!-- </lay-layer>-->
</lay-container>
</template>
<style scoped>
.content-box {
margin: 30px 10px;
display: block;
position: relative;
clear: both;
float: none;
min-height: 740px;
}
.row-select td {
overflow: inherit;
}
.layui-select {
width: 100%;
}
.edit {
color: green;
}
:deep(.edit-item .layui-input) {
border-color: #5FB878 !important;
}
:deep(.edit-item .layui-input:hover) {
border-color: #009688 !important;
color: #009688;
}
.isShow{
width: 370px;
height:30px;
border: none;
}
.isHidden{
display: none;
}
.isBomShow{
}
.isBomHidden{
display: none;
}
</style>
<script>
import {
ref
} from 'vue';
import {
getListByTeamId,
updateBatchById2
} from "/src/api/api/view";
import {
getBasicRoleList
} from "/src/api/api/user";
import {
getDataCode,
commonSave
} from "/src/api/api/common";
import {
getInfoData,
changeInfoData
} from "/src/api/api/materialType";
import OperateLog from "./OperateLog.vue";
export default {
components: {
OperateLog
},
setup() {
const dataColumn = ref([]);
const dataList = ref([]);
const editColumn = ref([]);
const selectDataMap = ref(null);
const typeList = ref([
[],
[]
]);
const userPower = ref([
[],
[]
]);
const cellStyle = function(row, column, rowIndex, columnIndex) {
let back = column.table == "TFS_ViewMaterial" ? "background:rgb(246, 246, 246) !important;" : ""
return back;
}
const cellClassName = function(row, column, rowIndex, columnIndex) {
return column.cellClass || "";
}
const inputCodeValue = ref("");
const inputDescValue = ref("");
const visible2 = ref(false)
const changeVisible2 = function() {
visible2.value = !visible2.value
}
return {
dataColumn,
dataList,
editColumn,
selectDataMap,
typeList,
userPower,
cellStyle,
cellClassName,
inputCodeValue,
inputDescValue,
isShow: false,
isBomShow :false,
visible2,
changeVisible2
};
},
props: {
dataInfoObj: {
type: Object,
default: () => {},
},
viewDataList: {
type: Object,
default: () => [],
}
},
mounted() {
this.getUserPower();
},
methods: {
async getUserPower() {
if (this.dataInfoObj.FCanEdit != 2) {
this.userPower[0] = (await getBasicRoleList({
FRoleType: 40,
FViewType: this.dataInfoObj.FViewType
}) || []).map(it => parseInt(it.F2))
this.userPower[1] = (await getBasicRoleList({
FRoleType: 44,
FViewType: this.dataInfoObj.FViewType
}) || []).map(it => parseInt(it.F2))
}
this.initPage(layer.load(2));
},
async initPage(idx) {
let _data = await getListByTeamId({
teamId: this.dataInfoObj.FTeamID,
viewType: this.dataInfoObj.FViewType
});
if(this.dataInfoObj.FViewType == 1){
this.inputCodeValue = _data.rows[0].HalfCode;
this.inputDescValue = _data.rows[0].HalfDesc;
this.isShow = true;
}else if(this.dataInfoObj.FViewType == 2 || this.dataInfoObj.FViewType == 3 || this.dataInfoObj.FViewType == 4){
this.isBomShow = true;
}
this.typeList[0] = _data.types.filter(s => s.FDepth == 1) || [];
this.typeList[1] = _data.types.filter(s => s.FDepth != 1) || [];
let dataColumn = _data.columns || [];
let editColumn = dataColumn.filter(it => {
let b = false;
if (this.dataInfoObj.FCanEdit != 2) {
if (it.fieldType == 7) b = this.userPower[1].indexOf(it.id) >= 0;
else b = this.userPower[0].indexOf(it.id) >= 0;
if (b) {
it.customSlot = it.key;
it.cellClass = "edit-item"
}
}
return b;
});
if (editColumn.length > 0) {
if (this.selectDataMap == null) {
let dataTypeIds = editColumn.filter(it => {
it.selectType = it.dataType.startsWith('select:');
if (it.selectType) {
it.selectTypeId = it.dataType.substring(7)
}
return it.selectType;
}).map(it => it.selectTypeId);
if (dataTypeIds.length > 0) {
this.selectDataMap = await getDataCode({
FType: dataTypeIds.join(",")
});
}
}
// //
// if (this.dataInfoObj.FCanEdit != 2) {
// let tempColumn1 = dataColumn.filter(s => s.customSlot) || [];
// let tempColumn2 = dataColumn.filter(s => s.customSlot == undefined) || [];
// dataColumn = [...tempColumn1, ...tempColumn2];
// }
}
let col7 = dataColumn.filter(s => s.fieldType == 7) || [];
_data.rows.forEach((item) => {
let k3Code = item.FBaseMaterialDesc;
if(k3Code.indexOf("@") > 0){
item.FK3Code = k3Code.substr(0, k3Code.indexOf("@"));
item.FK3Name = k3Code.substr(k3Code.indexOf("@") +1);
}else{
item.FK3Code = "";
item.FK3Name = "";
}
if(k3Code.lastIndexOf(".") > 0){
item.FK3ShortCode = item.FK3Code.substr(item.FK3Code.lastIndexOf(".")+1);
}else{
item.FK3ShortCode = "";
}
let info = _data.infos.find(s => s.FDataID == item.FMaterialID) || null;
if (info != null) {
col7.forEach((col) => {
item[col.key] = info[col.key] || item[col.key] || "";
});
}
item.FTypeID1 = (item.FTypeID1 == 0 || item.FTypeID1 == -1) ? "" : item.FTypeID1;
item.FTypeID2 = (item.FTypeID2 == 0 || item.FTypeID2 == -1) ? "" : item.FTypeID2;
});
let saveId = this.dataInfoObj.FViewType + "_" + this.dataInfoObj.FID;
localStorage.setItem('EditView' + saveId, JSON.stringify(_data.rows));
this.editColumn = editColumn;
this.dataList = _data.rows;
this.dataColumn = dataColumn;
setTimeout(function() {
layer.close(idx);
}, 500);
},
cancelClick(isRefresh) {
isRefresh = isRefresh == undefined ? false : isRefresh;
this.$emit('cancelClick', isRefresh);
},
async _changeType(data, type) {
if (type == 1) {
data.FTypeID2 = -1;
} else {
if (data.FTypeID2) {
let result = await getInfoData({
"FDataID": data.FTypeID2,
"FType": 1
}) || null;
if (result != null && result.FID) {
let col7 = this.dataColumn.filter(s => s.fieldType == 7) || [];
col7.forEach((item) => {
if (item.table == "TFS_MaterialInfo") {
data[item.key] = result[item.key] || data[item.key] || "";
}
});
}
}
}
},
async saveBatch() {
let idx = layer.load(2);
let updateObj = {
LogList: [],
FTeamID: this.dataInfoObj['FTeamID'],
FViewType: this.dataInfoObj.FViewType
};
let saveId = this.dataInfoObj.FViewType + "_" + this.dataInfoObj.FID;
let cacheDataList = JSON.parse(localStorage.getItem('EditView' + saveId));
this.dataList.forEach((row, index) => {
let cache = cacheDataList[index];
let dataObj = {};
for (let col of this.editColumn) {
let valTemp = row[col.key];
if (valTemp != cache[col.key]) {
if (!dataObj[col.table]) {
dataObj[col.table] = {};
dataObj[col.table].FMaterialID = row["FMaterialID"];
}
dataObj[col.table][col.key] = valTemp;
if (col.key == "FTypeID1" || col.key == "FTypeID2") {
let temps = this.typeList[col.key == "FTypeID1" ? 0 : 1] || [];
let temp = temps.find(s => s.FID == valTemp) || null;
valTemp = temp == null ? "" : temp.FName;
}
updateObj.LogList.push(col.title + "" + (valTemp == "" ? "删除" : valTemp));
}
}
for (let key in dataObj) {
if (!updateObj[key]) updateObj[key] = [];
updateObj[key].push(dataObj[key]);
}
});
let updateLog = updateObj.LogList.join("、");
if (updateLog != "") {
delete updateObj.LogList
//
let _result = await updateBatchById2(updateObj);
if (_result.Code === 200) {
await commonSave({
teamId: updateObj.FTeamID,
type: this.dataInfoObj['FType'],
desc: updateLog
}, "OperateLog");
let $this = this;
//$this.initPage();
localStorage.setItem('EditView' + saveId, JSON.stringify(this.dataList));
setTimeout(function() {
layer.close(idx);
layer.msg('保存成功');
$this.$emit('cancelClick', true, true);
$this.$refs.OperateLog._getPageList();
}, 500);
}
} else {
layer.close(idx);
layer.msg('您没有做任何更改')
}
}
}
}
</script>

@ -0,0 +1,160 @@
<template>
<lay-container fluid="true" style="padding:10px;">
<lay-row space="10">
<lay-col span="24">
<lay-card>
<lay-form :model="searchObj" class="search-box">
<lay-row class="search-items">
<lay-form-item label="物料号" prop="FCode">
<lay-input v-model="searchObj.FCode"></lay-input>
</lay-form-item>
<lay-form-item label="试验号" prop="FTestCode">
<lay-input v-model="searchObj.FTestCode"></lay-input>
</lay-form-item>
<lay-form-item label="物料描述" prop="FName">
<lay-input v-model="searchObj.FName"></lay-input>
</lay-form-item>
</lay-row>
<lay-form-item class="search-btn">
<lay-button size="sm" type="primary" @click="_clickSearch"></lay-button>
<lay-button size="sm" @click="_clickReset"></lay-button>
</lay-form-item>
</lay-form>
<lay-table :columns="dataColumn" id="id" :dataSource="dataList"
:page="dataList.length>0?pageInfo:null" @change="changePage">
<template v-slot:operator="{ data }">
<lay-button v-if="dataInfoObj.FName==data.FName" size="xs" type="danger"
@click="_choseData(data)">已选</lay-button>
<lay-button v-else size="xs" type="normal" @click="_choseData(data)"></lay-button>
</template>
</lay-table>
</lay-card>
</lay-col>
</lay-row>
</lay-container>
</template>
<script>
import {
ref,
watch
} from "vue";
import {
getPageList
} from "/src/api/api/common";
import '@layui/layui-vue/es/checkbox/index.css';
import '@layui/layui-vue/es/radio/index.css';
export default {
setup() {
let dataColumn = [{
title: "物料号",
key: "FCode",
align: 'center'
},
{
title: "试验号",
key: "FTestCode",
align: 'center'
},
{
title: "物料描述",
key: "FName",
align: 'center'
},
{
title: "操作",
key: "operator",
width: "100px",
customSlot: 'operator',
align: 'center'
}
];
const pageInfo = ref({
total: 0,
limit: 10,
current: 1
});
const dataList = ref([]);
const searchObj = ref({});
const postData = ref({});
const objInfoObj = ref({});
return {
dataColumn,
dataList,
pageInfo,
searchObj,
postData,
objInfoObj,
};
},
props: {
dataInfoObj: {
type: Object,
default: () => {},
}
},
mounted() {
this._getPageList(true);
},
methods: {
changePage(obj) {
this.pageInfo.current = obj.current;
this._getPageList();
},
//
async _getPageList(isFirst, showOk) {
this.pageInfo.total = 0;
if (isFirst) {
this.pageInfo.current = 1;
this.pageInfo.total = 0;
}
this.postData.FPageIndex = this.pageInfo.current;
this.postData.FPageSize = this.pageInfo.limit;
this.postData.FType = 40;
let result = await getPageList(this.postData, "Material");
result.Data.List = result.Data.List || [];
this.pageInfo.total = result.Data.Total || 0;
this.dataList = result.Data.List;
},
//
dateFormat(dataStr) {
return dataStr.replace('T', ' ').split('.')[0];
},
_choseData(data) {
let $this = this;
layer.confirm("您确定要选择此子项吗?", {
title: "提示",
btn: [{
text: '确定',
callback: function(id) {
layer.close(id);
$this.$emit('selectClick', data)
}
},
{
text: '取消',
callback: function(id) {
layer.close(id);
}
}
]
});
},
//-
_clickSearch() {
this.postData = {};
for (let key in this.searchObj) {
let val = this.searchObj[key];
if (val != null && val !== "") this.postData[key] = val;
}
this._getPageList(true);
},
//-
_clickReset() {
this.searchObj = {};
this._clickSearch();
}
}
}
</script>

@ -0,0 +1,85 @@
<template>
<lay-table class="empty-small2 empty-small3" style="margin:30px 0;" height="200px" :columns="dataColumn" id="FID"
:dataSource="dataList">
<template v-slot:toolbar>
<p style="float:right;">操作日志</p>
<lay-button size="sm" @click="_getPageList()"></lay-button>
</template>
</lay-table>
</template>
<script>
import {
ref
} from 'vue';
import {
getPageList
} from "/src/api/api/common";
export default {
setup() {
let dataColumn = [{
title: "序号",
key: "RowIndex",
width: "80px"
},
{
title: "操作时间",
key: "FAddDate",
width: "200px"
},
{
title: "操作人",
key: "FOptUser",
width: "180px",
align: 'center'
},
{
title: "说明",
key: "FDesc"
}
];
dataColumn.forEach((item) => {
item.align = "center";
});
const dataList = ref([]);
return {
dataColumn,
dataList
}
},
props: {
dataInfoObj: {
type: Object,
default: () => {},
}
},
mounted() {
setTimeout((item) => {
this._getPageList();
}, 100);
},
methods: {
cancelClick(isRefresh) {
this.$emit('cancelClick', isRefresh !== undefined ? isRefresh : false);
},
//
dateFormat(dataStr) {
return dataStr.replace('T', ' ').split('.')[0];
},
async _getPageList() {
if (this.dataInfoObj.FTeamID) {
let postObj = {
FTeamID: this.dataInfoObj.FTeamID,
FType: this.dataInfoObj.FType,
FPageSize: 99999
};
let result = await getPageList(postObj, 'OperateLog');
this.dataList = result.Data.List || [];
this.dataList.forEach(item => {
item.FAddDate = item.FAddDate == null ? "" : this.dateFormat(item.FAddDate);
});
}
}
}
}
</script>

@ -0,0 +1,198 @@
<template>
<lay-container :style="'height:'+(taskInfoObj.FType==10?'420':'366')+'px'">
<lay-form :model="editDataInfo" class="edit-info color999" :initValidate="false">
<lay-form-item label="物料描述" prop="FName" required :initValidate="false">
<lay-input v-model="editDataInfo.FName" style="width:calc(100% - 76px);margin-right:10px" disabled="true"></lay-input>
<lay-button :disabled="editDataInfo&&editDataInfo.FIsMdm" type="normal" @click="selectMaterial">
</lay-button>
</lay-form-item>
<lay-form-item label="物料编号" prop="FCode" required :initValidate="false">
<lay-input v-model="editDataInfo.FCode" style="width:calc(100% - 76px);margin-right:10px" disabled="true"></lay-input>
</lay-form-item>
<lay-form-item v-if="taskInfoObj.FType==10||editDataInfo.FID" label="物料组" prop="FGroup">
<lay-select v-model="editDataInfo.FGroup" v-if="seletList[1].length>0">
<lay-select-option v-for="(rV,rI) in seletList[1]" key="rI" :value="rV.FValue+''" :label="rV.FName">
</lay-select-option>
</lay-select>
</lay-form-item>
<lay-form-item label="单位" prop="FUnit" required>
<lay-select v-model="editDataInfo.FUnit" v-if="seletList[0].length>0">
<lay-select-option v-for="(rV,rI) in seletList[0]" key="rI" :value="rV.FValue+''"
:label="rV.FValue">
</lay-select-option>
</lay-select>
<p class="note3" v-if="editDataInfo.FUnit&&seletList[0].find(s=>s.FValue==editDataInfo.FUnit)!=null">
{{ seletList[0].find(s=>s.FValue==editDataInfo.FUnit).FName }}
</p>
</lay-form-item>
<lay-form-item label="包规对应尺寸" prop="FIsPackageSize">
<lay-radio v-model="editDataInfo.FIsPackageSize" name="FIsPackageSize" :value="1"></lay-radio>
<lay-radio v-model="editDataInfo.FIsPackageSize" name="FIsPackageSize" :value="0"></lay-radio>
</lay-form-item>
<lay-form-item label="包材外形尺寸" prop="FOutSize">
<lay-input v-model="editDataInfo.FOutSize" placeholder="长*宽*高(mm)"></lay-input>
</lay-form-item>
<lay-form-item label="包材重量(kg)" prop="FWeight">
<lay-input v-model="editDataInfo.FWeight"></lay-input>
</lay-form-item>
<lay-form-item label="数量" prop="FCount">
<lay-input v-model="editDataInfo.FCount"></lay-input>
</lay-form-item>
</lay-form>
<view class="menuBtn" v-show="taskInfoObj.FType==10||!editDataInfo.FID">
<lay-button type="danger" @click="submitClick"></lay-button>
<lay-button @click="$emit('cancelClick')"></lay-button>
</view>
<lay-layer :area="['70%','80%']" v-model="showEditBox" title="选择包材">
<MaterialSelect :dataInfoObj="editDataInfo" @selectClick="selectClick" @cancelClick="showEditBox=false">
</MaterialSelect>
</lay-layer>
</lay-container>
</template>
<style scoped>
.edit-info {
width: 90%;
padding-right: 30px;
margin: 30px auto 10px;
}
.menuBtn {
display: block;
text-align: center;
width: 96%;
margin: 20px auto;
}
.empty-small2 {
max-width: 96%;
margin: 0 auto;
}
.empty-small2>.layui-btn {
margin-bottom: 16px;
}
.note {
color: #999;
font-size: 12px;
margin: 12px auto 2px;
text-align: right;
}
</style>
<script>
import {
ref,
reactive
} from 'vue';
import {
dockMDMCode
} from "/src/api/api/package";
import {
getPageList,
getDataCode
} from "/src/api/api/common";
import MaterialSelect from "./MaterialSelect.vue";
export default {
components: {
MaterialSelect
},
setup() {
const editDataInfo = ref({});
const showEditBox = ref(false);
const initValidate = ref(false);
return {
editDataInfo,
showEditBox,
initValidate,
seletList: ref([
[],
[]
])
}
},
props: {
dataInfoObj: {
type: Object,
default: () => {},
},
taskInfoObj: {
type: Object,
default: () => {},
}
},
mounted() {
this._getTypeList();
if (this.dataInfoObj) {
this.editDataInfo = JSON.parse(JSON.stringify(this.dataInfoObj));
} else {
this.editDataInfo.FUnit = "EA";
}
},
methods: {
selectMaterial() {
this.showEditBox = true;
},
async _getTypeList() {
let result = await getDataCode({
FType: '1,2'
});
this.seletList[0] = result.FType1 || [];
this.seletList[1] = result.FType2 || [];
},
selectClick(item) {
this.editDataInfo.FMaterialID = item.FID;
this.editDataInfo.FName = item.FName;
this.editDataInfo.FCode = item.FCode || "";
this.showEditBox = false;
},
async _submitData(layId, data) {
layer.close(layId);
this.editDataInfo.FCode = data.FCode || "";
this.editDataInfo.FMaterialID = data.FMaterialID || -1;
this.editDataInfo.FGroup = data.FGroup || this.editDataInfo.FGroup || "";
if (this.taskInfoObj.FType == 10) {
let idx = layer.load(2);
let postData = JSON.parse(JSON.stringify(this.taskInfoObj));
postData.FList = JSON.stringify([this.editDataInfo]);
let result = await dockMDMCode(postData);
layer.close(idx);
this.$emit('cancelClick', true);
} else {
this.$emit('submitClick', this.editDataInfo);
}
},
async submitClick() {
if (!this.editDataInfo.FName) return this.editDataInfo.FName = "";
let result = await getPageList({
FPageIndex: 1,
FPageSize: 1,
FType: 40,
FName: this.editDataInfo.FName.trim() || ""
}, "Material");
let list = result.Data.List || [];
let $this = this;
let data = {};
let message = "系统检索到您使用的是新物料,请确认?";
if (list.length > 0) {
data = list[0];
message = "系统检索到您使用的是旧物料,请确认?";
}
layer.confirm(message, {
title: "提示",
btn: [{
text: this.taskInfoObj.FType == 10 ? '提交MDM' : '确定',
callback: function(id) {
$this._submitData(id, data);
}
}, {
text: '取消',
callback: function(id) {
layer.close(id);
}
}]
});
}
}
}
</script>

@ -0,0 +1,253 @@
<template>
<lay-container style="height:450px;overflow:hidden">
<view v-show="showSupplyInfo==4" class="note-no">
不需要补充包材规格
</view>
<lay-form v-show="showSupplyInfo==2 || showSupplyInfo==3" :model="editDataInfo" class="edit-info color999"
:initValidate="false">
<lay-form-item label="名称" prop="FName" required :initValidate="false">
<lay-input v-model="editDataInfo.FName" style="width:calc(100% - 76px);margin-right:10px"></lay-input>
<lay-button :disabled="showSupplyInfo!=2" type="normal" @click="selectMaterial">
</lay-button>
</lay-form-item>
<lay-form-item label="物料组" prop="FGroup" required>
<lay-select v-model="editDataInfo.FGroup" v-if="seletList[1].length>0">
<lay-select-option v-for="(rV,rI) in seletList[1]" key="rI" :value="rV.FValue+''" :label="rV.FName">
</lay-select-option>
</lay-select>
</lay-form-item>
<lay-form-item label="单位" prop="FUnit" required>
<lay-select v-model="editDataInfo.FUnit" v-if="seletList[0].length>0">
<lay-select-option v-for="(rV,rI) in seletList[0]" key="rI" :value="rV.FValue+''"
:label="rV.FValue">
</lay-select-option>
</lay-select>
<p class="note3" v-if="editDataInfo.FUnit&&seletList[0].find(s=>s.FValue==editDataInfo.FUnit)!=null">
{{ seletList[0].find(s=>s.FValue==editDataInfo.FUnit).FName }}
</p>
</lay-form-item>
<lay-form-item label="包材外形尺寸" prop="FOutSize">
<lay-input v-model="editDataInfo.FOutSize" placeholder="长*宽*高(mm)"></lay-input>
</lay-form-item>
<lay-form-item label="包材重量(kg)" prop="FWeight">
<lay-input v-model="editDataInfo.FWeight"></lay-input>
</lay-form-item>
<lay-form-item label="数量" prop="FCount">
<lay-input v-model="editDataInfo.FCount"></lay-input>
</lay-form-item>
</lay-form>
<view class="menuBtn" v-show="showSupplyInfo==2">
<lay-button type="danger" @click="submitClick"></lay-button>
<lay-button @click="$emit('cancelClick')"></lay-button>
</view>
<lay-layer :area="['70%','80%']" v-model="showEditBox" title="选择包材">
<MaterialSelect :dataInfoObj="editDataInfo" @selectClick="selectClick" @cancelClick="showEditBox = false">
</MaterialSelect>
</lay-layer>
</lay-container>
</template>
<style scoped>
.edit-info {
width: 90%;
padding-right: 30px;
margin: 30px auto 10px;
}
.note-no {
font-weight: bold;
text-align: center;
width: 100%;
display: block;
line-height: 400px;
font-size: 40px;
color: #5FB878;
}
.note3 {
display: inline-flex;
line-height: 38px;
margin-left: 12px;
}
.menuBtn {
display: block;
text-align: center;
width: 96%;
margin: 20px auto;
}
.empty-small2 {
max-width: 96%;
margin: 0 auto;
}
.empty-small2>.layui-btn {
margin-bottom: 16px;
}
.note {
color: #999;
font-size: 12px;
margin: 12px auto 2px;
text-align: right;
}
</style>
<script>
import {
ref,
reactive
} from 'vue';
import {
dockMDMCode,
getPackageChildList,
noSupplyPackageChild
} from "/src/api/api/package";
import {
getPageList,
getDataCode
} from "/src/api/api/common";
import MaterialSelect from "./MaterialSelect.vue";
export default {
components: {
MaterialSelect
},
setup() {
const editDataInfo = ref({});
const showEditBox = ref(false);
const showSupplyInfo = ref(0);
return {
editDataInfo,
showEditBox,
showSupplyInfo,
seletList: ref([
[],
[]
])
}
},
props: {
dataInfoObj: {
type: Object,
default: () => {},
}
},
mounted() {
this._getTypeList();
this._getPackageSupplyList();
},
methods: {
selectMaterial() {
this.showEditBox = true;
},
async _getTypeList() {
let result = await getDataCode({
FType: '1,2'
});
this.seletList[0] = result.FType1 || [];
this.seletList[1] = result.FType2 || [];
},
async _getPackageSupplyList() {
let result = await getPackageChildList({
FPageSize: 999,
FTeamID: this.dataInfoObj.FTeamID
});
if (result.Data.Total > 0) this.editDataInfo = result.Data.List[0];
if (this.dataInfoObj.FState != 2) {
if (result.Data.Total == 0) this.showSupplyInfo = 1; //
else this.showSupplyInfo = 2; //
} else {
if (result.Data.Total > 0) this.showSupplyInfo = 3; //
else this.showSupplyInfo = 4; //
}
if (this.showSupplyInfo == 1) this.showIsSupply();
},
//
showIsSupply() {
let $this = this;
layer.confirm("请确认是否需要补充额外包材?", {
title: "提示",
btn: [{
text: '需要',
callback: function(id) {
$this.showSupplyInfo = 2;
$this.editDataInfo.FUnit = $this.editDataInfo.FUnit || "EA";
layer.close(id);
}
},
{
text: '不需要',
callback: function(id) {
$this._noSupplyPackageChild();
layer.close(id);
}
}
]
});
},
//
async _noSupplyPackageChild() {
await noSupplyPackageChild(this.dataInfoObj);
this.showSupplyInfo = 4;
this.$emit('cancelClick', true);
},
selectClick(item) {
this.editDataInfo.FMaterialID = item.FID;
this.editDataInfo.FName = item.FName;
this.editDataInfo.FCode = item.FCode || "";
this.showEditBox = false;
},
async _submitData(layId, data) {
layer.close(layId);
this.editDataInfo.FCode = data.FCode || this.editDataInfo.FCode || "";
this.editDataInfo.FMaterialID = data.FID || this.editDataInfo.FID || -1;
this.editDataInfo.FGroup = data.FGroup || this.editDataInfo.FGroup || "";
this.editDataInfo.FTeamID = this.dataInfoObj.FTeamID || data.FTeamID || -1;
let idx = layer.load(2);
let postData = JSON.parse(JSON.stringify(this.dataInfoObj));
postData.FList = JSON.stringify([this.editDataInfo]);
let result = await dockMDMCode(postData);
if (result > 0) this._noSupplyPackageChild();
layer.close(idx);
},
async submitClick() {
if (!this.editDataInfo.FName) return this.editDataInfo.FName = "";
if (!this.editDataInfo.FGroup) return this.editDataInfo.FGroup = "";
if (!this.editDataInfo.FUnit) return this.editDataInfo.FUnit = "";
let result = await getPageList({
FPageIndex: 1,
FPageSize: 1,
FType: 40,
FName: this.editDataInfo.FName.trim() || ""
}, "Material");
let list = result.Data.List || [];
let $this = this;
let data = {};
let btnName = "";
let message = "系统检索到您使用的是新物料,请确认?";
if (list.length > 0) {
data = list[0];
message = "系统检索到您使用的是旧物料,请确认?";
btnName = "保存";
}
if (btnName == "") {
btnName = this.editDataInfo.FID ? "提交MDM" : "保存并提交MDM";
}
layer.confirm(message, {
title: "提示",
btn: [{
text: btnName,
callback: function(id) {
$this._submitData(id, data);
}
}, {
text: '取消',
callback: function(id) {
layer.close(id);
}
}]
});
}
}
}
</script>

@ -0,0 +1,216 @@
<template>
<lay-container fluid="true" class="content-box">
<lay-table v-if="dataList.length>0" :columns="dataColumn" :data-source="dataList">
<template v-slot:operator="{ data }">
<lay-button size="xs" type="primary" @click="_getTeamworkView(data,1)">
查看
</lay-button>
<lay-button size="xs" type="primary" @click="_getTeamworkView(data,2)">
导出
</lay-button>
</template>
</lay-table>
<lay-form class="dataInfo">
<div>
<lay-button v-if="dataInfoObj.FCanEdit!=2" type="danger" @click="submitClick()"></lay-button>
<lay-button v-if="dataInfoObj.FCanEdit!=2" @click="cancelClick"></lay-button>
<p class="note">备注所有视图填写完成请确认流程完成流程完成后不允许修改</p>
</div>
</lay-form>
</lay-container>
<lay-layer area="90%" v-model="showEditBox" title="视图查看">
<ShowView v-if="showEditBox" :viewList="viewList" :viewHeight="viewHeight"></ShowView>
</lay-layer>
<OperateLog v-if="dataInfoObj.FTeamID" ref="OperateLog" :dataInfoObj="dataInfoObj"></OperateLog>
</template>
<style scoped>
.content-box {
margin: 30px 10px;
display: block;
position: relative;
clear: both;
float: none;
min-height: 400px;
}
.dataInfo {
margin-top: 40px;
text-align: center;
}
.note {
color: #999;
font-size: 12px;
margin: 10px auto;
}
</style>
<script>
import {
ref
} from 'vue';
import {
getTeamworkView
} from "/src/api/api/teamwork";
import {
getBasicRoleList
} from "/src/api/api/user";
import {
sureTeamWork
} from "/src/api/api/task";
import {
getDataModel
} from "/src/api/api/common";
import ShowView from '../../Team/components/ShowView.vue';
export default {
components: {
ShowView
},
setup() {
const dataList = ref([]);
let dataColumn = [{
title: "视图",
key: "name",
},
{
title: "操作",
key: "operator",
width: "148px",
customSlot: "operator",
align: "center"
}
];
const teamInfoObj = ref({});
//
const viewTypeCount = ref(5);
const showEditBox = ref(false);
const viewList = ref([]);
const viewHeight = ref(500);
return {
dataColumn,
dataList,
viewTypeCount,
showEditBox,
viewList,
viewHeight
}
},
props: {
dataInfoObj: {
type: Object,
default: () => {},
}
},
mounted() {
this._getViewList();
console.log(this.dataInfoObj);
},
methods: {
//
async _getViewList() {
this.teamInfoObj = await getDataModel({
FID: this.dataInfoObj.FTeamID
}, "Teamwork");
let result = await getBasicRoleList({
FRoleType: 39,
FRoleSet: "true"
}) || [];
let dataList = [];
let hasType = this.teamInfoObj.FViewType;
result.forEach((item) => {
let viewData = dataList.find(s => s.name == item.FName) || null;
if (viewData == null) {
if (hasType.indexOf(item.FCode) != -1) {
viewData = {
name: item.FName,
seeCode: "",
outCode: ""
};
if (item.FRemark.indexOf("查看") != -1) viewData.seeCode = item.FCode;
if (item.FRemark.indexOf("导出") != -1) viewData.outCode = item.FCode;
dataList.push(viewData);
}
} else {
if (item.FRemark.indexOf("查看") != -1) viewData.seeCode = item.FCode;
if (item.FRemark.indexOf("导出") != -1) viewData.outCode = item.FCode;
}
});
this.dataList = dataList;
},
async _getTeamworkView(data, type) {
let viewType = parseInt(type == 1 ? data.seeCode : data.outCode);
if (type == 2) viewType = viewType - this.viewTypeCount;
let postData = {
FTeamID: this.dataInfoObj.FTeamID,
FViewType: viewType,
HalfId: this.dataInfoObj.FMaterialHalfIDs,
FType: type
};
postData.FFinish = this.dataInfoObj.FCanEdit == 2 ? 1 : 0;
let idx = layer.load(2);
let result = await getTeamworkView(postData);
layer.close(idx);
if (type == 1) {
let list = [];
let count = 0;
for (let key in result) {
list.push(result[key]);
count += result[key].length;
};
if (count == 0) {
layer.msg("请稍等,视图信息还在编辑中", {
time: 2000,
icon: 3
});
} else {
let height = document.documentElement.clientHeight || document.body.clientHeight || 1000;
this.viewList = list;
this.viewHeight = Math.ceil(height * 0.6);
this.showEditBox = true;
}
} else {
window.open(result);
}
},
submitClick() {
let message = "流程完成之后视图不允许修改,您确认完成吗?";
let $this = this;
layer.confirm(message, {
title: "提示",
btn: [{
text: '确定',
callback: function(id) {
$this._submitData(id);
}
}, {
text: '取消',
callback: function(id) {
layer.close(id);
}
}]
});
},
async _submitData(layId) {
layer.close(layId);
let result = await sureTeamWork(this.dataInfoObj.FTeamID);
if (result > 0) {
layer.msg('操作成功', {
icon: 1,
time: 3000
});
this.cancelClick(true);
} else {
layer.msg('还有事项未完成', {
icon: 3,
time: 3000
});
}
},
cancelClick(isRefresh) {
isRefresh = isRefresh == undefined ? false : isRefresh;
this.$emit('cancelClick', isRefresh);
}
}
}
</script>

@ -0,0 +1,223 @@
<template>
<lay-container fluid="true" class="content-box">
<lay-table height="160px" class="row-select" v-if="dataColumn.length>0" :columns="dataColumn"
:data-source="dataList" :row-style="rowStyle">
<template v-slot:toolbar v-if="dataInfoObj.FCanEdit!=2">
<lay-button size="sm" @click="saveBatch" type="primary" :disabled="editColumn.length===0">保存
</lay-button>
</template>
<template v-for="item in editColumn" v-slot:[item.key]="{ data }">
<lay-input v-if="!item.dataType" size="sm" v-model="data[item.key]" required></lay-input>
</template>
</lay-table>
<OperateLog v-if="dataInfoObj.FTeamID" ref="OperateLog" :dataInfoObj="dataInfoObj"></OperateLog>
</lay-container>
</template>
<style scoped>
.content-box {
min-height: 580px;
margin: 30px 10px;
display: block;
position: relative;
clear: both;
float: none;
}
.row-select td {
overflow: inherit;
}
</style>
<script>
import {
ref
} from 'vue';
import {
getListByTeamId,
updateBatchById
} from "/src/api/api/view";
import {
getBasicRoleList
} from "/src/api/api/user";
import {
reviewMaterialGroup
} from "/src/api/api/task";
import OperateLog from "./OperateLog.vue";
import {
getDataCode,
commonSave
} from "/src/api/api/common";
export default {
components: {
OperateLog
},
setup() {
const dataColumn = ref([]);
const dataList = ref([]);
const cacheDataList = ref([]);
const dataColor = ref([]);
const editColumn = ref([]);
const selectDataMap = ref({});
let colors = ["1E9FFF", "009688", "393D49", "5FB878"];
const rowStyle = function(row, rowIndex) {
let color = "";
for (let idx = 0; idx < dataColor.value.length; idx++) {
if (rowIndex > dataColor.value[idx]) color = "color:#" + colors[idx];
}
return color;
}
return {
dataColumn,
dataList,
cacheDataList,
dataColor,
editColumn,
selectDataMap,
rowStyle
}
},
props: {
dataInfoObj: {
type: Object,
default: () => {},
},
viewDataList: {
type: Object,
default: () => [],
}
},
mounted() {
console.log(this.dataInfoObj)
this.initPage();
},
methods: {
async initPage() {
let dataColumn = [];
let dataColor = [];
let _data = await getListByTeamId({
teamId: this.dataInfoObj.FTeamID,
viewType: 1,
FAllView: "1"
});
let _power = [];
if (this.dataInfoObj.FCanEdit != 2) {
_power = (await getBasicRoleList({
FRoleType: 36
}) || []).map(it => parseInt(it.F2));
}
dataColumn = _data.columns;
this.editColumn = dataColumn.filter(it => {
if (this.dataInfoObj.FCanEdit == 2) return true;
let b = _power.indexOf(it.id) >= 0;
if (b) it.customSlot = it.key;
return b;
});
//
if (this.dataInfoObj.FCanEdit != 2) {
let tempColumn1 = dataColumn.filter(s => s.customSlot) || [];
let tempColumn2 = dataColumn.filter(s => s.customSlot == undefined) || [];
dataColumn = [...tempColumn1, ...tempColumn2];
}
let col7 = dataColumn.filter(s => s.fieldType == 7) || [];
_data.rows.forEach((item) => {
let info = _data.infos.find(s => s.FDataID == item.FMaterialID) || null;
if (info != null) {
col7.forEach((col) => {
item[col.key] = info[col.key] || item[col.key] || "";
});
}
if (item.FTypeID1 == 0 || item.FTypeID1 == -1) {
item.FTypeID1 = "";
} else {
let first = _data.types.find(s => s.FID == item.FTypeID1) || null;
if (first != null) {
item.FTypeID1 = first.FName;
first = _data.types.find(s => s.FID == item.FTypeID2) || null;
item.FTypeID2 = first != null ? first.FName : "";
} else {
item.FTypeID1 = item.FTypeID2 = "";
}
}
});
this.cacheDataList = JSON.parse(JSON.stringify(_data.rows));
this.dataList = _data.rows;
this.dataColumn = dataColumn;
this.dataColor = dataColor
},
cancelClick(isRefresh) {
isRefresh = isRefresh == undefined ? false : isRefresh;
this.$emit('cancelClick', isRefresh);
},
async submitUpdate(_list, _logs) {
let idx = layer.load(2);
let _result = await reviewMaterialGroup({
FTaskID: this.dataInfoObj.FID,
FTeamID: this.dataInfoObj.FTeamID,
FList: JSON.stringify(_list)
});
if (_result > 0) {
await commonSave({
teamId: this.dataInfoObj['FTeamID'],
type: this.dataInfoObj['FType'],
desc: _logs.length > 0 ? _logs.join("") : "未修改"
}, "OperateLog");
let $this = this;
setTimeout(function() {
layer.close(idx);
layer.msg('复核成功');
$this.cancelClick(true)
}, 500);
} else {
layer.close(idx);
layer.msg('复核失败');
}
this.$refs.OperateLog._getPageList();
},
saveBatch() {
let _list = [];
let _logs = [];
this.dataList.forEach((row, index) => {
let cache = this.cacheDataList[index];
let _row = {};
let _log = [];
for (let col of this.editColumn) {
if (row[col.key] !== cache[col.key]) {
_row[col.key] = row[col.key];
_log.push(col.title + "" + row[col.key]);
}
}
if (Object.keys(_row).length > 0) {
_row['FID'] = row['FID'];
_list.push(_row);
_logs.push(_log.join("、"));
}
});
let max = this.dataList.length;
let min = _list.length;
let message = min <= 0 ? "您没做修改," : (min != max ? ("您有" + (max - min) + "项没修改,") : "");
message += "确认提交吗?";
let $this = this;
layer.confirm(message, {
title: "提示",
btn: [{
text: '确定',
callback: function(id) {
layer.close(id);
$this.submitUpdate(_list, _logs);
}
},
{
text: '取消',
callback: function(id) {
layer.close(id);
}
}
]
});
}
}
}
</script>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save