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
73 KiB

3 years ago
import{_ as _export_sfc,r as ref,x as watch,y as layer,o as openBlock,f as createElementBlock,d as createVNode,w as withCtx,c as createBlock,F as Fragment,h as renderList,i as createCommentVNode,t as toDisplayString,z as createTextVNode,A as pushScopeId,B as popScopeId,e as createBaseVNode,C as component,D as component$1,E as component$2,G as component$3,H as component$4,q as component$5,I as component$6,v as http,J as resolveComponent,j as component$7,K as getBasicRoleList,L as createSlots,n as normalizeClass,M as withDirectives,N as vShow,m as component$8,O as component$9,l as component$a,P as normalizeStyle,Q as component$b,R as _sfc_main$d,S as component$c}from"./index.b3f8b7f1.js";/* empty css *//* empty css *//* empty css */import{a as getDataModel,b as getDataCode,c as getBasicList,g as getPageList,u as updateDataInfo,i as insertDataInfo,d as commonSave}from"./common.d8f31935.js";import{g as getFactoryList}from"./factory.c30f2aec.js";import{g as getInfoData}from"./materialType.f34aeb6a.js";import{d as dockMDMCode,g as getPackageInfo,u as updatePackageData,a as getPackageChildList,n as noSupplyPackageChild}from"./package.94c98454.js";/* empty css */var index="",AddTerm_vue_vue_type_style_index_0_scoped_true_lang="";const _sfc_main$c={setup(){const a=ref({FMaterialType:"ZMAT",FWeightUnit:"KG"}),t=ref([]),o=ref([[],[]]),e=ref([]);let s=[{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"}];s.forEach(r=>{r.align="center"});const l=ref({total:0,limit:5,current:1}),n=ref([]),i=ref("");watch(i,function(){const r=n.value.find(m=>m.FID==i.value)||null;r!=null&&(a.value.FFormulaName=r.FName+"+"+r.FTestCode+"+"+r.FVersionCode,a.value.FFormulaID=r.FID,a.value.FVersionCode=r.FVersionCode,a.value.FFormulaTestCode=r.FTestCode)});const d=ref(!1),c=ref(!0),u=ref([]),p=ref([]),y=ref(null);return{dataInfo:a,formulaList:t,seletList:o,typeList:e,dataColumn:s,dataList:n,pageInfo:l,selectedKey:i,showEditBox:d,showButton:c,saleList:u,factoryLists:p,factoryValue:y}},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 getFactoryList()||[]},async _getTeamData(a){let t=await getDataModel({FID:a,FKey:"FID,FTestCode,FWeightUnit,FSaleCode,FMaterialType,FMaterialGroup,FFormulaTestCode,FFormulaName,FFormulaID"},"Teamwork");this.dataInfo=t||this.dataInfo},async _getSelectList(){let a=await getDataCode({FType:"1,2"});this.seletList[0]=a.FType1||[],this.seletList[1]=a.FType2||[],this.typeList=await getBasicList(37)||[],this._getPageList()},async _inputSaleCode(a){let t={FPageIndex:1,FPageSize:10,FName:a||""};if(this.saleList=[],t.FName!=""){let o=await getPageList(t,"Material");this.saleList=o.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 t={FPageIndex:this.pageInfo.current,FPageSize:this.pageInfo.limit},o=this.dataInfo.FSearchName;o&&o!=""&&(t.Or_FPlmCode=t.Or_FTestCode=t.Or_FName=t.Or_FVersionCode=o);let e=await getPageList(t,"Formula");e.Data.List=e.Data.List||[],e.Data.List.forEach(s=>{let l=this.typeList.find(n=>n.FValue==s.FType);s.FTypeName=l==null?s.FType:l.FName,this.dataInfo.FFormulaID==s.FID&&(this.selectedKey=s.FID)}),this.pageInfo.total=e.Data.Total||0,this.dataList=e.Data.List},async submitClick(a){let t=this.dataInfo;t.FSaleCode=(t.FSaleCode||"").trim(),t.FTestCode=(t.FTestCode||"").trim(),t.FMaterialGroup=(t.FMaterialGroup||"").trim(),t.FWeightUnit=(t.FWeightUnit||"").trim(),t.FFormulaName=(t.FFormulaName||"").trim(),t.factoryValue=this.factoryValue;for(let o i