You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
103 KiB
2 lines
103 KiB
|
3 years ago
|
import{_ as V,r as c,x as K,y as h,o as d,f,d as u,w as n,F as R,h as w,c as M,i as I,t as E,z as D,A as Q,B as j,e as B,C as W,G as H,D as L,E as z,I as q,H as v,q as b,K as ie,L as le,l as Fe,m as re,j as X,M as G,J as A,N as oe,n as U,O as ne,P as ye,Q as pe}from"./index.58a4812e.js";/* empty css *//* empty css */import{a as Y,b as N,c as Z,g as x,u as J,i as $,d as ce}from"./common.a907f978.js";import{g as ee}from"./factory.56670aad.js";/* empty css */import{g as de,u as se}from"./view.a8aea462.js";import{g as ue}from"./materialType.20973eba.js";const Te={setup(){const a=c({FMaterialType:"ZMAT",FWeightUnit:"KG"}),e=c([]),i=c([[],[]]),t=c([]);let F=[{type:"radio"},{title:"\u540D\u79F0",key:"FName"},{title:"\u8BD5\u9A8C\u53F7",key:"FTestCode"},{title:"\u914D\u65B9\u79CD\u7C7B",key:"FTypeName",width:"110px"},{title:"\u7248\u672C\u53F7",key:"FVersionCode"}];F.forEach(P=>{P.align="center"});const o=c({total:0,limit:5,current:1}),l=c([]),y=c("");K(y,function(){const P=l.value.find(_=>_.FID==y.value)||null;P!=null&&(a.value.FFormulaName=P.FName+"+"+P.FTestCode+"+"+P.FVersionCode,a.value.FFormulaID=P.FID,a.value.FVersionCode=P.FVersionCode,a.value.FFormulaTestCode=P.FTestCode)});const T=c(!1),s=c(!0),p=c([]),C=c([]),r=c(null);return{dataInfo:a,formulaList:e,seletList:i,typeList:t,dataColumn:F,dataList:l,pageInfo:o,selectedKey:y,showEditBox:T,showButton:s,saleList:p,factoryLists:C,factoryValue:r}},props:{dataInfoObj:{type:Object,default:()=>{}}},mounted(){this.dataInfoObj&&this.dataInfoObj.FTeamID&&(this._getTeamData(this.dataInfoObj.FTeamID),this.showButton=this.dataInfoObj.FCanEdit!=2),this._getSelectList(),this._getFactoryList()},methods:{cancelClick(a){this.$emit("cancelClick",a||!1)},async _getFactoryList(){this.factoryLists=await ee()||[]},async _getTeamData(a){let e=await Y({FID:a,FKey:"FID,FTestCode,FWeightUnit,FSaleCode,FMaterialType,FMaterialGroup,FFormulaTestCode,FFormulaName,FFormulaID,FPackCode,FCreateFactoryID"},"Teamwork");this.dataInfo=e||this.dataInfo},async _getSelectList(){let a=await N({FType:"1,2"});this.seletList[0]=a.FType1||[],this.seletList[1]=a.FType2||[],this.typeList=await Z(37)||[],this._getPageList()},async _inputSaleCode(a){let e={FPageIndex:1,FPageSize:10,FName:a||""};if(this.saleList=[],e.FName!=""){let i=await x(e,"Material");this.saleList=i.Data.List||[]}},_searchPageList(a){this._getPageList(!0)},changePage(a){this.pageInfo.current=a.current,this.pageInfo.limit=a.limit,this._getPageList()},async _getPageList(a){a&&(this.pageInfo.current=1,this.pageInfo.total=0);let e={FPageIndex:this.pageInfo.current,FPageSize:this.pageInfo.limit},i=this.dataInfo.FSearchName;i&&i!=""&&(e.Or_FPlmCode=e.Or_FTestCode=e.Or_FName=e.Or_FVersionCode=i);let t=await x(e,"Formula");t.Data.List=t.Data.List||[],t.Data.List.forEach(F=>{let o=this.typeList.find(l=>l.FValue==F.FType);F.FTypeName=o==null?F.FType:o.FName,this.dataInfo.FFormulaID==F.FID&&(this.selectedKey=F.FID)}),this.pageInfo.total=t.Data.Total||0,this.dataList=t.Data.List},async submitClick(a){let e=this.dataInfo;e.FSaleCode=(e.FSaleCode||"").trim(),e.FTestCode=(e.FTestCode||"").trim(),e.FMaterialGroup=(e.FMaterialGroup||"").trim(),e.FWeightUnit=(e.FWeightUnit||"").trim(),e.FFormulaName=(e.FFormulaName||"").trim(),e.FCreateFactoryID=e.FCreateFactoryID==-1?"":e.FCreateFactoryID;for(let i in e)if(e[i]=="")return!1;if(e.FState=a?1:0,e=JSON.parse(JSON.stringify(e)),e.FTestCode!=e.FFormulaTestCode)return this.sureTextCode(e),!1;this._postTermData(e)},sureTextCode(a){let e=this;h.confirm("\u9009\u62E9\u7684\u914D\u65B9\u548C\u8BA2\u5355\u8BD5\u9A8C\u53F7\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u786E\u8BA4\u4F7F\u7528\u9009\u62E9\u7684\u914D\u65B9\u561B\uFF1F",{title:"\u63D0\u793A",btn:[{text:"\u6682\u65F6\u4FDD\u5B58",callback:function(i){h.close(i),a.FState=0,e._postTermData(a)}},{text:"\u786E\u8BA4\u63D0\u4EA4",callback:function(i){h.close(i),a.FState=1,e._postTermData(a)}}]})},async _postTermData(a){delete a.FSearchName;let e=0,i=h.load(2);a.FID&&a.FID>0?e=await J(a,"Teamwork")||0:e=await $(a,"Teamwork")||0,e>0&&this.cancelClick
|