leo 3 years ago
commit 744180f92e

1
.gitignore vendored

@ -1 +1,2 @@
node_modules node_modules
/dist

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Before

Width:  |  Height:  |  Size: 1.1 KiB

133
dist/index.html vendored

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

@ -44,4 +44,14 @@ export async function DownViewAll(param) {
result = data; result = data;
}); });
return result; return result;
}
//更新物料
export async function UpdateDataModel(param)
{
let result = [];
await http.post('/api/Material/UpdateDataModel2', param).then((data) => {
result = data;
});
return result;
} }

@ -113,5 +113,56 @@ export default [
meta: { title: '日志管理', icon: "" }, meta: { title: '日志管理', icon: "" },
} }
] ]
},
{
path: '/materia',
component: BaseLayout,
meta: { title: '物料路线' },
children: [
{
path: '/materia/all',
component: () => import('../../views/materia/all.vue'),
meta: { title: '物料记录', icon: "" },
},
{
path: '/materia/route',
component: () => import('../../views/materia/route.vue'),
meta: { title: '物料事项', icon: "" },
}
]
},
{
path: '/half',
component: BaseLayout,
meta: { title: '半成品实验号变更' },
children: [
{
path: '/half/half',
component: () => import('../../views/half/half.vue'),
meta: { title: '配方变更', icon: "" },
},
{
path: '/half/route',
component: () => import('../../views/half/route.vue'),
meta: { title: '半成品变更事项', icon: "" },
}
]
},
{
path: '/log/log',
component: BaseLayout,
meta: { title: '操作日志' },
children: [
{
path: '/log/log',
component: () => import('../../views/log/log.vue'),
meta: { title: '操作日志', icon: "" },
},
{
path: '/log/log',
component: () => import('../../views/log/log.vue'),
meta: { title: '操作日志', icon: "" },
}
]
} }
] ]

@ -72,8 +72,8 @@
<lay-layer :area="modelArea[8]" v-model="showEditBox[8]" :title="objInfoObj.FName"> <lay-layer :area="modelArea[8]" v-model="showEditBox[8]" :title="objInfoObj.FName">
<SupplyPackage v-if="showEditBox[8]" :data-info-obj="objInfoObj" @cancelClick="cancelClick"></SupplyPackage> <SupplyPackage v-if="showEditBox[8]" :data-info-obj="objInfoObj" @cancelClick="cancelClick"></SupplyPackage>
</lay-layer> </lay-layer>
<lay-layer :area="modelArea[10]" v-model="showEditBox[10]" :title="objInfoObj.FName"> <lay-layer :area="modelArea[10]" height="700px" v-model="showEditBox[10]" :title="objInfoObj.FName">
<EditFSuccedaneum v-if="showEditBox[10]" @getData="getData" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></EditFSuccedaneum> <EditFSuccedaneum style="height: 70vh;overflow: auto;" v-if="showEditBox[10]" @getData="getData" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></EditFSuccedaneum>
</lay-layer> </lay-layer>
<lay-layer :area="modelArea[11]" v-model="showEditBox[11]" :title="objInfoObj.FName"> <lay-layer :area="modelArea[11]" v-model="showEditBox[11]" :title="objInfoObj.FName">
<EditMaterial v-if="showEditBox[11]" @getData="getData" @showEditMaterial="showEditMaterial" :MaterialModel="MaterialModel" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></EditMaterial> <EditMaterial v-if="showEditBox[11]" @getData="getData" @showEditMaterial="showEditMaterial" :MaterialModel="MaterialModel" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></EditMaterial>
@ -197,8 +197,8 @@
const searchObj = ref({}); const searchObj = ref({});
const postData = ref({}); const postData = ref({});
const MaterialModel= ref({}); const MaterialModel= ref({});
const showEditBox = ref([false, false, false, false, false, false, false, false, false, false, false, false]); const showEditBox = ref([false, 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%","70%"]); const modelArea = ref(["70%", "70%", "70%", "86%", "70%", "70%", "70%", "70%", "700px", "70%", "70%","70%","70%"]);
const objInfoObj = ref({}); const objInfoObj = ref({});
const editType = ref(1); const editType = ref(1);
const stateList = ref([{ const stateList = ref([{
@ -272,6 +272,7 @@
}, },
// //
async _getPageList(isFirst, showOk) { async _getPageList(isFirst, showOk) {
//this.dataList = []; //this.dataList = [];
this.pageInfo.total = 0; this.pageInfo.total = 0;
if (isFirst) { if (isFirst) {
@ -301,6 +302,7 @@
this.pageInfo.total = result.Data.Total || 0; this.pageInfo.total = result.Data.Total || 0;
this.dataList = result.Data.List; this.dataList = result.Data.List;
this.hasLoaded = true; this.hasLoaded = true;
debugger
}, },
// //
dateFormat(dataStr) { dateFormat(dataStr) {

@ -1,7 +1,8 @@
<template> <template>
<lay-container fluid="true" class="content-box"> <lay-container style="height:700px;overflow: auto;" fluid="true" class="content-box">
<lay-table class="row-select" v-if="dataColumn.length > 0" height="320px" :columns="dataColumn" <FormulaView :teamId="dataInfoObj.FTeamID" :halfId="dataInfoObj.FMaterialHalfIDs"></FormulaView>
:data-source="dataList" :cellStyle="cellStyle" :cellClassName="cellClassName"> <lay-table id="dataTable" 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"> <template v-slot:toolbar v-if="dataInfoObj.FCanEdit != 2">
<!-- <lay-button size="sm" type="primary" :class="this.isBomShow ? 'isBomShow' : 'isBomHidden'" @click="changeVisible2">BOM</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"> <lay-input :class="this.isShow ? 'isShow' : 'isHidden'" v-model="inputCodeValue" :readonly="true">
@ -12,7 +13,8 @@
</lay-input> </lay-input>
</template> </template>
<template v-if="dataList == undefined || !dataList.FID" v-slot:operator="{ data }"> <template v-if="dataList == undefined || !dataList.FID" v-slot:operator="{ data }">
<lay-button size="xs" type="primary" @click="changeVisible2(data)"></lay-button> <lay-button size="sm" type="primary" v-if="data.FSuccedaneumID == 0 || data.FSuccedaneumID == ''"
@click="changeVisible2(data)">选择</lay-button>
</template> </template>
</lay-table> </lay-table>
<OperateLog v-if="dataInfoObj.FTeamID" ref="OperateLog" :dataInfoObj="dataInfoObj"></OperateLog> <OperateLog v-if="dataInfoObj.FTeamID" ref="OperateLog" :dataInfoObj="dataInfoObj"></OperateLog>
@ -22,6 +24,9 @@
</template> </template>
</template> </template>
<style scoped> <style scoped>
.content-box { .content-box {
margin: 30px 10px; margin: 30px 10px;
@ -32,6 +37,7 @@
min-height: 740px; min-height: 740px;
} }
.row-select td { .row-select td {
overflow: inherit; overflow: inherit;
} }
@ -63,8 +69,6 @@
display: none; display: none;
} }
.isBomShow {}
.isBomHidden { .isBomHidden {
display: none; display: none;
} }
@ -80,10 +84,11 @@ import {
getBasicRoleList getBasicRoleList
} from "/src/api/api/user"; } from "/src/api/api/user";
import { import {
getDataCode,
commonSave commonSave
} from "/src/api/api/common"; } from "/src/api/api/common";
import{
UpdateDataModel
} from "/src/api/api/material"
import { import {
getInfoData, getInfoData,
changeInfoData changeInfoData
@ -92,10 +97,12 @@ import {
import { EditTypeList } from "/src/api/api/teamwork"; import { EditTypeList } from "/src/api/api/teamwork";
import OperateLog from "./OperateLog.vue"; import OperateLog from "./OperateLog.vue";
import FormulaView from "./FormulaView.vue";
export default { export default {
components: { components: {
OperateLog OperateLog,
FormulaView,
}, },
setup() { setup() {
let dataColumn = [{ let dataColumn = [{
@ -126,7 +133,7 @@ export default {
}, },
{ {
title: "替代料编号", title: "替代料编号",
key: "FSuccedaneumID", key: "FSuccedaneumCode",
width: "178px", width: "178px",
align: 'center' align: 'center'
}, },
@ -142,7 +149,12 @@ export default {
width: "160px", width: "160px",
align: 'center' align: 'center'
}, },
{
title: "是否需要替代料",
key: "selected",
width: "160px",
align: 'center'
},
{ {
title: "操作", title: "操作",
key: "operator", key: "operator",
@ -177,7 +189,7 @@ export default {
const inputDescValue = ref(""); const inputDescValue = ref("");
const visible2 = ref(false); const visible2 = ref(false);
return { return {
dataColumn, dataColumn,
@ -224,30 +236,45 @@ export default {
this.initPage(layer.load(2)); this.initPage(layer.load(2));
}, },
async initPage(idx) { async initPage(idx) {
debugger
let _data = await GetMaterialInfoListByTeamId({ let _data = await GetMaterialInfoListByTeamId({
tempId: this.dataInfoObj.FTeamID tempId: this.dataInfoObj.FTeamID
}); });
this.dataList = _data.Data; this.dataList = _data.Data.map(function (item) {
if (item.FSuccedaneumID == -1) {
item["selected"] = "不需要";
}
else if (item.FSuccedaneumID > 0) {
item["selected"] = "需要";
}
return item;
});
setTimeout(function () { setTimeout(function () {
layer.close(idx); layer.close(idx);
}, 500); }, 500);
}, },
changeVisible2(data) { changeVisible2(data) {
let $this = this; let $this = this;
layer.confirm("是否选择替代料", { layer.confirm("是否需要替代料", {
btn: [{ btn: [{
text: '选择', text: '需要',
callback: function (id) { callback: function (id) {
layer.close(id); layer.close(id);
$this.$emit('cancelClick', true, false); $this.$emit('cancelClick', true, false);
$this.$emit("getData", data); $this.$emit("getData", data);
} }
}, },
{ {
text: '不选择' text: '不需要',
}] callback: function (id) {
layer.close(id);
data.FSuccedaneumID = -1;
$this.saveBatch(data);
}
}]
}) })
}, },
cancelClick(isRefresh) { cancelClick(isRefresh) {
@ -274,89 +301,33 @@ export default {
} }
} }
}, },
async saveBatch() { async saveBatch(data) {
let updateInfo = {
var arr = new Array(); FID: data.FID,
tempId:this.dataInfoObj.FTeamID,
for (let i = 0; i < this.dataList.length; i++) { taskId:this.dataInfoObj.FID
if (this.dataList[i].FTypeID1 == null || this.dataList[i].FTypeID1 == "") {
layer.msg("请选择一级分类", { icon: 2, time: 1000 });
return;
}
if (this.dataList[i].FTypeID2 == null || this.dataList[i].FTypeID2 == "") {
layer.msg("请选择二级分类", { icon: 2, time: 1000 });
return;
}
arr.push({ FMaterialID: this.dataList[i].FMaterialID, FTypeID1: this.dataList[i].FTypeID1, FTypeID2: this.dataList[i].FTypeID2 })
}
let arr2 = {
taskId: this.dataInfoObj.FID,
tempId: this.dataInfoObj.FTeamID,
list: arr
}
let result = await EditTypeList(arr2);
let idx = layer.load(2);
let updateObj = {
LogList: [],
FTeamID: this.dataInfoObj['FTeamID'],
FViewType: this.dataInfoObj.FViewType
}; };
let saveId = this.dataInfoObj.FViewType + "_" + this.dataInfoObj.FID; updateInfo.FSuccedaneumID = -1;
let cacheDataList = JSON.parse(localStorage.getItem('EditType' + saveId)); updateInfo.FSuccedaneumInfo = "";
this.dataList.forEach((row, index) => { updateInfo.FSuccedaneumType = "";
let cache = cacheDataList[index]; updateInfo.FSuccedaneumCode = "";
let dataObj = {}; let result = await UpdateDataModel(updateInfo) || 0;
for (let col of this.editColumn) { debugger
let valTemp = row[col.key]; //
if (valTemp != cache[col.key]) { if (result.Code==200) {
if (!dataObj[col.table]) { await commonSave({
dataObj[col.table] = {}; teamId: this.dataInfoObj.FTeamID,
dataObj[col.table].FMaterialID = row["FMaterialID"]; type: this.dataInfoObj.FType,
} desc: data.FTestCode + "确认不使用替代料"
dataObj[col.table][col.key] = valTemp; }, "OperateLog");
if (col.key == "FTypeID1" || col.key == "FTypeID2") { let $this = this;
let temps = this.typeList[col.key == "FTypeID1" ? 0 : 1] || []; this.initPage();
let temp = temps.find(s => s.FID == valTemp) || null; setTimeout(function () {
valTemp = temp == null ? "" : temp.FName; layer.close(idx);
} layer.msg('保存成功');
updateObj.LogList.push(col.title + "" + (valTemp == "" ? "删除" : valTemp)); //$this.$emit('cancelClick', true, true);
} this.$refs.OperateLog._getPageList();
} }, 500);
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
//
if (result.Code === 200) {
await commonSave({
teamId: updateObj.FTeamID,
type: this.dataInfoObj['FType'],
desc: updateLog
}, "OperateLog");
let $this = this;
//$this.initPage();
localStorage.setItem('EditType' + 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('您没有做任何更改')
} }
} }
} }

@ -1,5 +1,5 @@
<template> <template>
<lay-container class="content-box" :style="'padding-top:'+(editType!=1?0:35)+'px'"> <lay-container class="content-box" :style="'padding-top:' + (editType != 1 ? 0 : 35) + 'px'">
<view class="edit-box"> <view class="edit-box">
<lay-form :model="searchObj" class="search-box edit-info"> <lay-form :model="searchObj" class="search-box edit-info">
<lay-row class="color666"> <lay-row class="color666">
@ -14,7 +14,7 @@
</lay-form-item> </lay-form-item>
<lay-form-item label="产品分类" prop="FType"> <lay-form-item label="产品分类" prop="FType">
<lay-select v-model="searchObj.FType"> <lay-select v-model="searchObj.FType">
<lay-select-option v-for="(tIdv,tIdx) in typeListObj" :key="tIdx" :value="tIdv.FValue" <lay-select-option v-for="(tIdv, tIdx) in typeListObj" :key="tIdx" :value="tIdv.FValue"
:label="tIdv.FName"></lay-select-option> :label="tIdv.FName"></lay-select-option>
</lay-select> </lay-select>
</lay-form-item> </lay-form-item>
@ -32,10 +32,10 @@
<lay-form-item label="主物料描述" prop="FName"> <lay-form-item label="主物料描述" prop="FName">
<lay-input :disabled="isDisabled" v-model="objInfo.FName" type="FName"></lay-input> <lay-input :disabled="isDisabled" v-model="objInfo.FName" type="FName"></lay-input>
</lay-form-item> </lay-form-item>
<lay-form-item :label=" editType == 1 ? '替代料物料号' : '副产物物料号' "> <lay-form-item :label="editType == 1 ? '替代料物料号' : '副产物物料号'">
<lay-input :disabled="isDisabled" v-model="objInfo.choseData.FCode"></lay-input> <lay-input :disabled="isDisabled" v-model="objInfo.choseData.FCode"></lay-input>
</lay-form-item> </lay-form-item>
<lay-form-item :label=" editType == 1 ? '替代料描述' : '副产物描述' "> <lay-form-item :label="editType == 1 ? '替代料描述' : '副产物描述'">
<lay-input :disabled="isDisabled" v-model="objInfo.choseData.FName"></lay-input> <lay-input :disabled="isDisabled" v-model="objInfo.choseData.FName"></lay-input>
</lay-form-item> </lay-form-item>
<lay-form-item v-if="editType != 1" label="副产物数量"> <lay-form-item v-if="editType != 1" label="副产物数量">
@ -51,242 +51,261 @@
</lay-form> </lay-form>
</view> </view>
<view class="edit-box"> <view class="edit-box">
<lay-table :class=" 'empty-small' + editType " :columns="dataColumn" id="id" :dataSource="dataList" <lay-table :class="'empty-small' + editType" :columns="dataColumn" id="id" :dataSource="dataList"
v-model:selected-key="selectedKey" :page="dataList.length>0?pageInfo:null" @change="changePage"> v-model:selected-key="selectedKey" :page="dataList.length > 0 ? pageInfo : null" @change="changePage">
</lay-table> </lay-table>
</view> </view>
</lay-container> </lay-container>
</template> </template>
<style scoped> <style scoped>
.content-box { .content-box {
height: 744px; height: 744px;
display: block; display: block;
position: relative; position: relative;
clear: both; clear: both;
float: none; float: none;
} }
.edit-box { .edit-box {
display: block; display: block;
width: 99%; width: 99%;
text-align: center; text-align: center;
margin: 0 auto; margin: 0 auto;
clear: both; clear: both;
float: none; float: none;
} }
.edit-info { .edit-info {
margin: 20px 0 10px; margin: 20px 0 10px;
width: 47%; width: 47%;
padding-left: 1%; padding-left: 1%;
padding-right: 1%; padding-right: 1%;
display: inline-block; display: inline-block;
margin-right: 0.75%; margin-right: 0.75%;
} }
.edit-info+.edit-info { .edit-info+.edit-info {
margin-left: 0.75%; margin-left: 0.75%;
margin-right: 0; margin-right: 0;
} }
.layui-form-item { .layui-form-item {
margin-bottom: 16px; margin-bottom: 16px;
} }
</style> </style>
<script> <script>
import { import {
ref, ref,
watch watch
} from 'vue'; } from 'vue';
import { import {
updateDataInfo, getPageList,
getPageList commonSave
} from "/src/api/api/common"; } from "/src/api/api/common";
export default { import {
setup() { UpdateDataModel
const objInfo = ref({ } from "/src/api/api/material"
choseData: {
FName: "",
FType: "",
FCode: ""
}
});
const postData = ref({});
const pageInfo = ref({ export default {
total: 0, setup() {
limit: 5, const objInfo = ref({
current: 1 choseData: {
}); FName: "",
let dataColumn = [{ FType: "",
type: "radio" FCode: ""
},
{
title: "物料号",
key: "FCode",
width: "200px"
},
{
title: "试验号",
key: "FTestCode",
width: "200px"
},
{
title: "物料描述",
key: "FName",
minWidth: "300px"
},
{
title: "产品分类",
key: "FTypeName",
width: "110px"
}
];
dataColumn.forEach((item) => {
item.align = "center";
});
const dataList = ref([]);
const selectedKey = ref("");
const isDisabled = ref(true);
const searchObj = ref({});
watch(selectedKey, function() {
const choseObj = dataList.value.find(s => s.id == selectedKey.value) || null;
if (choseObj != null) {
objInfo.value.choseData.FID = choseObj.FID;
objInfo.value.choseData.FName = choseObj.FName;
objInfo.value.choseData.FType = choseObj.FType;
objInfo.value.choseData.FCode = choseObj.FCode;
}
});
return {
objInfo,
postData,
pageInfo,
dataColumn,
dataList,
selectedKey,
isDisabled,
searchObj
} }
});
const postData = ref({});
const pageInfo = ref({
total: 0,
limit: 5,
current: 1
});
let dataColumn = [{
type: "radio"
}, },
props: { {
dataInfoObj: { title: "物料号",
type: Object, key: "FCode",
default: () => {}, width: "200px"
},
MaterialModel:{
type: Object,
default: () => {},
},
typeListObj: {
type: Array,
default: () => [],
},
editType: {
type: Number,
default: () => 1,
},
}, },
mounted() { {
this.objInfoObj=this.MaterialModel; title: "试验号",
let objInfo = JSON.parse(JSON.stringify(this.objInfoObj)); key: "FTestCode",
objInfo.choseData = { width: "200px"
FID: this.editType == 1 ? objInfo.FSuccedaneumID : objInfo.FFuProductsID, },
FName: this.editType == 1 ? objInfo.FSuccedaneumInfo : objInfo.FFuProductsInfo, {
FType: this.editType == 1 ? objInfo.FSuccedaneumType : objInfo.FFuProductsType, title: "物料描述",
FCode: this.editType == 1 ? objInfo.FSuccedaneumCode : objInfo.FFuProductsCode, key: "FName",
FCount: objInfo.FFuProductsCount || "", minWidth: "300px"
FUnit: objInfo.FFuProductsUnit || "" },
}; {
if (this.editType == 1) this.pageInfo.limit = 6; title: "产品分类",
this.objInfo = objInfo; key: "FTypeName",
width: "110px"
}
];
dataColumn.forEach((item) => {
item.align = "center";
});
const dataList = ref([]);
const selectedKey = ref("");
const isDisabled = ref(true);
const searchObj = ref({});
watch(selectedKey, function () {
const choseObj = dataList.value.find(s => s.id == selectedKey.value) || null;
if (choseObj != null) {
objInfo.value.choseData.FID = choseObj.FID;
objInfo.value.choseData.FName = choseObj.FName;
objInfo.value.choseData.FType = choseObj.FType;
objInfo.value.choseData.FCode = choseObj.FCode;
}
});
return {
objInfo,
postData,
pageInfo,
dataColumn,
dataList,
selectedKey,
isDisabled,
searchObj
}
},
props: {
dataInfoObj: {
type: Object,
default: () => { },
},
MaterialModel: {
type: Object,
default: () => { },
},
typeListObj: {
type: Array,
default: () => [],
},
editType: {
type: Number,
default: () => 1,
},
},
mounted() {
this.objInfoObj = this.MaterialModel;
let objInfo = JSON.parse(JSON.stringify(this.objInfoObj));
objInfo.choseData = {
FID: this.editType == 1 ? objInfo.FSuccedaneumID : objInfo.FFuProductsID,
FName: this.editType == 1 ? objInfo.FSuccedaneumInfo : objInfo.FFuProductsInfo,
FType: this.editType == 1 ? objInfo.FSuccedaneumType : objInfo.FFuProductsType,
FCode: this.editType == 1 ? objInfo.FSuccedaneumCode : objInfo.FFuProductsCode,
FCount: objInfo.FFuProductsCount || "",
FUnit: objInfo.FFuProductsUnit || ""
};
if (this.editType == 1) this.pageInfo.limit = 6;
this.objInfo = objInfo;
this._getPageList();
},
methods: {
//-
changePage(obj) {
this.pageInfo.current = obj.current;
this._getPageList(); this._getPageList();
}, },
methods: { //-
//- _clickSearch() {
changePage(obj) { this.postData = {};
this.pageInfo.current = obj.current; for (let key in this.searchObj) {
this._getPageList(); let val = this.searchObj[key];
}, if (val != null && val != "") this.postData[key] = val;
//- }
_clickSearch() { this._getPageList(true);
this.postData = {}; },
for (let key in this.searchObj) { //-
let val = this.searchObj[key]; _clickReset() {
if (val != null && val != "") this.postData[key] = val; this.searchObj = {};
} this._clickSearch();
this._getPageList(true); },
}, //-
//- async _getPageList(isFirst) {
_clickReset() { debugger
this.searchObj = {}; this.pageInfo.total = 0;
this._clickSearch(); if (isFirst) {
}, this.pageInfo.current = 1;
//-
async _getPageList(isFirst) {
this.pageInfo.total = 0; this.pageInfo.total = 0;
if (isFirst) { }
this.pageInfo.current = 1; this.postData.FPageIndex = this.pageInfo.current;
this.pageInfo.total = 0; this.postData.FPageSize = this.pageInfo.limit;
let result = await getPageList(this.postData, "Material");
result.Data.List = result.Data.List || [];
let cD = this.objInfo.choseData;
result.Data.List.forEach((item) => {
let type = this.typeListObj.find(s => s.FValue == item.FType);
item.FTypeName = type == null ? "" : type.FName;
item.id = item.FID;
if (item.FCode == cD.FCode && item.FName == cD.FName && item.FType == cD.FType &&
this.selectedKey != item.id) {
this.selectedKey = item.id
} }
this.postData.FPageIndex = this.pageInfo.current; });
this.postData.FPageSize = this.pageInfo.limit; this.pageInfo.total = result.Data.Total || 0;
let result = await getPageList(this.postData, "Material"); this.dataList = result.Data.List;
result.Data.List = result.Data.List || []; },
let cD = this.objInfo.choseData; //
result.Data.List.forEach((item) => { async submitClick() {
let type = this.typeListObj.find(s => s.FValue == item.FType); let updateInfo = {
item.FTypeName = type == null ? "" : type.FName; FID: this.objInfo.FID,
item.id = item.FID; tempId:this.dataInfoObj.FTeamID,
if (item.FCode == cD.FCode && item.FName == cD.FName && item.FType == cD.FType && taskId:this.dataInfoObj.FID
this.selectedKey != item.id) { };
this.selectedKey = item.id if (this.editType == 1) {
} updateInfo.FSuccedaneumID = this.objInfo.choseData.FID || -1;
updateInfo.FSuccedaneumInfo = this.objInfo.choseData.FName || "";
updateInfo.FSuccedaneumType = this.objInfo.choseData.FType || "";
updateInfo.FSuccedaneumCode = this.objInfo.choseData.FCode || "";
} else {
updateInfo.FFuProductsID = this.objInfo.choseData.FID || -1;
updateInfo.FFuProductsInfo = this.objInfo.choseData.FName || "";
updateInfo.FFuProductsType = this.objInfo.choseData.FType || "";
updateInfo.FFuProductsCode = this.objInfo.choseData.FCode || "";
updateInfo.FFuProductsCount = this.objInfo.choseData.FCount || "";
updateInfo.FFuProductsUnit = this.objInfo.choseData.FUnit || "";
}
let result = await UpdateDataModel(updateInfo) || 0;
this.dataInfoObj
debugger
if (result.Code==200) {
debugger
await commonSave({
teamId: this.dataInfoObj.FTeamID,
type: this.dataInfoObj['FType'],
desc: "选择了" + this.objInfo.FTestCode + "的使用替代物料" + updateInfo["FSuccedaneumCode"]
}, "OperateLog");
layer.msg("操作成功", {
time: 1500,
icon: 1
}); });
this.pageInfo.total = result.Data.Total || 0; this._getPageList(true);
this.dataList = result.Data.List; setTimeout(() => {
}, this.cancelClick(true);
// this.$emit("showEditMaterial");
async submitClick() { }, 150)
let updateInfo = { } else {
FID: this.objInfo.FID layer.msg("操作失败", {
}; time: 1000,
if (this.editType == 1) { icon: 2
updateInfo.FSuccedaneumID = this.objInfo.choseData.FID || -1; })
updateInfo.FSuccedaneumInfo = this.objInfo.choseData.FName || "";
updateInfo.FSuccedaneumType = this.objInfo.choseData.FType || "";
updateInfo.FSuccedaneumCode = this.objInfo.choseData.FCode || "";
} else {
updateInfo.FFuProductsID = this.objInfo.choseData.FID || -1;
updateInfo.FFuProductsInfo = this.objInfo.choseData.FName || "";
updateInfo.FFuProductsType = this.objInfo.choseData.FType || "";
updateInfo.FFuProductsCode = this.objInfo.choseData.FCode || "";
updateInfo.FFuProductsCount = this.objInfo.choseData.FCount || "";
updateInfo.FFuProductsUnit = this.objInfo.choseData.FUnit || "";
}
let result = await updateDataInfo(updateInfo, "Material") || 0;
if (result > 0) {
layer.msg("操作成功", {
time: 1500,
icon: 1
});
setTimeout(() => {
this.cancelClick(true);
this.$emit("showEditMaterial");
}, 150)
} else {
layer.msg("操作失败", {
time: 1000,
icon: 2
})
}
},
//
cancelClick(isRefresh) {
this.$emit('cancelClick', isRefresh == undefined ? false : isRefresh);
} }
},
//
cancelClick(isRefresh) {
this.$emit('cancelClick', isRefresh == undefined ? false : isRefresh);
} }
} }
}
</script> </script>

@ -0,0 +1,391 @@
<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{EditTypeList} from "/src/api/api/teamwork";
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: ""
});
debugger
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;
// });
let editColumn = dataColumn.map(function(item){
if(item.title=="一级分类"||item.title=="二级分类")
{
item.customSlot=item.key;
item.cellClass="edit-item";
}
return item;
});
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('EditType' + 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() {
var arr=new Array();
for(let i=0;i<this.dataList.length;i++)
{
if(this.dataList[i].FTypeID1==null||this.dataList[i].FTypeID1=="")
{
layer.msg("请选择一级分类", { icon : 2, time: 1000});
return;
}
if(this.dataList[i].FTypeID2==null||this.dataList[i].FTypeID2=="")
{
layer.msg("请选择二级分类", { icon : 2, time: 1000});
return;
}
arr.push({FMaterialID:this.dataList[i].FMaterialID,FTypeID1:this.dataList[i].FTypeID1,FTypeID2:this.dataList[i].FTypeID2})
}
let arr2={
taskId:this.dataInfoObj.FID,
tempId:this.dataInfoObj.FTeamID,
list:arr
}
let result= await EditTypeList(arr2);
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('EditType' + 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("、");
let $this=this;
if (updateLog != "") {
delete updateObj.LogList
//
if (result.Code === 200) {
await commonSave({
teamId: updateObj.FTeamID,
type: this.dataInfoObj['FType'],
desc: updateLog
}, "OperateLog");
//$this.initPage();
localStorage.setItem('EditType' + saveId, JSON.stringify(this.dataList));
setTimeout(function() {
layer.close(idx);
layer.msg('保存成功');
$this.$emit('cancelClick', true, false);
$this.$refs.OperateLog._getPageList();
}, 500);
}
} else {
layer.close(idx);
layer.msg('您没有做任何更改')
}
}
}
}
</script>

@ -304,6 +304,8 @@ export default {
this.originalColumns = this.deepCopy(dataColumn); this.originalColumns = this.deepCopy(dataColumn);
this.getFreezingColumns(); this.getFreezingColumns();
debugger
this._changeType(_data.rows[0],2);
setTimeout(function () { setTimeout(function () {
layer.close(idx); layer.close(idx);
}, 500); }, 500);

@ -139,7 +139,6 @@ export default {
}); });
} }
}); });
this.dataColumn = dataColumn; this.dataColumn = dataColumn;
let result2 = await getPageList({ let result2 = await getPageList({
FPageSize: 99, FPageSize: 99,
@ -169,6 +168,8 @@ export default {
return item; return item;
}) || []; }) || [];
debugger
}, },
cancelClick() { cancelClick() {
this.$emit('cancelClick', false); this.$emit('cancelClick', false);

@ -12,8 +12,8 @@
<lay-form-item label="包规" required prop="FPackCode" label-width="120" style="margin-bottom:30px;"> <lay-form-item label="包规" required prop="FPackCode" label-width="120" style="margin-bottom:30px;">
<lay-input v-model="dataInfo.FPackCode"></lay-input> <lay-input v-model="dataInfo.FPackCode"></lay-input>
</lay-form-item> </lay-form-item>
<lay-form-item label="选择模式" prop="factoryValue" required label-width="120"> <lay-form-item label="选择模式" prop="FCreateFactoryID" required label-width="120">
<lay-select v-model="factoryValue" placeholder="请选择"> <lay-select v-model="dataInfo.FCreateFactoryID" placeholder="请选择">
<lay-select-option v-for="(fIdv, fIdx) in factoryLists" key="fIdx" :value="fIdv.FID" :label="fIdv.FName"></lay-select-option> <lay-select-option v-for="(fIdv, fIdx) in factoryLists" key="fIdx" :value="fIdv.FID" :label="fIdv.FName"></lay-select-option>
</lay-select> </lay-select>
</lay-form-item> </lay-form-item>
@ -236,7 +236,7 @@ export default {
async _getTeamData(dataId) { async _getTeamData(dataId) {
let result = await getDataModel({ let result = await getDataModel({
FID: dataId, FID: dataId,
FKey: "FID,FTestCode,FWeightUnit,FSaleCode,FMaterialType,FMaterialGroup,FFormulaTestCode,FFormulaName,FFormulaID" FKey: "FID,FTestCode,FWeightUnit,FSaleCode,FMaterialType,FMaterialGroup,FFormulaTestCode,FFormulaName,FFormulaID,FPackCode,FCreateFactoryID"
}, "Teamwork"); }, "Teamwork");
this.dataInfo = result || this.dataInfo; this.dataInfo = result || this.dataInfo;
}, },
@ -304,7 +304,7 @@ export default {
postData.FMaterialGroup = (postData.FMaterialGroup || "").trim(); postData.FMaterialGroup = (postData.FMaterialGroup || "").trim();
postData.FWeightUnit = (postData.FWeightUnit || "").trim(); postData.FWeightUnit = (postData.FWeightUnit || "").trim();
postData.FFormulaName = (postData.FFormulaName || "").trim(); postData.FFormulaName = (postData.FFormulaName || "").trim();
postData.factoryValue=this.factoryValue; postData.FCreateFactoryID=(postData.FCreateFactoryID==-1?"":postData.FCreateFactoryID);
for (let key in postData) { for (let key in postData) {
if (postData[key] == "") return false; if (postData[key] == "") return false;
} }

@ -283,6 +283,7 @@
foot: result.filter(s => s.FGroup == 3) || [] foot: result.filter(s => s.FGroup == 3) || []
} }
this.dataProcess = dataProcess; this.dataProcess = dataProcess;
debugger
}, },
// //
async _getViewList() { async _getViewList() {
@ -313,8 +314,11 @@
}); });
console.log(dataList) console.log(dataList)
this.dataList = dataList; this.dataList = dataList;
debugger
}, },
async _getTeamworkView(data, type) { async _getTeamworkView(data, type) {
debugger
let viewType = parseInt(type == 1 ? data.seeCode : data.outCode); let viewType = parseInt(type == 1 ? data.seeCode : data.outCode);
if (type == 2) viewType = viewType - this.viewTypeCount; if (type == 2) viewType = viewType - this.viewTypeCount;
let postData = { let postData = {

@ -0,0 +1,340 @@
<template>
<lay-form :model="dataInfo" class="dataInfo">
<lay-form-item label="原配方" prop="FCreateFactoryID" required label-width="120" style="margin-bottom:30px;">
<lay-select v-model="dataInfo.FCreateFactoryID" placeholder="请选择">
<lay-select-option v-for="(fIdv, fIdx) in factoryLists" key="fIdx" :value="fIdv.FID" :label="fIdv.FName"></lay-select-option>
</lay-select>
<p class="note">配方号+版本号+描述</p>
</lay-form-item>
<lay-form-item label="变更后的配方" prop="FFormulaName" required label-width="120" style="margin-bottom:30px;">
<lay-select v-model="dataInfo.FCreateFactoryID" placeholder="请选择">
<lay-select-option v-for="(fIdv, fIdx) in factoryLists" key="fIdx" :value="fIdv.FID" :label="fIdv.FName"></lay-select-option>
</lay-select>
<p class="note">配方号+版本号+描述</p>
</lay-form-item>
<lay-form-item>
<p class="note3">配方变更影响的旧物料</p>
<lay-table :columns="dataColumn" v-model:selected-key="selectedKey" id="FID"
:dataSource="dataList">
</lay-table>
</lay-form-item>
<lay-form-item class="remark">
<p>备注配方变更需要重新下载BOM配方配方变更后一下内容需要重新更新到SAP</p>
<p>1如果实验号变更那么实验号对应的受影响的物料会自动更新实验号</p>
<p>2配方变更会重新下载BOM配方</p>
<p>3新BOM配方对应的配方视图重新生成同时用户需要更新到SAP</p>
<p>4新BOM配方中的新的物料需要用户维护视图并更新到SAP</p>
</lay-form-item>
</lay-form>
<div v-if="showButton" style="text-align: center;">
<lay-form-item>
<lay-button type="normal" @click="submitClick(true)"></lay-button>
<lay-button @click="cancelClick"></lay-button>
</lay-form-item>
</div>
</template>
<style scoped>
.dataInfo {
max-width: 90%;
height: 600px;
margin: 30px auto;
padding-right: 30px;
overflow-y: auto;
}
.search-btn2 {
position: absolute;
right: 0;
top: 0;
}
.note2 {
display: inline-block;
margin-left: 16px;
}
.note3 {
display: inline-flex;
line-height: 38px;
}
.note2,
.note {
color: #999;
font-size: 12px;
}
.note {
margin-top: 4px;
position: absolute;
left: 0;
}
.note .layui-form-radio,
.note .layui-form-radio i {
margin: 0 1px 0 0;
padding: 0;
font-size: 14px;
margin-top: -2px;
line-height: 0;
}
.FSearchName {
color: var(--global-primary-color)
}
.remark{
line-height: 2;
font-size: 18px;
}
</style>
<script>
import {
ref,
watch
} from 'vue';
import {
getDataCode,
getPageList,
getBasicList,
insertDataInfo,
updateDataInfo,
getDataModel
} from "/src/api/api/common";
import {
getFactoryList
} from "/src/api/api/factory";
export default {
setup() {
const dataInfo = ref({
FMaterialType: "ZMAT",
FWeightUnit: "KG"
});
const formulaList = ref([]);
const seletList = ref([
[],
[]
]);
const typeList = ref([]);
let dataColumn = [ {
title: "物料号",
key: "F1",
width: "160px"
},
{
title: "试验号",
key: "F2",
width: "160px"
},
{
title: "物料描述",
key: "F3",
width: "110px",
width: "260px"
},
{
title: "产品分类",
key: "F4",
width: "160px"
}
];
dataColumn.forEach((item) => {
item.align = "center";
});
const pageInfo = ref({
total: 0,
limit: 5,
current: 1
});
const dataList = ref([]);
const selectedKey = ref("");
watch(selectedKey, function () {
const chose = dataList.value.find(s => s.FID == selectedKey.value) || null;
if (chose != null) {
dataInfo.value.FFormulaName = chose.FName + "+" + chose.FTestCode + "+" + chose.FVersionCode;
dataInfo.value.FFormulaID = chose.FID;
dataInfo.value.FVersionCode = chose.FVersionCode;
dataInfo.value.FFormulaTestCode = chose.FTestCode;
}
});
const showEditBox = ref(false);
const showButton = ref(true);
const saleList = ref([]);
const factoryLists = ref([]);
const factoryValue=ref(null);
return {
dataInfo,
formulaList,
seletList,
typeList,
dataColumn,
dataList,
pageInfo,
selectedKey,
showEditBox,
showButton,
saleList,
factoryLists,
factoryValue
}
},
props: {
dataInfoObj: {
type: Object,
default: () => { },
}
},
mounted() {
//
if (this.dataInfoObj && this.dataInfoObj.FTeamID) {
this._getTeamData(this.dataInfoObj.FTeamID);
this.showButton = this.dataInfoObj.FCanEdit != 2
}
this._getSelectList();
this._getFactoryList();
},
methods: {
cancelClick(isFirst) {
this.$emit('cancelClick', isFirst ? isFirst : false);
},
async _getFactoryList() {
this.factoryLists = await getFactoryList() || [];
},
async _getTeamData(dataId) {
let result = await getDataModel({
FID: dataId,
FKey: "FID,FTestCode,FWeightUnit,FSaleCode,FMaterialType,FMaterialGroup,FFormulaTestCode,FFormulaName,FFormulaID,FPackCode,FCreateFactoryID"
}, "Teamwork");
this.dataInfo = result || this.dataInfo;
},
async _getSelectList() {
let result = await getDataCode({
FType: '1,2'
});
this.seletList[0] = result.FType1 || [];
this.seletList[1] = result.FType2 || [];
this.typeList = await getBasicList(37) || [];
this._getPageList();
},
async _inputSaleCode(val) {
let pData = {
FPageIndex: 1,
FPageSize: 10,
FName: val || ""
};
this.saleList = [];
if (pData.FName != "") {
let result = await getPageList(pData, "Material");
this.saleList = result.Data.List || [];
}
},
//
_searchPageList(value) {
this._getPageList(true);
},
//
changePage(obj) {
this.pageInfo.current = obj.current;
this.pageInfo.limit = obj.limit;
this._getPageList();
},
//
async _getPageList(isFirst) {
if (isFirst) {
this.pageInfo.current = 1;
this.pageInfo.total = 0;
}
let postData = {
FPageIndex: this.pageInfo.current,
FPageSize: this.pageInfo.limit
}
let search = this.dataInfo.FSearchName;
if (search && search != "") {
postData.Or_FPlmCode = postData.Or_FTestCode = postData.Or_FName = postData.Or_FVersionCode =
search;
}
let result = await getPageList(postData, "Formula");
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 ? item.FType : type.FName;
if (this.dataInfo.FFormulaID == item.FID) this.selectedKey = item.FID
});
this.pageInfo.total = result.Data.Total || 0;
this.dataList = [{F1:"10000271",F2:"KTFTS22111101",F3:"KTFTS22111101-K001@测试",F4:"产成品"},
{F1:"",F2:"KTFTS22111101",F3:"12",F4:"半成品"},
{F1:"10000270",F2:"KTFTS22111101",F3:"KTFTS22111101-K001@测试",F4:"产成品"}];
},
//-
async submitClick(isCreate) {
let postData = this.dataInfo;
postData.FSaleCode = (postData.FSaleCode || "").trim();
postData.FTestCode = (postData.FTestCode || "").trim();
postData.FMaterialGroup = (postData.FMaterialGroup || "").trim();
postData.FWeightUnit = (postData.FWeightUnit || "").trim();
postData.FFormulaName = (postData.FFormulaName || "").trim();
postData.FCreateFactoryID=(postData.FCreateFactoryID==-1?"":postData.FCreateFactoryID);
for (let key in postData) {
if (postData[key] == "") return false;
}
// let indexs = [postData.FSaleCode.indexOf("-"), postData.FSaleCode.indexOf("@")];
// if (indexs[0] == -1 || indexs[1] == -1 || indexs[1] - indexs[0] < 2) {
// layer.msg('')
// return false;
// }
postData.FState = isCreate ? 1 : 0;
postData = JSON.parse(JSON.stringify(postData));
if (postData.FTestCode != postData.FFormulaTestCode) {
this.sureTextCode(postData);
return false;
}
this._postTermData(postData);
},
//-
sureTextCode(postData) {
let $this = this;
layer.confirm("选择的配方和订单试验号不一致,请确认使用选择的配方嘛?", {
title: "提示",
btn: [{
text: '暂时保存',
callback: function (id) {
layer.close(id);
postData["FState"] = 0;
$this._postTermData(postData);
}
},
{
text: '确认提交',
callback: function (id) {
layer.close(id);
postData["FState"] = 1;
$this._postTermData(postData);
}
}
]
});
},
//-
async _postTermData(postData) {
delete postData["FSearchName"];
let result = 0;
let idx = layer.load(2);
if (postData.FID && postData.FID > 0) {
result = await updateDataInfo(postData, "Teamwork") || 0;
} else {
result = await insertDataInfo(postData, "Teamwork") || 0;
}
if (result > 0) {
this.cancelClick(true);
}
layer.close(idx);
}
}
}
</script>

File diff suppressed because one or more lines are too long

@ -0,0 +1,118 @@
<template>
<lay-table style="margin:0 0 30px 0;" height="200px" :columns="dataColumn" :data-source="dataList">
<template v-slot:toolbar>
<p style="float:left;">配方视图</p>
</template>
</lay-table>
</template>
<script>
import {
ref
} from 'vue';
import {
getTeamworkView
} from "/src/api/api/teamwork";
export default {
setup() {
const viewList = ref([]);
const dataColumn = ref([
{type: 'number', title: '序号', width: '56'},
{key: '工厂', title: '工厂', align: 'center', width: '130px'},
{key: '开始生效日期', title: '开始生效日期', align: 'center', width: '130px'},
{key: 'BOM用途', title: 'BOM用途', align: 'center', width: '130px'},
{key: 'BOM状态', title: 'BOM状态', align: 'center', width: '130px'},
{key: '可选文本', title: '可选文本', align: 'center', width: '130px'},
{key: '可选BOM', title: '可选BOM', align: 'center', width: '130px'},
{key: '父项编码', title: '父项编码', align: 'center', width: '200px'},
{key: '父项描述', title: '父项描述', align: 'center', width: '300px'},
{key: '基本数量', title: '基本数量', align: 'center', width: '130px'},
{key: '基本单位', title: '基本单位', align: 'center', width: '130px'},
{key: '子项序号', title: '子项序号', align: 'center', width: '130px'},
{key: '项目类别', title: '项目类别', align: 'center', width: '130px'},
{key: '子项编码', title: '子项编码', align: 'center', width: '200px'},
{key: '子件描述', title: '子件描述', align: 'center', width: '300px'},
{key: '组件数量', title: '组件数量', align: 'center', width: '130px'},
{key: '计量单位', title: '计量单位', align: 'center', width: '130px'},
{key: '工程变更号', title: '工程变更号', align: 'center', width: '130px'},
{key: '项目ID', title: '项目ID', align: 'center', width: '130px'},
{key: '物料供应标识符', title: '物料供应标识符', align: 'center', width: '130px'},
{key: '备件标示', title: '备件标示', align: 'center', width: '130px'},
{key: '生产仓储地点', title: '生产仓储地点', align: 'center', width: '130px'},
{key: '组件损耗率', title: '组件损耗率', align: 'center', width: '130px'},
{key: '成本核算标识相关', title: '成本核算标识相关', align: 'center', width: '130px'},
{key: '生产相关', title: '生产相关', align: 'center', width: '130px'},
{key: 'BOM项目文本1', title: 'BOM项目文本1', align: 'center', width: '130px'},
{key: 'BOM项目文本2', title: 'BOM项目文本2', align: 'center', width: '130px'},
{key: '替代项目组', title: '替代项目组', align: 'center', width: '130px'},
{key: '优先级', title: '优先级', align: 'center', width: '130px'},
{key: '策略', title: '策略', align: 'center', width: '130px'},
{key: '使用可能性', title: '使用可能性', align: 'center', width: '130px'},
{key: '固定损耗数量', title: '固定损耗数量', align: 'center', width: '130px'}
]);
const dataList = ref([]);
return {
viewList,
dataColumn,
dataList
}
},
props: {
teamId: {
type: String,
default: () => ""
},
halfId: {
type: String,
default: () => ""
}
},
mounted() {
this.initPage();
},
methods: {
async initPage() {
let dataColumn = [{
type: "number",
title: "序号",
width: "56"
}];
let dataList = [];
let postData = {
FTeamID: this.teamId,
FViewType: 2,
FType: 1,
HalfId : this.halfId
};
let result = await getTeamworkView(postData);
let formulaList = result["List1"]
if (formulaList) {
for (let key in formulaList[0]) {
let width = (key.indexOf("描述") != -1 || key == "文本" || key == "物料") ? "300px" :
"130px";
width = key.indexOf("编码") != -1 ? "200px" : width;
dataColumn.push({
key: key,
title: key.split('.').pop(),
align: "center",
width: width
});
}
formulaList.forEach((item) => {
dataList.push(item);
});
}
// this.dataColumn = dataColumn;
this.dataList = dataList;
}
}
}
</script>

@ -0,0 +1,78 @@
<template>
<lay-container>
<view class="layui-item33 color999" :style="'max-height:900px'">
<lay-row space="10">
<lay-col md="4" sm="12" xs="24" v-for="(item, index) in columns">
<lay-checkbox-group v-model="checkedItem">
<lay-checkbox :name="item.title" skin="primary" :value="item.key">
{{ item.title }}
</lay-checkbox>
</lay-checkbox-group>
</lay-col>
</lay-row>
</view>
<view class="menuBtn">
<lay-button type="primary" @click="submitClick"></lay-button>
<lay-button @click="cancelClick"></lay-button>
</view>
</lay-container>
</template>
<script>
import {
ref
} from 'vue';
export default {
setup() {
const columnList = ref([]);
const checkedItem = ref([]);
return {
columnList,
checkedItem,
}
},
props: {
columns: {
type: Object,
default: () => [],
},
freezingColumns: {
type: Object,
default: () => [],
}
},
mounted() {
this.initPage();
},
methods: {
initPage() {
this.columnList = this.columns;
this.checkedItem = this.freezingColumns.concat();
},
cancelClick() {
this.$emit('cancelClick', this.freezingColumns);
},
submitClick() {
this.$emit('cancelClick', this.checkedItem);
}
}
}
</script>
<style scoped>
.layui-item33 {
width: 90%;
padding-right: 30px;
margin: 30px auto 10px;
display: block;
overflow: auto;
position: relative;
clear: both;
}
.menuBtn {
display: block;
text-align: center;
width: 96%;
margin: 20px auto;
}
</style>

@ -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,248 @@
<template>
<div class="box-data">
<lay-scroll height="800px">
<lay-container class="dataInfo">
<lay-row space="10">
<lay-col md="6"><div class="grid-demo" style="text-align: right;">原配方</div></lay-col>
<lay-col md="18"><div class="grid-demo" style="text-align: left;">配方号+版本号+描述</div></lay-col>
<lay-col md="6"><div class="grid-demo" style="text-align: right;">变更后的配方</div></lay-col>
<lay-col md="18"><div class="grid-demo" style="text-align: left;">配方号+版本号+描述</div></lay-col>
</lay-row>
</lay-container>
<lay-quote v-if="dataList.length>0"></lay-quote>
<lay-container class="tableInfo" v-if="dataList.length>0">
<lay-table :columns="dataColumn" :dataSource="dataList">
<template v-slot:operator="{ data }">
<lay-button v-if="data.seeCode!=''" size="xs" type="primary" @click="_getTeamworkView(data,1)">
查看
</lay-button>
<lay-button v-if="data.outCode!=''" size="xs" type="primary" @click="_getTeamworkView(data,2)">
导出
</lay-button>
</template>
</lay-table>
</lay-container>
</lay-scroll>
<lay-layer area="90%" v-model="showEditBox" title="视图查看">
<ShowMaterial :viewList="viewList" :viewHeight="viewHeight" @cancelClick="cancelClick"></ShowMaterial>
</lay-layer>
</div>
</template>
<style scoped>
.box-data {
margin: 10px auto;
display: block;
}
.dataInfo {
max-width: 960px;
margin: 14px auto 20px;
overflow: hidden;
clear: both;
float: none;
}
.pro-item.state1 {
background-color: rgb(50, 189, 182, 0.9);
background-image: url('../../../assets/state1.png');
box-shadow: 4px 4px 4px rgb(50, 189, 182, 0.4);
}
.pro-item.state2 {
background-color: rgb(22, 138, 221, 0.9);
background-image: url('../../../assets/state2.png');
box-shadow: 4px 4px 4px rgb(22, 138, 221, 0.4);
}
.pro-item.none {
float: none !important;
display: block !important;
margin-left: auto;
margin-right: auto;
overflow: hidden;
}
.pro-item.none .left {
margin-top: 11px;
}
.pro-item {
background: rgb(187, 187, 187, 0.9) url('../../../assets/state0.png') no-repeat left top;
-webkit-border-radius: 6px;
-ms-border-radius: 6px;
-o-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
width: 48%;
margin: 10px 1%;
padding: 16px 5px;
box-shadow: 4px 4px 4px rgb(187, 187, 187, 0.4);
}
.pro-item .left {
width: 34%;
display: block;
text-align: center;
float: left;
margin-top: 13px;
margin-bottom: 5px;
}
.pro-item .left.margin {
margin-top: 6px;
margin-bottom: 0;
}
.pro-item .left.margin .group {
margin: 6px auto 2px;
}
.pro-item .left .num {
-webkit-border-radius: 32px;
-ms-border-radius: 32px;
-o-border-radius: 32px;
-moz-border-radius: 32px;
border-radius: 32px;
display: block;
line-height: 32px;
font-size: 22px;
width: 32px;
border: 1px solid #222;
margin: 0 auto;
}
.pro-item .left .group {
font-weight: 500;
line-height: 22px;
margin: 10px auto 8px;
font-size: 16px;
max-width: 100px;
display: block;
overflow: hidden;
}
.pro-item .right {
width: 63%;
display: inline-block;
line-height: 22px;
}
.pro-item .right p {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis
}
.pro-next {
display: block;
background: url('../../../assets/state-next.jpg') no-repeat center;
height: 30px;
margin: 10px auto;
}
.tableInfo {
max-width: 96%;
margin: 20px auto;
overflow: hidden;
clear: both;
float: none;
}
</style>
<script>
import {
ref,
watch
} from 'vue';
import {
getTeamProcessList,
getTeamworkView
} from "/src/api/api/teamwork";
import {
getBasicRoleList
} from "/src/api/api/user";
import ShowMaterial from './ShowMaterial.vue';
export default {
components: {
ShowMaterial
},
setup() {
const dataList = ref([]);
let dataColumn = [{
title: "视图",
key: "name",
},
{
title: "操作",
key: "operator",
width: "148px",
customSlot: "operator",
align: "center"
}
];
const dataProcess = ref({});
//
const viewTypeCount = ref(5);
const showEditBox = ref(false);
const viewList = ref([]);
const viewHeight = ref(500);
return {
dataList,
dataColumn,
dataProcess,
viewTypeCount,
showEditBox,
viewList,
viewHeight
}
},
props: {
dataInfoObj: {
type: Object,
default: () => {},
}
},
mounted() {
this._getViewList();
},
methods: {
//
async _getViewList() {
this.dataList = [{"name":"新物料视图","seeCode":"1","outCode":"6"},{"name":"受影响的物料视图","seeCode":"5","outCode":"10"},{"name":"配方视图","seeCode":"5","outCode":"10"}];
},
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.FID,
FViewType: viewType,
FType: type,
HalfId : this.dataInfoObj.FMaterialHalfIDs
};
if (this.dataInfoObj.FProgress == "100" || this.dataInfoObj.FProgress == "100%") {
postData.FFinish = 1;
}
let idx = layer.load(2);
let result = await getTeamworkView(postData);
layer.close(idx);
if (type == 1) {
this.showEditBox = true;
} else {
window.open(result);
}
},
//
dateFormat(dataStr) {
if (dataStr == null || dataStr == "") return "";
return dataStr.replace('T', ' ').split('.')[0];
},
cancelClick(isFirst) {
this.$emit('cancelClick', isFirst ? isFirst : false);
}
}
}
</script>

File diff suppressed because one or more lines are too long

@ -0,0 +1,95 @@
<template>
<lay-container fluid="true" class="content-box">
<lay-table v-if="dataColumn.length>0" :height="viewHeight+'px'" :columns="dataColumn" :data-source="dataList"
:row-style="rowStyle">
</lay-table>
</lay-container>
</template>
<style scoped>
.content-box {
margin: 30px 10px;
display: block;
position: relative;
clear: both;
float: none;
}
</style>
<script>
import {
ref
} from 'vue';
export default {
setup() {
const dataColumn = ref([]);
const dataList = 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,
}
},
props: {
viewList: {
type: Object,
default: () => [],
},
viewHeight: {
type: Number,
default: () => 600,
}
},
mounted() {
this.initPage();
},
methods: {
initPage() {
let dataColumn = [{
type: "number",
title: "序号",
width: "56"
}];
let dataList = [];
let dataColor = []
this.viewList.forEach((item) => {
if (item.length > 0) {
if (dataColumn.length == 1) {
for (let key in item[0]) {
let width = (key.indexOf("描述") != -1 || key == "文本" || key == "物料") ? "300px" :
"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
},
cancelClick() {
this.$emit('cancelClick', false);
}
}
}
</script>

@ -0,0 +1,307 @@
<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>
<lay-button size="sm" type="primary" @click="showEditMaterial(2)"></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="showEditMaterial(3)"></lay-button>
</template>
</lay-table>
</lay-card>
</lay-col>
</lay-row>
<lay-layer :area="modelArea[2]" v-model="showEditBox[2]" title="配方变更">
<EditMateria v-if="showEditBox[2]" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></EditMateria>
</lay-layer>
<lay-layer :area="modelArea[3]" v-model="showEditBox[3]" title="配方变更详情">
<ShowData1 v-if="showEditBox[3]" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></ShowData1>
</lay-layer>
</lay-container>
</template>
<style scoped>
.layui-table-body {
min-height: 50vh;
}
</style>
<script>
import {
ref,
watch
} from "vue";
import {
getBasicList,
getPageList
} from "/src/api/api/common";
import ShowData1 from '../half/components/ShowData1.vue';
import EditMateria from '../half/components/EditMateria.vue';
import EditView from '../half/components/EditView.vue';
import '@layui/layui-vue/es/checkbox/index.css';
import '@layui/layui-vue/es/radio/index.css';
export default {
components: {
EditMateria,
EditView,
ShowData1
},
setup() {
let dataColumn = [
{
title: "序号",
key: "F1",
width: "160px",
align: 'center',
hide: false
}, {
title: "原试验号",
key: "F2",
width: "300px",
align: 'center',
hide: false
},
{
title: "原版本号",
key: "F3",
width: "160px",
align: 'center',
hide: false
},
{
title: "新试验号",
key: "F4",
width: "160px",
align: 'center',
hide: false
},
{
title: "新版本号",
key: "F5",
width: "400px",
align: 'center'
},
{
title: "产品分类",
key: "F6",
width: "400px",
align: 'center'
},
{
title: "发起时间",
key: "F7",
width: "180px",
align: 'center'
},
{
title: "发起人",
key: "F8",
width: "178px",
align: 'center'
},
{
title: "操作",
key: "operator",
width: "130px",
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 MaterialModel = ref({});
const showEditBox = ref([false, false, false, false, false, false, false, false, false, false, false, false, false]);
const modelArea = ref(["70%", "70%", "70%", "40%", "70%", "70%", "70%", "70%", "700px", "70%", "70%", "70%", "70%"]);
const objInfoObj = ref({});
const editType = ref(1);
const stateList = ref([{
id: 1,
name: "进行中"
}, {
id: 2,
name: "已完成"
}]);
const hasLoaded = ref(false);
const dataItem = ref([]);
return {
selectedKeys,
checkbox,
defaultToolbar,
dataColumn,
dataList,
pageInfo,
searchObj,
postData,
typeList,
showEditBox,
modelArea,
objInfoObj,
editType,
stateList,
hasLoaded,
MaterialModel,
dataItem
};
},
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 = [{ F1: 1, F2: "10020421", F3: "1.0", F4: "10020421", F5: "2.0", F6: "半成品", F7: "2022-10-24 11:00", F8: "kai" }];
this.hasLoaded = true;
},
//
dateFormat(dataStr) {
return dataStr.replace('T', ' ').split('.')[0];
},
getData(data) {
this.MaterialModel = data;
for (let i = 0; i < this.showEditBox.length; i++) {
this.showEditBox[i] = false;
}
this.showEditBox[11] = true;
this.editType = 1;
},
showEditMaterial(i) {
this.showEditBox[i] = true;
},
_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 if (data.FType == 15) {
data.FBoxType = 9; //
} else if (data.FType == 16) {
this.dataItem = data;
data.FBoxType = 10; //
} 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,337 @@
<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>
<lay-button size="sm" type="normal" style="float:right" @click="showEditMaterial(1)"></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="showEditMaterial(3)"></lay-button>
</template>
</lay-table>
</lay-card>
</lay-col>
</lay-row>
<lay-layer :area="modelArea[2]" v-model="showEditBox[2]" :title="编辑物料">
<EditMateria v-if="showEditBox[2]" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></EditMateria>
</lay-layer>
<lay-layer :area="modelArea[3]" v-model="showEditBox[3]" :title="物料视图">
<EditView v-if="showEditBox[3]" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></EditView>
</lay-layer>
</lay-container>
</template>
<script>
import {
ref,
watch
} from "vue";
import {
getBasicList,
getPageList
} from "/src/api/api/common";
import EditMateria from '../half/components/EditMateria.vue';
import EditView from '../half/components/EditView.vue';
import '@layui/layui-vue/es/checkbox/index.css';
import '@layui/layui-vue/es/radio/index.css';
export default {
components: {
EditMateria,
EditView
},
setup() {
let dataColumn = [
{
title: "序号",
key: "F1",
width: "160px",
align: 'center',
hide: false
},{
title: "新试验号",
key: "F2",
width: "300px",
align: 'center',
hide: false
},
{
title: "新版本号",
key: "F3",
width: "160px",
align: 'center',
hide: false
},
{
title: "事项",
key: "F4",
width: "160px",
align: 'center',
hide: false
},
{
title: "产品分类",
key: "F5",
width: "400px",
align: 'center'
},
{
title: "发起时间",
key: "F6",
width: "180px",
align: 'center'
},
{
title: "发起人",
key: "F7",
width: "178px",
align: 'center'
},
{
title: "负责人",
key: "F8",
width: "98px",
align: 'center',
customSlot: '',
},
{
title: "操作",
key: "operator",
width: "130px",
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 MaterialModel= ref({});
const showEditBox = ref([false, 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%","70%","70%"]);
const objInfoObj = ref({});
const editType = ref(1);
const stateList = ref([{
id: 1,
name: "进行中"
}, {
id: 2,
name: "已完成"
}]);
const hasLoaded = ref(false);
const dataItem=ref([]);
return {
selectedKeys,
checkbox,
defaultToolbar,
dataColumn,
dataList,
pageInfo,
searchObj,
postData,
typeList,
showEditBox,
modelArea,
objInfoObj,
editType,
stateList,
hasLoaded,
MaterialModel,
dataItem
};
},
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;
debugger
this.dataList = [{"F1":"1","F2":"10020421",
"F3":"","F4":"物料分类选择",
"F5":"半成品","F6":"2022-10-24 11:00",
"F7":"Kai","F8":"Kai"},
{"F1":"2","F2":"10020421","F3":"","F4":"物料编辑",
"F5":"半成品","F6":"2022-10-24 11:00","F7":"Kai","F8":"Kai"}];
this.hasLoaded = true;
},
//
dateFormat(dataStr) {
return dataStr.replace('T', ' ').split('.')[0];
},
getData(data){
this.MaterialModel = data;
for (let i = 0; i < this.showEditBox.length; i++) {
this.showEditBox[i] = false;
}
this.showEditBox[11] = true;
this.editType = 1;
},
showEditMaterial(i){
this.showEditBox[i] = true;
},
_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 if (data.FType == 15) {
data.FBoxType = 9; //
}else if(data.FType==16){
this.dataItem=data;
data.FBoxType = 10; //
}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,297 @@
<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 :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>
<lay-button size="sm" type="normal" @click="showEditMaterial(1)"></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="showEditMaterial(3)"></lay-button>
</template>
</lay-table>
</lay-card>
</lay-col>
</lay-row>
<lay-layer :area="modelArea[1]" v-model="showEditBox[1]" title="新增物料">
<AddMateria v-if="showEditBox[1]" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></AddMateria>
</lay-layer>
<lay-layer :area="modelArea[2]" v-model="showEditBox[2]" title="修改物料">
<EditMateria v-if="showEditBox[2]" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></EditMateria>
</lay-layer>
<lay-layer :area="modelArea[3]" v-model="showEditBox[3]" title="编辑物料">
<EditView v-if="showEditBox[3]" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></EditView>
</lay-layer>
</lay-container>
</template>
<script>
import {
ref,
watch
} from "vue";
import {
getBasicList,
getPageList
} from "/src/api/api/common";
import AddMateria from '../materia/components/AddMateria.vue';
import EditMateria from '../materia/components/EditMateria.vue';
import EditView from '../materia/components/EditView.vue';
import '@layui/layui-vue/es/checkbox/index.css';
import '@layui/layui-vue/es/radio/index.css';
export default {
components: {
AddMateria,
EditMateria,
EditView
},
setup() {
let dataColumn = [{
type: "checkbox"
},
{
title: "ID",
key: "F1",
width: "160px",
align: 'center',
hide: false
},{
title: "模块",
key: "F2",
width: "300px",
align: 'center',
hide: false
},
{
title: "功能",
key: "F3",
width: "160px",
align: 'center',
hide: false
},
{
title: "操作描述",
key: "F4",
width: "160px",
align: 'center',
hide: false
},
{
title: "操作时间",
key: "F5",
width: "180px",
align: 'center'
},
{
title: "操作类型",
key: "F6",
width: "400px",
align: 'center'
},
{
title: "操作人",
key: "F7",
width: "178px",
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 MaterialModel= ref({});
const showEditBox = ref([false, 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%","70%","70%"]);
const objInfoObj = ref({});
const editType = ref(1);
const stateList = ref([{
id: 1,
name: "进行中"
}, {
id: 2,
name: "已完成"
}]);
const hasLoaded = ref(false);
const dataItem=ref([]);
return {
selectedKeys,
checkbox,
defaultToolbar,
dataColumn,
dataList,
pageInfo,
searchObj,
postData,
typeList,
showEditBox,
modelArea,
objInfoObj,
editType,
stateList,
hasLoaded,
MaterialModel,
dataItem
};
},
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 = [
{"F1":"1","F2":"协同路线","F3":"KTFKP22100901-K501@测试","F4":"新增协同","F5":"2022-10-24 11:00","F6":"新增","F7":"Kai"},
{"F1":"2","F2":"协同路线","F3":"KTFKP22100901-K501@测试","F4":"查看了物料视图","F5":"2022-10-24 11:00","F6":"查看","F7":"Kai"}
];
},
//
dateFormat(dataStr) {
return dataStr.replace('T', ' ').split('.')[0];
},
getData(data){
this.MaterialModel = data;
for (let i = 0; i < this.showEditBox.length; i++) {
this.showEditBox[i] = false;
}
this.showEditBox[11] = true;
this.editType = 1;
},
showEditMaterial(i){
this.showEditBox[i] = true;
},
_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 if (data.FType == 15) {
data.FBoxType = 9; //
}else if(data.FType==16){
this.dataItem=data;
data.FBoxType = 10; //
}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,344 @@
<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>
<lay-button size="sm" type="normal" @click="showEditMaterial(1)"></lay-button>
<lay-button size="sm" type="primary" @click="showEditMaterial(2)"></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="showEditMaterial(3)"></lay-button>
</template>
</lay-table>
</lay-card>
</lay-col>
</lay-row>
<lay-layer :area="modelArea[1]" v-model="showEditBox[1]" title="新增物料">
<AddMateria v-if="showEditBox[1]" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></AddMateria>
</lay-layer>
<lay-layer :area="modelArea[2]" v-model="showEditBox[2]" title="修改物料">
<EditMateria v-if="showEditBox[2]" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></EditMateria>
</lay-layer>
<lay-layer :area="modelArea[3]" v-model="showEditBox[3]" title="编辑物料">
<EditView v-if="showEditBox[3]" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></EditView>
</lay-layer>
</lay-container>
</template>
<script>
import {
ref,
watch
} from "vue";
import {
getBasicList,
getPageList
} from "/src/api/api/common";
import AddMateria from '../materia/components/AddMateria.vue';
import EditMateria from '../materia/components/EditMateria.vue';
import EditView from '../materia/components/EditView.vue';
import '@layui/layui-vue/es/checkbox/index.css';
import '@layui/layui-vue/es/radio/index.css';
export default {
components: {
AddMateria,
EditMateria,
EditView
},
setup() {
let dataColumn = [
{
title: "ID",
key: "FID",
width: "160px",
align: 'center',
hide: false
},{
title: "物料号",
key: "FMdmCode",
width: "300px",
align: 'center',
hide: false
},
{
title: "物料描述",
key: "FSaleCode",
width: "160px",
align: 'center',
hide: false
},
{
title: "试验号",
key: "FTestCode",
width: "160px",
align: 'center',
hide: false
},
{
title: "产品分类",
key: "FDesc",
width: "400px",
align: 'center'
},
{
title: "发起时间",
key: "FAddDate",
width: "180px",
align: 'center'
},
{
title: "发起人",
key: "FUserName",
width: "178px",
align: 'center'
},
{
title: "类型",
key: "IsEdit",
width: "98px",
align: 'center',
customSlot: '',
},
{
title: "状态",
key: "FStateName",
width: "160px",
align: 'center'
},
{
title: "操作",
key: "operator",
width: "130px",
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 MaterialModel= ref({});
const showEditBox = ref([false, 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%","70%","70%"]);
const objInfoObj = ref({});
const editType = ref(1);
const stateList = ref([{
id: 1,
name: "进行中"
}, {
id: 2,
name: "已完成"
}]);
const hasLoaded = ref(false);
const dataItem=ref([]);
return {
selectedKeys,
checkbox,
defaultToolbar,
dataColumn,
dataList,
pageInfo,
searchObj,
postData,
typeList,
showEditBox,
modelArea,
objInfoObj,
editType,
stateList,
hasLoaded,
MaterialModel,
dataItem
};
},
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);
item["IsEdit"]=Math.floor(Math.random()*10)==0?"编辑":"新增";
});
this.pageInfo.total = result.Data.Total || 0;
debugger
this.dataList = result.Data.List;
this.hasLoaded = true;
},
//
dateFormat(dataStr) {
return dataStr.replace('T', ' ').split('.')[0];
},
getData(data){
this.MaterialModel = data;
for (let i = 0; i < this.showEditBox.length; i++) {
this.showEditBox[i] = false;
}
this.showEditBox[11] = true;
this.editType = 1;
},
showEditMaterial(i){
this.showEditBox[i] = true;
},
_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 if (data.FType == 15) {
data.FBoxType = 9; //
}else if(data.FType==16){
this.dataItem=data;
data.FBoxType = 10; //
}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,340 @@
<template>
<lay-form :model="dataInfo" class="dataInfo">
<lay-form-item label="新增物料描述" prop="FSaleCode" required label-width="120" style="margin-bottom:30px;">
<lay-input v-model="dataInfo.FSaleCode" @input="_inputSaleCode"></lay-input>
<p class="note">成品半成品中间品子项包材可以新增原料不允许新增</p>
</lay-form-item>
<lay-form-item label="选择模式" prop="FCreateFactoryID" required label-width="120" style="margin-bottom:30px;">
<lay-select v-model="dataInfo.FCreateFactoryID" placeholder="请选择">
<lay-select-option v-for="(fIdv, fIdx) in factoryLists" key="fIdx" :value="fIdv.FID" :label="fIdv.FName"></lay-select-option>
</lay-select>
<p class="note">模式必选通过模式确认视图类型</p>
</lay-form-item>
<lay-form-item label="选择物料组" prop="FMaterialGroup" required label-width="120">
<lay-select v-model="dataInfo.FMaterialGroup" 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="FWeightUnit" required label-width="120">
<lay-select v-model="dataInfo.FWeightUnit" 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="seletList[0].find(s => s.FValue == dataInfo.FWeightUnit) != null">
{{ seletList[0].find(s => s.FValue == dataInfo.FWeightUnit).FName }}
</p>
</lay-form-item>
<lay-form-item label="物料类型" prop="FMaterialType" required label-width="120" style="margin-bottom:30px;">
<lay-select v-model="dataInfo.FMaterialGroup" 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="FTestCode" required label-width="120">
<lay-input v-model="dataInfo.FTestCode"></lay-input>
</lay-form-item>
</lay-form>
<div v-if="showButton" style="text-align: center;">
<lay-form-item>
<lay-button type="normal" @click="submitClick(true)"></lay-button>
<lay-button @click="cancelClick"></lay-button>
</lay-form-item>
</div>
</template>
<style scoped>
.dataInfo {
max-width: 90%;
height: 600px;
margin: 30px auto;
padding-right: 30px;
overflow-y: auto;
}
.search-btn2 {
position: absolute;
right: 0;
top: 0;
}
.note2 {
display: inline-block;
margin-left: 16px;
}
.note3 {
display: inline-flex;
line-height: 38px;
margin-left: 12px;
}
.note2,
.note {
color: #999;
font-size: 12px;
}
.note {
margin-top: 4px;
position: absolute;
}
.note .layui-form-radio,
.note .layui-form-radio i {
margin: 0 1px 0 0;
padding: 0;
font-size: 14px;
margin-top: -2px;
line-height: 0;
}
.FSearchName {
color: var(--global-primary-color)
}
</style>
<script>
import {
ref,
watch
} from 'vue';
import {
getDataCode,
getPageList,
getBasicList,
insertDataInfo,
updateDataInfo,
getDataModel
} from "/src/api/api/common";
import {
getFactoryList
} from "/src/api/api/factory";
export default {
setup() {
const dataInfo = ref({
FMaterialType: "ZMAT",
FWeightUnit: "KG"
});
const formulaList = ref([]);
const seletList = ref([
[],
[]
]);
const typeList = ref([]);
let dataColumn = [{
type: "radio"
}, {
title: "名称",
key: "FName"
},
{
title: "试验号",
key: "FTestCode"
},
{
title: "配方种类",
key: "FTypeName",
width: "110px"
},
{
title: "版本号",
key: "FVersionCode"
}
];
dataColumn.forEach((item) => {
item.align = "center";
});
const pageInfo = ref({
total: 0,
limit: 5,
current: 1
});
const dataList = ref([]);
const selectedKey = ref("");
watch(selectedKey, function () {
const chose = dataList.value.find(s => s.FID == selectedKey.value) || null;
if (chose != null) {
dataInfo.value.FFormulaName = chose.FName + "+" + chose.FTestCode + "+" + chose.FVersionCode;
dataInfo.value.FFormulaID = chose.FID;
dataInfo.value.FVersionCode = chose.FVersionCode;
dataInfo.value.FFormulaTestCode = chose.FTestCode;
}
});
const showEditBox = ref(false);
const showButton = ref(true);
const saleList = ref([]);
const factoryLists = ref([]);
const factoryValue=ref(null);
return {
dataInfo,
formulaList,
seletList,
typeList,
dataColumn,
dataList,
pageInfo,
selectedKey,
showEditBox,
showButton,
saleList,
factoryLists,
factoryValue
}
},
props: {
dataInfoObj: {
type: Object,
default: () => { },
}
},
mounted() {
//
if (this.dataInfoObj && this.dataInfoObj.FTeamID) {
this._getTeamData(this.dataInfoObj.FTeamID);
this.showButton = this.dataInfoObj.FCanEdit != 2
}
this._getSelectList();
this._getFactoryList();
},
methods: {
cancelClick(isFirst) {
this.$emit('cancelClick', isFirst ? isFirst : false);
},
async _getFactoryList() {
this.factoryLists = await getFactoryList() || [];
},
async _getTeamData(dataId) {
let result = await getDataModel({
FID: dataId,
FKey: "FID,FTestCode,FWeightUnit,FSaleCode,FMaterialType,FMaterialGroup,FFormulaTestCode,FFormulaName,FFormulaID,FPackCode,FCreateFactoryID"
}, "Teamwork");
this.dataInfo = result || this.dataInfo;
},
async _getSelectList() {
let result = await getDataCode({
FType: '1,2'
});
this.seletList[0] = result.FType1 || [];
this.seletList[1] = result.FType2 || [];
this.typeList = await getBasicList(37) || [];
this._getPageList();
},
async _inputSaleCode(val) {
let pData = {
FPageIndex: 1,
FPageSize: 10,
FName: val || ""
};
this.saleList = [];
if (pData.FName != "") {
let result = await getPageList(pData, "Material");
this.saleList = result.Data.List || [];
}
},
//
_searchPageList(value) {
this._getPageList(true);
},
//
changePage(obj) {
this.pageInfo.current = obj.current;
this.pageInfo.limit = obj.limit;
this._getPageList();
},
//
async _getPageList(isFirst) {
if (isFirst) {
this.pageInfo.current = 1;
this.pageInfo.total = 0;
}
let postData = {
FPageIndex: this.pageInfo.current,
FPageSize: this.pageInfo.limit
}
let search = this.dataInfo.FSearchName;
if (search && search != "") {
postData.Or_FPlmCode = postData.Or_FTestCode = postData.Or_FName = postData.Or_FVersionCode =
search;
}
let result = await getPageList(postData, "Formula");
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 ? item.FType : type.FName;
if (this.dataInfo.FFormulaID == item.FID) this.selectedKey = item.FID
});
this.pageInfo.total = result.Data.Total || 0;
this.dataList = result.Data.List;
},
//-
async submitClick(isCreate) {
let postData = this.dataInfo;
postData.FSaleCode = (postData.FSaleCode || "").trim();
postData.FTestCode = (postData.FTestCode || "").trim();
postData.FMaterialGroup = (postData.FMaterialGroup || "").trim();
postData.FWeightUnit = (postData.FWeightUnit || "").trim();
postData.FFormulaName = (postData.FFormulaName || "").trim();
postData.FCreateFactoryID=(postData.FCreateFactoryID==-1?"":postData.FCreateFactoryID);
for (let key in postData) {
if (postData[key] == "") return false;
}
// let indexs = [postData.FSaleCode.indexOf("-"), postData.FSaleCode.indexOf("@")];
// if (indexs[0] == -1 || indexs[1] == -1 || indexs[1] - indexs[0] < 2) {
// layer.msg('')
// return false;
// }
postData.FState = isCreate ? 1 : 0;
postData = JSON.parse(JSON.stringify(postData));
if (postData.FTestCode != postData.FFormulaTestCode) {
this.sureTextCode(postData);
return false;
}
this._postTermData(postData);
},
//-
sureTextCode(postData) {
let $this = this;
layer.confirm("选择的配方和订单试验号不一致,请确认使用选择的配方嘛?", {
title: "提示",
btn: [{
text: '暂时保存',
callback: function (id) {
layer.close(id);
postData["FState"] = 0;
$this._postTermData(postData);
}
},
{
text: '确认提交',
callback: function (id) {
layer.close(id);
postData["FState"] = 1;
$this._postTermData(postData);
}
}
]
});
},
//-
async _postTermData(postData) {
delete postData["FSearchName"];
let result = 0;
let idx = layer.load(2);
if (postData.FID && postData.FID > 0) {
result = await updateDataInfo(postData, "Teamwork") || 0;
} else {
result = await insertDataInfo(postData, "Teamwork") || 0;
}
if (result > 0) {
this.cancelClick(true);
}
layer.close(idx);
}
}
}
</script>

@ -0,0 +1,323 @@
<template>
<lay-form :model="dataInfo" class="dataInfo">
<lay-form-item label="选择模式" prop="FCreateFactoryID" required label-width="120" style="margin-bottom:30px;">
<lay-select v-model="dataInfo.FCreateFactoryID" placeholder="请选择">
<lay-select-option v-for="(fIdv, fIdx) in factoryLists" key="fIdx" :value="fIdv.FID" :label="fIdv.FName"></lay-select-option>
</lay-select>
<p class="note">模式必选通过模式确认视图类型</p>
</lay-form-item>
<lay-form-item label="请选择物料名称" prop="FFormulaName" required label-width="120" style="margin-bottom:30px;">
<lay-select v-model="dataInfo.FCreateFactoryID" placeholder="请选择">
<lay-select-option v-for="(fIdv, fIdx) in factoryLists" key="fIdx" :value="fIdv.FID" :label="fIdv.FName"></lay-select-option>
</lay-select>
<p class="note">检索该模式下的所有物料</p>
</lay-form-item>
<lay-form-item v-if="dataList.length > 0">
<lay-table height="200px" :columns="dataColumn" v-model:selected-key="selectedKey" id="FID"
:dataSource="dataList" :page="dataList.length > 0 ? pageInfo : null" @change="changePage">
</lay-table>
</lay-form-item>
</lay-form>
<div v-if="showButton" style="text-align: center;">
<lay-form-item>
<lay-button type="normal" @click="submitClick(true)"></lay-button>
<lay-button @click="cancelClick"></lay-button>
</lay-form-item>
</div>
</template>
<style scoped>
.dataInfo {
max-width: 90%;
height: 600px;
margin: 30px auto;
padding-right: 30px;
overflow-y: auto;
}
.search-btn2 {
position: absolute;
right: 0;
top: 0;
}
.note2 {
display: inline-block;
margin-left: 16px;
}
.note3 {
display: inline-flex;
line-height: 38px;
margin-left: 12px;
}
.note2,
.note {
color: #999;
font-size: 12px;
}
.note {
margin-top: 4px;
position: absolute;
left: 0;
}
.note .layui-form-radio,
.note .layui-form-radio i {
margin: 0 1px 0 0;
padding: 0;
font-size: 14px;
margin-top: -2px;
line-height: 0;
}
.FSearchName {
color: var(--global-primary-color)
}
</style>
<script>
import {
ref,
watch
} from 'vue';
import {
getDataCode,
getPageList,
getBasicList,
insertDataInfo,
updateDataInfo,
getDataModel
} from "/src/api/api/common";
import {
getFactoryList
} from "/src/api/api/factory";
export default {
setup() {
const dataInfo = ref({
FMaterialType: "ZMAT",
FWeightUnit: "KG"
});
const formulaList = ref([]);
const seletList = ref([
[],
[]
]);
const typeList = ref([]);
let dataColumn = [{
type: "radio"
}, {
title: "物料号",
key: "FName"
},
{
title: "试验号",
key: "FTestCode"
},
{
title: "物料描述",
key: "FTypeName",
width: "110px"
},
{
title: "产品分类",
key: "FVersionCode"
}
];
dataColumn.forEach((item) => {
item.align = "center";
});
const pageInfo = ref({
total: 0,
limit: 5,
current: 1
});
const dataList = ref([]);
const selectedKey = ref("");
watch(selectedKey, function () {
const chose = dataList.value.find(s => s.FID == selectedKey.value) || null;
if (chose != null) {
dataInfo.value.FFormulaName = chose.FName + "+" + chose.FTestCode + "+" + chose.FVersionCode;
dataInfo.value.FFormulaID = chose.FID;
dataInfo.value.FVersionCode = chose.FVersionCode;
dataInfo.value.FFormulaTestCode = chose.FTestCode;
}
});
const showEditBox = ref(false);
const showButton = ref(true);
const saleList = ref([]);
const factoryLists = ref([]);
const factoryValue=ref(null);
return {
dataInfo,
formulaList,
seletList,
typeList,
dataColumn,
dataList,
pageInfo,
selectedKey,
showEditBox,
showButton,
saleList,
factoryLists,
factoryValue
}
},
props: {
dataInfoObj: {
type: Object,
default: () => { },
}
},
mounted() {
//
if (this.dataInfoObj && this.dataInfoObj.FTeamID) {
this._getTeamData(this.dataInfoObj.FTeamID);
this.showButton = this.dataInfoObj.FCanEdit != 2
}
this._getSelectList();
this._getFactoryList();
},
methods: {
cancelClick(isFirst) {
this.$emit('cancelClick', isFirst ? isFirst : false);
},
async _getFactoryList() {
this.factoryLists = await getFactoryList() || [];
},
async _getTeamData(dataId) {
let result = await getDataModel({
FID: dataId,
FKey: "FID,FTestCode,FWeightUnit,FSaleCode,FMaterialType,FMaterialGroup,FFormulaTestCode,FFormulaName,FFormulaID,FPackCode,FCreateFactoryID"
}, "Teamwork");
this.dataInfo = result || this.dataInfo;
},
async _getSelectList() {
let result = await getDataCode({
FType: '1,2'
});
this.seletList[0] = result.FType1 || [];
this.seletList[1] = result.FType2 || [];
this.typeList = await getBasicList(37) || [];
this._getPageList();
},
async _inputSaleCode(val) {
let pData = {
FPageIndex: 1,
FPageSize: 10,
FName: val || ""
};
this.saleList = [];
if (pData.FName != "") {
let result = await getPageList(pData, "Material");
this.saleList = result.Data.List || [];
}
},
//
_searchPageList(value) {
this._getPageList(true);
},
//
changePage(obj) {
this.pageInfo.current = obj.current;
this.pageInfo.limit = obj.limit;
this._getPageList();
},
//
async _getPageList(isFirst) {
if (isFirst) {
this.pageInfo.current = 1;
this.pageInfo.total = 0;
}
let postData = {
FPageIndex: this.pageInfo.current,
FPageSize: this.pageInfo.limit
}
let search = this.dataInfo.FSearchName;
if (search && search != "") {
postData.Or_FPlmCode = postData.Or_FTestCode = postData.Or_FName = postData.Or_FVersionCode =
search;
}
let result = await getPageList(postData, "Formula");
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 ? item.FType : type.FName;
if (this.dataInfo.FFormulaID == item.FID) this.selectedKey = item.FID
});
this.pageInfo.total = result.Data.Total || 0;
this.dataList = result.Data.List;
},
//-
async submitClick(isCreate) {
let postData = this.dataInfo;
postData.FSaleCode = (postData.FSaleCode || "").trim();
postData.FTestCode = (postData.FTestCode || "").trim();
postData.FMaterialGroup = (postData.FMaterialGroup || "").trim();
postData.FWeightUnit = (postData.FWeightUnit || "").trim();
postData.FFormulaName = (postData.FFormulaName || "").trim();
postData.FCreateFactoryID=(postData.FCreateFactoryID==-1?"":postData.FCreateFactoryID);
for (let key in postData) {
if (postData[key] == "") return false;
}
// let indexs = [postData.FSaleCode.indexOf("-"), postData.FSaleCode.indexOf("@")];
// if (indexs[0] == -1 || indexs[1] == -1 || indexs[1] - indexs[0] < 2) {
// layer.msg('')
// return false;
// }
postData.FState = isCreate ? 1 : 0;
postData = JSON.parse(JSON.stringify(postData));
if (postData.FTestCode != postData.FFormulaTestCode) {
this.sureTextCode(postData);
return false;
}
this._postTermData(postData);
},
//-
sureTextCode(postData) {
let $this = this;
layer.confirm("选择的配方和订单试验号不一致,请确认使用选择的配方嘛?", {
title: "提示",
btn: [{
text: '暂时保存',
callback: function (id) {
layer.close(id);
postData["FState"] = 0;
$this._postTermData(postData);
}
},
{
text: '确认提交',
callback: function (id) {
layer.close(id);
postData["FState"] = 1;
$this._postTermData(postData);
}
}
]
});
},
//-
async _postTermData(postData) {
delete postData["FSearchName"];
let result = 0;
let idx = layer.load(2);
if (postData.FID && postData.FID > 0) {
result = await updateDataInfo(postData, "Teamwork") || 0;
} else {
result = await insertDataInfo(postData, "Teamwork") || 0;
}
if (result > 0) {
this.cancelClick(true);
}
layer.close(idx);
}
}
}
</script>

File diff suppressed because one or more lines are too long

@ -0,0 +1,118 @@
<template>
<lay-table style="margin:0 0 30px 0;" height="200px" :columns="dataColumn" :data-source="dataList">
<template v-slot:toolbar>
<p style="float:left;">配方视图</p>
</template>
</lay-table>
</template>
<script>
import {
ref
} from 'vue';
import {
getTeamworkView
} from "/src/api/api/teamwork";
export default {
setup() {
const viewList = ref([]);
const dataColumn = ref([
{type: 'number', title: '序号', width: '56'},
{key: '工厂', title: '工厂', align: 'center', width: '130px'},
{key: '开始生效日期', title: '开始生效日期', align: 'center', width: '130px'},
{key: 'BOM用途', title: 'BOM用途', align: 'center', width: '130px'},
{key: 'BOM状态', title: 'BOM状态', align: 'center', width: '130px'},
{key: '可选文本', title: '可选文本', align: 'center', width: '130px'},
{key: '可选BOM', title: '可选BOM', align: 'center', width: '130px'},
{key: '父项编码', title: '父项编码', align: 'center', width: '200px'},
{key: '父项描述', title: '父项描述', align: 'center', width: '300px'},
{key: '基本数量', title: '基本数量', align: 'center', width: '130px'},
{key: '基本单位', title: '基本单位', align: 'center', width: '130px'},
{key: '子项序号', title: '子项序号', align: 'center', width: '130px'},
{key: '项目类别', title: '项目类别', align: 'center', width: '130px'},
{key: '子项编码', title: '子项编码', align: 'center', width: '200px'},
{key: '子件描述', title: '子件描述', align: 'center', width: '300px'},
{key: '组件数量', title: '组件数量', align: 'center', width: '130px'},
{key: '计量单位', title: '计量单位', align: 'center', width: '130px'},
{key: '工程变更号', title: '工程变更号', align: 'center', width: '130px'},
{key: '项目ID', title: '项目ID', align: 'center', width: '130px'},
{key: '物料供应标识符', title: '物料供应标识符', align: 'center', width: '130px'},
{key: '备件标示', title: '备件标示', align: 'center', width: '130px'},
{key: '生产仓储地点', title: '生产仓储地点', align: 'center', width: '130px'},
{key: '组件损耗率', title: '组件损耗率', align: 'center', width: '130px'},
{key: '成本核算标识相关', title: '成本核算标识相关', align: 'center', width: '130px'},
{key: '生产相关', title: '生产相关', align: 'center', width: '130px'},
{key: 'BOM项目文本1', title: 'BOM项目文本1', align: 'center', width: '130px'},
{key: 'BOM项目文本2', title: 'BOM项目文本2', align: 'center', width: '130px'},
{key: '替代项目组', title: '替代项目组', align: 'center', width: '130px'},
{key: '优先级', title: '优先级', align: 'center', width: '130px'},
{key: '策略', title: '策略', align: 'center', width: '130px'},
{key: '使用可能性', title: '使用可能性', align: 'center', width: '130px'},
{key: '固定损耗数量', title: '固定损耗数量', align: 'center', width: '130px'}
]);
const dataList = ref([]);
return {
viewList,
dataColumn,
dataList
}
},
props: {
teamId: {
type: String,
default: () => ""
},
halfId: {
type: String,
default: () => ""
}
},
mounted() {
this.initPage();
},
methods: {
async initPage() {
let dataColumn = [{
type: "number",
title: "序号",
width: "56"
}];
let dataList = [];
let postData = {
FTeamID: this.teamId,
FViewType: 2,
FType: 1,
HalfId : this.halfId
};
let result = await getTeamworkView(postData);
let formulaList = result["List1"]
if (formulaList) {
for (let key in formulaList[0]) {
let width = (key.indexOf("描述") != -1 || key == "文本" || key == "物料") ? "300px" :
"130px";
width = key.indexOf("编码") != -1 ? "200px" : width;
dataColumn.push({
key: key,
title: key.split('.').pop(),
align: "center",
width: width
});
}
formulaList.forEach((item) => {
dataList.push(item);
});
}
// this.dataColumn = dataColumn;
this.dataList = dataList;
}
}
}
</script>

@ -0,0 +1,78 @@
<template>
<lay-container>
<view class="layui-item33 color999" :style="'max-height:900px'">
<lay-row space="10">
<lay-col md="4" sm="12" xs="24" v-for="(item, index) in columns">
<lay-checkbox-group v-model="checkedItem">
<lay-checkbox :name="item.title" skin="primary" :value="item.key">
{{ item.title }}
</lay-checkbox>
</lay-checkbox-group>
</lay-col>
</lay-row>
</view>
<view class="menuBtn">
<lay-button type="primary" @click="submitClick"></lay-button>
<lay-button @click="cancelClick"></lay-button>
</view>
</lay-container>
</template>
<script>
import {
ref
} from 'vue';
export default {
setup() {
const columnList = ref([]);
const checkedItem = ref([]);
return {
columnList,
checkedItem,
}
},
props: {
columns: {
type: Object,
default: () => [],
},
freezingColumns: {
type: Object,
default: () => [],
}
},
mounted() {
this.initPage();
},
methods: {
initPage() {
this.columnList = this.columns;
this.checkedItem = this.freezingColumns.concat();
},
cancelClick() {
this.$emit('cancelClick', this.freezingColumns);
},
submitClick() {
this.$emit('cancelClick', this.checkedItem);
}
}
}
</script>
<style scoped>
.layui-item33 {
width: 90%;
padding-right: 30px;
margin: 30px auto 10px;
display: block;
overflow: auto;
position: relative;
clear: both;
}
.menuBtn {
display: block;
text-align: center;
width: 96%;
margin: 20px auto;
}
</style>

@ -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,344 @@
<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>
<lay-button size="sm" type="normal" style="float:right" @click="showEditMaterial(1)"></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="showEditMaterial(3)"></lay-button>
</template>
</lay-table>
</lay-card>
</lay-col>
</lay-row>
<lay-layer :area="modelArea[1]" v-model="showEditBox[1]" :title="新增物料">
<AddMateria v-if="showEditBox[1]" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></AddMateria>
</lay-layer>
<lay-layer :area="modelArea[2]" v-model="showEditBox[2]" :title="编辑物料">
<EditMateria v-if="showEditBox[2]" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></EditMateria>
</lay-layer>
<lay-layer :area="modelArea[3]" v-model="showEditBox[3]" :title="编辑物料">
<EditView v-if="showEditBox[3]" :dataInfoObj="objInfoObj" @cancelClick="cancelClick"></EditView>
</lay-layer>
</lay-container>
</template>
<script>
import {
ref,
watch
} from "vue";
import {
getBasicList,
getPageList
} from "/src/api/api/common";
import AddMateria from '../materia/components/AddMateria.vue';
import EditMateria from '../materia/components/EditMateria.vue';
import EditView from '../materia/components/EditView.vue';
import '@layui/layui-vue/es/checkbox/index.css';
import '@layui/layui-vue/es/radio/index.css';
export default {
components: {
AddMateria,
EditMateria,
EditView
},
setup() {
let dataColumn = [
{
title: "编号",
key: "FID",
width: "160px",
align: 'center',
hide: false
},{
title: "物料号",
key: "FMdmCode",
width: "300px",
align: 'center',
hide: false
},
{
title: "物料描述",
key: "FSaleCode",
width: "160px",
align: 'center',
hide: false
},
{
title: "试验号",
key: "FTestCode",
width: "160px",
align: 'center',
hide: false
},
{
title: "来源",
key: "FDesc",
width: "160px",
align: 'center'
},
{
title: "产品分类",
key: "FDesc",
width: "400px",
align: 'center'
},
{
title: "发起时间",
key: "FAddDate",
width: "180px",
align: 'center'
},
{
title: "发起人",
key: "FUserName",
width: "178px",
align: 'center'
},
{
title: "负责人",
key: "IsEdit",
width: "98px",
align: 'center',
customSlot: '',
},
{
title: "操作",
key: "operator",
width: "130px",
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 MaterialModel= ref({});
const showEditBox = ref([false, 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%","70%","70%"]);
const objInfoObj = ref({});
const editType = ref(1);
const stateList = ref([{
id: 1,
name: "进行中"
}, {
id: 2,
name: "已完成"
}]);
const hasLoaded = ref(false);
const dataItem=ref([]);
return {
selectedKeys,
checkbox,
defaultToolbar,
dataColumn,
dataList,
pageInfo,
searchObj,
postData,
typeList,
showEditBox,
modelArea,
objInfoObj,
editType,
stateList,
hasLoaded,
MaterialModel,
dataItem
};
},
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;
debugger
this.dataList = result.Data.List;
debugger
this.hasLoaded = true;
},
//
dateFormat(dataStr) {
return dataStr.replace('T', ' ').split('.')[0];
},
getData(data){
this.MaterialModel = data;
for (let i = 0; i < this.showEditBox.length; i++) {
this.showEditBox[i] = false;
}
this.showEditBox[11] = true;
this.editType = 1;
},
showEditMaterial(i){
this.showEditBox[i] = true;
},
_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 if (data.FType == 15) {
data.FBoxType = 9; //
}else if(data.FType==16){
this.dataItem=data;
data.FBoxType = 10; //
}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>
Loading…
Cancel
Save