123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915 |
- <template>
- <el-card shadow="always" :body-style="{ padding: '10px' }">
- <div class="app-container">
- <el-dialog
- :title="upload.title"
- :visible.sync="upload.open"
- width="400px"
- append-to-body
- >
- <el-upload
- ref="upload"
- :limit="1"
- accept=".xlsx, .xls"
- :headers="upload.headers"
- :action="
- upload.url +
- '?updateSupport=' +
- upload.updateSupport +
- '&tableName=' +
- tableName +
- '&sqlKey=' +
- tableKey
- "
- v-loading="upload.isUploading"
- :disabled="upload.isUploading"
- :on-progress="handleFileUploadProgress"
- :on-success="handleFileSuccess"
- :auto-upload="false"
- :onChange="handleChange"
- drag
- >
- <i class="el-icon-upload"></i>
- <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
- <div class="el-upload__tip text-center" slot="tip">
- <!-- <div class="el-upload__tip" slot="tip">-->
- <!-- <el-checkbox v-model="upload.updateSupport"/>-->
- <!-- 是否更新已经存在的用户数据-->
- <!-- </div>-->
- <span>仅允许导入xls、xlsx格式文件。</span>
- <el-link
- type="primary"
- :underline="false"
- style="font-size: 12px; vertical-align: baseline"
- @click="importTemplate"
- >下载模板
- </el-link>
- </div>
- </el-upload>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitFileForm">确 定</el-button>
- <el-button @click="upload.open = false">取 消</el-button>
- </div>
- </el-dialog>
- <Queryfrom
- :form-vals="templateInfo.where"
- :statisticList="statisticList"
- :showCount="showCount"
- :showSearch="showSearch"
- @getList="getList"
- ref="mychild"
- />
- <el-row :gutter="10" class="mb8">
- <el-col :span="1.5">
- <el-button
- type="primary"
- plain
- icon="el-icon-plus"
- size="mini"
- @click="addHandler"
- >新增
- </el-button>
- </el-col>
- <!-- <el-col :span="1.5" v-if="false">
- <el-button
- type="success"
- plain
- icon="el-icon-edit"
- size="mini"
- :disabled="single"
- @click="handleUpdate"
- >修改
- </el-button>
- </el-col> -->
- <el-col :span="1.5">
- <el-button
- type="danger"
- plain
- icon="el-icon-delete"
- size="mini"
- :disabled="multiple"
- @click="myDeleteHandler"
- >删除
- </el-button>
- </el-col>
- <!-- <el-col :span="1.5">
- <el-button
- plain
- icon="el-icon-upload2"
- size="mini"
- @click="upload.open = true"
- >导入
- </el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="warning"
- plain
- icon="el-icon-download"
- size="mini"
- @click="handleExport"
- >导出
- </el-button>
- </el-col> -->
- <right-toolbar
- style="float: right"
- :showCount.sync="showCount"
- :showSearch.sync="showSearch"
- :counts="true"
- @queryTable="pageList"
- ></right-toolbar>
- <el-radio-group
- style="float: right; margin-right: 100px"
- v-model="queryParams.orderType"
- size="mini"
- @change="orderTypeChange"
- >
- <el-radio-button :label="null">全部</el-radio-button>
- <el-radio-button :label="1">库存</el-radio-button>
- <el-radio-button :label="2">生产</el-radio-button>
- </el-radio-group>
- </el-row>
- <el-table
- v-loading="loading"
- :data="tableList"
- @selection-change="handleSelectionChange"
- ref="tableRef"
- :cell-style="cellStyle"
- :reserve-selection="true"
- row-key="saleOrderId"
- >
- <el-table-column
- type="selection"
- width="55"
- reserve-selection
- align="center"
- >
- </el-table-column>
- <el-table-column
- v-for="item in columns"
- :key="item.key"
- :label="item.value"
- align="center"
- :prop="item.key"
- >
- <template slot-scope="scope">
- <!-- 存在字段样式或字典样式 -->
- <template
- v-if="
- scope.row.styleFieldObj != undefined &&
- scope.row.styleFieldObj[item.key]
- "
- >
- <!-- 字段样式 -->
- <template v-if="scope.row.styleFieldObj[item.key].styleType == 1">
- <!-- 一般字体样式 -->
- <template
- v-if="scope.row.styleFieldObj[item.key].fieldStyleType == 0"
- >
- <span
- :style="`color:${
- scope.row.styleFieldObj[item.key].fontColor
- }`"
- >{{ scope.row[item.key] }}</span
- >
- </template>
- <!-- 标签字体样式 -->
- <template
- v-else-if="
- scope.row.styleFieldObj[item.key].fieldStyleType == 1
- "
- >
- <el-tag
- :type="scope.row.styleFieldObj[item.key].tagType"
- :effect="
- scope.row.styleFieldObj[item.key].isTagFullBg
- ? 'dark'
- : 'light'
- "
- >
- {{ scope.row[item.key] }}
- </el-tag>
- </template>
- </template>
- <!-- 字典样式 -->
- <template
- v-else-if="scope.row.styleFieldObj[item.key].styleType == 2"
- >
- <span
- v-if="
- scope.row.styleFieldObj[item.key].listClass == '' ||
- scope.row.styleFieldObj[item.key].listClass == 'default'
- "
- >{{ scope.row.styleFieldObj[item.key].dictLabel }}</span
- >
- <el-tag
- v-else
- :type="
- scope.row.styleFieldObj[item.key].listClass == 'primary'
- ? ''
- : scope.row.styleFieldObj[item.key].listClass
- "
- >{{ scope.row.styleFieldObj[item.key].dictLabel }}
- </el-tag>
- </template>
- </template>
- <!-- 显示默认值 -->
- <template v-else>
- {{ scope.row[item.key] }}
- </template>
- </template>
- </el-table-column>
- <el-table-column
- v-if="isShowExcuteCol"
- label="操作"
- align="center"
- class-name="small-padding fixed-width"
- >
- <template slot-scope="scope">
- <!-- <el-button
- type="info"
- size="default"
- @click="handleEdit(scope.$index, scope.row)"
- >编辑</el-button
- > -->
- <Menu
- :row="scope.row"
- v-for="btnObj in excuteBtnArr"
- :key="btnObj.id"
- :listAll="btnObj"
- @excuteHandler="excuteHandler"
- ></Menu>
- </template>
- </el-table-column>
- </el-table>
- <pagination
- v-show="total > 0"
- :total="total"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="pageList"
- />
- <!-- k-form-build 组件渲染弹窗-->
- <el-dialog :title="title" :visible.sync="kOpen" append-to-body>
- <k-form-build
- v-if="jsonData"
- class="formBuild"
- ref="addFromRef"
- :dynamicData="dynamicData"
- :defaultValue="defaultValue"
- @submit="tempSubBtn"
- @change="formChangeHandler"
- :value="jsonData"
- />
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="editConfirmHandler"
- >确 定
- </el-button>
- <el-button @click="kCancel">取 消</el-button>
- </div>
- </el-dialog>
- <!-- 添加或出库单:- 过磅记录生成数据对话框 -->
- <el-dialog
- :title="title"
- width="1300px"
- :visible.sync="open"
- append-to-body
- >
- <el-row :gutter="20">
- <el-form
- :model="formData"
- ref="formDataRef"
- :rules="rules"
- label-width="100px"
- :inline="true"
- size="normal"
- >
- <el-col :span="12">
- <el-form-item prop="saleNo" label="合同号:">
- <el-input size="small" v-model="formData.saleNo"></el-input>
- </el-form-item>
- </el-col>
- <!-- <el-col :span="12">
- <el-form-item prop="lotNumber" label="批号:">
- <el-input size="small" v-model="formData.lotNumber"></el-input>
- </el-form-item>
- </el-col> -->
- <!-- <el-col :span="12">
- <el-form-item prop="saleDate" label="日期:">
- <el-date-picker
- size="small"
- v-model="formData.saleDate"
- value-format="yyyy-MM-dd"
- format="yyyy-MM-dd"
- type="date"
- placeholder="选择日期"
- >
- </el-date-picker>
- </el-form-item>
- </el-col> -->
- <el-col :span="12">
- <el-form-item prop="saleCustomNo" label="客户名称:">
- <el-select
- size="small"
- v-model="formData.saleCustomNo"
- placeholder="请选择客户"
- clearable
- filterable
- @change="customChangeHandler"
- >
- <el-option
- v-for="item in customerOptions"
- :key="item.customNo"
- :label="item.customName"
- :value="item.customNo"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="联系人:" size="normal">
- {{ formData.contactPerson }}
- </el-form-item>
- <el-form-item label="客户地址:" size="normal">
- {{ formData.customAddress }}
- </el-form-item>
- <el-form-item label="客户国别:" size="normal">
- {{ formData.customCountryType }}
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item
- label-width="120px"
- prop="saleOrderEstimatedTime"
- label="预计下单时间:"
- >
- <el-date-picker
- size="small"
- v-model="formData.saleOrderEstimatedTime"
- value-format="yyyy-MM-dd"
- format="yyyy-MM-dd"
- type="date"
- placeholder="选择日期"
- >
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="交货天数:" size="normal" prop="saleLeadTime">
- <el-input
- size="small"
- v-model="formData.saleLeadTime"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="交货日期:" size="normal" prop="deliveryDate">
- <el-date-picker
- size="small"
- v-model="formData.deliveryDate"
- type="date"
- placeholder="选择日期"
- >
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-divider>货品明细</el-divider>
- </el-col>
- <el-table
- :data="productionTableData"
- border
- show-summary
- :summary-method="getSummaries"
- sum-text="小计"
- style="width: 100%"
- >
- <el-table-column prop="productName" label="品名" width="180">
- <template slot-scope="scope">
- <!-- <el-input
- v-model="scope.row.productName"
- size="small"
- clearable
- ></el-input> -->
- <el-form-item
- :prop="'productName-' + scope.$index"
- :name="'productName-' + scope.$index"
- style="margin: 0px; padding: 0px"
- >
- <!-- @change="
- handleProductChange(scope.row.productNo, scope.row)
- :filter-method="(val) => mySelectFilter(val, scope.row)"
- " -->
- <el-select
- v-model="scope.row.productName"
- placeholder=""
- filterable
- @change="
- newProductChange(scope.row.productName, scope.row)
- "
- >
- <el-option
- v-for="item in productionOptions"
- :key="item.productNo"
- :label="item.productName"
- :value="item.productName"
- >
- <span class="discribe" style="float: left">{{
- item.productName+"--"+item.productNo
- }}</span>
- <!-- <span
- style="float: right; color: #8492a6; font-size: 13px"
- >{{ item.productSpecifications }}</span
- > -->
- </el-option>
- </el-select>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- prop="productSpecifications"
- width="180"
- label="规格"
- >
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.productSpecifications"
- @change="handleSpecificationsChange(scope.row)"
- placeholder=""
- filterable
- >
- <el-option
- v-for="(item,index) in scope.row.specificationsList"
- :key="item.productSpecifications.index"
- :label="item.productSpecifications"
- :value="{value:item.productSpecifications,label:item.productType}"
- >
- <span class="discribe" style="float: left">{{
- item.productSpecifications
- }}</span>
- <span
- style="float: right; color: #8492a6; font-size: 13px"
- >{{ item.productType }}</span
- >
- </el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column prop="productType" label="类型">
- </el-table-column>
- <el-table-column prop="colours" width="130" label="色号">
- <template slot-scope="scope">
- <el-form-item
- :prop="'colours-' + scope.$index"
- :name="'colours-' + scope.$index"
- style="margin: 0px; padding: 0px"
- >
- <el-select
- v-model="scope.row.colours"
- placeholder=""
- filterable
- @change="colourNumberChangeHandler(scope.row)"
- >
- <el-option
- v-for="(item,index) in colourNumberOptions"
- :key="item.colour.index"
- :label="item.colour"
- :value="item.colour"
- >
- <!-- <span class="discribe" style="float: left">{{
- item.materieEncoding + item.materieColorNumber
- }}</span> -->
- <!-- <span
- style="float: right; color: #8492a6; font-size: 13px"
- >{{ item.materielCode }}</span
- > -->
- </el-option>
- </el-select>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column prop="level" width="100" label="等级">
- <template slot-scope="scope">
- <el-form-item
- :prop="'level-' + scope.$index"
- :name="'level-' + scope.$index"
- style="margin: 0px; padding: 0px"
- >
- <el-select
- v-model="scope.row.level"
- placeholder=""
- filterable
- >
- <el-option
- v-for="item in levelOptions"
- :key="item.id"
- :label="item.codeName"
- :value="item.codeName"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column prop="productNumber" label="数量/kg">
- <template slot-scope="scope">
- <el-form-item
- :prop="'productNumber-' + scope.$index"
- :name="'productNumber-' + scope.$index"
- style="margin: 0px; padding: 0px"
- >
- <el-input
- v-model="scope.row.productNumber"
- oninput="value=value.replace(/[^0-9.]/g,'')"
- size="small"
- clearable
- @change="computedPrice(scope.row)"
- ></el-input>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column prop="productUnitPrice" label="单价">
- <template slot-scope="scope">
- <el-form-item
- :prop="'productUnitPrice-' + scope.$index"
- :name="'productUnitPrice-' + scope.$index"
- style="margin: 0px; padding: 0px"
- >
- <el-input
- v-model="scope.row.productUnitPrice"
- size="small"
- oninput="value=value.replace(/[^0-9.]/g,'')"
- @change="computedPrice(scope.row)"
- clearable
- ></el-input>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column prop="productAmounts" label="金额">
- <template slot-scope="scope">
- {{ scope.row.productAmounts }}
- </template>
- </el-table-column>
- <el-table-column prop="sliceType" label="切片型号">
- <template slot-scope="scope">
- <el-form-item
- :prop="'sliceType-' + scope.$index"
- :name="'sliceType-' + scope.$index"
- style="margin: 0px; padding: 0px"
- >
- <el-select
- v-model="scope.row.sliceType"
- placeholder=""
- clearable
- filterable
- @change="sliceTypeChangeHandler(scope.row)"
- >
- <el-option
- v-for="item in sliceTypeOptions"
- :key="item.materielCode"
- :label="item.materielName"
- :value="item.materielCode"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column prop="inventoryBoxNum" label="库存箱数">
- <template slot-scope="scope">
- {{ scope.row.inventoryBoxNum }}
- </template>
- </el-table-column>
- <el-table-column prop="inventoryWeight" label="库存重量/kg">
- <template slot-scope="scope">
- {{ scope.row.inventoryWeight }}
- </template>
- </el-table-column>
- <el-table-column prop="remark" label="备注">
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.remark"
- size="small"
- clearable
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column label="操作">
- <template slot-scope="scope">
- <el-button
- type="danger"
- size="small"
- @click="deleteProduct(scope.$index)"
- >删除
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <el-button
- class="mt5"
- type="primary"
- style="width: 100%"
- size="small"
- @click="addProduct"
- >添加货品
- </el-button>
- <el-col :span="12">
- <el-form-item label-width="120px" label="合计金额(大写)">
- <!-- <el-input
- v-model="formData.saleAmountInWords"
- size="small"
- clearable
- ></el-input> -->
- {{ formData.saleAmountInWords }}
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item prop="salePayType" label="付款方式">
- <!-- <el-input
- v-model="formData.salePayType"
- size="small"
- clearable
- ></el-input> -->
- <el-select
- v-model="formData.salePayType"
- size="small"
- clearable
- filterable
- >
- <el-option
- v-for="item in dict.type.payment_method"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12" v-show="formData.salePayType == '1'">
- <el-form-item prop="earnestMoney" label="定金">
- <el-input
- v-model="formData.earnestMoney"
- clearable
- size="small"
- />
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-divider>工艺要求</el-divider>
- </el-col>
- <el-col :span="12">
- <el-form-item label="网络:">
- <el-input
- v-model="formData.craftGrid"
- size="small"
- clearable
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="油剂:">
- <el-input
- v-model="formData.craftOil"
- size="small"
- clearable
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="卷装:">
- <el-input
- v-model="formData.craftPackage"
- size="small"
- clearable
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="色牢度:">
- <el-input
- v-model="formData.craftColorFastness"
- size="small"
- clearable
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="捻向:">
- <el-select
- v-model="formData.directionOfTwist"
- clearable
- filterable
- >
- <el-option
- v-for="item in dict.type.direction_of_twist"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="其它:">
- <el-input
- v-model="formData.craftOther"
- size="small"
- clearable
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="包装/贴唛:">
- <el-input
- v-model="formData.craftMark"
- size="small"
- clearable
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="运输方式:">
- <el-input
- v-model="formData.shippingMethod"
- size="small"
- clearable
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-divider>审计人员数据</el-divider>
- </el-col>
- <el-col :span="12">
- <el-form-item label="业务员:">
- <!-- <el-input
- v-model="formData.salesman"
- size="small"
- clearable
- ></el-input> -->
- {{ nickName }}
- </el-form-item>
- </el-col>
- </el-form>
- </el-row>
- <div slot="footer" class="dialog-footer">
- <el-button
- type="primary"
- @click="editConfirm"
- :disabled="isAdding"
- :loading="isAdding"
- >确 定</el-button
- >
- <el-button @click="cancel">取 消</el-button>
- </div>
- </el-dialog>
- <!-- 绑定按钮dialog -->
- <el-dialog
- title="提示"
- :visible.sync="btnDialogVisible"
- :before-close="handleClose"
- >
- <DialogTemplate
- ref="dialogRef"
- :groupKey="groupKey"
- :rowobj="rowobj"
- :subCount="subCount"
- :tableCount="tableCount"
- :subTableName="subTableName"
- @addList="addListHandler"
- >
- </DialogTemplate>
- <span slot="footer" class="dialog-footer">
- <el-button @click="btnDialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="btnComfirm">确 定</el-button>
- </span>
- </el-dialog>
- <!-- 自定义弹窗 -->
- <el-dialog title="提示" :visible.sync="deliverShow" width="1200px">
- <!-- <DialogTemplate
- ref="dialogRef"
- :groupKey="groupKey"
- :rowobj="rowobj"
- :subCount="subCount"
- :tableCount="tableCount"
- :subTableName="subTableName"
- @addList="addListHandler"
- >
- </DialogTemplate> -->
- <Deliver ref="deliverRef" :currentRow="currentRow"></Deliver>
- <span slot="footer" class="dialog-footer">
- <el-button @click="deliverShow = false">取 消</el-button>
- <el-button type="primary" @click="btnComfirm">确 定</el-button>
- </span>
- </el-dialog>
- <!-- 详情弹窗 -->
- <el-dialog title="详情" :visible.sync="detailShow" width="1250px">
- <div ref="detailTable" id="detail"></div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="detailShow = false">取 消</el-button>
- <el-button type="primary" @click="detailPrintHandler"
- >打 印</el-button
- >
- </span>
- </el-dialog>
- <!-- 销售出库弹窗 -->
- <el-dialog
- title="打印-销售出库单"
- :visible.sync="outBoundShow"
- width="1000px"
- >
- <oldOutBound
- v-if="oldInventoryState == 2"
- ref="oldOutBoundRef"
- :currentRow="currentRow"
- ></oldOutBound>
- <OutBound v-else ref="outBoundRef" :currentRow="currentRow"></OutBound>
- <span slot="footer" class="dialog-footer">
- <el-button @click="outBoundShow = false">取 消</el-button>
- <el-button type="primary" @click="outBoundPrintHandler">
- 打印</el-button
- >
- </span>
- </el-dialog>
- <!-- 出库明细 -->
- <el-dialog
- :title="stockTitle"
- :visible.sync="outStockShow"
- width="1200px"
- :before-close="outStockCloseHandler"
- >
- <!-- <OutStock ref="outStockRef"></OutStock> -->
- <OutStockDetail ref="OutStockDetailRef"></OutStockDetail>
- <span slot="footer" class="dialog-footer">
- <el-button @click="outStockCloseHandler">关 闭</el-button>
- <!-- <el-button type="primary" @click="btnComfirm">确 定</el-button> -->
- </span>
- </el-dialog>
- <div id="printDom"></div>
- </div>
- </el-card>
- </template>
- <script>
- import {
- delTableData,
- dragTableInfo,
- listTable,
- unionListTableData,
- getInfoBySqlKey,
- btnCommonApi,
- addTableData,
- batchEdit,
- getStatisticList,
- getTableList1,
- checkOrderNo,
- delOrder,
- productInvoiceInfo,
- addProductInvoice,
- updateProductInvoice,
- saleOrderList,
- queryMaterielList,
- getSaleOrderProductionListDistinct,
- getProductSpecificationsByProductName,
- printOutsourceOrder,
- productColourList, saleProductsBatchEdit, addLogOrder,
- } from "@/api/tablelist/commonTable";
- import {getProductInventory, updateOrder} from "@/api/system/retailMange.js";
- import { listData } from "@/api/system/tenant/data";
- import { getToken } from "@/utils/auth";
- import Queryfrom from "@/views/tablelist/commonTable/queryfrom.vue";
- import { camelCase, toUnderline } from "@/utils";
- import { inputDisableComplete } from "@/utils/other";
- import Menu from "@/views/tablelist/commonTable/BtnMenu.vue";
- import { checkRole } from "@/utils/permission";
- import DialogTemplate from "@/views/dialogTemplate/components/index.vue";
- import {
- queryDropDownBoxData,
- getSaleOrderProductionList,
- } from "@/api/dragform/form";
- import { v4 as uuidv4 } from "uuid";
- import { mapState } from "vuex";
- import moment from "moment";
- import Deliver from "@/views/orderMange/components/dialogForm/Deliver.vue";
- import OutBound from "@/views/orderMange/components/dialogForm/OutBound.vue";
- import outBoundPrint from "@/utils/print/outBoundPrint";
- import oldOutBoundPrint from "@/utils/print/oldOutBoundPrint";
- import { listCustomer } from "@/api/system/customer";
- import OutStock from "@/views/orderMange/components/dialogForm/OutStock.vue";
- import OutStockDetail from "@/views/orderMange/components/dialogForm/OutStockDetail.vue"; //拆分零售订单与普通订单
- import oldOutBound from "@/views/orderMange/components/dialogForm/oldOutBound.vue";
- import { numToCapital } from "@/utils/other";
- import {getOptionLsit} from "@/api/codeListManage/productCodeList";
- export default {
- name: "listInfo",
- dicts: ["payment_method", "direction_of_twist"],
- components: {
- Queryfrom,
- Menu,
- DialogTemplate,
- Deliver,
- OutBound,
- OutStock,
- oldOutBound,
- OutStockDetail,
- },
- data() {
- return {
- stockTitle: "", //出库弹窗标题
- isAdding: false,
- oldInventoryState: 0,
- totalMoney: "", //总金额 小写
- outStockShow: false, //出库详情
- selection: [], //勾选的数据
- // 出库单 start
- outBoundShow: false,
- // 出库单 end
- // 发货 start
- deliverShow: false,
- // 发货 end
- // 出库单 start
- // 出库单 end
- myDelIds: [], //新增接口 删除的id
- dropDownData: {},
- // 详情弹窗数据
- detailShow: false,
- printDomData: "",
- // k-form-build组件渲染弹窗
- kOpen: false,
- // 新的自定义数据 start
- orderType: 0, //新的条件查询参数
- productIds: [], //货品Ids
- isEdit: false,
- formData: {
- //订单表数据
- saleNo: "", //合同号
- saleCustomNo: "", //客户编号
- saleDate: "", //销售单日期
- saleOrderEstimatedTime: "", //预计下单时间
- saleLeadTime: "", //交货周期
- deliveryDate: "", //交货日期
- saleAmounts: "", //合计金额 小写
- saleAmountInWords: "", //合计金额 大写
- salePayType: "", //支付方式
- earnestMoney: "", //定金
- salesman: "", //业务员
- saleLeader: "", //业务主管
- finance: "", //财务部
- production: "", //生产部
- saleApprover: "", //批准人
- customAddress: "", //客户地址
- customCountryType: "", //国家类型
- contactPerson: "", //联系人
- // 货品明细表数据
- lotNumber: "", //批号
- productNo: "", //货品号
- productName: "", //货品名称
- productNumber: "", //销售数量
- productWeight: "", //销售重量kg
- productUnitPrice: "", //单价
- productAmounts: "", //金额
- sliceType: "", //切片类型
- sliceTypeLabel: "",
- colourNumberLabel: "",
- colours: "", //色号
- remark: "", //备注
- level: "", //等级
- inventoryBoxNum: "", //库存箱数
- inventoryWeight: "", //库存重量
- // 工艺表
- craftGrid: "", //网络
- craftOil: "", //油剂
- craftPackage: "", //卷装
- craftColorFastness: "", //色牢度
- directionOfTwist: "", //捻向
- craftOther: "", //其它工艺要求
- craftMark: "", //包装/贴唛
- shippingMethod: "", //运输方式
- },
- sliceTypeOptions: [], //切片型号选项
- colourNumberOptions: [], //色号选项
- allProductionOptions: [], //所有产品选项
- levelOptions: [], //等级选项
- productionOptions: [],
- customerOptions: [],
- productionTableData: [
- // {
- // productNo: "", //货品名称
- // productNumber: 2, //销售数量
- // productWeight: 1, //销售重量kg
- // productUnitPrice: 20, //单价
- // productAmounts: 20, //金额
- // remark: "", //备注
- // },
- ],
- rules: {
- // deliveryDate: [
- // {
- // required: true,
- // message: "请选择交货日期",
- // trigger: "change",
- // },
- // ],
- salePayType: [
- {
- required: true,
- message: "请选择付款方式",
- trigger: "change",
- },
- ],
- saleNo: [
- {
- required: true,
- message: "请输入合同号",
- trigger: "blur",
- },
- {
- validator: this.validateOrderNo,
- trigger: "blur",
- },
- ],
- saleDate: [
- {
- required: true,
- message: "请选择日期",
- trigger: "change",
- },
- ],
- // lotNumber: [
- // {
- // required: true,
- // message: "请输入批号",
- // trigger: "blur",
- // },
- // ],
- saleCustomNo: [
- {
- required: true,
- message: "请选择客户",
- trigger: "change",
- },
- ],
- // saleOrderEstimatedTime: [
- // {
- // required: true,
- // message: "请选择预计下单时间",
- // trigger: "change",
- // },
- // ],
- // saleLeadTime: [
- // {
- // required: true,
- // message: "请输入交货天数",
- // trigger: "blur",
- // },
- // ],
- earnestMoney: [
- {
- validator: this.validateEarnestMoney,
- trigger: "blur",
- },
- ],
- },
- // end
- // 绑定按钮dialog
- btnDialogVisible: false,
- // 绑定修改dialog
- groupKey: "",
- // 遮罩层
- loading: true,
- // 选中数组
- ids: [],
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 显示统计
- showCount: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 用户表格数据
- tableList: [],
- // 弹出层标题
- title: "",
- // 日期范围
- dateRange: [],
- // 表单参数
- form: {},
- // cru 弹窗
- open: false,
- // excel共通导入数据
- upload: {
- // 是否显示弹出层
- open: false,
- // 弹出层标题(
- title: "",
- // 是否禁用上传
- isUploading: false,
- // 是否更新已经存在的数据
- updateSupport: 0,
- // 设置上传的请求头部
- headers: { Authorization: "Bearer " + getToken() },
- // 上传的地址
- url: process.env.VUE_APP_BASE_API1 + "common/uploadData",
- },
- // 排序方式 默认降序
- sortOrder: true,
- // 共通查询参数接受子组件的参数
- queryParams: {
- orderType: null,
- pageNum: 1, // 第几页
- pageSize: 10, // 每页大小
- orderByColumn: "", // 根据某列排序
- isAsc: "", // desc(降序)或 asc(升序)
- saleOrderOrderType: "",
- // 基本查询参数
- basicMap: {
- tableName: "drag_form",
- },
- // 当前表字段筛选参数
- queryMap: {
- // 当前查询基本参数
- // ... key : value 当前页面的筛选条件
- // 超级查询的唯一值
- queryCriteriaValue: "",
- },
- },
- // 列信息
- columns: {},
- // 当前模版信息
- templateInfo: {},
- // 查询条件
- queryFromWhere: {},
- // 当前table唯一标识
- tableKey: null,
- // 当前表名称
- tableName: null,
- //存放html代码块
- iframeUrl: "",
- //存放表单渲染数据
- jsonData: {},
- // 回显表格数据,
- defaultValue: {},
- // 统计card
- statisticList: [],
- // 样式表
- styleList: [],
- // 字典样式对象
- dictStyleObj: {},
- // 操作列 按钮数据
- excuteBtnArr: [],
- // 下拉框动态数据
- dynamicData: {},
- // 当前点击按钮的数据
- currentBtnData: {},
- // 修改选中行
- rowobj: {},
- // 该行的统计信息
- subCount: [],
- tableCount: [],
- // 弹窗新增数据
- addLists: [],
- subTableName: "",
- // 当前点击行的数据
- currentRow: {},
- };
- },
- created() {
- // 得到当前展示的table的唯一标识
- this.tableKey = this.$route.query.tableKey;
- this.getList(this.queryParams);
- // 初始化时,默认选择第一个选项
- // this.productionTableData.forEach(row => {
- // row.sliceType = this.sliceTypeOptions.length > 0 ? this.sliceTypeOptions[0].materielCode : '';
- // });
- },
- watch: {
- totalMoney: {
- handler(newVal, oldVal) {
- if (isNaN(Number(newVal))) {
- this.formData.saleAmountInWords = "零";
- } else {
- const ntc = new numToCapital();
- this.formData.saleAmountInWords = ntc.uppercase(newVal);
- }
- },
- deep: true,
- immediate: true,
- },
- },
- async mounted() {
- await this.getDropDownData();
- },
- computed: {
- isShowExcuteCol() {
- return !this.excuteBtnArr?.every((arr) => arr.children.length == 0);
- },
- ...mapState({
- nickName: (state) => state.user.nickName,
- }),
- },
- methods: {
- // 出库明细弹窗关闭回调
- outStockCloseHandler() {
- this.outStockShow = false;
- this.getList(this.queryParams);
- },
- // 更新库存箱数和重量
- async updateStorage(row) {
- // console.log("查询库存箱数和重量")
- let {
- productNo,
- productType,
- lotNumber,
- productName,
- productSpecifications,
- colours,
- specificationsList,
- } = row;
- let productColour = "";
- let targetColor = this.colourNumberOptions.find((item) => {
- return item.colour == colours;
- });
- let productId = "";
- if (specificationsList && specificationsList.length > 0) {
- let targetItem = specificationsList.find(
- (item) => item.productSpecifications == productSpecifications.value && item.productType == productSpecifications.label
- );
- productId = targetItem.id;
- }
- if (targetColor) {
- productColour =
- targetColor.materieEncoding + "" + targetColor.materieColorNumber;
- }
- productColour =colours;
- let payload = {
- productId,
- productType,
- lotNum: lotNumber,
- productName,
- productSpecifications,
- productColour,
- };
- if (
- !lotNumber &&
- !productId &&
- !productType &&
- !productName &&
- !productSpecifications &&
- !productColour
- )
- return;
- let res = await getProductInventory(payload);
- if ((res.code = 200)) {
- // console.log(res);
- row.inventoryWeight = res.data.inventoryWeight || 0;
- row.inventoryBoxNum = res.data.inventoryBoxNum || 0;
- } else {
- // console.log(res);
- }
- },
- // 规格变化回调
- handleSpecificationsChange(row) {
- this.updateStorage(row);
- let { productSpecifications, specificationsList } = row;
- if (productSpecifications) {
- let targetItem = specificationsList.find(
- (item) => item.productSpecifications == productSpecifications.value && item.productType == productSpecifications.label
- );
- // console.log(targetItem);
- row.productNo = targetItem?.productNo;
- row.productType = targetItem?.productType;
- } else {
- row.productNo = "";
- row.productType = "";
- }
- },
- // 新的产品改变回调
- async newProductChange(productName, row) {
- // 发请求获取对应的规格数据
- //this.updateStorage(row);
- if (!productName) {
- row.specificationsList = [];
- (row.productNo = ""), (row.productType = "");
- row.productSpecifications = "";
- return;
- }
- // let targetItem = this.productionOptions.find(
- // (item) => item.productNo == productNo
- // );
- // row.productName = targetItem?.productName;
- // row.productType = targetItem?.productType;
- // 获取规格数据
- let res = await getProductSpecificationsByProductName({
- productName: productName,
- });
- if (res.code == 200) {
- row.specificationsList = res.data;
- // console.log(row.specificationsList);
- let defaultItem = row.specificationsList.find(
- (item) => item.isDefaultSpecifications
- );
- if (defaultItem) {
- row.productSpecifications = defaultItem.productSpecifications;
- row.productNo = defaultItem.productNo;
- row.productType = defaultItem.productType;
- } else {
- row.productSpecifications =
- row.specificationsList[0]?.productSpecifications || "";
- row.productNo = row.specificationsList[0]?.productNo || "";
- row.productType = row.specificationsList[0]?.productType || "";
- }
- } else {
- row.specificationsList = [];
- }
- },
- // 自定义筛选方法
- mySelectFilter(value, row) {
- // console.log(value);
- // row.productNo = value;
- if (value) {
- let target = [];
- // 在全部列表中查找
- target = this.allProductionOptions.filter((item) =>
- item.productName.includes(value)
- );
- // console.log(target);
- this.productionOptions = target;
- // if (target.length) {
- // this.productionOptions = target;
- // return true;
- // } else {
- // return false;
- // }
- } else {
- this.productionOptions = this.allProductionOptions.slice(0, 500);
- }
- },
- // 获取下拉数据
- async getSelectOptions() {
- try {
- let res = await getOptionLsit();
- if (res.code == 200) {
- this.dropDownData = res.data || {};
- // 初始化默认值
- if (this.dropDownData.level?.length > 0 && this.excuteType == 1) {
- this.formData.level = this.dropDownData.level[0].codeName;
- }
- } else {
- this.$message.error("网络异常!");
- }
- } catch (error) {}
- },
- // 等级改变回调
- async levelChangeHandler() {
- // return;
- // 等级发生变化,重新获取码单号
- this.tableData = []; //清空打印记录
- let res = await getQrCode();
- this.summertId = new Date().getTime(); //总码单id重新生成
- if (res.code == 200) {
- this.qrCode = res.msg;
- } else {
- this.$message.error(res.msg);
- }
- },
- // 出库单回调
- async myPrintOutBoundHandler(row, data) {
- // console.log("row", row);
- this.oldInventoryState = row.oldInventoryState;
- this.currentRow = row;
- this.outBoundShow = true;
- this.$nextTick(() => {
- if (this.oldInventoryState != 2) {
- this.$refs.outBoundRef.getTableData(row, false);
- } else {
- this.$refs.oldOutBoundRef.getTableData(row, false);
- }
- });
- },
- // 出库单打印回调
- async outBoundPrintHandler() {
- let res = {};
- if (this.oldInventoryState != 2) {
- res = await this.$refs.outBoundRef.getPrintData();
- } else {
- res = await this.$refs.oldOutBoundRef.getPrintData();
- }
- // console.log(res);
- if (res.flag) {
- try {
- if (this.oldInventoryState != 2) {
- let payload = res.data.tableData.map((item) => {
- let { saleNo } = this.currentRow;
- return {
- accountingType: "1",
- accountsReceivableDate: new Date(),
- saleNo,
- noticeNumber: item.noticeNumber,
- // saleProductNo: item.saleProductNo,
- productId: item.productId,
- productName: item.productName,
- productSpecifications: item.productSpecifications,
- productColour: item.productColour,
- lotNumber: item.lotNumber,
- weight: item.productNumber,
- productPrice: item.productUnitPrice,
- amountReceivable: Number(
- (
- Number(item.productNumber) * Number(item.productUnitPrice)
- ).toFixed(2)
- ),
- billingType: "1",
- accountsReceivableRemark: res.data.form.remark,
- receivedAmount: 0,
- status: 1,
- boxNum: item.boxNum,
- productLevel: item.productLevel,
- returnReceipt: "0",
- };
- });
- // let result = await printOutsourceOrder(payload);
- // if (result.code == 200) {
- res.data.form.printUser = this.nickName;
- outBoundPrint(res.data, "printDom", false);
- // } else {
- // throw new Error(result.msg);
- // }
- } else {
- res.data.form.printUser = this.nickName;
- oldOutBoundPrint(res.data, "printDom", false);
- }
- } catch (error) {
- this.$message.error(error);
- }
- }
- },
- // 产品名失焦
- handleProductBlur(productNo, row) {
- // console.log("blur", productNo);
- // if (!productNo) {
- // this.productionOptions = this.allProductionOptions.slice(0, 500);
- // row.productType = "";
- // }
- },
- // 产品名称改变
- handleProductChange(productNo, row) {
- // console.log(productNo);
- if (!productNo) {
- this.productionOptions = this.allProductionOptions.slice(0, 500);
- row.productType = "";
- return;
- }
- let targetItem = this.allProductionOptions.find(
- (item) => item.productNo == productNo
- );
- row.productName = targetItem?.productName;
- row.productType = targetItem?.productType;
- if (targetItem) {
- targetItem = JSON.parse(JSON.stringify(targetItem));
- }
- this.productionOptions = this.allProductionOptions.slice(0, 500);
- if (!this.productionOptions.find((item) => item.productNo == productNo)) {
- this.productionOptions.unshift(targetItem);
- }
- },
- // 订单类型改变回调
- orderTypeChange(type) {
- this.getList(false, type);
- },
- // 生成合同号
- getSaleNo() {
- let timeStr = moment().format("YYYYMMDD");
- for (var i = 0; i < 5; i++) {
- timeStr += parseInt(Math.random() * 10);
- }
- return timeStr;
- },
- // 重置审计表单数据
- resetFormData() {
- Object.assign(this.formData, {
- //订单表数据
- saleNo: this.getSaleNo(), //合同号
- saleCustomNo: "", //客户编号
- saleDate: moment(new Date()).format("YYYY-MM-DD"), //销售单日期
- saleOrderEstimatedTime: moment(new Date()).format("YYYY-MM-DD"), //预计下单时间
- saleLeadTime: "", //交货周期
- deliveryDate: "",
- saleAmounts: "", //合计金额 小写
- saleAmountInWords: "", //合计金额 大写
- salePayType: "", //支付方式
- earnestMoney: "",
- salesman: "", //业务员
- saleLeader: "", //业务主管
- finance: "", //财务部
- production: "", //生产部
- saleApprover: "", //批准人
- customAddress: "", //客户地址
- customCountryType: "", //国家类型
- contactPerson: "", //联系人
- // 货品明细表数据
- lotNumber: "", //批号
- productNo: "", //货品号
- productName: "", //货品名称
- productNumber: "", //销售数量
- productWeight: "", //销售重量kg
- productUnitPrice: "", //单价
- productAmounts: "", //金额
- sliceType: "", //切片类型
- sliceTypeLabel: "",
- colourNumberLabel: "",
- level: "",//等级
- colours: "", //色号
- remark: "", //备注
- // 工艺表
- craftGrid: "", //网络
- craftOil: "", //油剂
- craftPackage: "", //卷装
- craftColorFastness: "", //色牢度
- directionOfTwist: "",
- craftOther: "", //其它工艺要求
- craftMark: "", //包装/贴唛
- shippingMethod: "", //运输方式
- });
- this.productionTableData = [];
- },
- // 自定义的小计计算方法
- getSummaries(param) {
- const { columns, data } = param;
- // console.log(columns, data);
- const sums = [];
- columns.forEach((column, index) => {
- if (index === 0) {
- sums[index] = "小计";
- return;
- }
- const values = data.map((item) => Number(item[column.property]));
- if (
- index === 1 ||
- index === 2 ||
- index === 3 ||
- index === 4 ||
- index === 8 ||
- index === 9 ||
- index === 10 ||
- index === 11 ||
- index === 12
- ) {
- sums[index] = "";
- } else if (!values.every((value) => isNaN(value))) {
- sums[index] = values
- .reduce((prev, curr) => {
- const value = Number(curr);
- if (!isNaN(value)) {
- return prev + curr;
- } else {
- return prev;
- }
- }, 0)
- ?.toFixed(2);
- if (index == 7) {
- this.totalMoney = sums[index];
- }
- } else {
- sums[index] = "N/A";
- }
- });
- return sums;
- },
- // 货品表格数据删除回调
- deleteProduct(index) {
- this.productionTableData.splice(index, 1);
- this.initTableValidate();
- },
- // 货品表格数据新增回调
- addProduct() {
- this.productionTableData.push({
- saleProductNo: uuidv4(),
- productNo: "", //货品编号
- productType: "", //类型
- productName: "", //货品名称
- productNumber: 0, //销售数量
- productWeight: 0, //销售重量kg
- productUnitPrice: 0, //单价
- productAmounts: "", //金额
- sliceType: "022", //切片类型
- sliceTypeLabel: "",
- colourNumberLabel: "",
- colours: "", //色号
- remark: "", //备注
- specificationsList: [],
- productSpecifications: "", //型号
- inventoryBoxNum: "", //库存箱数
- inventoryWeight: "", //库存重量
- });
- // 添加校验规则
- this.initTableValidate();
- },
- // 自定义校验规则
- validateTableField(rule, value, callback) {
- // console.log("校验规则", rule, value);
- let { message, field } = rule;
- let index = field.split("-")[1],
- fieldName = field.split("-")[0];
- // console.log(
- // index,
- // fieldName,
- // this.productionTableData[Number(index)][fieldName]
- // );
- if (
- !this.productionTableData[Number(index)][fieldName] &&
- this.productionTableData[Number(index)][fieldName] !== 0 &&
- this.productionTableData[Number(index)][fieldName] !== "0"
- ) {
- callback(new Error(message));
- } else {
- callback();
- }
- },
- // 初始化校验规则
- initTableValidate() {
- let length = this.productionTableData.length;
- for (let i = 0; i < length; i++) {
- this.rules["productNo-" + i] = [
- {
- // required: true,
- message: "请选择货品",
- trigger: "change",
- validator: this.validateTableField,
- },
- ];
- this.rules["productNumber-" + i] = [
- {
- // required: true,
- message: "请输入数量",
- trigger: "blur",
- validator: this.validateTableField,
- },
- ];
- this.rules["productUnitPrice-" + i] = [
- {
- // required: true,
- message: "请输入单价",
- trigger: "blur",
- validator: this.validateTableField,
- },
- ];
- this.rules["sliceType-" + i] = [
- {
- // required: true,
- message: "请选择切片类型",
- trigger: "change",
- validator: this.validateTableField,
- },
- ];
- this.rules["colours-" + i] = [
- {
- // required: true,
- message: "请选择色号",
- trigger: "change",
- validator: this.validateTableField,
- },
- ];
- }
- // console.log(this.rules);
- },
- // 客户名称改变回调
- customChangeHandler(val) {
- // if (!val) return;
- let customData = this.customerOptions.find(
- (item) => item.customNo == val
- );
- this.formData.customAddress = customData?.customAddress || "无";
- this.formData.customCountryType = customData?.customCountryType || "无";
- this.formData.contactPerson = customData?.contactPerson || "无";
- },
- //审计新增
- async addHandler() {
- this.isEdit = false;
- // await this.getDropDownData();
- this.resetFormData();
- this.title = "新增销售单";
- this.open = true;
- this.$nextTick(() => {
- this.$refs["formDataRef"].clearValidate();
- });
- },
- // 获取下拉框数据
- async getDropDownData() {
- try {
- // let payLoad = [
- // {
- // basicMap: {
- // tableName: "production",
- // },
- // },
- // {
- // basicMap: {
- // tableName: "customer",
- // },
- // },
- // ];
- // let res = await queryDropDownBoxData(payLoad);
- // 新的获取客户选项数据的接口
- let res = await listCustomer({ isEnablePaging: false });
- if (res.code == 200) {
- // let { customer } = res.data.resultMap;
- // this.allProductionOptions = production || [];
- // this.productionOptions =
- // this.allProductionOptions.slice(0, 100) || [];
- this.customerOptions = res.rows || [];
- } else {
- throw Error("获取下拉框数据失败");
- }
- let proRes = await getSaleOrderProductionListDistinct();
- // console.log("proRes", proRes);
- if (proRes.code == 200) {
- // console.log(proRes.data);
- // let { production, customer } = proRes.data.resultMap;
- // this.allProductionOptions = proRes.data || [];
- // this.productionOptions =
- // this.allProductionOptions.slice(0, 500) || [];
- this.productionOptions = proRes.data;
- } else {
- throw Error("获取下拉框数据失败");
- }
- let allProRes = await getSaleOrderProductionList();
- if (allProRes.code == 200) {
- this.allProductionOptions = allProRes.data || [];
- } else {
- console.log(allProRes);
- }
- } catch (error) {
- console.log(error);
- }
- // 色号数据
- try {
- let payLoad = [
- {
- basicMap: {
- tableName: "materiel",
- },
- conditionMap: {
- materiel_species: ["1"],
- },
- },
- ];
- // let res = await queryDropDownBoxData(payLoad);
- // let res = await queryMaterielList();
- let res = await productColourList({ isEnablePaging: false });
- if (res.code == 200) {
- // console.log(res.data);
- // let { materiel } = res.data;
- this.colourNumberOptions = res.rows || [];
- } else {
- throw Error("获取下拉框数据失败");
- }
- } catch (error) {
- console.log(error);
- }
- // 切片型号
- try {
- let payLoad = [
- {
- basicMap: {
- tableName: "materiel",
- },
- conditionMap: {
- materiel_species: ["6"],
- },
- },
- ];
- let res = await queryDropDownBoxData(payLoad);
- if (res.code == 200) {
- // console.log(res.data.resultMap);
- let { materiel } = res.data.resultMap;
- this.sliceTypeOptions = materiel || [];
- } else {
- throw Error("获取下拉框数据失败");
- }
- } catch (error) {
- console.log(error);
- }
- //等级
- try{
- let res = await getOptionLsit();
- if (res.code == 200) {
- this.levelOptions = res.data.level;
- // console.log("----------------------",res.data.level)
- } else {
- this.$message.error("网络异常!");
- }
- }catch (error){}
- },
- //
- // 获取row-key
- getRowKey(row) {
- return row[
- camelCase(this.tableName + "_" + this.templateInfo.template?.primaryKey)
- ];
- },
- /** 查询列表 */
- getList(queryParams, orderType = 0) {
- this.loading = true;
- // 序列化当前查询参数列表
- queryParams && (this.queryParams.queryMap = queryParams.queryMap);
- // 获取当前表单结构信息
- dragTableInfo({ queryMap: { tableKey: this.tableKey } })
- .then((res) => {
- // 得到当前模版信息 --- sql columns queryWhere
- this.templateInfo = res.data.resultMap;
- this.styleList = res.data.resultMap.style?.map((item) => {
- item.styleField = camelCase(
- item.styleField.replace(".", "_") || ""
- );
- return item;
- });
- // 获取操作列的按钮数据
- this.excuteBtnArr = res.data.resultMap.button;
- // console.log(this.excuteBtnArr, "excuteBtnArr");
- // if (this.excuteBtnArr.length) {
- this.excuteBtnArr[0].children.push(
- {
- btnName: "编辑",
- btnType: "myEdit",
- btnIcon: "",
- btnShowCondition:""
- ,
- btnHasPermi: "huaxian:xsglddgl:INSERT",
- children: [],
- },
- {
- btnName: "出库明细",
- btnType: "OutDetail",
- btnIcon: "",
- // btnShowCondition: "[]",
- btnShowCondition:
- '[{"fieldName":"sale_order.status","mark":"3","refValue":"1"},{"fieldName":"sale_order.status","mark":"3","refValue":"7"},{"fieldName":"sale_order.status","mark":"3","refValue":"8"},{"fieldName":"sale_order.status","mark":"3","refValue":"11"}]',
- btnHasPermi: "huaxian:xsglddgl:INSERT",
- children: [],
- },
- {
- btnName: "重新登账",
- btnType: "ReAccount",
- btnIcon: "",
- // btnShowCondition: "[]",
- btnShowCondition:
- '[{"fieldName":"sale_order.status","mark":"6","refValue":"11"}]',
- btnHasPermi: "huaxian:xsglddgl:INSERT",
- children: [],
- },
- {
- btnName: "打印出库单",
- btnType: "printOutBound",
- btnIcon: "",
- // btnShowCondition: "[]",
- btnShowCondition:
- '[{"fieldName":"sale_order.status","mark":"3","refValue":"1"},{"fieldName":"sale_order.status","mark":"3","refValue":"2"},{"fieldName":"sale_order.status","mark":"3","refValue":"8"},{"fieldName":"sale_order.status","mark":"3","refValue":"7"},{"fieldName":"sale_order.status","mark":"3","refValue":"11"}]',
- btnHasPermi: "huaxian:xsglddgl:INSERT",
- children: [],
- },
- {
- btnName: "出库发货",
- btnType: "deliver",
- btnIcon: "",
- // btnShowCondition: "[]",
- btnShowCondition:
- '[{"fieldName":"sale_order.status","mark":"3","refValue":"1"},{"fieldName":"sale_order.status","mark":"3","refValue":"2"},{"fieldName":"sale_order.status","mark":"3","refValue":"8"},{"fieldName":"sale_order.status","mark":"3","refValue":"7"},{"fieldName":"sale_order.status","mark":"3","refValue":"11"}]',
- // ,{"fieldName":"sale_order.status","mark":"3","refValue":"3"} 3待生产
- btnHasPermi: "huaxian:xsglddgl:INSERT",
- children: [],
- },
- {
- btnName: "详情",
- btnType: "myDetail",
- btnIcon: "",
- btnShowCondition: "",
- btnHasPermi: "huaxian:xsglddgl:INSERT",
- children: [],
- },
- {
- btnName: "删除",
- btnType: "myDelete",
- btnIcon: "",
- btnShowCondition:
- '[{"fieldName":"sale_order.status","mark":"3","refValue":"2"},{"fieldName":"sale_order.status","mark":"3","refValue":"3"},{"fieldName":"sale_order.status","mark":"3","refValue":"4"},{"fieldName":"sale_order.status","mark":"3","refValue":"5"},{"fieldName":"sale_order.status","mark":"3","refValue":"6"},{"fieldName":"sale_order.status","mark":"3","refValue":"8"},{"fieldName":"sale_order.status","mark":"3","refValue":"9"},{"fieldName":"sale_order.status","mark":"3","refValue":"11"}]',
- children: [],
- btnHasPermi: "huaxian:xsglddgl:INSERT",
- },
- {
- btnName: "完成",
- btnType: "myComplate",
- btnIcon: "",
- btnShowCondition:
- '[{"fieldName":"sale_order.status","mark":"6","refValue":"9"},{"fieldName":"sale_order.status","mark":"3","refValue":"11"}]',
- children: [],
- btnHasPermi: "huaxian:xsglddgl:INSERT",
- },
- {
- btnName: "异常结束",
- btnType: "myEror",
- btnIcon: "",
- btnShowCondition:"",
- children: [],
- btnHasPermi: "huaxian:xsglddgl:INSERT",
- }
- // {
- // btnName: "记录批次",
- // btnType: "recordBatch",
- // btnIcon: "",
- // btnShowCondition: "",
- // children: [],
- // btnHasPermi: "huaxian:xsglddgl:INSERT",
- // }
- );
- // }
- this.queryParams.orderByColumn =
- res.data.resultMap.querySql.orderByColumn;
- this.sortOrder = JSON.parse(res.data.resultMap.querySql.sortOrder);
- // 根据拖拽时设置当前列表排列顺序
- this.queryParams.isAsc = this.sortOrder ? "DESC" : "ASC";
- this.tableName = this.templateInfo.template.dtTableName;
- // 得到查询条件
- this.queryFromWhere = res.data.resultMap.where;
- // 得到当前列表信息
- this.columns = this.columnsHandler(
- JSON.parse(this.templateInfo.template.dtColumnName)
- );
- // console.log(this.columns, "000");
- })
- .finally((fes) => {
- if (this.templateInfo == {}) return;
- // 调用查询需要携带当前table的唯一标识
- this.queryParams.queryMap.sqlkey = this.templateInfo.template.sqlKey;
- // 排序
- // this.queryParams.orderByColumn = camelCase(
- // this.queryParams.orderByColumn || ""
- // );
- // 根据sql语句查询当前表数据
- // let getListFun = orderType == 0 ? unionListTableData : getTableList1;
- // if (orderType != 0) {
- // this.queryParams.conditionMap = {
- // columnName: "order_type",
- // columnValue: orderType,
- // };
- // }
- delete this.queryParams.orderByColumn;
- this.queryParams.queryMap.queryParam =
- this.queryParams.queryMap.queryCriteriaValue;
- // this.queryParams.orderType = "";
- this.queryParams.queryParam =
- this.queryParams.queryMap.queryCriteriaValue;
- saleOrderList(this.queryParams).then(async (res) => {
- this.tableList = [];
- // res.rows.forEach((item) => {
- // this.tableList.push(item.resultMap);
- // });
- this.tableList = res.rows;
- // 订单表字段添加表名
- this.tableList.forEach((item) => {
- let keys = Object.keys(item);
- for (const key of keys) {
- if (key == "customName") {
- item["customer_" + key] = item[key];
- } else {
- item["sale_order_" + key] = item[key];
- }
- }
- });
- // 驼峰转换
- let tempTableList = [];
- tempTableList = this.tableList.map((item) => {
- let kv = {};
- for (let itemKey in item) {
- kv[camelCase(itemKey)] = item[itemKey];
- }
- return kv;
- });
- // this.setDictStyleData().then(() => {
- // this.tableList = this.setFieldStyleData(this.tableList);
- // });
- this.tableList = await this.setFieldStyleData(tempTableList);
- // console.log(this.tableList);
- this.total = res.total;
- this.$nextTick(() => {
- this.$refs.tableRef?.clearSelection();
- });
- this.loading = false;
- });
- // 查询统计信息
- getStatisticList({
- queryMap: {
- tableKey: this.templateInfo.template.tableKey,
- queryCriteriaValue: this.queryParams.queryMap.queryCriteriaValue,
- },
- }).then((res) => {
- this.statisticList = res.data;
- });
- });
- },
- // 校验定金
- validateEarnestMoney(rule, value, callback) {
- // console.log(value);
- if (this.formData.salePayType == "1") {
- if (value == "" || value == null || value == undefined) {
- callback(new Error("请输入定金金额"));
- } else {
- callback();
- }
- } else {
- callback();
- }
- },
- // 校验订单号是否有效
- async validateOrderNo(rule, value, callback) {
- // console.log(value);
- // let saleNo = this.formData.orderNo;
- // 检验订单号合法
- let checkNoPayload = {
- saleNo: value,
- };
- if (this.isEdit) {
- checkNoPayload.id = this.formData.id;
- }
- let result = await checkOrderNo(checkNoPayload);
- if (result.code == 200) {
- if (result.data) {
- callback();
- } else {
- callback(new Error("合同号已存在"));
- }
- } else {
- callback(new Error("校验失败,请稍后再试"));
- }
- },
- // 校验表格数据
- validateTableData() {
- if (this.productionTableData.length == 0) {
- return {
- res: false,
- msg: "请添加货品明细",
- };
- }
- let res = this.productionTableData.every((item) => {
- return (
- item.productNo &&
- item.productNumber &&
- item.productUnitPrice &&
- item.productAmounts &&
- item.sliceType &&
- item.colours
- );
- });
- if (!res) {
- return {
- res: false,
- msg: "请填写完整货品明细",
- };
- }
- return {
- res: true,
- msg: "",
- };
- },
- // 审计 提交编辑结果按钮回调
- async editConfirm() {
- // let tableValidate = this.validateTableData();
- // if (!tableValidate.res) {
- // this.$message.warning(tableValidate.msg);
- // // return;
- // }
- this.isAdding = true;
- this.$refs.formDataRef.validate(async (valid) => {
- if (valid) {
- let {
- id,
- //订单表数据
- saleNo,
- saleCustomNo,
- saleDate,
- saleOrderEstimatedTime,
- saleLeadTime,
- deliveryDate,
- saleAmounts,
- saleAmountInWords,
- salePayType,
- earnestMoney,
- salesman,
- saleLeader,
- finance,
- production,
- saleApprover,
- // 工艺表数据
- craftGrid,
- craftOil,
- craftPackage,
- craftColorFastness,
- directionOfTwist,
- craftOther,
- craftMark,
- shippingMethod,
- // 产品表
- lotNumber,
- } = this.formData;
- let saleCraftNo = this.isEdit ? this.formData.saleCraftNo : uuidv4();
- // saleNo = this.isEdit ? this.formData.saleNo : uuidv4();
- let saleProductsNo = this.productionTableData
- .map((item) => item.saleProductNo)
- .join(","); //销售单表sale_products_no字段存货品表的sale_product_no,逗号分割
- var st = null;
- if(!this.isEdit){
- st = 1;
- };
- let saleValue = {
- status: st, //新增销售单时 默认为1
- saleNo,
- lotNumber, //批号
- saleProductsNo,
- saleOrderTechnologyNo: saleCraftNo,
- saleCustomNo,
- saleDate: saleDate
- ? moment(new Date(saleDate)).format("YYYY-MM-DD")
- : "",
- saleOrderEstimatedTime: saleOrderEstimatedTime
- ? moment(new Date(saleOrderEstimatedTime)).format("YYYY-MM-DD")
- : "",
- deliveryDate: deliveryDate
- ? moment(new Date(deliveryDate)).format("YYYY-MM-DD")
- : "",
- saleLeadTime,
- // saleAmounts, //合计金额 小写
- saleAmountInWords,
- salePayType,
- earnestMoney,
- salesman: this.nickName,
- saleLeader,
- finance,
- production,
- saleApprover,
- };
- let craftValue = {
- saleOrderNo: saleNo,
- saleCraftNo,
- craftGrid,
- craftOil,
- craftPackage,
- craftColorFastness,
- directionOfTwist,
- craftOther,
- craftMark,
- shippingMethod,
- };
- let saleData = {
- //订单表新增数据
- basicMap: {
- tableName: "sale_order",
- },
- // addListMap: [saleValue],
- conditionMap: {},
- commMap: {},
- btnParametersMap: {},
- };
- let craftData = {
- //工艺表新增数据
- basicMap: {
- tableName: "sale_craft",
- },
- // addListMap: [craftValue],
- conditionMap: {},
- commMap: {},
- btnParametersMap: {},
- };
- // console.log("===========================",this.productionTableData);return;
- this.productionTableData.forEach((item) => {
- item.saleOrderNo = saleNo;
- item.lotNumber = lotNumber;
- delete item.productNotes;
- delete item.updateBy;
- delete item.updateById;
- delete item.updateTime;
- delete item.createBy;
- delete item.createTime;
- delete item.createById;
- delete item.delFlag;
- delete item.sliceTypeLabel;
- delete item.colourNumberLabel;
- delete item.productType; //删除类型
- delete item.taskProcessKey;
- delete item.processKey;
- delete item.onBoardState;
- delete item.taskNodeKey;
- delete item.productionLineNo;
- delete item.status;
- delete item.specificationsList;
- delete item.productSpecifications;
- delete item.productType;
- delete item.inventoryBoxNum;
- delete item.inventoryWeight;
- const matchedOption = this.colourNumberOptions.find(
- (option) => option.colour === item.colours
- );
- let taskName = item.productName + "-" + matchedOption.colour;
- // +
- // "-" +
- // matchedOption.materieEncoding;
- item.taskName = taskName;
- });
- // this.productionTableData.forEach((item) => {
- // delete item.productType; //删除产品类型
- // });
- //console.log("===========================",this.productionTableData);return;
- // return;
- let productData = {
- //货品表新增数据
- basicMap: {
- tableName: "sale_products",
- },
- addListMap: [...this.productionTableData],
- conditionMap: {},
- commMap: {},
- btnParametersMap: {},
- };
- if (this.isEdit) {
- //修改
- Object.keys(saleValue).map((k) => {
- saleData.commMap[k] = saleValue[k];
- });
- Object.keys(craftValue).map((k) => {
- craftData.commMap[k] = craftValue[k];
- });
- // saleData.conditionMap.saleNo = saleValue.saleNo;
- saleData.conditionMap.id = this.formData.id;
- craftData.conditionMap.saleCraftNo = craftValue.saleCraftNo;
- // for(let i = 0;i<this.)
- let deletPayload = {
- //删除货品数据的接口
- basicMap: {
- tableName: "sale_products",
- },
- conditionMap: {
- saleProductNo: this.productIds,
- },
- };
- let delRes = { code: 200 };
- if (this.productIds.length) {
- // delRes = await delTableData(deletPayload); //删除旧数据
- }
- //let updateSaleRes = await batchEdit(saleData);
- let updateCraftRes = await batchEdit(craftData);
- let updateSaleRes = { code: 200 };
- let addProductRes = { code: 200 };
- //循环修改
- let filteredItems = this.productionTableData.filter(item => 'id' in item);
- addLogOrder(this.formData).then(re=>{
- });
- if (filteredItems.length) {
- filteredItems.forEach(item=>{
- saleProductsBatchEdit(item).then(re=>{
- updateSaleRes = re.data
- });
- })
- }
- if (productData.addListMap.length > 0) {
- let filteredItemss = this.productionTableData.filter(item => !('id' in item));
- productData.addListMap = filteredItemss;
- if(filteredItemss.length > 0){
- addProductRes = await addTableData(productData);
- }
- }
- console.log("--------------------------",updateCraftRes,updateSaleRes,addProductRes)
- if (
- updateSaleRes?.code === 200 ||
- updateCraftRes?.code === 200 ||
- addProductRes?.code === 200
- ) {
- this.$message.success("修改成功");
- this.isAdding = false;
- this.open = false;
- this.getList();
- } else {
- this.isAdding = false;
- this.$message.error("修改失败");
- }
- } else {
- //新增
- saleData.addListMap = [saleValue];
- craftData.addListMap = [craftValue];
- let saleRes = await addTableData(saleData);
- let craftRes = await addTableData(craftData);
- let productRes = { code: 200 };
- if (productData.addListMap.length) {
- productRes = await addTableData(productData);
- }
- if (
- saleRes.code === 200 &&
- craftRes.code === 200 &&
- productRes.code === 200
- ) {
- this.$message.success("添加成功");
- this.open = false;
- this.isAdding = false;
- this.getList();
- } else {
- this.$message.error("添加失败");
- this.isAdding = false;
- }
- }
- // Object.keys(saleValue).map((k) => {
- // saleData.commMap[k] = saleValue[k];
- // });
- } else {
- this.isAdding = false;
- this.$message.error("请完善表单数据");
- }
- });
- },
- // 审计 编辑回调
- async handleEdit(index, row) {
- // console.log(row);
- let { saleOrderSaleNo } = row;
- try {
- let payLoad = [
- {
- basicMap: {
- tableName: "sale_order",
- },
- conditionMap: {
- sale_no: [saleOrderSaleNo],
- },
- },
- {
- basicMap: {
- tableName: "sale_products",
- },
- conditionMap: {
- sale_order_no: [saleOrderSaleNo],
- },
- },
- {
- basicMap: {
- tableName: "sale_craft",
- },
- conditionMap: {
- sale_order_no: [saleOrderSaleNo],
- },
- },
- ];
- let res = await queryDropDownBoxData(payLoad);
- if (res.code == 200) {
- this.isEdit = true;
- let { sale_craft, sale_order, sale_products } = res.data.resultMap;
- Object.assign(this.formData, {
- ...sale_craft[0],
- ...sale_order[0],
- });
- let { saleDate, saleOrderEstimatedTime, deliveryDate } =
- sale_order[0];
- saleDate && (this.formData.saleDate = new Date(saleDate));
- saleOrderEstimatedTime &&
- (this.formData.saleOrderEstimatedTime = saleOrderEstimatedTime);
- deliveryDate && (this.formData.deliveryDate = new Date(deliveryDate));
- this.productIds = sale_products.map((item) => item.saleProductNo);
- // await this.getDropDownData();
- let promiseArr = [];
- this.productionTableData = sale_products.map((item, index) => {
- let targetItem = this.allProductionOptions.find(
- (i) => item.productNo == i.productNo
- );
- item.productSpecifications = targetItem?.productSpecifications;
- item.productType = targetItem?.productType;
- promiseArr[index] = getProductSpecificationsByProductName({
- productName: item.productName,
- });
- return item;
- });
- console.log(this.productionTableData,"hmc")
- let promiseRes = await Promise.all(promiseArr);
- promiseRes.forEach((item, index) => {
- this.productionTableData[index].specificationsList = item.data;
- });
- if (this.formData.saleCustomNo) {
- this.customChangeHandler(this.formData.saleCustomNo);
- }
- this.title = "编辑审计单";
- this.initTableValidate();
- this.open = true;
- }
- } catch (error) {
- console.log(error);
- }
- },
- // 审计 批量删除回调
- async batchDelete() {
- if (!this.ids.length) return;
- try {
- await this.$confirm("是否确认删除选中的数据?", "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- });
- let orderPayload = {
- basicMap: {
- tableName: "sale_order",
- },
- conditionMap: {
- saleNo: this.ids,
- },
- };
- let productsPayload = {
- basicMap: {
- tableName: "sale_products",
- },
- conditionMap: {
- saleOrderNo: this.ids,
- },
- };
- let craftPayload = {
- basicMap: {
- tableName: "sale_craft",
- },
- conditionMap: {
- saleOrderNo: this.ids,
- },
- };
- let orderRes = await delTableData(orderPayload);
- // let productRes = await delTableData(productsPayload);
- // let craftRes = await delTableData(craftPayload);
- if (orderRes.code == 200) {
- this.$message.success("删除成功");
- this.getList();
- } else {
- this.$message.error("删除失败");
- throw Error("删除失败");
- }
- this.ids = [];
- this.$refs.tableRef.clearSelection();
- } catch (error) {
- console.log(error);
- }
- },
- // 计算金额
- computedPrice(row) {
- let { productNumber, productUnitPrice } = row;
- console.log(
- "productNumber, productUnitPrice",
- productNumber,
- productUnitPrice
- );
- row.productAmounts = (
- Number(productNumber) * Number(productUnitPrice)
- ).toFixed(2);
- },
- isUpperCase(char) {
- return char === char.toUpperCase();
- },
- // 下划线命名转驼峰命名
- toUnderScoreCase(str) {
- if (str === null) {
- return null;
- }
- let sb = "";
- // 前置字符是否大写
- let preCharIsUpperCase = true;
- // 当前字符是否大写
- let curreCharIsUpperCase = true;
- // 下一字符是否大写
- let nexteCharIsUpperCase = true;
- for (let i = 0; i < str.length; i++) {
- let c = str.charAt(i);
- if (i > 0) {
- preCharIsUpperCase = isUpperCase(str.charAt(i - 1));
- } else {
- preCharIsUpperCase = false;
- }
- curreCharIsUpperCase = isUpperCase(c);
- if (i < str.length - 1) {
- nexteCharIsUpperCase = isUpperCase(str.charAt(i + 1));
- }
- if (
- preCharIsUpperCase &&
- curreCharIsUpperCase &&
- !nexteCharIsUpperCase
- ) {
- sb += SEPARATOR;
- } else if (i !== 0 && !preCharIsUpperCase && curreCharIsUpperCase) {
- sb += SEPARATOR;
- }
- sb += c.toLowerCase();
- }
- return sb;
- },
- // 处理列表信息
- columnsHandler(columns) {
- let resArr = [];
- // console.log(columns, 111);
- columns.forEach((item) => {
- for (const key in item) {
- let tempObj = {};
- tempObj.key = camelCase(key);
- tempObj.value = item[key];
- resArr.push(tempObj);
- }
- });
- // console.log(resArr, 222);
- return resArr;
- },
- // 取消按钮
- cancel() {
- this.open = false;
- // this.reset();
- },
- // k-form-build 取消按钮
- kCancel() {
- this.kOpen = false;
- // this.reset();
- },
- // 分页查询
- pageList(row) {
- // 调用子组件-》携带子组件参数请求后台
- this.$refs.mychild.pageList(
- row == undefined
- ? {
- limit: this.queryParams.pageSize,
- page: this.queryParams.pageNum,
- }
- : row
- );
- },
- // 多选框选中数据
- handleSelectionChange(selection) {
- // this.ids = selection.map(
- // (item) =>
- // item[
- // camelCase(
- // this.tableName + "_" + this.templateInfo.template?.primaryKey
- // )
- // ]
- // );
- this.selection = selection;
- this.myDelIds = selection.map((item) => item.saleOrderId);
- // console.log(this.myDelIds);
- this.ids = selection.map((item) => item.saleOrderSaleNo);
- this.single = selection.length != 1;
- this.multiple = !selection.length;
- },
- // 更多操作触发
- handleCommand(command, row) {
- switch (command) {
- case "handleResetPwd":
- this.handleResetPwd(row);
- break;
- case "handleAuthRole":
- this.handleAuthRole(row);
- break;
- default:
- break;
- }
- },
- /** 新增按钮操作 */
- handleAdd(row) {
- // this.reset();
- this.defaultValue = {};
- getInfoBySqlKey(this.templateInfo.template.sqlKey).then(({ data }) => {
- if (!data || !data.dfVueTemplate) {
- this.jsonData = false;
- this.$message.error("当前表格未绑定表单!");
- return;
- }
- if (data.dfFormSql) {
- let dynamicData = JSON.parse(data.dfFormSql);
- Object.assign(this.dynamicData, dynamicData);
- }
- this.jsonData = JSON.parse(data.dfVueTemplate);
- this.open = true;
- this.title = "添加信息";
- this.form.password = this.initPassword;
- this.$nextTick(() => {
- this.$refs.addFromRef.reset();
- inputDisableComplete();
- });
- });
- },
- longestCommonSubstring(strs) {
- if (!strs || strs.includes("")) return "";
- let str1_Length = strs[0].length;
- let str_Nums = strs.length;
- let flag = 0;
- for (let i = 0; i < str1_Length && flag == 0; i++) {
- let char = strs[0][i];
- for (var j = 1; j < str_Nums; j++) {
- if (char !== strs[j][i] || i == strs[j].length) {
- return strs[1].substring(0, i);
- }
- }
- }
- return strs[0];
- },
- // 绑定dialog对话框关闭
- handleClose() {
- this.btnDialogVisible = false;
- },
- getLastUppercaseWord(text) {
- const pattern = /\b[A-Z][a-z]*\b/g;
- const matches = [...text.matchAll(pattern)];
- if (matches.length > 0) {
- const lastMatch = matches[matches.length - 1][0];
- return lastMatch;
- } else {
- return null;
- }
- },
- /** 修改按钮操作 */
- async handleUpdate(row, btnData) {
- let nameTable = this.templateInfo.template.dtTableName;
- this.rowobj = {};
- let obj = {};
- for (let key in row) {
- let modifiedTable = key
- .replace(/[A-Z]/g, (match) => `_${match}`)
- .toLowerCase();
- this.rowobj[modifiedTable] = row[key];
- let str = modifiedTable.substring(nameTable.length + 1);
- obj[str] = row[key];
- }
- // getInfoBySqlKey(this.templateInfo.template.sqlKey).then(({ data }) => {
- // if (!data || !data.dfVueTemplate) {
- // this.$message.error("当前表格未绑定表单!");
- // return;
- // }});
- // 新的修改请求
- try {
- let payLoad = {
- basicMap: {
- btnType: this.currentBtnData.btnType,
- btnKey: this.currentBtnData.btnKey,
- visible: "false",
- sqlKey: this.templateInfo.template.sqlKey,
- tableName: this.tableName,
- },
- conditionMap: {},
- };
- let primary = camelCase(
- this.tableName + "_" + this.templateInfo.template?.primaryKey
- );
- payLoad.conditionMap[this.templateInfo.template?.primaryKey] =
- row[primary];
- let res = await btnCommonApi(payLoad);
- // 判断是否绑定dialog弹窗
- if (!this.currentBtnData.btnTableFormGroupKey) {
- if (!res.data || !res.data.template) {
- this.$message.error("当前按钮未绑定表单!");
- return;
- }
- res.data.template.dfFormSql &&
- (this.dynamicData = JSON.parse(res.data.template.dfFormSql));
- this.addRealFieldName(res.data.result.resultMap);
- let resultMap = res.data.result.resultMap;
- Object.assign(this.defaultValue, resultMap);
- this.jsonData = JSON.parse(res.data.template.dfVueTemplate);
- this.kOpen = true;
- this.title = "修改信息";
- this.form.password = this.initPassword;
- this.$nextTick(() => {
- this.$refs.addFromRef.setData(res.data.result.resultMap);
- });
- } else {
- this.subTableName = res.data.result.dragTables[1].dtTableName;
- this.btnDialogVisible = true;
- this.groupKey = this.currentBtnData.btnTableFormGroupKey;
- this.$nextTick(() => {
- let refChild = this.$refs.dialogRef;
- refChild.getLists(this.groupKey);
- });
- let tablesubKey = res.data.result.dragTables[1].tableKey;
- // 查询统计信息
- getStatisticList({
- queryMap: {
- tableKey: tablesubKey,
- },
- }).then((res) => {
- this.subCount = res.data;
- });
- let prmKey = this.templateInfo.template.primaryKey;
- let pkey = prmKey.replace(/_([a-z])/g, (match, p1) =>
- p1.toUpperCase()
- );
- let data = {
- queryMap: {
- tableKey: res.data.result.dragTables[2].tableKey,
- },
- };
- let key =
- "#{" +
- this.templateInfo.template.dtTableName +
- "." +
- this.templateInfo.template.primaryKey;
- data.queryMap[key] =
- "'" + obj[this.templateInfo.template.primaryKey] + "'";
- getStatisticList(data).then((res) => {
- this.tableCount = res.data;
- });
- }
- // let fieldList = Object.keys(resultMap);
- // let tableName = this.longestCommonSubstring(fieldList);
- // fieldList.forEach((field) => {
- // let realField = field.replace(tableName, "");
- // realField = realField[0].toLocaleLowerCase() + realField.substring(1);
- // resultMap[realField] = resultMap[field];
- // });
- } catch (error) {
- this.$message.error("网络异常,请稍后再试");
- // console.log(error);
- }
- return;
- // getInfoBySqlKey(this.templateInfo.template.sqlKey).then(({ data }) => {
- // if (!data || !data.dfVueTemplate) {
- // this.$message.error("当前表格未绑定表单!");
- // return;
- // }
- // // let fieldList = Object.keys(row);
- // // let tableName = this.longestCommonSubstring(fieldList);
- // // fieldList.forEach((field) => {
- // // let realField = field.replace(tableName, "");
- // // realField = realField[0].toLocaleLowerCase() + realField.substring(1);
- // // row[realField] = row[field];
- // // });
- // this.addRealFieldName(row);
- // Object.assign(this.defaultValue, row);
- // this.jsonData = JSON.parse(data.dfVueTemplate);
- // this.open = true;
- // this.title = "修改信息";
- // this.form.password = this.initPassword;
- // this.$nextTick(() => {
- // this.$refs.addFromRef.setData(row);
- // });
- // });
- // return;
- this.reset();
- const userId = row.userId || this.ids;
- getUser(userId).then((response) => {
- this.form = response.data;
- this.postOptions = response.posts;
- this.roleOptions = response.roles;
- this.$set(this.form, "postIds", response.postIds);
- this.$set(this.form, "roleIds", response.roleIds);
- this.open = true;
- this.title = "修改当前信息";
- this.form.password = "";
- });
- },
- // 添加真正的字段名
- addRealFieldName(row) {
- let fieldList = Object.keys(row);
- // let tableName = this.longestCommonSubstring(fieldList);
- let tableName = camelCase(this.tableName);
- fieldList.forEach((field) => {
- let realField = field.replace(tableName, "");
- realField = realField[0].toLocaleLowerCase() + realField.substring(1);
- row[realField] = row[field];
- });
- },
- /** 提交按钮 */
- submitForm: function () {
- this.$refs["form"].validate((valid) => {
- if (valid) {
- if (this.form.userId != undefined) {
- updateUser(this.form).then((response) => {
- this.$modal.msgSuccess("修改成功");
- this.open = false;
- this.getList();
- });
- } else {
- addUser(this.form).then((response) => {
- this.$modal.msgSuccess("新增成功");
- this.open = false;
- this.getList();
- });
- }
- }
- });
- },
- /** 删除按钮操作
- *
- * 删除提示信息语句(标识)
- * */
- handleDelete(row, btnData) {
- let delIds = this.ids;
- let primary = camelCase(this.templateInfo.template?.primaryKey);
- // let realyKey=
- this.addRealFieldName(row);
- if (row[primary] != undefined && row[primary] != null) {
- delIds = [];
- delIds.push(row[primary]);
- }
- let data = {
- basicMap: {
- btnType: btnData.btnType,
- btnKey: btnData.btnKey,
- tableName: this.tableName,
- },
- conditionMap: {
- // id: delIds,
- },
- btnParametersMap: {},
- };
- if (this.currentBtnData.btnParams) {
- let btnParams =
- JSON.parse(this.currentBtnData.btnParams)?.commonFieldData || [];
- let conditionData =
- JSON.parse(this.currentBtnData.btnParams).conditionData || [];
- conditionData.forEach((item) => {
- data.conditionMap[item.fieldName.split(".")[1]] = item.fieldValue
- ? item.fieldValue
- : this.currentRow[camelCase(item.fieldName.replace(".", "_"))];
- });
- btnParams.forEach((item) => {
- data.btnParametersMap[item.fieldName.split(".")[1]] = item.fieldValue
- ? item.fieldValue
- : this.currentRow[camelCase(item.fieldName.replace(".", "_"))];
- });
- }
- // data.conditionMap[this.templateInfo.template?.primaryKey] = delIds;
- this.$modal
- .confirm('是否确认删除"' + delIds + '"的数据项?')
- .then(function () {
- // return delTableData(data);
- return btnCommonApi(data);
- })
- .then(() => {
- // 调用子组件查询方法 目的是携带上子组件中的查询参数
- this.$refs.mychild.pageList();
- this.$modal.msgSuccess("删除成功");
- })
- .catch(() => {});
- },
- // 批量删除接口
- handleBatchDelete() {
- let delIds = this.ids;
- let primary = camelCase(this.templateInfo.template?.primaryKey);
- // if (row && row[primary] != undefined && row[primary] != null) {
- // delIds = [];
- // delIds.push(row[primary]);
- // }
- let data = {
- basicMap: {
- tableName: this.tableName,
- },
- conditionMap: {
- // id: delIds,
- },
- };
- // if (this.currentBtnData.btnParams) {
- // let btnParams = JSON.parse(this.currentBtnData.btnParams);
- // btnParams.forEach((item) => {
- // data.btnParametersMap[
- // this.formatField(item.fieldName, camelCase(this.tableName))
- // ] = item.fieldValue
- // ? item.fieldValue
- // : this.currentRow[item.fieldName];
- // });
- // }
- data.conditionMap[this.templateInfo.template?.primaryKey] = delIds;
- this.$modal
- .confirm('是否确认删除"' + delIds + '"的数据项?')
- .then(function () {
- return delTableData(data);
- // return btnCommonApi(data);
- })
- .then(() => {
- // 调用子组件查询方法 目的是携带上子组件中的查询参数
- this.$refs.mychild.pageList();
- this.$modal.msgSuccess("删除成功");
- })
- .catch(() => {});
- },
- /** 导出按钮操作 */
- handleExport() {
- let primary = "saleOrderId";
- let realyKey = "saleOrderId";
- if (this.myDelIds.length > 0) {
- this.queryParams["execlMap"] = [];
- this.myDelIds.forEach((item) => {
- this.queryParams.execlMap.push(
- this.tableList.find((ttem) => {
- return ttem[realyKey] === item;
- })
- );
- });
- } else {
- this.$message.warning("请至少勾选一条导出数据");
- return;
- }
- this.queryParams.execlMap = JSON.stringify(this.queryParams.execlMap);
- this.download(
- process.env.VUE_APP_BASE_API1 + "common/export",
- {
- ...this.queryParams,
- },
- `文件名称_${new Date().getTime()}.xlsx`
- );
- },
- /** 导入按钮操作 */
- handleImport() {
- this.upload.title = "当前导入";
- this.upload.open = true;
- },
- /** 下载模板操作 */
- importTemplate() {
- this.download(
- process.env.VUE_APP_BASE_API1 +
- `common/exportTemplate?tableName=${this.tableName}&sqlkey=${this.templateInfo.template.sqlKey}`,
- {},
- `下载模版名称${new Date().getTime()}.xlsx`
- );
- },
- // 文件上传中处理
- handleFileUploadProgress(event, file, fileList) {
- this.upload.isUploading = true;
- },
- // 文件上传成功处理
- handleFileSuccess(response, file, fileList) {
- this.upload.open = false;
- this.upload.isUploading = false;
- this.$refs.upload.clearFiles();
- this.$alert(
- "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
- response.msg +
- "</div>",
- "导入结果",
- { dangerouslyUseHTMLString: true }
- );
- this.$refs.mychild.pageList({
- limit: this.queryParams.pageSize,
- page: this.queryParams.pageNum,
- });
- },
- //重点在这里
- handleChange(file, fileList) {
- file.name = this.tableName + "." + file.name.split(".")[1];
- fileList.forEach((item) => {
- item.name = this.tableName + "." + file.name.split(".")[1];
- });
- let newFile = new File(
- [file],
- this.tableName + "." + file.name.split(".")[1]
- ); //创建出来也是不可编辑的file对象
- },
- // 提交上传文件
- submitFileForm() {
- this.$refs.upload.submit();
- },
- // 弹窗新增的数
- addListHandler(val) {
- this.addLists.push(...val);
- },
- // 绑定弹窗Dialog确定按钮
- async btnComfirm() {
- let res = await this.$refs.deliverRef.getAllData();
- let { flag, isEdit, data } = res;
- if (flag) {
- if (isEdit) {
- //编辑
- let payLoad = {
- ...data.formData,
- saleProductInfoList: data.tableData,
- };
- let res = await updateProductInvoice(payLoad);
- if (res.code == 200) {
- this.$message.success("修改成功");
- this.deliverShow = false;
- this.getList();
- } else {
- this.$message.error("网络异常");
- }
- } else {
- //新增
- let payLoad = {
- ...data.formData,
- saleProductInfoList: data.tableData,
- };
- let res = await addProductInvoice(payLoad);
- if (res.code == 200) {
- this.$message.success("保存成功");
- this.deliverShow = false;
- this.getList();
- } else {
- this.$message.error("网络异常");
- }
- }
- }
- },
- // 去掉表名 开头字母小写
- formatField(field = "", tableName) {
- let temp = field.replace(tableName, "");
- return toUnderline(temp[0].toLowerCase() + temp.slice(1));
- },
- //提交编辑结果按钮回调
- async editConfirmHandler() {
- if (this.$refs.addFromRef) {
- this.$refs.addFromRef
- .getData()
- .then(async (values) => {
- let data = {
- basicMap: {
- tableName: this.tableName,
- // btnKey: btnData.btnKey,
- btnKey: this.currentBtnData.btnKey,
- },
- addListMap: [values],
- conditionMap: {},
- commMap: {},
- btnParametersMap: {},
- };
- if (this.currentBtnData.btnParams) {
- let btnParams =
- JSON.parse(this.currentBtnData.btnParams)?.commonFieldData ||
- [];
- let conditionData =
- JSON.parse(this.currentBtnData.btnParams).conditionData || [];
- // let
- btnParams.forEach((item) => {
- data.btnParametersMap[item.fieldName.split(".")[1]] =
- item.fieldValue
- ? item.fieldValue
- : this.currentRow[
- camelCase(item.fieldName.replace(".", "_"))
- ];
- });
- conditionData.forEach((item) => {
- data.conditionMap[item.fieldName.split(".")[1]] =
- item.fieldValue
- ? item.fieldValue
- : this.currentRow[
- camelCase(item.fieldName.replace(".", "_"))
- ];
- });
- }
- if (Object.keys(this.defaultValue).length) {
- // data.conditionMap[this.templateInfo.template?.primaryKey] =
- // this.defaultValue[this.templateInfo.template?.primaryKey];
- Object.keys(values).map((k) => {
- data.commMap[k] = values[k];
- });
- data.basicMap.btnType = this.currentBtnData.btnType;
- data.basicMap.visible = true;
- } else {
- data.basicMap.btnType = "INSERT";
- data.basicMap.visible = true;
- }
- try {
- let res = await btnCommonApi(data);
- if (res.code == 200) {
- this.$message.success("操作成功");
- } else {
- this.$message.error("网络异常,请稍后再试");
- }
- } catch (error) {
- console.log(error);
- this.$message.error("网络异常,请稍后再试");
- }
- this.getList();
- this.defaultValue = {};
- this.kOpen = false;
- })
- .catch((res) => {
- console.log(res);
- this.$modal.msgError("表单校验失败,请规范填写数据");
- });
- } else {
- // 没有绑定表单
- let data = {
- basicMap: {
- tableName: this.tableName,
- // btnKey: btnData.btnKey,
- btnKey: this.currentBtnData.btnKey,
- btnType: this.currentBtnData.btnType,
- visible: true,
- },
- addListMap: [],
- conditionMap: {},
- commMap: {},
- btnParametersMap: {},
- };
- if (this.currentBtnData.btnParams) {
- let btnParams =
- JSON.parse(this.currentBtnData.btnParams)?.commonFieldData || [];
- let conditionData =
- JSON.parse(this.currentBtnData.btnParams).conditionData || [];
- conditionData.forEach((item) => {
- data.conditionMap[item.fieldName.split(".")[1]] = item.fieldValue
- ? item.fieldValue
- : this.currentRow[camelCase(item.fieldName.replace(".", "_"))];
- });
- btnParams.forEach((item) => {
- data.btnParametersMap[item.fieldName.split(".")[1]] =
- item.fieldValue
- ? item.fieldValue
- : this.currentRow[camelCase(item.fieldName.replace(".", "_"))];
- });
- }
- // data.basicMap.btnType = this.currentBtnData.btnType;
- // data.basicMap.visible = true;
- try {
- let res = await btnCommonApi(data);
- if (res.code == 200) {
- this.$message.success("操作成功");
- } else {
- this.$message.error("网络异常,请稍后再试");
- }
- } catch (error) {
- console.log(error);
- this.$message.error("网络异常,请稍后再试");
- }
- this.getList();
- this.defaultValue = {};
- this.kOpen = false;
- }
- },
- // 使用提交数据类型的按钮获取数据
- tempSubBtn(getData) {
- getData()
- .then((values) => {
- console.log("验证通过", values);
- })
- .catch(() => {
- console.log("验证未通过,获取失败");
- });
- },
- // 判断是否生效行样式
- cellStyle({ row, column, rowIndex, columnIndex }) {
- let rowStyleList = this.styleList.filter((item) => item.styleType == 0);
- if (!rowStyleList.length) return "";
- let mainTableName = this.templateInfo.querySql.tableAlias; //主表名
- for (let i = 0; i < rowStyleList.length; i++) {
- let item = rowStyleList[i];
- let judgeRes = this.determineCondition(item.styleCondtion, row);
- if (judgeRes) {
- let styleCode = JSON.parse(item.styleCode);
- return `background-color:${styleCode.rowBgColor};`;
- }
- }
- },
- // 获取生效条件组结果
- determineCondition(conditionStr, row) {
- let conditionList = JSON.parse(conditionStr);
- if (!conditionList.length) return false;
- return conditionList.every((item) => this.judgeOneCondition(item, row));
- },
- // 获取单个判断条件结果
- judgeOneCondition(item, row) {
- let fullField = camelCase(item.tableName + "_" + item.fieldName);
- switch (item.condition) {
- case 1:
- return row[fullField] > item.flagValue;
- case 2:
- return row[fullField] < item.flagValue;
- case 3:
- return row[fullField] == item.flagValue;
- case 4:
- return row[fullField] >= item.flagValue;
- case 5:
- return row[fullField] <= item.flagValue;
- default:
- return true; //默认为true
- }
- },
- // 设置表格字段样式
- async setFieldStyleData(tableList) {
- // console.log(JSON.parse(JSON.stringify(tableList)));
- let fieldConditionList = this.styleList.filter(
- (item) => item.styleType == 1 || item.styleType == 2
- );
- if (!fieldConditionList.length) return tableList;
- let res = await this.setDictStyleData();
- this.dictStyleObj = res.reduce((pre, item) => {
- return {
- ...pre,
- ...item,
- };
- }, {});
- // console.log("this.dictStyleObj", this.dictStyleObj);
- tableList.forEach((row) => {
- // if (!row.styleFieldObj) row.styleFieldObj = {};
- for (let i = 0; i < fieldConditionList.length; i++) {
- let item = fieldConditionList[i];
- if (item.styleType == 1) {
- //字段样式
- let judgeRes = this.determineCondition(item.styleCondtion, row);
- if (judgeRes) {
- let styleCode = JSON.parse(item.styleCode);
- if (!row.styleFieldObj) row.styleFieldObj = {};
- row.styleFieldObj[item.styleField] = {
- styleType: item.styleType,
- fieldStyleType: styleCode.fieldStyleType,
- fontColor: styleCode.fontColor,
- isTagFullBg: styleCode.isTagFullBg,
- tagType: styleCode.tagType,
- };
- // row.styleField = item.styleField; //样式生效字段
- // row.styleType = item.styleType; //0:行样式 1:字段样式 2:字典样式
- // row.fieldStyleType = styleCode.fieldStyleType; //0:文本 1:标签
- // row.fontColor = styleCode.fontColor;
- // row.isTagFullBg = styleCode.isTagFullBg; //true/false
- // row.tagType = styleCode.tagType; //string
- }
- } else {
- //字典样式
- let dicStyle = this.dictStyleObj[item.styleField]?.find((dict) => {
- return dict.dictValue == row[item.styleField];
- });
- if (dicStyle) {
- if (!row.styleFieldObj) row.styleFieldObj = {};
- row.styleFieldObj[item.styleField] = dicStyle; //设置该字段应该显示的字典样式
- row.styleFieldObj[item.styleField].styleType = 2;
- }
- }
- }
- });
- return tableList;
- },
- //设置表格字典相关数据
- setDictStyleData() {
- let fieldConditionList = this.styleList.filter(
- (item) => item.styleType == 2
- );
- if (!fieldConditionList.length) return;
- let PromiseList = fieldConditionList.map((item) => {
- return new Promise((resolve, reject) => {
- let temp = {};
- try {
- listData({
- isEnablePaging: false,
- dictType: item.styleCondtion,
- }).then((res) => {
- temp[item.styleField] = res.rows;
- resolve(temp);
- });
- } catch (error) {
- reject(error);
- }
- });
- });
- return Promise.all(PromiseList);
- },
- // 内链页面跳转
- routerHandler(btnData, type) {
- let { url, commonFieldData } = JSON.parse(btnData.btnParams);
- let tempArr = [];
- if (commonFieldData) {
- let queryArr = JSON.parse(commonFieldData);
- tempArr = queryArr.map((item) => {
- let key = this.formatField(item.fieldName, camelCase(this.tableName));
- let value = item.fieldValue
- ? item.fieldValue
- : this.currentRow[item.fieldName];
- return key + "=" + value;
- });
- }
- if (tempArr.length) {
- url += "?" + tempArr.join("&");
- }
- // let link = btnData.btnParams;
- if (type == "INNERLINK") {
- this.$router.push(url);
- } else {
- window.open("http://" + url, "_blank");
- }
- },
- async handleDetail(row) {
- this.printDomData = await this.getDetailTableString(row);
- this.detailShow = true;
- this.$nextTick(() => {
- this.$refs.detailTable.innerHTML = this.printDomData;
- });
- },
- // 切片类型改变回调
- sliceTypeChangeHandler(row) {
- let { sliceType } = row;
- if (sliceType) {
- row.sliceTypeLabel = this.sliceTypeOptions.find(
- (item) => item.materielCode == sliceType
- )?.materielName;
- }
- },
- // 色号改变回调
- colourNumberChangeHandler(row) {
- this.updateStorage(row);
- let { colours } = row;
- if (colours) {
- let target = this.colourNumberOptions.find(
- (item) => item.colour == colours
- );
- if (target) {
- row.colourNumberLabel =
- target.materieEncoding + target.materieColorNumber;
- }
- // row.colourNumberLabel = this.colourNumberOptions.find(
- // (item) => item.materielCode == colours
- // )?.materieColorNumber;
- }
- },
- // 打印回调
- detailPrintHandler() {
- document.body.innerHTML = document.getElementById("printDom").innerHTML =
- this.printDomData;
- window.print(); //打印
- window.location.reload();
- return false;
- },
- // 根据字典value获取字典label
- getDictLabel(value, dict) {
- return (
- this.dict.type[dict].find((item) => {
- return item.value === value;
- })?.label || ""
- );
- },
- // 获取详情html字符串
- async getDetailTableString(row) {
- let { saleOrderSaleNo } = row;
- let payLoad = [
- {
- basicMap: {
- tableName: "sale_order",
- },
- conditionMap: {
- sale_no: [saleOrderSaleNo],
- },
- },
- {
- basicMap: {
- tableName: "sale_products",
- },
- conditionMap: {
- sale_order_no: [saleOrderSaleNo],
- },
- },
- {
- basicMap: {
- tableName: "sale_craft",
- },
- conditionMap: {
- sale_order_no: [saleOrderSaleNo],
- },
- },
- ];
- let res = await queryDropDownBoxData(payLoad);
- if (res.code == 200) {
- // console.log(res);
- let { sale_craft, sale_order, sale_products } = res.data.resultMap;
- let {
- //订单表数据
- saleNo, //合同号
- lotNumber, //批号
- saleCustomNo, //客户编号
- saleDate, //销售单日期
- saleOrderEstimatedTime, //预计下单时间
- saleLeadTime, //交货周期
- deliveryDate,
- saleAmounts, //合计金额 小写
- saleAmountInWords, //合计金额 大写
- salePayType, //支付方式
- earnestMoney,
- salesman, //业务员
- saleLeader, //业务主管
- finance, //财务部
- production, //生产部
- saleApprover, //批准人
- // customAddress, //客户地址
- // customCountryType, //国家类型
- // contactPerson, //联系人
- // 货品明细表数据
- // productNo, //货品号
- // productName, //货品名称
- // productNumber: "", //销售数量
- // productWeight: "", //销售重量kg
- // productUnitPrice: "", //单价
- // productAmounts: "", //金额
- // remark: "", //备注
- // 工艺表
- craftGrid, //网络
- craftOil, //油剂
- craftPackage, //卷装
- craftColorFastness, //色牢度
- directionOfTwist,
- craftOther, //其它工艺要求
- craftMark, //包装/贴唛
- shippingMethod, //运输方式
- } = { ...sale_craft[0], ...sale_order[0] };
- let customData = this.customerOptions.find(
- (item) => item.customNo == saleCustomNo
- );
- let payType = this.getDictLabel(salePayType, "payment_method"); //付款方式
- let customerName = customData ? customData.customName : "";
- let customAddress = customData?.customAddress || "无";
- let customCountryType = customData?.customCountryType || "";
- let contactPerson = customData?.contactPerson || "无";
- let directionOfTwistDescription = directionOfTwist
- ? this.getDictLabel(directionOfTwist, "direction_of_twist")
- : "";
- let printStr = `
- <table style="width:1200px; border-collapse:collapse;" border="1" cellpadding="10" align="center">
- <div style="text-align:center;font-size: 20px;">诸暨市新丝维纤维有限公司</div>
- <div style="text-align:center;">销售合同审计单</div>
- <tbody>
- <tr>
- <td width="600px" colspan="4">合同号:${saleNo}</td>
- <td width="600px" colspan="6">日期:${saleDate.replace(
- "T",
- " "
- )}</td>
- </tr>
- <tr align="center">
- <td width="300px" colspan="2">客户名称:</td>
- <td width="300px" colspan="2">${customerName}</td>
- <td width="300px" colspan="2">联系人:</td>
- <td width="150px" colspan="4">${contactPerson}</td>
- </tr>
- <tr align="center">
- <td width="300px" colspan="2">客户地址:</td>
- <td width="300px" colspan="3">${customAddress}</td>
- <td width="300px" colspan="2">客户国别:</td>
- <td width="300px" colspan="3">${customCountryType}</td>
- </tr>
- <tr align="center">
- <td width="300px" colspan="2">预计下单时间:</td>
- <td colspan="1">${saleOrderEstimatedTime.replace(
- "T",
- " "
- )}</td>
- <td colspan="2">交货周期:</td>
- <td >${saleLeadTime}</td>
- <td colspan="2">交货日期:</td>
- <td colspan="2">${deliveryDate.replace("T", " ")}</td>
- </tr>
- <tr align="center">
- <td colspan="10">货品明细</td>
- </tr>
- <tr align="center">
- <td width="150px">品名</td>
- <td width="100px">规格</td>
- <td width="100px">类型</td>
- <td width="100px">色号</td>
- <td width="100px">等级</td>
- <td width="150px">数量/kg</td>
- <td width="150px">单价</td>
- <td width="150px">金额</td>
- <td width="150px">切片型号</td>
- <td width="150px">备注</td>
- </tr>`;
- let amountTotal = 0,
- singlTotal = 0,
- moneyTotal = 0;
- for (let i = 0; i < sale_products.length; i++) {
- let item = sale_products[i];
- amountTotal += Number(item.productNumber);
- singlTotal += Number(item.productUnitPrice);
- moneyTotal += Number(item.productAmounts);
- let productData = this.allProductionOptions.find(
- (pro) => pro.productNo == item.productNo
- );
- // console.log(item.productNo, productData, this.allProductionOptions);
- item.sliceTypeLabel =
- this.sliceTypeOptions.find((k) => k.materielCode == item.sliceType)
- ?.materielName || "";
- item.colourNumberLabel = this.colourNumberOptions.find(
- (k) => k.colour == item.colours
- )?.colour;
- // item.materieEncoding + item.materieColorNumber
- // let materieEncoding = this.colourNumberOptions.find(
- // (k) => k.colour == item.colours
- // )?.materieEncoding;
- let productName = productData ? productData.productName : "";
- let productType = productData ? productData.productType : "";
- let productSpecifications = productData
- ? productData.productSpecifications
- : ""; //规格
- printStr += `<tr align="center">
- <td>${productName}</td>
- <td>${productSpecifications}</td>
- <td>${productType}</td>
- <td>${item.colourNumberLabel}</td>
- <td>${item.level?item.level : ""}</td>
- <td>${item.productNumber}</td>
- <td>${item.productUnitPrice}</td>
- <td>${item.productAmounts}</td>
- <td>${item.sliceTypeLabel}</td>
- <td>${item.remark}</td>
- </tr>`;
- }
- // 计算小计
- printStr += `
- <tr align="center">
- <td>小计:</td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td>${amountTotal.toFixed(2)}</td>
- <td>${singlTotal.toFixed(2)}</td>
- <td>${moneyTotal.toFixed(2)}</td>
- <td></td>
- <td></td>
- </tr>
- <tr>
- <td colspan="10">合计金额(大写):${saleAmountInWords}</td>
- </tr>
- `;
- if (salePayType == "1") {
- //定金
- printStr += `
- <tr>
- <td colspan="5">付款方式:${payType}</td>
- <td colspan="5">定金:${earnestMoney}</td>
- </tr>`;
- } else {
- printStr += `
- <tr>
- <td colspan="10">付款方式:${payType}</td>
- </tr>`;
- }
- printStr += `<tr align="center">
- <td colspan="10">工艺要求</td>
- </tr>
- <tr align="center">
- <td width="150px">网络</td>
- <td width="150px">油剂</td>
- <td width="150px">卷装</td>
- <td width="150px">色牢度</td>
- <td width="150px">捻向</td>
- <td width="150px">其他</td>
- <td width="150px"></td>
- <td width="150px"></td>
- <td width="150px"></td>
- </tr>
- <tr align="center">
- <td >${craftGrid}</td>
- <td>${craftOil}</td>
- <td>${craftPackage}</td>
- <td>${craftColorFastness}</td>
- <td>${directionOfTwistDescription}</td>
- <td>${craftOther}</td>
- <td width="150px"></td>
- <td width="150px"></td>
- <td width="150px"></td>
- <td width="150px"></td>
- </tr>
- <tr>
- <td colspan="10">包装/贴唛:${craftMark}</td>
- </tr>
- <tr>
- <td colspan="10">装运方式:${shippingMethod}</td>
- </tr>
- <tr align="center">
- <td colspan="2">业务员:</td>
- <td colspan="2">${salesman}</td>
- <td colspan="2">财务部:</td>
- <td colspan="4">${finance}</td>
- </tr>
- <tr align="center">
- <td colspan="2">业务主管:</td>
- <td colspan="2">${saleApprover}</td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- </tr>
- </tbody>
- </table>
- `;
- return printStr;
- // <td colspan="2">业务主管:</td>
- // <td colspan="2">${saleLeader}</td>
- // <tr align="center">
- // // <td colspan="2">生产部:</td>
- // // <td colspan="2">${production}</td>
- // </tr>
- // <tr align="center">
- // <td colspan="2"> 2</td>
- // <td> </td>
- // <td> </td>
- // <td> </td>
- // <td> </td>
- // </tr>
- // <tr>
- // <td colspan="2">小计:</td>
- // <td></td>
- // <td></td>
- // <td></td>
- // <td></td>
- // </tr>
- }
- },
- // 自定义删除按钮
- async myDeleteHandler(row) {
- // console.log(row);
- let stateArr = ["2", "3", "4", "5", "6", "8", "9"];
- let isDeleteValidate = this.selection.some((item) => {
- return stateArr.includes(item.status);
- });
- // console.log(this.selection);
- // console.log(isDeleteValidate);
- if (isDeleteValidate) {
- this.$message.error("仅允许删除订单状态为'未提交'或'未通过'的订单");
- return;
- }
- await this.$confirm("是否确认删除选中的数据?", "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- });
- let payLoad = row.saleOrderId ? [row.saleOrderId] : this.myDelIds;
- // console.log(payLoad);
- try {
- let res = await delOrder(payLoad);
- if (res.code === 200) {
- this.$message.success("删除成功");
- this.getList();
- this.myDelIds = [];
- this.$nextTick(() => {
- this.$refs.tableRef?.clearSelection();
- });
- } else {
- this.$message.error(res.msg);
- }
- } catch (error) {}
- },
- // 发货回调
- myDeliverHandler(row) {
- this.currentRow = row;
- this.deliverShow = true;
- this.$nextTick(() => {
- this.$refs.deliverRef.productInvoiceInfo(row);
- });
- },
- // 出库明细回调
- handleOutDetail(row) {
- this.stockTitle = "出库明细";
- this.outStockShow = true;
- this.$nextTick(() => {
- this.$refs.OutStockDetailRef.getOutStockDetail(row, false);
- });
- },
- // 重新登账回调
- handleReAccount(row) {
- this.stockTitle = "重新登账";
- this.outStockShow = true;
- this.$nextTick(() => {
- this.$refs.OutStockDetailRef.getOutStockDetail(row, false, true);
- });
- },
- // 操作列回调
- excuteHandler(btnData, row) {
- let { btnType, btnParams, btnFormType } = btnData;
- this.currentBtnData = btnData;
- this.currentRow = JSON.parse(JSON.stringify(row));
- // console.log("btnData", btnType, btnData, row);
- // 无表单
- if (btnFormType == "noNeed") {
- this.noNeedHandler(btnData, row);
- return;
- }
- switch (btnType) {
- case "INNERLINK":
- this.routerHandler(btnData, btnType);
- break;
- case "OUTLINK":
- this.routerHandler(btnData, btnType);
- break;
- case "UPDATE":
- this.handleUpdate(row, btnData);
- break;
- case "EXECUTE":
- this.handleUpdate(row, btnData);
- break;
- case "INITIATED":
- this.handleUpdate(row, btnData);
- break;
- case "DELETE":
- this.handleDelete(row, btnData);
- break;
- case "myEdit":
- this.handleEdit("1", row);
- break;
- case "OutDetail":
- this.handleOutDetail(row);
- break;
- case "ReAccount": //重新登账
- this.handleReAccount(row);
- break;
- case "myDetail":
- this.handleDetail(row);
- break;
- case "myDelete":
- this.myDeleteHandler(row, btnData);
- break;
- case "myComplate":
- this.myComplateHandler(row, btnData);
- break;
- case "myEror":
- this.myErorHandler(row, btnData);
- break;
- case "printOutBound":
- this.myPrintOutBoundHandler(row, btnData);
- break;
- case "deliver": //发货
- this.myDeliverHandler(row, btnData);
- break;
- case "recordBatch": //记录批次
- this.myRecordBatchHandler(row, btnData);
- break;
- default:
- break;
- }
- },
- // 记录批次回调
- async myRecordBatchHandler(row, btnData) {
- this.$confirm("请确认是否记录批次?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(async () => {
- let result = await printOutsourceOrder({saleNo: row.saleNo});
- if (result.code == 200) {
- res.data.form.printUser = this.nickName;
- outBoundPrint(res.data, "printDom", false);
- } else {
- throw new Error(result.msg);
- }
- }).catch(() => this.$message({type: "info", message: "已取消完成",}));
- },
- // 完成回调
- async myComplateHandler(row) {
- this.$confirm("即将确认完成, 是否继续?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(async () => {
- // 调用完成按钮
- let payload = {id: row.id, status: 6, saleNo: row.saleNo, completionTime: new Date(),};
- let res = await updateOrder(payload);
- if (res.code == 200) {
- this.$message({type: "success", message: "订单已完成",});
- this.getList();
- } else this.$message({type: "error", message: "订单已完成失败,请稍后再试",});
- }).catch(() => this.$message({type: "info", message: "已取消完成",}));
- },
- //异常结束
- myErorHandler(row) {
- this.$confirm("即将确认异常结束, 是否继续?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(async () => {
- // 调用完成按钮
- let payload = {id: row.id, status: 12, saleNo: row.saleNo, completionTime: new Date(),};
- let res = await updateOrder(payload);
- if (res.code == 200) {
- this.$message({type: "success", message: "订单已异常结束",});
- this.getList();
- } else this.$message({type: "error", message: "订单异常结束失败,请稍后再试",});
- }).catch(() => this.$message({type: "info", message: "已取消异常结束",}));
- },
- noNeedHandler(btnData, row) {
- this.$modal
- .confirm("是否确认执行该操作?")
- .then(async () => {
- // 获取默认参数
- let data = {
- basicMap: {
- tableName: this.tableName,
- // btnKey: btnData.btnKey,
- btnKey: this.currentBtnData.btnKey,
- },
- conditionMap: {},
- commMap: {},
- btnParametersMap: {},
- };
- // console.log(this.currentBtnData, this.currentRow);
- if (this.currentBtnData.btnParams) {
- let conditionData =
- JSON.parse(this.currentBtnData.btnParams).conditionData || [];
- // let
- let commonData =
- JSON.parse(this.currentBtnData.btnParams).commonFieldData || [];
- conditionData.forEach((item) => {
- data.conditionMap[item.fieldName.split(".")[1]] = item.fieldValue
- ? item.fieldValue
- : this.currentRow[camelCase(item.fieldName.replace(".", "_"))];
- });
- commonData.forEach((item) => {
- data.btnParametersMap[item.fieldName.split(".")[1]] =
- item.fieldValue
- ? item.fieldValue
- : this.currentRow[
- camelCase(item.fieldName.replace(".", "_"))
- ];
- });
- }
- data.basicMap.btnType = this.currentBtnData.btnType;
- data.basicMap.visible = true;
- try {
- let res = await btnCommonApi(data);
- if (res.code == 200) {
- this.$message.success(res.msg);
- } else {
- this.$message.error("网络异常,请稍后再试");
- }
- } catch (error) {
- // console.log(error);
- this.$message.error("网络异常,请稍后再试");
- }
- })
- .then(() => {
- // 调用子组件查询方法 目的是携带上子组件中的查询参数
- this.$refs.mychild.pageList();
- // this.$modal.msgSuccess("操作成功");
- })
- .catch(() => {});
- },
- // k-form-build表单变化回调
- formChangeHandler(value, label) {
- // console.log(value, label);
- },
- },
- };
- </script>
- <style scoped lang="scss">
- ::v-deep .el-dialog:not(.is-fullscreen) {
- min-width: 610px !important;
- }
- </style>
|