1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403 |
- <template>
- <div class="app-container">
- <!-- 配方模板表 -->
- <div ref="template" class="template">
- <div class="recipeTemplate">
- <p>日执行计划</p>
- </div>
- <div class="search">
- <el-date-picker v-model="table.getdataListParm.parammaps.mydate" type="date" placeholder="选择日期" style="width: 150px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :clearable="false" @change="changeDate" />
- <el-button class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore" />
- <el-button class="el-icon-arrow-right elIconArrowRight" @click="handleNext" />
- <el-select v-model="table.getdataListParm.parammaps.lpplantype" filterable placeholder="计划类型" class="filter-item" clearable style="width: 120px;" @change="changePlanType">
- <el-option v-for="item in planTypeList" :key="item.value" :label="item.lable" :value="item.value" />
- </el-select>
- <el-select v-model="table.getdataListParm.parammaps.times" filterable placeholder="班次" class="filter-item" style="width: 120px;" clearable @change="changeFrequency">
- <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <el-select v-model="table.getdataListParm.parammaps.printType" filterable placeholder="打印类型" class="filter-item" :clearable="false" style="width: 120px;">
- <el-option v-for="item in printingTypeList" :key="item.value" :label="item.lable" :value="item.value" />
- </el-select>
- <el-select v-model="table.getdataListParm.parammaps.plandimen" filterable placeholder="计划维度" class="filter-item" style="width: 120px;" :clearable="false">
- <el-option v-for="item in planningDimensionList" :key="item.value" :label="item.lable" :value="item.value" />
- </el-select>
- <el-select v-model="table.getdataListParm.parammaps.enable3" filterable placeholder="导出类型" class="filter-item" style="width: 120px;" :clearable="false">
- <el-option v-for="item in exportTypeList" :key="item.value" :label="item.lable" :value="item.value" />
- </el-select>
- <el-select v-model="table.getdataListParm.parammaps.tmrname" filterable placeholder="TMR名称" class="filter-item" style="width: 120px;" :clearable="false">
- <el-option v-for="item in tmrDownList" :key="item.tmrname" :label="item.tmrname" :value="item.tmrtname" />
- </el-select>
- <el-select v-model="table.getdataListParm.parammaps.iscompleted" filterable placeholder="执行状态" class="filter-item" style="width: 120px;" :clearable="false">
- <el-option v-for="item in iscompletedList" :key="item.value" :label="item.lable" :value="item.value" />
- </el-select>
- <el-button class="successBorder" @click="form_search">查询</el-button>
- <el-button class="export" icon="el-icon-upload2" @click="handleExport">导出</el-button>
- <el-button class="export" icon="el-icon-upload2" @click="handlePrint">打印</el-button>
- <el-button class="export" style="margin-left: -5px;" @click="form_deleteRecord">删除记录</el-button>
- </div>
- <div class="operation" style="margin-bottom: 10px;">
- <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="handleCreate">新生成</el-button>
- <el-button v-if="isRoleEdit" class="success" icon="el-icon-edit-outline" @click="handleRevisePlan">修改计划</el-button>
- <el-button v-if="isRoleEdit" class="copy" icon="el-icon-copy-document" @click="handleCopy">复制计划</el-button>
- <el-button v-if="isOrder && isRoleEdit" icon="el-icon-sort" class="success" @click="handleChangeOrder">更改顺序</el-button>
- <div v-else style="margin-left: 10px;display: inline-block;">
- <el-button v-if="isRoleEdit" icon="el-icon-folder-checked" class="success" @click="saveChangeOrder">保存</el-button>
- <el-button v-if="isRoleEdit" icon="el-icon-close" class="sortCancel" @click="cancelChangeOrder">取消</el-button>
- </div>
- <el-button v-if="isRoleEdit" class="success" icon="el-icon-open" @click="handleTakeEffect">生效</el-button>
- <el-button v-if="isRoleEdit" class="danger" icon="el-icon-turn-off" @click="handleDisable">禁用</el-button>
- <el-button v-if="dataSynchronization2.isDataSynchronization" class="success" icon="el-icon-plus" @click="form_updata">上传计划</el-button>
- <el-button v-if="dataSynchronization.isDataSynchronization && isRoleEdit" class="success" @click="handleDataSynchronization">数据同步</el-button>
- <el-button v-if="dataSynchronization3.isDataSynchronization&&isRoleEdit" class="success" @click="handleDataUpload">数据上传</el-button>
- <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" @click="handleDelete">删除</el-button>
- <el-button v-if="isRoleEdit && sapUpload.isSap" class="success" icon="el-icon-upload2" @click="handleSAPUpload">SAP上传</el-button>
- <el-button v-if="isRoleEdit && ispalyUd" class="success" icon="el-icon-plus" @click="handleGetUd1">搅拌数据上传</el-button>
- <el-button v-if="isRoleEdit && ispalyUd" class="success" icon="el-icon-plus" @click="handleGetUd2">剩料上传</el-button>
- <el-button v-if="isRoleEdit && ispalyUd" class="success" icon="el-icon-plus" @click="handleGetUd3">撒料上传</el-button>
- <!-- <el-button v-if="isRoleEdit" class="success" icon="el-icon-circle-check" @click="handleQuickcompletion">快速完成</el-button> -->
- </div>
- <!-- 日执行计划 -->
- <div class="table">
- <el-table
- id="table1"
- ref="parent"
- :key="table.tableKey"
- v-loading="table.listLoading"
- element-loading-text="给我一点时间"
- :data="table.list"
- border
- fit
- highlight-current-row
- style="width: 98%;"
- row-key="sort"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- :row-class-name="tableRowClassName"
- :height="myheight"
- @row-click="tableRowClick"
- @selection-change="handleSelect"
- >
- <el-table-column type="selection" min-width="50" />
- <el-table-column label="序号" align="center" prop="sort" width="50px" />
- <el-table-column label="计划名称" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.projname }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计划类型" prop="weight" min-width="90px" align="center" :formatter="lpplantype" />
- <el-table-column label="TMR编号" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.tmrtname }}</span>
- </template>
- </el-table-column>
- <el-table-column label="驾驶员" min-width="150px" align="center">
- <template slot-scope="scope">
- <!-- <span>{{ scope.row.driver }}</span> -->
- <el-select v-model="scope.row.driverId" :disabled="scope.row.havebutton == 1" filterable placeholder="驾驶员" class="filter-item" style="width:95%;padding:10px 0;" :clearable="false" @change="(value)=> {changeDriver(value, scope.row)}">
- <el-option v-for="item in driverList" :key="item.id" :label="item.drivername" :value="item.id" />
- </el-select>
- </template>
- </el-table-column>
- <el-table-column label="已执行" min-width="70px" align="center">
- <template slot-scope="scope">
- <div v-if="scope.row.havebutton == 0" style="background: #009A69;color:#fff;line-height:30px;">否</div>
- <div v-else style="background: #FC2323;color:#000 ;line-height:30px;">是</div>
- </template>
- </el-table-column>
- <el-table-column label="班次" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.times }}</span>
- </template>
- </el-table-column>
- <el-table-column label="理论量" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.lweight }}</span>
- </template>
- </el-table-column>
- <el-table-column label="启用" min-width="70px" align="center">
- <template slot-scope="scope">
- <el-switch v-if="dataDisabled == false" v-model="scope.row.enable" :disabled="scope.row.havebutton == 1" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.row)" />
- <el-switch v-else v-model="scope.row.enable" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.row)" />
- </template>
- </el-table-column>
- <el-table-column label="时间" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.plantime }}</span>
- </template>
- </el-table-column>
- <el-table-column label="配方名称" min-width="100px" align="center">
- <template slot-scope="scope">
- <b style="font-size: 26px;line-height: 30px;">{{ scope.row.ftname }}</b>
- </template>
- </el-table-column>
- <el-table-column label="头数" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.cowcount }}</span>
- </template>
- </el-table-column>
- <el-table-column label="描述" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.display }}</span>
- </template>
- </el-table-column>
- <el-table-column label="发料位" min-width="80px" align="left">
- <template slot-scope="scope">
- <span>{{ scope.row.barnames }}</span>
- </template>
- </el-table-column>
- <el-table-column align="center" width="100" label="操作" class-name="small-padding fixed-width" fixed="right">
- <template slot-scope="{row}">
- <el-button class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
- <el-button class="miniDanger" icon="el-icon-sort" @click="handleRowSort(row)" />
- </template>
- </el-table-column>
- </el-table>
- <span v-if="table.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ table.total }}条</span>
- </div>
- </div>
- <!-- maxHeight="enlargeHeight -->
- <div v-if="isDetail" style="position: relative;">
- <el-button class="hide" @click="handleCloseTable2" style="position: absolute;right: 0;top: -20px;">隐藏</el-button>
- <!-- 预混料 -->
- <div v-if="table3.getdataListParm.parammaps.lpplantype == 4" class="content">
- <el-row :gutter="20">
- <el-col :span="12">
- <div class="table2">
- <div class="contentOperation">
- <p>计划详情</p>
- </div>
- <div class="content-table">
- <el-table
- :key="table2.tableKey"
- v-loading="table2.listLoading"
- element-loading-text="给我一点时间"
- :data="table2.list"
- fit
- border
- highlight-current-row
- style="width: 100%;"
- height="450"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- :span-method="objectSpanMethod"
- >
- <el-table-column label="操作序号" width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sort }}</span>
- </template>
- </el-table-column>
- <el-table-column label="饲料名称" prop="fname" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.fname }}</span>
- </template>
- </el-table-column>
- <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.NoEdit">{{ scope.row.weight }}</span>
- <el-input v-if="scope.row.Edit" v-model="scope.row.weight" type="number" maxlength="32" style="width:95%;padding:10px 0;" />
- </template>
- </el-table-column>
- <el-table-column label="小计" prop="description" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.subtotal }}</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="left" min-width="200" class-name="small-padding">
- <template slot-scope="{row}">
- <el-button v-if="row.isUpdate && isRoleEdit" :disabled="table2.getdataListParm.parammaps.havebutton == 1" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate2(row)" />
- <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
- <el-button v-if="row.isUpdateSave" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData2(row,'0')" />
- <span v-if="row.isUpdateSave" class="centerSpan">|</span>
- <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel2(row)" />
- <!-- <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
- <el-button v-if="row.isUpdate && isRoleEdit" class="miniSuccess" @click="handleRowEmpty(row,0)">
- <svg-icon icon-class="clear" />
- </el-button> -->
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- </el-col>
- </el-row>
- </div>
- <!-- 撒料 -->
- <div v-if="table3.getdataListParm.parammaps.lpplantype == 0" class="content">
- <el-row :gutter="20">
- <el-col :span="12">
- <div class="table2">
- <div class="contentOperation">
- <p>计划详情</p>
- </div>
- <div class="content-table">
- <el-table
- :key="table2.tableKey"
- v-loading="table2.listLoading"
- element-loading-text="给我一点时间"
- :data="table2.list"
- fit
- border
- highlight-current-row
- style="width: 100%;"
- height="450"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- :span-method="objectSpanMethod"
- >
- <el-table-column label="操作序号" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sort }}</span>
- </template>
- </el-table-column>
- <el-table-column label="饲料名称" prop="fname" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.fname }}</span>
- </template>
- </el-table-column>
- <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.NoEdit">{{ scope.row.weight }}</span>
- <el-input v-if="scope.row.Edit" v-model="scope.row.weight" type="number" maxlength="32" style="width:95%;padding:10px 0;" />
- </template>
- </el-table-column>
- <el-table-column label="小计" prop="description" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.subtotal }}</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="left" min-width="200" class-name="small-padding">
- <template slot-scope="{row}">
- <el-button v-if="row.isUpdate && isRoleEdit" :disabled="table2.getdataListParm.parammaps.havebutton == 1" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate2(row)" />
- <el-button v-if="row.isUpdateSave" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData2(row,'0')" />
- <span v-if="row.isUpdateSave" class="centerSpan">|</span>
- <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel2(row)" />
- <!-- <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
- <el-button v-if="row.isUpdate && isRoleEdit" class="miniSuccess" @click="handleRowEmpty(row,0)">
- <svg-icon icon-class="clear" />
- </el-button> -->
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="table3">
- <div class="contentOperation">
- <p>栏舍详情</p>
- </div>
- <div class="content-table">
- <el-table
- :key="table3.tableKey"
- v-loading="table3.listLoading"
- element-loading-text="给我一点时间"
- :data="table3.list"
- height="450"
- fit
- border
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- >
- <el-table-column label=" 操作序号" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sort }}</span>
- </template>
- </el-table-column>
- <!-- <el-table-column label="栏舍编码" min-width="60px" align="center" prop="bcode" /> -->
- <el-table-column label="栏舍名称" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.fname }}</span>
- </template>
- </el-table-column>
- <el-table-column label="栏舍长度" min-width="60px" align="center" prop="length" />
- <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.NoEdit">{{ scope.row.weight }}</span>
- <el-input v-if="scope.row.Edit" v-model="scope.row.weight" type="number" maxlength="32" style="width:95%;padding:10px 0;" />
- </template>
- </el-table-column>
- <!-- <el-table-column label="数量" min-width="60px" align="center" prop="ccount" /> -->
- <el-table-column label="使用档位" min-width="60px" align="center" prop="gear" />
- <el-table-column label="车行速度" min-width="60px" align="center" prop="speed" />
- <el-table-column label="操作" align="left" min-width="200" class-name="small-padding">
- <template slot-scope="{row}">
- <el-button v-if="row.isUpdate && isRoleEdit" :disabled="table3.getdataListParm.parammaps.havebutton == 1" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate3(row)" />
- <el-button v-if="row.isUpdateSave" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData3(row,'1')" />
- <span v-if="row.isUpdateSave" class="centerSpan">|</span>
- <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel3(row)" />
- <!-- <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
- <e<el-button v-if="row.isUpdate && isRoleEdit" class="miniSuccess" @click="handleRowEmpty(row,1)">
- <svg-icon icon-class="clear" />
- </el-button> -->
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- </el-col>
- </el-row>
- </div>
- <!-- 剩料 -->
- <div v-if="table3.getdataListParm.parammaps.lpplantype == 3" class="content">
- <el-row :gutter="20">
- <el-col :span="12"><div class="table2">
- <div class="contentOperation">
- <p>计划详情</p>
- </div>
- <div class="content-table">
- <el-table
- :key="table2.tableKey"
- v-loading="table2.listLoading"
- element-loading-text="给我一点时间"
- :data="table2.list"
- fit
- border
- highlight-current-row
- style="width: 100%;"
- height="450"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- :span-method="objectSpanMethod"
- >
- <el-table-column label="操作序号" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sort }}</span>
- </template>
- </el-table-column>
- <el-table-column label="取料栏舍" prop="fname" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.fname }}</span>
- </template>
- </el-table-column>
- <el-table-column label="处理方式" prop="useinbar" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.useinbar }}</span>
- </template>
- </el-table-column>
- <el-table-column label="小计" prop="description" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.subtotal }}</span>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="table3">
- <div class="contentOperation">
- <p>栏舍详情</p>
- </div>
- <div class="content-table">
- <el-table
- :key="table3.tableKey"
- v-loading="table3.listLoading"
- element-loading-text="给我一点时间"
- :data="table3.list"
- height="450"
- fit
- border
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- >
- <el-table-column label="操作序号" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sort }}</span>
- </template>
- </el-table-column>
- <el-table-column label="转投栏舍" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.fname }}</span>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- </el-col>
- </el-row>
- </div>
- <!-- 撒料计划-混料 -->
- <div v-if="table3.getdataListParm.parammaps.lpplantype == 1 || table3.getdataListParm.parammaps.lpplantype == 5" class="content">
- <el-row :gutter="20">
- <el-col :span="12">
- <div class="table2">
- <div class="contentOperation">
- <p>计划详情</p>
- </div>
- <div class="content-table">
- <el-table
- :key="table2.tableKey"
- v-loading="table2.listLoading"
- element-loading-text="给我一点时间"
- :data="table2.list"
- fit
- border
- highlight-current-row
- style="width: 100%;"
- height="450"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- :span-method="objectSpanMethod"
- >
- <el-table-column label="操作序号" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sort }}</span>
- </template>
- </el-table-column>
- <el-table-column label="饲料名称" prop="fname" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.fname }}</span>
- </template>
- </el-table-column>
- <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.NoEdit">{{ scope.row.weight }}</span>
- <el-input v-if="scope.row.Edit" v-model="scope.row.weight" type="number" maxlength="32" style="width:95%;padding:10px 0;" />
- </template>
- </el-table-column>
- <el-table-column label="小计" prop="description" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.subtotal }}</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="left" min-width="200" class-name="small-padding">
- <template slot-scope="{row}">
- <el-button v-if="row.isUpdate && isRoleEdit" :disabled="table2.getdataListParm.parammaps.havebutton == 1" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate2(row)" />
- <el-button v-if="row.isUpdateSave" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData2(row,'0')" />
- <span v-if="row.isUpdateSave" class="centerSpan">|</span>
- <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel2(row)" />
- <!-- <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
- <el-button v-if="row.isUpdate && isRoleEdit" class="miniSuccess" @click="handleRowEmpty(row,0)">
- <svg-icon icon-class="clear" />
- </el-button> -->
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="table3">
- <div class="contentOperation">
- <p>栏舍详情</p>
- </div>
- <div class="content-table">
- <el-table
- :key="table3.tableKey"
- v-loading="table3.listLoading"
- element-loading-text="给我一点时间"
- :data="table3.list"
- height="450"
- fit
- border
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- >
- <el-table-column label=" 操作序号" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sort }}</span>
- </template>
- </el-table-column>
- <el-table-column label="撒料车辆" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.fname }}</span>
- </template>
- </el-table-column>
- <el-table-column label="设计重量(KG)" min-width="130px" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.NoEdit">{{ scope.row.weight }}</span>
- <el-input v-if="scope.row.Edit" v-model="scope.row.weight" type="number" maxlength="32" style="width:95%;padding:10px 0;" />
- </template>
- </el-table-column>
- <el-table-column label="操作" align="left" min-width="200" class-name="small-padding">
- <template slot-scope="{row}">
- <el-button v-if="row.isUpdate && isRoleEdit" :disabled="table3.getdataListParm.parammaps.havebutton == 1" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate3(row)" />
- <el-button v-if="row.isUpdateSave" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData3(row,'1')" />
- <span v-if="row.isUpdateSave" class="centerSpan">|</span>
- <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel3(row)" />
- <!-- <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
- <el-button v-if="row.isUpdate && isRoleEdit" class="miniSuccess" @click="handleRowEmpty(row,1)">
- <svg-icon icon-class="clear" />
- </el-button> -->
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- </el-col>
- </el-row>
- </div>
- <!-- 撒料计划-撒料 -->
- <div v-if="table3.getdataListParm.parammaps.lpplantype == 2" class="content">
- <el-row :gutter="20">
- <el-col :span="12">
- <div class="table3">
- <div class="contentOperation">
- <p>栏舍详情</p>
- </div>
- <div class="content-table">
- <el-table
- :key="table3.tableKey"
- v-loading="table3.listLoading"
- element-loading-text="给我一点时间"
- :data="table3.list"
- height="450"
- fit
- border
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- >
- <el-table-column label="操作序号" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sort }}</span>
- </template>
- </el-table-column>
- <el-table-column label="撒料车辆" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.fname }}</span>
- </template>
- </el-table-column>
- <el-table-column label="设计重量(KG)" min-width="130px" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.NoEdit">{{ scope.row.weight }}</span>
- <el-input v-if="scope.row.Edit" v-model="scope.row.weight" type="number" maxlength="32" style="width:95%;padding:10px 0;" />
- </template>
- </el-table-column>
- <el-table-column label="小计" prop="description" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.subtotal }}</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="left" min-width="200" class-name="small-padding">
- <template slot-scope="{row}">
- <el-button v-if="row.isUpdate && isRoleEdit" :disabled="table3.getdataListParm.parammaps.havebutton == 1" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate3(row)" />
- <el-button v-if="row.isUpdateSave" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData3(row,'0')" />
- <span v-if="row.isUpdateSave" class="centerSpan">|</span>
- <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel3(row)" />
- <!-- <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
- <el-button v-if="row.isUpdate && isRoleEdit" class="miniSuccess" @click="handleRowEmpty(row,0)">
- <svg-icon icon-class="clear" />
- </el-button> -->
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="table2">
- <div class="contentOperation">
- <p>计划详情</p>
- </div>
- <div class="content-table">
- <el-table
- :key="table2.tableKey"
- v-loading="table2.listLoading"
- element-loading-text="给我一点时间"
- :data="table2.list"
- fit
- border
- highlight-current-row
- style="width: 100%;"
- height="450"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- >
- <el-table-column label="操作序号" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sort }}</span>
- </template>
- </el-table-column>
- <!-- <el-table-column label="栏舍编码" min-width="60px" align="center" prop="bcode" /> -->
- <el-table-column label="栏舍名称" prop="fname" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.fname }}</span>
- </template>
- </el-table-column>
- <el-table-column label="栏舍长度" min-width="60px" align="center" prop="length" />
- <el-table-column label="设计重量(KG)" prop="weight" width="130px" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.NoEdit">{{ scope.row.weight }}</span>
- <el-input v-if="scope.row.Edit" v-model="scope.row.weight" type="number" maxlength="32" style="width:95%;padding:10px 0;" />
- </template>
- </el-table-column>
- <!-- <el-table-column label="数量" min-width="60px" align="center" prop="ccount" /> -->
- <el-table-column label="使用档位" min-width="60px" align="center" prop="gear" />
- <el-table-column label="车行速度" min-width="60px" align="center" prop="speed" />
- <el-table-column label="操作" align="left" min-width="200" class-name="small-padding">
- <template slot-scope="{row}">
- <el-button v-if="row.isUpdate && isRoleEdit" :disabled="table2.getdataListParm.parammaps.havebutton == 1" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate2(row)" />
- <el-button v-if="row.isUpdateSave" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData2(row,'1')" />
- <span v-if="row.isUpdateSave" class="centerSpan">|</span>
- <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel2(row)" />
- <!-- <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
- <el-button v-if="row.isUpdate && isRoleEdit" class="miniSuccess" @click="handleRowEmpty(row,1)">
- <svg-icon icon-class="clear" />
- </el-button> -->
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- </el-col>
- </el-row>
- </div>
- </div>
- <!-- 新生成 -->
- <el-dialog :title="textMap[newGeneration.dialogStatus]" :destroy-on-close="true" :visible.sync="newGeneration.dialogFormVisible" :close-on-click-modal="false" width="30%">
- <div class="newGeneration" v-loading="newGenerationLoading" >
- <el-form ref="temp" :rules="newGeneration.rules" :model="newGeneration.temp" label-position="right" label-width="100px" style="width: 100%;margin:0 auto 50px">
- <el-row v-if="newGeneration.dialogStatus== 'newGeneration'">
- <el-col :span="24">
- <el-form-item label="时间范围:" prop="inputDatetime">
- <el-date-picker v-model="newGeneration.temp.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 100%;" :clearable="false" :picker-options="pickerOptions2" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row v-else>
- <el-col :span="24">
- <el-form-item label="时间范围:" prop="copyInputDatetime">
- <el-date-picker v-model="newGeneration.temp.copyInputDatetime" :picker-options="pickerOptions" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 100%;" :clearable="false" />
- </el-form-item>
- </el-col>
- </el-row>
- <p v-if="newGeneration.temp.tips == true || newGeneration.dialogStatus == 'copy'" style="font-weight: 700;color: red;text-align: center;">注:撒料计划中存在未分配完栏舍,如下所示;建议及时进行分配</p>
- <div style="height: 200px;overflow: auto;">
- <div v-if="myMaxTimes == 1">
- <div>第一班:</div>
- <div v-for="(item,index) in tipsList.one" :key="index+'A'" >
- <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
- <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
- <span v-for="(item2,index2) in item.arrList" :key="index2+'a'">
- {{item2.barname}}
- </span>
- </span>
- </div>
- </div>
- <div v-else-if="myMaxTimes == 2">
- <div>第一班:</div>
- <div v-for="(item,index) in tipsList.one" :key="index+'B'" >
- <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
- <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
- <span v-for="(item2,index2) in item.arrList" :key="index2+'b'">
- {{item2.barname}}
- </span>
- </span>
- </div>
- <div>第二班:</div>
- <div v-for="(item,index) in tipsList.two" :key="index+'C'" >
- <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
- <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
- <span v-for="(item2,index2) in item.arrList" :key="index2+'c'">
- {{item2.barname}}
- </span>
- </span>
- </div>
- </div>
- <div v-else-if="myMaxTimes == 3">
- <div>第一班:</div>
- <div v-for="(item,index) in tipsList.one" :key="index+'D'" >
- <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
- <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
- <span v-for="(item2,index2) in item.arrList" :key="index2+'d'">
- {{item2.barname}}
- </span>
- </span>
- </div>
- <div>第二班:</div>
- <div v-for="(item,index) in tipsList.two" :key="index+'E'" >
- <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
- <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
- <span v-for="(item2,index2) in item.arrList" :key="index2+'e'">
- {{item2.barname}}
- </span>
- </span>
- </div>
- <div>第三班:</div>
- <div v-for="(item,index) in tipsList.three" :key="index+'F'" >
- <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
- <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
- <span v-for="(item2,index2) in item.arrList" :key="index2+'f'">
- {{item2.barname}}
- </span>
- </span>
- </div>
- </div>
- <div v-else>
- <div>第一班:</div>
- <div v-for="(item,index) in tipsList.one" :key="index+'G'" >
- <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
- <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
- <span v-for="(item2,index2) in item.arrList" :key="index2+'g'">
- {{item2.barname}}
- </span>
- </span>
- </div>
- <div>第二班:</div>
- <div v-for="(item,index) in tipsList.two" :key="index+'H'" >
- <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
- <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
- <span v-for="(item2,index2) in item.arrList" :key="index2+'h'">
- {{item2.barname}}
- </span>
- </span>
- </div>
- <div>第三班:</div>
- <div v-for="(item,index) in tipsList.three" :key="index+'I'" >
- <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
- <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
- <span v-for="(item2,index2) in item.arrList" :key="index2+'i'">
- {{item2.barname}}
- </span>
- </span>
- </div>
- <div>第四班:</div>
- <div v-for="(item,index) in tipsList.four" :key="index+'J'" >
- <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
- <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
- <span v-for="(item2,index2) in item.arrList" :key="index2+'j'">
- {{item2.barname}}
- </span>
- </span>
- </div>
- </div>
- </div>
- </el-form>
- <div slot="footer" class="dialog-footer" style="bottom:20px">
- <el-button class="cancelClose" @click="newGeneration.dialogFormVisible = false;getList()">取消</el-button>
- <el-button v-if="newGeneration.dialogStatus== 'newGeneration'" class="save" :disabled="isokDisable" @click="newGenerationData()">确认</el-button>
- <el-button v-else class="save" :disabled="isokDisable" @click="copyData()">确认</el-button>
- </div>
- </div>
- </el-dialog>
- <!-- 历史记录 -->
- <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="historyRecord.dialogFormVisible" :close-on-click-modal="false" width="90%">
- <template slot="title">
- <div class="avue-crud__dialog__header">
- <span class="el-dialog__title">
- <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
- {{ textMap[historyRecord.dialogStatus] }}
- </span>
- <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
- <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
- <svg-icon v-else icon-class="fullscreen" />
- </div>
- </div>
- </template>
- <div class="historyRecord">
- <keep-alive>
- <component :is="historyRecord.myComponent" ref="historyRecord" />
- </keep-alive>
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button class="cancelClose cancelClose1" @click="historyRecord.dialogFormVisible = false; ">关闭</el-button>
- </div>
- </el-dialog>
- <!-- 正在同步中 -->
- <el-dialog :destroy-on-close="true" :visible.sync="dataSynchronization.dialogFormVisible" :close-on-click-modal="false" width="30%">
- <div class="dataSynchronization" style="text-align: center;font-size: 18px;">
- <i class="el-icon-loading" />
- <span>正在同步</span>
- <div slot="footer" class="dialog-footer" style="bottom:10px">
- <el-button class="miniPrimary" @click="dataSynchronization.dialogFormVisible = false;">确认</el-button>
- </div>
- </div>
- </el-dialog>
- <!-- 修改计划 -->
- <RevisePlan :show.sync="isShowDialog" :parent-active-name="activeName" :parent-date="parentDate" />
- <!-- 删除记录 -->
- <el-dialog :title="textMap[deleteRecord.dialogStatus]" :destroy-on-close="true" :visible.sync="deleteRecord.dialogFormVisible" :close-on-click-modal="false" width="90%">
- <div class="deleteRecord">
- <div class="search">
- <el-date-picker v-model="deleteRecord.mydate" type="date" placeholder="选择日期" style="width: 150px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :clearable="false" @change="changeDeleteRecordDate" />
- </div>
- <div class="table">
- <el-table
- :key="deleteRecord.tableKey"
- v-loading="deleteRecord.listLoading"
- element-loading-text="给我一点时间"
- :data="deleteRecord.list"
- border
- fit
- highlight-current-row
- style="width: 98%;"
- row-key="sort"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- :height="370"
- >
- <el-table-column label="序号" align="center" prop="sort" width="50px" />
- <el-table-column label="计划名称" min-width="90px" align="center" prop="projname" />
- <el-table-column label="计划类型" prop="weight" min-width="90px" align="center" :formatter="lpplantype" />
- <el-table-column label="TMR编号" min-width="90px" align="center" prop="tmrtname" />
- <el-table-column label="驾驶员" min-width="90px" align="center" prop="driver" />
- <el-table-column label="已执行" min-width="70px" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.havebutton == 0">否</span>
- <span v-else>是</span>
- </template>
- </el-table-column>
- <el-table-column label="班次" min-width="80px" align="center" prop="times" />
- <el-table-column label="理论量" min-width="80px" align="center" prop="lweight" />
- <el-table-column label="启用" min-width="70px" align="center">
- <template slot-scope="scope">
- <el-switch v-if="dataDisabled == false" disabled v-model="scope.row.enable" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.row)" />
- <el-switch v-else v-model="scope.row.enable" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.row)" />
- </template>
- </el-table-column>
- <el-table-column label="时间" min-width="80px" align="center" prop="plantime" />
- <el-table-column label="配方名称" min-width="100px" align="center" prop="ftname" />
- <el-table-column label="头数" min-width="80px" align="center" prop="cowcount" />
- <el-table-column label="描述" min-width="80px" align="center" prop="display" />
- <el-table-column label="发料位" min-width="80px" align="left" prop="barnames" />
- </el-table>
- <span v-if="deleteRecord.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ deleteRecord.total }}条</span>
- </div>
- <div slot="footer" class="dialog-footer" style="bottom:20px">
- <el-button class="cancelClose1" @click="deleteRecord.dialogFormVisible = false;getList()">取消</el-button>
- </div>
- </div>
- </el-dialog>
- <el-dialog :title="textMap[sapUpload.dialogStatus]" :destroy-on-close="true" :visible.sync="sapUpload.dialogFormVisible" :close-on-click-modal="false" width="30%">
- <div class="sapUpload">
- <el-form ref="sapUpload" :rules="sapUpload.rules" :model="sapUpload.temp" label-position="right" label-width="100px" style="width: 100%;margin:0 auto 50px">
- <el-row>
- <el-col :span="24">
- <el-form-item label="时间:" prop="date">
- <el-date-picker v-model="sapUpload.temp.date" :clearable="false" class="filter-item" type="date" />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div slot="footer" class="dialog-footer" style="bottom:20px">
- <el-button class="cancelClose" @click="sapUpload.dialogFormVisible = false;getList()">取消</el-button>
- <el-button class="save" v-if="sapUpload.dialogStatus == 'sapUpload'" :disabled="isokDisable" @click="sapUploadData()">确认</el-button>
- <el-button class="save" v-else-if="sapUpload.dialogStatus == 'udload1'" :disabled="isokDisable" @click="udData1()">确认</el-button>
- <el-button class="save" v-else-if="sapUpload.dialogStatus == 'udload2'" :disabled="isokDisable" @click="udData2()">确认</el-button>
- <el-button class="save" v-else-if="sapUpload.dialogStatus == 'udload3'" :disabled="isokDisable" @click="udData3()">确认</el-button>
- </div>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import { GetDataByName, GetDataByNames, ExecDataByConfig, PostDataByName, getDorm, GetReportform, checkButtons,postJson,postJson2,SyncSCJH } from '@/api/common'
- import RevisePlan from './revisePlan.vue'
- import printJS from 'print-js'
- import { parseTime, json2excel,handleTableSpan, handleObjectSpanMethod } from '@/utils/index.js'
- import Cookies from 'js-cookie'
- import Sortable from 'sortablejs'
- import { MessageBox } from 'element-ui'
- export default {
- name: 'DailyExecutionPlan',
- components: {
- RevisePlan
- },
- data() {
- return {
- myheight: document.documentElement.clientHeight - 280,
- // myheight: 500,
- enlargeHeight: document.documentElement.clientHeight - 85 - 165 + 50,
- isDetail:false,
- newGenerationLoading:false,
- dialogFull: false,
- isRoleEdit: [],
- dataDisabled: false,
- requestParams: [
- // { name: 'getDictByName', offset: 0, pagecount: 0, params: ['牲畜父类'] }
- ],
- planTypeList: [{ lable: '预混计划', value: '4' }, { lable: '撒料计划', value: '0' },
- // { lable: '剩料计划', value: '3' },
- { lable: '撒料计划-混料', value: '1' }, { lable: '撒料计划-撒料', value: '2' }, { lable: '预称重计划', value: '5' }], // 计划类型
- printingTypeList: [{ lable: '精料', value: '1' }, { lable: '铲车', value: '2' }], // 打印类型
- frequencyList: [], // 班次
- planningDimensionList: [{ lable: '发料顺序', value: '0' }, { lable: 'TMR', value: '1' }], // 发料顺序
- exportTypeList: [{ lable: '投料简打', value: '0' }, { lable: '累加投料', value: '1' }, { lable: '撒料简打', value: '2' }, { lable: '投撒料简打', value: '3' }, { lable: '投撒料累加', value: '4' }, { lable: '包装简打', value: '5' }, { lable: '实发简打', value: '6' }], // 导出类型
- iscompletedList: [{ lable: '是', value: '1' },{ lable: '否', value: '0' } ],
- // 班次
- maxTime: {
- getMaxTimesParm: {
- name: 'getSysoptEnable',
- page: 1,
- offset: 1,
- pagecount: 1,
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- inforname: 'times'
- }
- }
- },
- isOrder: true,
- table: {
- getdataListParm: {
- name: 'getDownloadedplanList',
- page: 1,
- offset: 1,
- pagecount: '',
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- barid: '',
- mydate: parseTime(new Date(), '{y}-{m}-{d}'),
- times: '',
- lpplantype: '',
- printType: '',
- plandimen: '0',
- enable3: '0',
- iscompleted:"",
- tmrname:"",
- }
- },
- tableKey: 0,
- list: [],
- total: 0,
- listLoading: false
- },
- // 计划内容操作详情
- table2: {
- getdataListParm: {
- name: 'getDownloadplandtl1ListV2',
- page: 1,
- offset: 1,
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- date: '',
- id: ''
- }
- },
- tableKey: 0,
- list: [],
- total: 0,
- listLoading: false
- },
- // 计划内容 舍栏详情
- table3: {
- getdataListParm: {
- name: 'getDownloadplandt2ListV2',
- page: 1,
- offset: 1,
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- date: '',
- id: ''
- }
- },
- tableKey: 0,
- list: [],
- total: 0,
- listLoading: false
- },
- // 新生成
- newGeneration: {
- dialogFormVisible: false,
- dialogStatus: '',
- getdataListParm: {
- name: 'checkLLPIsDistribution',
- page: 1,
- offset: 1,
- pagecount: 1,
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid')
- }
- },
- temp: {
- inputDatetime: [parseTime(new Date(), '{y}-{m}-{d}'), parseTime(new Date(), '{y}-{m}-{d}')],
- tips:''
- },
- rules: {
- inputDatetime: [{ type: 'array', required: true, message: '必填', trigger: 'blur' }],
- copyInputDatetime: [{ type: 'array', required: true, message: '必填', trigger: 'blur' }]
- }
- },
- pickerMinDate: '',
- pickerOptions: {
- onPick: ({ maxDate, minDate }) => {
- this.pickerMinDate = minDate.getTime()
- if (maxDate) {
- this.pickerMinDate = ''
- }
- },
- disabledDate: (time) => {
- if (this.pickerMinDate !== '') {
- const one = 31 * 24 * 3600 * 1000
- const minTime = this.pickerMinDate
- const maxTime = this.pickerMinDate + one
- return time.getTime() < minTime || time.getTime() > maxTime - 8.64e7
- }
- return time.getTime() < Date.now() - 8.64e7
- }
- },
- pickerOptions2: {
- onPick: ({ maxDate, minDate }) => {
- this.pickerMinDate = minDate.getTime()
- if (maxDate) {
- this.pickerMinDate = ''
- }
- },
- disabledDate: (time) => {
- if (this.pickerMinDate !== '') {
- const one = 14 * 24 * 3600 * 1000
- const minTime = this.pickerMinDate
- const maxTime = this.pickerMinDate + one
- return time.getTime() < minTime || time.getTime() > maxTime - 8.64e7
- }
- return time.getTime() < Date.now() - 8.64e7
- }
- },
- historyRecord: {
- dialogFormVisible: false,
- dialogStatus: '',
- myComponent: null
- },
- dataSynchronization: {
- dialogFormVisible: false,
- dialogStatus: '',
- getdataListParm: {
- name: 'getSysoptEnable',
- page: 1,
- offset: 1,
- pagecount: 1,
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- inforname: 'isDataSync'
- }
- },
- isDataSynchronization: false
- },
- dataSynchronization2: {
- dialogFormVisible: false,
- dialogStatus: '',
- getdataListParm: {
- name: 'getSysoptEnable',
- page: 1,
- offset: 1,
- pagecount: 1,
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- inforname: 'zcSync'
- }
- },
- isDataSynchronization: false
- },
- dataSynchronization3: {
- dialogFormVisible: false,
- dialogStatus: '',
- getdataListParm: {
- name: 'getSysoptEnable',
- page: 1,
- offset: 1,
- pagecount: 1,
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- inforname: 'wgSap'
- }
- },
- isDataSynchronization: false
- },
- textMap: {
- newGeneration: '新生成',
- historyRecord: '历史记录',
- revisePlan: '修改计划',
- copy: '复制计划',
- deleteRecord:'删除记录',
- sapUpload:'SAP上传',
- udload1:'搅拌数据上传',
- udload2:'剩料上传',
- udload3:'撒料上传',
- },
- isokDisable: false,
- requestParam: {},
- rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
- cellStyle: { padding: 0 + 'px' },
- isShowDialog: false,
- activeName: '栏舍配方',
- parentDate: '',
- downLoad: {
- getdataListParm: {
- name: '',
- page: 1,
- offset: 1,
- pagecount: '',
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- date: ''
- }
- },
- list: [],
- labelList: []
- },
- tmrDownList:[],
- getTmrListParam: {
- name: 'getDownloadedplanTmrNameUnfinished',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- mydate: parseTime(new Date(), '{y}-{m}-{d}')
- }
- },
- myMaxTimes:'',
- tipsList:[],
- spanObj: {},
- mergekeys: ['sort', 'description'],
- deleteRecord:{
- dialogFormVisible: false,
- dialogStatus: '',
- total:0,
- tableKey:0,
- listLoading:false,
- list:[],
- mydate: parseTime(new Date(), '{y}-{m}-{d}')
- },
- selectList: [],
- driverList:[],
- sapUpload:{
- dialogFormVisible: false,
- dialogStatus: '',
- temp:{
- date: parseTime(new Date(), '{y}-{m}-{d}')
- },
- rules: {
- date: [{ required: true, message: '必填', trigger: 'blur' }],
- },
- getdataListParm: {
- name: 'getSysoptEnable',
- page: 1,
- offset: 1,
- pagecount: 1,
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- inforname: 'xdmysapupload'
- }
- },
- isSap: false,
- },
- ispalyUd: false
- }
- },
- created() {
- this.getIspalyUd()
- this.parentDate = this.table.getdataListParm.parammaps.mydate
- console.log(this.parentDate, 'this.parentDate')
- this.getDataSynchronization()
- this.getDataSynchronization2()
- this.getDataSynchronization3()
- this.getButtons()
- this.getList()
- this.getDownList()
- this.getIsDisplay()
- this.getIsSap()
- this.getTMRList()
- this.getDriverList()
- },
- mounted() {
- this.getTmrListParam.parammaps.mydate = parseTime(new Date(), '{y}-{m}-{d}')
- },
- methods: {
- getDriverList(){
- const url = 'authdata/GetDataByName'
- const data = {
- "name":"getDriverList",
- "page":1,"offset":1,"pagecount":50,
- "returntype":"Map",
- "parammaps":{"pastureid":Cookies.get('pastureid')}
- }
- postJson(url, data).then(response => {
- if(response.data !== null){
- this.driverList = response.data.list
- }else{
- this.driverList = []
- }
- })
- },
- getTMRList(){
- this.getTmrListParam.parammaps.mydate = this.table.getdataListParm.parammaps.mydate
- GetDataByName(this.getTmrListParam).then(response => {
- if (response.data.list !== null) {
- this.tmrDownList = response.data.list
- }
- })
- },
- getButtons() {
- const Edit = 'DailyExecutionPlan'
- const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
- this.isRoleEdit = isRoleEdit
- },
- getDataSynchronization() {
- GetDataByName(this.dataSynchronization.getdataListParm).then(response => {
- // console.log(response.data.list[0])
- if(response.data.list !== null){
- if (response.data.list[0].inforvalue == 0) {
- this.dataSynchronization.isDataSynchronization = false
- } else {
- this.dataSynchronization.isDataSynchronization = true
- }
- }
- })
- },
- getDataSynchronization2() {
- GetDataByName(this.dataSynchronization2.getdataListParm).then(response => {
- if(response.data.list !== null){
- if (response.data.list[0].inforvalue == 0) {
- this.dataSynchronization2.isDataSynchronization = false
- } else {
- this.dataSynchronization2.isDataSynchronization = true
- }
- }
- })
- },
- getDataSynchronization3() {
- GetDataByName(this.dataSynchronization3.getdataListParm).then(response => {
- // console.log(response.data.list[0])
- if (response.data.list[0].inforvalue == 0) {
- this.dataSynchronization3.isDataSynchronization = false
- } else {
- this.dataSynchronization3.isDataSynchronization = true
- }
- })
- },
- form_updata() {
- var send_data = {
- name: 'syncSCJH',
- page: 1,
- offset: 1,
- pagecount: 1,
- returntype: 'Map',
- parammaps: {
- // pastureid: Cookies.get('pastureid'),
- // inforname: 'isDataSync'
- }
- }
- SyncSCJH(send_data).then(response => {
- if (response.msg === 'fail') {
- this.$notify({ title: '上传失败', message: response.data, type: 'warning', duration: 2000 })
- } else {
- this.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
- }
- })
- },
- getIsDisplay() {
- GetDataByName(this.maxTime.getMaxTimesParm).then(response => {
- console.log(response.data.list[0].inforvalue)
- this.myMaxTimes = response.data.list[0].inforvalue
- if (response.data.list[0].inforvalue == 1) {
- this.frequencyList = [{ id: '1', name: '第一班' }]
- } else if (response.data.list[0].inforvalue == 2) {
- this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }]
- } else if (response.data.list[0].inforvalue == 3) {
- this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }]
- } else if (response.data.list[0].inforvalue == 4) {
- this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }, { id: '4', name: '第四班' }]
- } else if (response.data.list[0].inforvalue == 5) {
- this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }, { id: '4', name: '第四班' }, { id: '5', name: '第五班' }]
- } else if (response.data.list[0].inforvalue == 6) {
- this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }, { id: '4', name: '第四班' }, { id: '5', name: '第五班' }, { id: '6', name: '第六班' }]
- }
- })
- },
- getDownList() {
- GetDataByNames(this.requestParams).then(response => {
- // this.livestockTypeList = response.data.getDictByName.list
- })
- },
- // -------------------日执行计划-----------------------------
- handleBefore() {
- if (this.table.getdataListParm.parammaps.mydate !== '' && this.table.getdataListParm.parammaps.mydate !== null) {
- this.table.getdataListParm.parammaps.mydate = new Date(this.table.getdataListParm.parammaps.mydate)
- var start = new Date(this.table.getdataListParm.parammaps.mydate.setDate(this.table.getdataListParm.parammaps.mydate.getDate() - 1))
- // var start = this.table.getdataListParm.parammaps.mydate - 1
- this.table.getdataListParm.parammaps.mydate = parseTime(start, '{y}-{m}-{d}')
- // this.$forceUpdate()
- this.parentDate = this.table.getdataListParm.parammaps.mydate
- this.getTMRList()
- this.getList()
- }
- var d = this.table.getdataListParm.parammaps.mydate
- var curDate = parseTime(new Date(), '{y}-{m}-{d}')
- if (d < curDate) {
- this.dataDisabled = true
- } else {
- this.dataDisabled = false
- }
- console.log(this.dataDisabled)
- },
- handleNext() {
- if (this.table.getdataListParm.parammaps.mydate !== '' && this.table.getdataListParm.parammaps.mydate !== null) {
- this.table.getdataListParm.parammaps.mydate = new Date(this.table.getdataListParm.parammaps.mydate)
- var stop = new Date(this.table.getdataListParm.parammaps.mydate.setDate(this.table.getdataListParm.parammaps.mydate.getDate() + 1))
- this.table.getdataListParm.parammaps.mydate = parseTime(stop, '{y}-{m}-{d}')
- this.parentDate = this.table.getdataListParm.parammaps.mydate
- this.getTMRList()
- this.getList()
- }
- var d = this.table.getdataListParm.parammaps.mydate
- var curDate = parseTime(new Date(), '{y}-{m}-{d}')
- if (d < curDate) {
- this.dataDisabled = true
- } else {
- this.dataDisabled = false
- }
- console.log(this.dataDisabled)
- },
- getList() {
- this.table.listLoading = true
- GetDataByName(this.table.getdataListParm).then(response => {
- console.log('table数据', response.data.list)
- if (response.data.list !== null) {
- // var obj = { 'id': '580999', 'havebutton': '0', 'lpplantype': 2, 'pid': '3283220207862547456', 'times': '第二班', 'projname': '2.666' }
- // response.data.list[6] = obj
- this.getIsColor(response.data.list)
- this.table.list = response.data.list
- this.table.pageNum = response.data.pageNum
- this.table.pageSize = response.data.pageSize
- this.table.total = response.data.total
- console.log('计划类型', response.data.list[0].lpplantype)
- this.table2.getdataListParm.parammaps.havebutton = response.data.list[0].havebutton
- this.table3.getdataListParm.parammaps.havebutton = response.data.list[0].havebutton
- if (response.data.list[0].lpplantype == 0) {
- // 撒料
- this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
- this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
- this.table2.getdataListParm.parammaps.useinbartype = ''
- this.table3.getdataListParm.parammaps.useinbartype = ''
- this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
- this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
- this.table2.getdataListParm.parammaps.id = response.data.list[0].id
- this.table3.getdataListParm.parammaps.id = response.data.list[0].id
- this.table2.getdataListParm.parammaps.tmrId = response.data.list[0].tmrid
- this.table3.getdataListParm.parammaps.tmrId = response.data.list[0].tmrid
- this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
- this.table2.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
- this.getList2()
- this.getList3()
- } else if (response.data.list[0].lpplantype == 1) {
- // 撒料计划-混料
- this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
- this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
- this.table2.getdataListParm.parammaps.useinbartype = ''
- this.table3.getdataListParm.parammaps.useinbartype = ''
- this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
- this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
- this.table2.getdataListParm.parammaps.id = response.data.list[0].id
- this.table3.getdataListParm.parammaps.id = response.data.list[0].id
- this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
- this.getList2()
- this.getList3()
- } else if (response.data.list[0].lpplantype == 2) {
- // 撒料计划-撒料
- this.table2.getdataListParm.name = 'getDownloadplandt2ListV2'
- this.table3.getdataListParm.name = 'getDownloadplandtl1ListV2'
- this.table2.getdataListParm.parammaps.useinbartype = ''
- this.table3.getdataListParm.parammaps.useinbartype = ''
- this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
- this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
- this.table2.getdataListParm.parammaps.id = response.data.list[0].id
- this.table3.getdataListParm.parammaps.id = response.data.list[0].id
- this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
- this.table2.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
- this.getList2()
- this.getList3()
- } else if (response.data.list[0].lpplantype == 3) {
- // 剩料
- this.table2.getdataListParm.name = 'getDownloadplandt2ListV2'
- this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
- this.table2.getdataListParm.parammaps.useinbartype = 0
- this.table3.getdataListParm.parammaps.useinbartype = 1
- this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
- this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
- this.table2.getdataListParm.parammaps.id = response.data.list[0].id
- this.table3.getdataListParm.parammaps.id = response.data.list[0].id
- this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
- this.getList2()
- this.getList3()
- } else if (response.data.list[0].lpplantype == 4) {
- // 预混
- this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
- this.table2.getdataListParm.parammaps.useinbartype = ''
- this.table3.getdataListParm.parammaps.useinbartype = ''
- this.table2.getdataListParm.parammaps.id = response.data.list[0].id
- this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
- this.getList2()
- } else if (response.data.list[0].lpplantype == 5) {
- // 预称重计划
- this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
- this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
- this.table2.getdataListParm.parammaps.useinbartype = ''
- this.table3.getdataListParm.parammaps.useinbartype = ''
- this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
- this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
- this.table2.getdataListParm.parammaps.id = response.data.list[0].id
- this.table3.getdataListParm.parammaps.id = response.data.list[0].id
- this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
- this.getList2()
- this.getList3()
- }
- } else {
- this.table.list = []
- this.table3.getdataListParm.parammaps.lpplantype = ''
- this.table2.getdataListParm.parammaps.id = ''
- this.table3.getdataListParm.parammaps.id = ''
- // this.getList2()
- // this.getList3()
- this.table2.list = []
- this.table3.list = []
- }
- setTimeout(() => {
- this.table.listLoading = false
- }, 100)
- })
- },
- form_search() {
- this.getTMRList()
- this.table.getdataListParm.offset = 1
- this.getList()
- },
- handleEnableChange(row) {
- this.requestParam.name = 'updatedownloadenable'
- this.requestParam.parammaps = {}
- this.requestParam.parammaps.pastureid = row.pastureid
- this.requestParam.parammaps.id = row.id
- this.requestParam.parammaps.enable = row.enable
- PostDataByName(this.requestParam).then(response => {
- if (response.msg === 'fail') {
- this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
- } else {
- this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
- this.getList()
- }
- })
- },
- getIsColor(arr) {
- var map = {}
- var dest = []
- for (var i = 0; i < arr.length; i++) {
- var ai = arr[i]
- if (!map[ai.pid]) {
- dest.push({
- pid: ai.pid,
- data: [ai]
- })
- map[ai.pid] = ai
- } else {
- for (var j = 0; j < dest.length; j++) {
- var dj = dest[j]
- if (dj.pid == ai.pid) {
- dj.data.push(ai)
- break
- }
- }
- }
- }
- console.log(dest)
- var newArr1 = []
- for (var i = 0; i < dest.length; i++) {
- var newArr = dest[i].data
- for (var j = 0; j < dest[i].data.length; j++) {
- dest[i].data[j].isColor = i
- newArr1.push(dest[i].data[j])
- }
- }
- console.log(newArr1)
- this.table.list = newArr1
- },
- tableRowClassName({ row }) {
- if (row.isColor % 2 == 0) {
- return 'warning-row'
- } else {
- return 'success-row'
- }
- },
- lpplantype: function(cellValue) {
- if (cellValue.lpplantype == 0) {
- return '撒料计划'
- } else if (cellValue.lpplantype == 1) {
- return '撒料计划-混料'
- } else if (cellValue.lpplantype == 2) {
- return '撒料计划-撒料'
- } else if (cellValue.lpplantype == 3) {
- return '剩料计划'
- } else if (cellValue.lpplantype == 4) {
- return '预混计划'
- } else if (cellValue.lpplantype == 5) {
- return '预称重计划'
- }
- },
- changeDate(val) {
- console.log('选择了日期', val)
- this.getList()
- // this.getList2()
- // this.getList3()
- var d = this.table.getdataListParm.parammaps.mydate
- var curDate = parseTime(new Date(), '{y}-{m}-{d}')
- if (d < curDate) {
- this.dataDisabled = true
- } else {
- this.dataDisabled = false
- }
- console.log(this.dataDisabled)
- this.parentDate = this.table.getdataListParm.parammaps.mydate
- console.log(this.parentDate, 'this.parentDate')
- },
- changePlanType(val) {
- console.log('选择了计划类型', val)
- this.getList()
- this.getList2()
- this.getList3()
- },
- changeFrequency(val) {
- console.log('选择了班次', val)
- this.getList()
- this.getList2()
- this.getList3()
- },
- // 日执行计划行点击
- tableRowClick(row, column, event) {
- console.log(row, column, event)
- console.log('点击计划类型', row.lpplantype)
- if (this.isOrder == false) {
- this.$message({ type: 'error', message: '请保存或取消当前更改顺序操作', duration: 2000 })
- } else {
- if (column.label !== '操作') {
- this.isDetail = true // 点击行显示详情
- this.myheight = document.documentElement.clientHeight - 85 - 265 - 230
- }
- }
- this.table2.getdataListParm.parammaps.havebutton = row.havebutton
- this.table3.getdataListParm.parammaps.havebutton = row.havebutton
- // 撒料计划0/撒料计划-混料1/撒料计划-撒料2/剩料计划3/预混计划4/预称重计划5
- if (row.lpplantype == 0) {
- // 撒料
- this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
- this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
- this.table2.getdataListParm.parammaps.useinbartype = ''
- this.table3.getdataListParm.parammaps.useinbartype = ''
- this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
- this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
- this.table2.getdataListParm.parammaps.id = row.id
- this.table3.getdataListParm.parammaps.id = row.id
- this.table2.getdataListParm.parammaps.tmrId = row.tmrid
- this.table3.getdataListParm.parammaps.tmrId = row.tmrid
- this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
- this.table2.getdataListParm.parammaps.lpplantype = row.lpplantype
- this.getList2()
- this.getList3()
- } else if (row.lpplantype == 1) {
- // 撒料计划-混料
- this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
- this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
- this.table2.getdataListParm.parammaps.useinbartype = ''
- this.table3.getdataListParm.parammaps.useinbartype = ''
- this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
- this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
- this.table2.getdataListParm.parammaps.id = row.id
- this.table3.getdataListParm.parammaps.id = row.id
- this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
- this.getList2()
- this.getList3()
- } else if (row.lpplantype == 2) {
- // 撒料计划-撒料
- this.table2.getdataListParm.name = 'getDownloadplandt2ListV2'
- this.table3.getdataListParm.name = 'getDownloadplandtl1ListV2'
- this.table2.getdataListParm.parammaps.useinbartype = ''
- this.table3.getdataListParm.parammaps.useinbartype = ''
- this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
- this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
- this.table2.getdataListParm.parammaps.id = row.id
- this.table3.getdataListParm.parammaps.id = row.id
- this.table2.getdataListParm.parammaps.tmrId = row.tmrid
- this.table3.getdataListParm.parammaps.tmrId = row.tmrid
- this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
- this.table2.getdataListParm.parammaps.lpplantype = row.lpplantype
- this.getList2()
- this.getList3()
- console.log(this.table3.getdataListParm.parammaps.lpplantype)
- } else if (row.lpplantype == 3) {
- // 剩料
- this.table2.getdataListParm.name = 'getDownloadplandt2ListV2'
- this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
- this.table2.getdataListParm.parammaps.useinbartype = 0
- this.table3.getdataListParm.parammaps.useinbartype = 1
- this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
- this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
- this.table2.getdataListParm.parammaps.id = row.id
- this.table3.getdataListParm.parammaps.id = row.id
- this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
- this.getList2()
- this.getList3()
- } else if (row.lpplantype == 4) {
- // 预混
- this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
- this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
- this.table2.getdataListParm.parammaps.useinbartype = ''
- this.table3.getdataListParm.parammaps.useinbartype = ''
- this.table2.getdataListParm.parammaps.id = row.id
- this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
- this.getList2()
- } else if (row.lpplantype == 5) {
- // 预称重计划
- this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
- this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
- this.table2.getdataListParm.parammaps.useinbartype = ''
- this.table3.getdataListParm.parammaps.useinbartype = ''
- this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
- this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
- this.table2.getdataListParm.parammaps.id = row.id
- this.table3.getdataListParm.parammaps.id = row.id
- this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
- this.getList2()
- this.getList3()
- }
- this.$forceUpdate()
- },
- handleCloseTable2() {
- this.isDetail = false
- this.myheight = document.documentElement.clientHeight - 280
- },
- // 计划内容操作详情
- getList2() {
- console.log(this.table2.getdataListParm.parammaps.lpplantype,'lpplantype===')
- if(this.table2.getdataListParm.parammaps.lpplantype == 2){
- const url = 'new_api/user/gear'
- const data = {
- pasture_id:this.table2.getdataListParm.parammaps.pastureid,
- id:this.table2.getdataListParm.parammaps.id,
- tmr_id:this.table2.getdataListParm.parammaps.tmrId,
- use_in_bar_type:this.table2.getdataListParm.parammaps.useinbartype
- }
- postJson(url, data).then(response => {
- for (let i = 0; i < response.data.list.length; i++) {
- this.$set(response.data.list[i], 'Edit', false) // 编辑
- this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
- this.$set(response.data.list[i], 'isCreate', false) // 新增操作
- this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
- this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
- }
- this.table2.list = response.data.list
- // 撒料计划0/撒料计划-混料1/撒料计划-撒料2/剩料计划3/预混计划4
- if (this.table2.getdataListParm.parammaps.lpplantype == 0 || this.table2.getdataListParm.parammaps.lpplantype == 1 || this.table2.getdataListParm.parammaps.lpplantype == 4) {
- const arr = []
- var a = 0
- let b = this.table2.list[0].sort
- let c = 0
- for (let i = 0; i < this.table2.list.length; i++) {
- if (b !== parseInt(this.table2.list[i].sort)) {
- b = this.table2.list[i].sort
- // arr.push({ 'sort': '小计', 'weight': a.toFixed(parseInt(Cookies.get('decimal'))) })
- a = 0
- }
- a = a + parseFloat(this.table2.list[i].weight)
- c = c + parseFloat(this.table2.list[i].weight)
- arr.push(this.table2.list[i])
- }
- // arr.push({ 'sort': '小计', 'weight': a.toFixed(parseInt(Cookies.get('decimal'))) })
- arr.push({ 'sort': '总计', 'weight': c.toFixed(parseInt(Cookies.get('decimal'))) })
- this.table2.list = arr
- }
- if (this.table2.getdataListParm.parammaps.lpplantype == 2) {
- const arr = []
- var aa = 0
- let bb = this.table2.list[0].sort
- let cc = 0
- for (let i = 0; i < this.table2.list.length; i++) {
- if (bb !== parseInt(this.table2.list[i].sort)) {
- bb = this.table2.list[i].sort
- aa = 0
- }
- aa = aa + parseFloat(this.table2.list[i].weight)
- cc = cc + parseFloat(this.table2.list[i].weight)
- arr.push(this.table2.list[i])
- }
- arr.push({ 'sort': '总计', 'weight': cc.toFixed(parseInt(Cookies.get('decimal'))) })
- this.table2.list = arr
- console.log('this.table2.list', this.table2.list)
- console.log(this.table2.getdataListParm.parammaps.lpplantype)
- }
- console.log(this.table2.list)
- this.table2.pageNum = response.data.pageNum
- this.table2.pageSize = response.data.pageSize
- this.table2.total = response.data.total
- this.handleSpan()
- setTimeout(() => {
- this.table2.listLoading = false
- }, 100)
- })
- }else{
- this.table2.listLoading = true
- this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
- GetDataByName(this.table2.getdataListParm).then(response => {
- console.log('table数据', response.data.list)
- if (response.data.list !== null) {
- for (let i = 0; i < response.data.list.length; i++) {
- this.$set(response.data.list[i], 'Edit', false) // 编辑
- this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
- this.$set(response.data.list[i], 'isCreate', false) // 新增操作
- this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
- this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
- }
- this.table2.list = response.data.list
- // 撒料计划0/撒料计划-混料1/撒料计划-撒料2/剩料计划3/预混计划4
- if (this.table3.getdataListParm.parammaps.lpplantype == 0 || this.table3.getdataListParm.parammaps.lpplantype == 1 || this.table3.getdataListParm.parammaps.lpplantype == 4) {
- const arr = []
- var a = 0
- let b = this.table2.list[0].sort
- let c = 0
- for (let i = 0; i < this.table2.list.length; i++) {
- if (b !== parseInt(this.table2.list[i].sort)) {
- b = this.table2.list[i].sort
- // arr.push({ 'sort': '小计', 'weight': a.toFixed(parseInt(Cookies.get('decimal'))) })
- a = 0
- }
- a = a + parseFloat(this.table2.list[i].weight)
- c = c + parseFloat(this.table2.list[i].weight)
- arr.push(this.table2.list[i])
- }
- // arr.push({ 'sort': '小计', 'weight': a.toFixed(parseInt(Cookies.get('decimal'))) })
- arr.push({ 'sort': '总计', 'weight': c.toFixed(parseInt(Cookies.get('decimal'))) })
- this.table2.list = arr
- }
- if (this.table3.getdataListParm.parammaps.lpplantype == 2) {
- const arr = []
- var aa = 0
- let bb = this.table2.list[0].sort
- let cc = 0
- for (let i = 0; i < this.table2.list.length; i++) {
- if (bb !== parseInt(this.table2.list[i].sort)) {
- bb = this.table2.list[i].sort
- aa = 0
- }
- aa = aa + parseFloat(this.table2.list[i].weight)
- cc = cc + parseFloat(this.table2.list[i].weight)
- arr.push(this.table2.list[i])
- }
- arr.push({ 'sort': '总计', 'weight': cc.toFixed(parseInt(Cookies.get('decimal'))) })
- this.table2.list = arr
- console.log('this.table2.list', this.table2.list)
- console.log(this.table3.getdataListParm.parammaps.lpplantype)
- }
- console.log(this.table2.list)
- this.table2.pageNum = response.data.pageNum
- this.table2.pageSize = response.data.pageSize
- this.table2.total = response.data.total
- } else {
- this.table2.list = []
- }
- this.handleSpan()
- setTimeout(() => {
- this.table2.listLoading = false
- }, 100)
- })
- }
- },
- // 计划内容栏舍详 情
- getList3() {
- if(this.table3.getdataListParm.parammaps.lpplantype == 0){
- const url = 'new_api/user/gear'
- const data = {
- pasture_id:this.table3.getdataListParm.parammaps.pastureid,
- id:this.table3.getdataListParm.parammaps.id,
- tmr_id:this.table3.getdataListParm.parammaps.tmrId,
- use_in_bar_type:this.table3.getdataListParm.parammaps.useinbartype
- }
- postJson(url, data).then(response => {
- if (response.data.list !== null) {
- for (let i = 0; i < response.data.list.length; i++) {
- this.$set(response.data.list[i], 'Edit', false) // 编辑
- this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
- this.$set(response.data.list[i], 'isCreate', false) // 新增操作
- this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
- this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
- }
- this.table3.list = response.data.list
- if (this.table3.getdataListParm.parammaps.lpplantype == 0) {
- const arr = []
- var a = 0
- let b = this.table3.list[0].sort
- let c = 0
- for (let i = 0; i < this.table3.list.length; i++) {
- if (b !== parseInt(this.table3.list[i].sort)) {
- b = this.table3.list[i].sort
- a = 0
- }
- a = a + parseFloat(this.table3.list[i].weight)
- c = c + parseFloat(this.table3.list[i].weight)
- arr.push(this.table3.list[i])
- }
- arr.push({ 'sort': '总计', 'weight': c.toFixed(parseInt(Cookies.get('decimal'))) })
- this.table3.list = arr
- }
- console.log(this.table3.getdataListParm.parammaps.lpplantype,'lpplantype===')
- // if(this.table3.getdataListParm.parammaps.lpplantype == 0){
- // this.getGearList()
- // }
- this.table3.pageNum = response.data.pageNum
- this.table3.pageSize = response.data.pageSize
- this.table3.total = response.data.total
- } else {
- this.table3.list = []
- }
- setTimeout(() => {
- this.table3.listLoading = false
- }, 100)
- })
- }else{
- this.table3.listLoading = true
- this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
- GetDataByName(this.table3.getdataListParm).then(response => {
- console.log('table数据', response.data.list)
- if (response.data.list !== null) {
- for (let i = 0; i < response.data.list.length; i++) {
- this.$set(response.data.list[i], 'Edit', false) // 编辑
- this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
- this.$set(response.data.list[i], 'isCreate', false) // 新增操作
- this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
- this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
- }
- this.table3.list = response.data.list
- if (this.table3.getdataListParm.parammaps.lpplantype == 0) {
- const arr = []
- var a = 0
- let b = this.table3.list[0].sort
- let c = 0
- for (let i = 0; i < this.table3.list.length; i++) {
- if (b !== parseInt(this.table3.list[i].sort)) {
- b = this.table3.list[i].sort
- a = 0
- }
- a = a + parseFloat(this.table3.list[i].weight)
- c = c + parseFloat(this.table3.list[i].weight)
- arr.push(this.table3.list[i])
- }
- arr.push({ 'sort': '总计', 'weight': c.toFixed(parseInt(Cookies.get('decimal'))) })
- this.table3.list = arr
- }
- console.log(this.table3.getdataListParm.parammaps.lpplantype,'lpplantype===')
- // if(this.table3.getdataListParm.parammaps.lpplantype == 0){
- // this.getGearList()
- // }
- this.table3.pageNum = response.data.pageNum
- this.table3.pageSize = response.data.pageSize
- this.table3.total = response.data.total
- } else {
- this.table3.list = []
- }
- setTimeout(() => {
- this.table3.listLoading = false
- }, 100)
- })
- }
- },
- getGearList(){
- let data = {
- name: 'getTmrGearList',
- page: 1,
- offset: 1,
- pagecount: parseInt(Cookies.get('pageCount')),
- returntype: 'Map',
- parammaps: {
- tmrId: this.table3.getdataListParm.parammaps.tmrId
- }
- }
- var list = []
- console.log('=====')
- GetDataByName(data).then(response => {
- console.log('table数据', response.data.list)
- if (response.data.list !== null) {
- list = response.data.list
- } else {
- list = []
- }
- console.log(this.table3.list,'table3')
- this.table3.list = [{gear:4},{gear:9.99},{gear:15}]
- this.table3.list.forEach((item1,key1) => {
- let mygear = 0
- if(item1.gear < list[0].rev || item1.gear > list[list.length-1].rev){
- mygear = 0
- }else{
- list.forEach((item2,key2) => {
- if(list[key2].rev <= item1.gear && list[key2+1].rev > item1.gear){
- mygear = list[key2+1].gear
- }
- });
- }
- console.log(mygear,'mygear')
- if(key1 == this.table3.list.length-1){
- this.$set(item1,'gear','')
- }else{
- this.$set(item1,'gear',mygear)
- }
- })
- console.log( this.table3.list,' this.table3.list')
- })
- },
- // 新生成
- handleCreate() {
- console.log('点击了新生成')
- this.newGeneration.temp.inputDatetime = [parseTime(new Date(), '{y}-{m}-{d}'), parseTime(new Date(), '{y}-{m}-{d}')]
- GetDataByName(this.newGeneration.getdataListParm).then(response => {
- console.log('table数据', response.data.list)
- if (response.data.list !== null) {
- if (response.data.list[0].vmsg == '存在未分配') {
- this.newGeneration.temp.tips = true
- this.$message({ type: 'warning', message: '撒料计划中存在未分配完栏舍,建议及时进行分配', duration: 2000 })
- this.getTips()
- }else{
- this.newGeneration.temp.tips = false
- this.newGeneration.dialogStatus = 'newGeneration'
- this.newGeneration.dialogFormVisible = true
- }
- }
- })
- },
- getTips(){
- const url = 'authdata/feedp/undistribute'
- const data = {}
- // data.times = 1
- data.times = this.myMaxTimes
- data.pastureid = Cookies.get('pastureid')
- this.tipsList = []
- postJson(url, data).then(response => {
- if(response.data !== null){
- this.tipsList = response.data
- // if(this.myMaxTimes == 1){
- // this.tipsList = response.data.one
- // }else if(this.myMaxTimes == 2){
- // this.tipsList.push(response.data.one,response.data.two)
- // }else if(this.myMaxTimes == 3){
- // this.tipsList.push(response.data.one,response.data.two,response.data.three)
- // }else if(this.myMaxTimes == 4){
- // this.tipsList.push(response.data.one,response.data.two,response.data.three,response.data.four)
- // }
- }else{
- this.tipsList = []
- }
- console.log('this.tipsList==>',this.tipsList)
- this.newGeneration.dialogStatus = 'newGeneration'
- this.newGeneration.dialogFormVisible = true
- })
- },
- DateDiff(sDate1, sDate2) {
- console.log(sDate1, sDate2)
- var aDate, oDate1, oDate2, iDays
- aDate = sDate1.split('-')
- oDate1 = new Date(aDate[0], aDate[1], aDate[2]) // 转换为12-18-2006格式
- aDate = sDate2.split('-')
- oDate2 = new Date(aDate[0], aDate[1], aDate[2])
- iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 / 24) // 把相差的毫秒数转换为天数
- this.newGeneration.temp.days = parseInt(iDays) + 1
- return iDays
- },
- newGenerationData() {
- console.log('点击了新生成保存', this.newGeneration.temp)
- this.newGenerationLoading = true
- this.isokDisable = true
- this.$refs['temp'].validate(valid => {
- if (valid) {
- this.newGeneration.temp.startTime = parseTime(this.newGeneration.temp.inputDatetime[0], '{y}-{m}-{d}')
- this.newGeneration.temp.stopTime = parseTime(this.newGeneration.temp.inputDatetime[1], '{y}-{m}-{d}')
- this.DateDiff(this.newGeneration.temp.stopTime, this.newGeneration.temp.startTime)
- this.requestParam = {}
- this.requestParam.common = { 'returnmap': '0' }
- this.requestParam.data = []
- this.requestParam.data[0] = { 'name': 'checkDLPIsStart', 'type': 'v', 'parammaps': {
- pastureid: Cookies.get('pastureid'),
- startTime: this.newGeneration.temp.startTime
- }}
- this.requestParam.data[1] = { 'name': 'checkPreMixStorage', 'type': 'e', 'parammaps': {
- pastureid: Cookies.get('pastureid'),
- days: this.newGeneration.temp.days
- }}
- this.requestParam.data[2] = { 'name': 'createdownloadedplan', 'type': 'e', 'parammaps': {
- pastureid: Cookies.get('pastureid'),
- startTime: this.newGeneration.temp.startTime,
- stopTime: this.newGeneration.temp.stopTime
- }}
- ExecDataByConfig(this.requestParam).then(response => {
- console.log('新生成保存发送参数', this.requestParam)
- if (response.msg === 'fail') {
- this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
- this.isokDisable = false
- this.newGenerationLoading = false
- } else {
- this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
- this.newGeneration.dialogFormVisible = false
- this.getList()
- this.isokDisable = false
- this.newGenerationLoading = false
- }
- })
- }
- })
- },
- // 修改计划
- handleRevisePlan(data) {
- this.dialogFull = false
- var arr = []
- if (this.table.list.length > 0) {
- for (let i = 0; i < this.table.list.length; i++) {
- if (this.table.list[i].havebutton == 1) {
- arr.push(this.table.list[i])
- }
- }
- }
- if (arr.length !== this.table.list.length) {
- console.log('点击了修改计划1', this.activeName)
- this.isShowDialog = true
- this.activeName = '栏舍配方'
- console.log('点击了修改计划2', this.activeName)
- } else {
- this.$message({ type: 'error', message: '当前日期不可修改计划,请重新选择日期' })
- }
- },
- handleExport() {
- this.downLoad.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
- this.downLoad.getdataListParm.parammaps.lpplantype = this.table.getdataListParm.parammaps.lpplantype
- this.downLoad.getdataListParm.parammaps.times = this.table.getdataListParm.parammaps.times
- this.downLoad.getdataListParm.parammaps.enable = this.table.getdataListParm.parammaps.enable
- this.downLoad.getdataListParm.parammaps.enable2 = this.table.getdataListParm.parammaps.enable2
- var exportTitle = ''
- if (this.table.getdataListParm.parammaps.plandimen == '1') {
- if (this.table.getdataListParm.parammaps.enable3 == '0') {
- this.downLoad.getdataListParm.name = 'downloadPlanTLJDTMR'
- exportTitle = this.table.getdataListParm.parammaps.mydate + '投料简打'
- } else if (this.table.getdataListParm.parammaps.enable3 == '1') {
- this.downLoad.getdataListParm.name = 'downloadPlanTLLDTMR'
- exportTitle = this.table.getdataListParm.parammaps.mydate + '累加投料'
- } else if (this.table.getdataListParm.parammaps.enable3 == '2') {
- this.downLoad.getdataListParm.name = 'downloadPlanSLJDTMR'
- exportTitle = this.table.getdataListParm.parammaps.mydate + '撒料简打'
- } else if (this.table.getdataListParm.parammaps.enable3 == '3') {
- this.downLoad.getdataListParm.name = 'downloadPlanTSLJDTMR'
- exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料简打'
- } else if (this.table.getdataListParm.parammaps.enable3 == '4') {
- this.downLoad.getdataListParm.name = 'downloadPlanTSLLDTMR'
- exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料累加'
- } else if (this.table.getdataListParm.parammaps.enable3 == '5') {
- this.downLoad.getdataListParm.name = 'downloadPlanBZJDTMR'
- exportTitle = this.table.getdataListParm.parammaps.mydate + '包装简打'
- } else {
- this.downLoad.getdataListParm.name = 'downloadPlanSFJDTMR'
- exportTitle = this.table.getdataListParm.parammaps.mydate + '实发简打'
- }
- } else {
- if (this.table.getdataListParm.parammaps.enable3 == '0') {
- this.downLoad.getdataListParm.name = 'downloadPlanTLJD'
- exportTitle = this.table.getdataListParm.parammaps.mydate + '投料简打'
- } else if (this.table.getdataListParm.parammaps.enable3 == '1') {
- this.downLoad.getdataListParm.name = 'downloadPlanTLLD'
- exportTitle = this.table.getdataListParm.parammaps.mydate + '累加投料'
- } else if (this.table.getdataListParm.parammaps.enable3 == '2') {
- this.downLoad.getdataListParm.name = 'downloadPlanSLJD'
- exportTitle = this.table.getdataListParm.parammaps.mydate + '撒料简打'
- } else if (this.table.getdataListParm.parammaps.enable3 == '3') {
- this.downLoad.getdataListParm.name = 'downloadPlanTSLJD'
- exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料简打'
- } else if (this.table.getdataListParm.parammaps.enable3 == '4') {
- this.downLoad.getdataListParm.name = 'downloadPlanTSLLD'
- exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料累加'
- } else if (this.table.getdataListParm.parammaps.enable3 == '5') {
- this.downLoad.getdataListParm.name = 'downloadPlanBZJD'
- exportTitle = this.table.getdataListParm.parammaps.mydate + '包装简打'
- } else {
- this.downLoad.getdataListParm.name = 'downloadPlanSFJD'
- exportTitle = this.table.getdataListParm.parammaps.mydate + '实发简打'
- }
- }
- GetReportform(this.downLoad.getdataListParm).then(response => {
- if (response.data.list !== null) {
- this.downLoad.labelList = []
- var filterValArr = []
- for (let i = 0; i < response.data.list.data1.length; i++) {
- this.downLoad.labelList.push(response.data.list.data1[i].label)
- filterValArr.push(response.data.list.data1[i].prop)
- }
- this.downLoad.list = response.data.list.data2
- } else {
- this.downLoad.list = []
- }
- var multiHeaderArr = []
- for (let i = 0; i < this.downLoad.labelList.length; i++) {
- if (i == 0) {
- multiHeaderArr.push(exportTitle)
- } else {
- multiHeaderArr.push('')
- }
- }
- import('@/vendor/Export5Excel').then(excel => {
- const multiHeader = [
- multiHeaderArr
- ]
- const multiHeader2 = [
- this.downLoad.labelList
- ]
- const filterVal = filterValArr
- const data = this.downLoad.list.map((v) => filterVal.map((j) => v[j]))
- const merges = []
- excel.export_json_to_excel({ multiHeader, multiHeader2, data, filename: exportTitle, merges })
- })
- })
- },
- rowDrop() {
- console.log(document.querySelector('#table1 .el-table__body-wrapper tbody'))
- const tbody = document.querySelector('#table1 .el-table__body-wrapper tbody')
- // this.sorTable()
- const that = this
- var sortable = Sortable.create(tbody, {
- disabled: that.dropState,
- onChoose({ newIndex, oldIndex }) {
- console.log(that.isOrder, 'that.isOrder == false')
- console.log(that.dropState, 'that.dropState')
- if (that.dropState == true || that.isOrder == true) {
- sortable.destroy()
- }
- },
- onEnd(evt) {
- var tableList = [...that.table.list] // 保留拖动前数据
- const targetRow = that.table.list.splice(evt.oldIndex, 1)[0] // 拖动数据
- const targetRow2 = that.table.list[evt.newIndex] // 拖动后下方数据
- const targetRow3 = that.table.list[evt.newIndex - 1] // 拖动后上方数据
- console.log(targetRow, 'targetRow')
- console.log(targetRow2, 'targetRow2')
- console.log(targetRow3, 'targetRow3')
- that.table.list.splice(evt.newIndex, 0, targetRow)
- // ==========
- // 已执行的计划不可拖动
- if (targetRow.havebutton == 1) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({ type: 'error', message: '因已执行的计划不可调整顺序', duration: 2000 })
- return false
- }
- // 相同班次之间可以拖动
- // if (targetRow2 !== undefined && targetRow3 !== undefined) {
- // if (targetRow.times !== targetRow2.times && targetRow.times !== targetRow3.times) {
- // that.$nextTick(() => {
- // that.$set(that.table, 'list', tableList)
- // })
- // that.$message({ type: 'error', message: '因班次不同不可调整顺序', duration: 2000 })
- // return false
- // }
- // } else if (targetRow2 !== undefined && targetRow3 == undefined) {
- // if (targetRow.times !== targetRow2.times) {
- // that.$nextTick(() => {
- // that.$set(that.table, 'list', tableList)
- // })
- // that.$message({ type: 'error', message: '因班次不同不可调整顺序', duration: 2000 })
- // return false
- // }
- // } else if (targetRow2 == undefined && targetRow3 !== undefined) {
- // if (targetRow.times !== targetRow3.times) {
- // that.$nextTick(() => {
- // that.$set(that.table, 'list', tableList)
- // })
- // that.$message({ type: 'error', message: '因班次不同不可调整顺序', duration: 2000 })
- // return false
- // }
- // }
- // 撒料计划0,
- // 撒料计划-混料1
- // 撒料计划-撒料2
- // 剩料计划3
- // 预混计划4
- // 预称重计划5
- if (targetRow.lpplantype == 1) { // 拖动数据为撒料计划-混料
- if (targetRow2 == undefined) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- } else if (targetRow2 !== undefined && targetRow2.pid == targetRow.pid) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- } else {
- var pidArr = [] // pid相同的值
- var pidArr1 = [] //
- var index // 索引
- for (let i = 0; i < tableList.length; i++) {
- if (tableList[i].pid == targetRow.pid) {
- pidArr.push(tableList[i])
- } else {
- pidArr1.push(tableList[i])
- }
- }
- // 找到对应上方pid 的ID
- // 比如说id 580243 找到对应的索引
- if (targetRow3 !== undefined) {
- for (let i = 0; i < pidArr1.length; i++) {
- if (pidArr1[i].id == targetRow3.id) {
- index = i
- }
- }
- } else {
- for (let i = 0; i < pidArr1.length; i++) {
- if (pidArr1[i].id == targetRow2.id) {
- index = i - 1
- }
- }
- }
- pidArr1.splice(index + 1, 0, ...pidArr)
- console.log(pidArr1)
- that.$nextTick(() => {
- that.table.list = pidArr1
- })
- }
- if (targetRow2 !== undefined && targetRow3 !== undefined) {
- if (targetRow2.pid == targetRow3.pid) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({ type: 'error', message: '不可将其他计划拖动至预称重计划之间', duration: 2000 })
- return false
- }
- }
- } else if (targetRow.lpplantype == 5) { // 拖动数据为预称重计划
- if (targetRow2 !== undefined) {
- console.log(targetRow3, targetRow2, 'zhidao')
- if (targetRow3 !== undefined) {
- if (targetRow3.pid !== targetRow.pid && targetRow2.pid !== targetRow.pid) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
- return false
- } else {
- console.log('wojinlaile', targetRow2, targetRow)
- if (targetRow3.lpplantype == 0 && targetRow2.pid !== targetRow.pid) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({ type: 'error', message: '预称重计划不可拖动至撒料计划下方', duration: 2000 })
- return false
- }
- if (targetRow2.lpplantype !== 5 && targetRow3.lpplantype !== 5) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
- return false
- }
- }
- } else {
- if (targetRow2.pid !== targetRow.pid) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
- return false
- } else {
- if (targetRow2.pid !== targetRow.pid) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({ type: 'error', message: '预称重计划不可拖动至撒料计划下方', duration: 2000 })
- return false
- }
- }
- }
- } else {
- if (targetRow2 == undefined) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
- return false
- } else if (targetRow3.pid !== targetRow.pid) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
- return false
- } else {
- if (targetRow3.lpplantype == 0) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({ type: 'error', message: '预称重计划不可拖动至撒料计划下方', duration: 2000 })
- return false
- }
- }
- }
- if (targetRow2 !== undefined && targetRow3 !== undefined) {
- if (targetRow2.pid !== targetRow.pid && targetRow3.pid !== targetRow.pid) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({ type: 'error', message: '不可将其他计划拖动至预称重计划之间', duration: 2000 })
- return false
- } else if (targetRow3.pid == targetRow.pid && (targetRow3.lpplantype == 1 || targetRow3.lpplantype == 2)) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
- return false
- }
- }
- } else if (targetRow.lpplantype == 2) { // 拖动数据为撒料计划-撒料
- if (targetRow2 == undefined) {
- if (targetRow3.pid !== targetRow.pid) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({ type: 'error', message: '撒料计划-撒料不可拖动至其他位置', duration: 2000 })
- return false
- }
- } else {
- if (targetRow2.lpplantype == 1 && (targetRow2.pid == targetRow.pid || targetRow2 == undefined)) {
- // 拖动数据下方为撒料计划-混料时且pid相同,不可拖动,提示
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({ type: 'error', message: '撒料计划-撒料不可拖动至撒料计划-混料上方', duration: 2000 })
- return false
- } else if (targetRow.lpplantype == 2 && (targetRow2.pid == targetRow.pid || targetRow3.pid == targetRow.pid || targetRow2 == undefined || targetRow3 == undefined)) {
- console.log('正常拖动')
- } else {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({ type: 'error', message: '撒料计划-撒料不可拖动至其他位置', duration: 2000 })
- return false
- }
- }
- if (targetRow2 !== undefined && targetRow3 !== undefined) {
- if (targetRow2.pid == targetRow3.pid) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({ type: 'error', message: '不可将其他计划拖动至预称重计划之间', duration: 2000 })
- return false
- }
- }
- } else if (targetRow.lpplantype == 0) { // 拖动数据为撒料计划
- console.log('遍历有相同的pid,一起跟着拖动3')
- var pidArr = [] // pid相同的值
- var pidArr1 = [] //
- var index // 索引
- for (let i = 0; i < tableList.length; i++) {
- if (tableList[i].pid == targetRow.pid) {
- pidArr.push(tableList[i])
- } else {
- pidArr1.push(tableList[i])
- }
- }
- if (pidArr.length > 0) {
- // 找到对应上方pid 的ID
- // 比如说id 580243 找到对应的索引
- if (targetRow3 !== undefined) {
- for (let i = 0; i < pidArr1.length; i++) {
- if (pidArr1[i].id == targetRow3.id) {
- index = i
- }
- }
- } else {
- for (let i = 0; i < pidArr1.length; i++) {
- if (pidArr1[i].id == targetRow2.id) {
- index = i - 1
- }
- }
- }
- pidArr1.splice(index + 1, 0, ...pidArr)
- console.log(pidArr1)
- that.$nextTick(() => {
- that.table.list = pidArr1
- })
- }
- if (targetRow2 !== undefined && targetRow3 !== undefined) {
- if (targetRow2.pid == targetRow3.pid) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({ type: 'error', message: '不可拖动至其他计划中间;', duration: 2000 })
- return false
- }
- }
- } else if (targetRow.lpplantype == 3 || targetRow.lpplantype == 4) {
- if (targetRow2 !== undefined && targetRow3 !== undefined) {
- if (targetRow2.pid == targetRow3.pid) {
- if (targetRow2.lpplantype == 5 && targetRow3.lpplantype == 5) {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- that.$message({ type: 'error', message: '不可拖动至预称重计划跟预称重计划之间', duration: 2000 })
- return false
- } else if (targetRow.pid == targetRow2.pid && targetRow.lpplantype == 3 && targetRow2.lpplantype == 3 || targetRow.pid == targetRow3.pid && targetRow.lpplantype == 3 && targetRow3.lpplantype == 3) {
- console.log('剩料之间可以互相拖动')
- console.log(tableList)
- } else {
- that.$nextTick(() => {
- that.$set(that.table, 'list', tableList)
- })
- // 撒料计划0,
- // 撒料计划-混料1
- // 撒料计划-撒料2
- // 剩料计划3
- // 预混计划4
- // 预称重计划5
- if (targetRow3.lpplantype == 0) {
- that.$set(targetRow3, 'mylpplantype', '撒料计划')
- } else if (targetRow3.lpplantype == 1) {
- that.$set(targetRow3, 'mylpplantype', '撒料计划-混料')
- } else if (targetRow3.lpplantype == 2) {
- that.$set(targetRow3, 'mylpplantype', '撒料计划-撒料')
- } else if (targetRow3.lpplantype == 3) {
- that.$set(targetRow3, 'mylpplantype', '剩料计划')
- } else if (targetRow3.lpplantype == 4) {
- that.$set(targetRow3, 'mylpplantype', '预混计划')
- } else if (targetRow3.lpplantype == 5) {
- that.$set(targetRow3, 'mylpplantype', '预称重计划')
- }
- if (targetRow2.lpplantype == 0) {
- that.$set(targetRow2, 'mylpplantype', '撒料计划')
- } else if (targetRow2.lpplantype == 1) {
- that.$set(targetRow2, 'mylpplantype', '撒料计划-混料')
- } else if (targetRow2.lpplantype == 2) {
- that.$set(targetRow2, 'mylpplantype', '撒料计划-撒料')
- } else if (targetRow2.lpplantype == 3) {
- that.$set(targetRow2, 'mylpplantype', '剩料计划')
- } else if (targetRow2.lpplantype == 4) {
- that.$set(targetRow2, 'mylpplantype', '预混计划')
- } else if (targetRow2.lpplantype == 5) {
- that.$set(targetRow2, 'mylpplantype', '预称重计划')
- }
- var message = '不可拖动至' + targetRow3.mylpplantype + '跟' + targetRow2.mylpplantype + '之间'
- that.$message({ type: 'error', message: message, duration: 2000 })
- return false
- }
- }
- }
- // ========
- // var pidArr = [] // pid相同的值
- // var pidArr1 = [] //
- // var index // 索引
- // for (let i = 0; i < tableList.length; i++) {
- // if (tableList[i].pid == targetRow.pid) {
- // pidArr.push(tableList[i])
- // } else {
- // pidArr1.push(tableList[i])
- // }
- // }
- // if (pidArr.length > 0) {
- // // 找到对应上方pid 的ID
- // // 比如说id 580243 找到对应的索引
- // if (targetRow3 !== undefined) {
- // for (let i = 0; i < pidArr1.length; i++) {
- // if (pidArr1[i].id == targetRow3.id) {
- // index = i
- // }
- // }
- // } else {
- // for (let i = 0; i < pidArr1.length; i++) {
- // if (pidArr1[i].id == targetRow2.id) {
- // index = i - 1
- // }
- // }
- // }
- // pidArr1.splice(index + 1, 0, ...pidArr)
- // console.log(pidArr1)
- // that.$nextTick(() => {
- // that.table.list = pidArr1
- // })
- // }
- // if (targetRow2 !== undefined && targetRow3 !== undefined) {
- // if (targetRow2.pid == targetRow3.pid) {
- // that.$nextTick(() => {
- // that.$set(that.table, 'list', tableList)
- // })
- // that.$message({ type: 'error', message: '不可将其他计划拖动至预称重计划之间9999', duration: 2000 })
- // return false
- // }
- // }
- }
- // ===
- }
- })
- },
- // 复制
- handleCopy() {
- if (this.table.list.length > 0) {
- this.newGeneration.temp = {}
- this.newGeneration.dialogStatus = 'copy'
- this.newGeneration.dialogFormVisible = true
- } else {
- this.$message({ type: 'error', message: '当前无计划可复制' })
- }
- },
- copyData() {
- console.log(this.newGeneration.temp.copyInputDatetime)
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 5000)
- this.$refs['temp'].validate(valid => {
- if (valid) {
- this.requestParam.name = 'copydownloadedplan'
- this.requestParam.parammaps = {}
- this.requestParam.parammaps.pastureid = Cookies.get('pastureid')
- this.requestParam.parammaps.date = this.table.getdataListParm.parammaps.mydate
- this.requestParam.parammaps.startTime = parseTime(this.newGeneration.temp.copyInputDatetime[0], '{y}-{m}-{d}')
- this.requestParam.parammaps.stopTime = parseTime(this.newGeneration.temp.copyInputDatetime[1], '{y}-{m}-{d}')
- PostDataByName(this.requestParam).then(response => {
- if (response.msg === 'fail') {
- this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
- } else {
- this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
- this.newGeneration.dialogFormVisible = false
- this.getList()
- }
- })
- }
- })
- },
- handleChangeOrder() {
- // 拖动顺序
- this.isOrder = false
- this.rowDrop()
- },
- saveChangeOrder() {
- // 保存顺序
- var sortList = []
- for (let i = 0; i < this.table.list.length; i++) {
- var obj = {}
- obj.sort = i
- obj.pastureid = this.table.list[i].pastureid
- obj.id = this.table.list[i].id
- sortList.push(obj)
- }
- console.log(sortList)
- this.requestParam = {}
- this.requestParam.common = { 'returnmap': '0' }
- this.requestParam.data = []
- this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': sortList }}
- this.requestParam.data[0].children = []
- this.requestParam.data[0].children[0] = { 'name': 'updatedownloadesort', 'type': 'e', 'parammaps': {
- id: '@insertSpotList.id',
- pastureid: '@insertSpotList.pastureid',
- sort: '@insertSpotList.sort'
- }}
- ExecDataByConfig(this.requestParam).then(response => {
- console.log('顺序切换保存发送参数', this.requestParam)
- if (response.msg === 'fail') {
- this.$notify({ title: '顺序切换失败', message: response.data, type: 'warning', duration: 2000 })
- } else {
- this.$notify({ title: '', message: '顺序切换成功', type: 'success', duration: 2000 })
- this.getList()
- this.isOrder = true
- }
- })
- },
- cancelChangeOrder() {
- // 取消顺序
- this.getList()
- this.isOrder = true
- },
- handleDataSynchronization() {
- MessageBox.confirm('是否确认同步数据?', {
- confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
- }).then(() => {
- this.requestParam = {}
- this.requestParam.pastureid = Cookies.get('pastureid')
- // this.$alert('正在同步', { confirmButtonText: '确定' })
- this.dataSynchronization.dialogFormVisible = true
- getDorm(this.requestParam).then(response => {
- console.log(response)
- if (response.msg == 'ok') {
- this.dataSynchronization.dialogFormVisible = false
- this.$notify({ title: '同步成功', message: '同步成功', type: 'success', duration: 2000 })
- } else {
- this.$notify({ title: '同步失败', message: response.data, type: 'warning', duration: 2000 })
- this.dataSynchronization.dialogFormVisible = false
- }
- })
- }).catch(() => {
- this.$message({ type: 'info', message: '已取消数据同步' })
- })
- },
- handleRowDelete(row) {
- console.log('删除')
- MessageBox.confirm('是否确认删除此信息?', {
- confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
- }).then(() => {
- this.selectList = []
- this.requestParam = {}
- this.requestParam.name = 'delDownloadedplan'
- this.requestParam.parammaps = {}
- this.requestParam.parammaps.pastureid = row.pastureid
- this.requestParam.parammaps.id = row.id
- PostDataByName(this.requestParam).then(response => {
- if (response.msg === 'fail') {
- this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
- } else {
- this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
- this.getList()
- }
- })
- }).catch(() => {
- this.$message({ type: 'info', message: '已取消删除' })
- })
- },
- handleRowSort(row){
- this.$prompt('由于混料车和撒料车是一体的,插入顺序不能隔开', '排序', {
- inputPlaceholder:'请输入您要插入的位置',
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- inputPattern: /^\d+$/ ,
- inputErrorMessage: '请检查插入位置序号是否正确'
- }).then(({ value }) => {
- const url = 'authdata/plan/sort/edit'
- const data = {
- planId:row.id,
- mydate:row.mydate,
- sort:value
- }
- postJson(url, data).then(response => {
- if (response.msg === 'fail') {
- this.$notify({ title: '失败', message: response.data, type: 'error', duration: 2000 })
- } else {
- this.$notify({ title: '成功', message: '成功', type: 'success', duration: 2000 })
- this.getList()
- }
- })
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '取消排序'
- });
- });
- },
- handleSpan() {
- this.mergekeys.forEach(key => {
- this.spanObj[key] = []
- let position = 0
- this.table2.list.forEach((item, index) => {
- if (index === 0) {
- this.spanObj[key].push(1)
- position = 0
- } else {
- if (key == 'description') {
- if (this.table2.list[index][key] === this.table2.list[index - 1][key] && this.table2.list[index]['sort'] === this.table2.list[index - 1]['sort']) {
- this.spanObj[key][position] += 1
- this.spanObj[key].push(0)
- } else {
- this.spanObj[key].push(1)
- position = index
- }
- } else {
- if (this.table2.list[index][key] === this.table2.list[index - 1][key]) {
- this.spanObj[key][position] += 1
- this.spanObj[key].push(0)
- } else {
- this.spanObj[key].push(1)
- position = index
- }
- }
- }
- })
- })
- },
- objectSpanMethod({ row, column, rowIndex, columnIndex }) {
- for (let i = 0; i < this.mergekeys.length; i++) {
- if (column.property === this.mergekeys[i]) {
- const _row = this.spanObj[this.mergekeys[i]][rowIndex]
- const _col = _row > 0 ? 1 : 0
- return {
- rowspan: _row,
- colspan: _col
- }
- }
- }
- },
- form_deleteRecord(){
- this.deleteRecord.dialogStatus = 'deleteRecord'
- this.deleteRecord.dialogFormVisible = true
- this.deleteRecord.mydate = this.table.getdataListParm.parammaps.mydate
- this.getDeleteRecordList()
- },
- changeDeleteRecordDate(){
- this.getDeleteRecordList()
- },
- getDeleteRecordList(){
- const url = 'authdata/GetDataByName'
- const data = {}
- data.name = 'getDownloadedplanDeleteList'
- data.page = 1
- data.offset = 1
- data.pagecount = ""
- data.returntype = "Map"
- data.parammaps = {}
- data.parammaps.pastureid = Cookies.get('pastureid')
- data.parammaps.mydate = this.deleteRecord.mydate
- postJson(url, data).then(response => {
- if(response.data !== null){
- this.deleteRecord.list = response.data.list
- }else{
- this.deleteRecord.list = []
- }
- this.deleteRecord.total = response.data.total
- })
- },
- handleSelect(val) {
- console.log('勾选数据', val)
- this.selectList = val
- },
- handleTakeEffect() {
- if (this.selectList.length == 0) {
- this.$message({ type: 'error', message: '请选择车次信息', duration: 2000 })
- } else {
- MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否生效?', {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- for (let i = 0; i < this.selectList.length; i++) {
- // this.$set(this.selectList[i], 'enable', '1')
- this.selectList[i].enable = 1
- }
- console.log('生效', this.selectList)
- this.requestParam.common = {
- 'returnmap': '0'
- }
- this.requestParam.data = []
- this.requestParam.data[0] = {
- 'name': 'insertSpotList',
- 'resultmaps': {
- 'list': this.selectList
- }
- }
- this.requestParam.data[0].children = []
- this.requestParam.data[0].children[0] = {
- 'name': 'updateDownloadedplanEnable',
- 'type': 'e',
- 'parammaps': {
- enable: '@insertSpotList.enable',
- id: '@insertSpotList.id',
- pastureid: '@insertSpotList.pastureid'
- }
- }
- ExecDataByConfig(this.requestParam).then(response => {
- console.log('生效保存发送参数', this.requestParam)
- if (response.msg === 'fail') {
- this.$notify({ title: '生效失败', message: response.data, type: 'warning', duration: 2000 })
- } else {
- this.$notify({ title: '成功', message: '生效成功', type: 'success', duration: 2000 })
- this.getList()
- }
- })
- })
- }
- },
- handleDisable() {
- if (this.selectList.length == 0) {
- this.$message({type: 'error', message: '请选择车次信息', duration: 2000 })
- } else {
- MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否禁用?', {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- for (let i = 0; i < this.selectList.length; i++) {
- // this.$set(this.selectList[i], 'enable', '1')
- this.selectList[i].enable = 0
- }
- console.log('禁用', this.selectList)
- this.requestParam.common = {
- 'returnmap': '0'
- }
- this.requestParam.data = []
- this.requestParam.data[0] = {
- 'name': 'insertSpotList',
- 'resultmaps': {
- 'list': this.selectList
- }
- }
- this.requestParam.data[0].children = []
- this.requestParam.data[0].children[0] = {
- 'name': 'updateDownloadedplanEnable',
- 'type': 'e',
- 'parammaps': {
- enable: '@insertSpotList.enable',
- id: '@insertSpotList.id',
- pastureid: '@insertSpotList.pastureid'
- }
- }
- ExecDataByConfig(this.requestParam).then(response => {
- console.log('禁用保存发送参数', this.requestParam)
- if (response.msg === 'fail') {
- this.$notify({ title: '禁用失败', message: response.data, type: 'warning', duration: 2000 })
- } else {
- this.$notify({ title: '成功', message: '禁用成功', type: 'success', duration: 2000 })
- this.getList()
- }
- })
- })
- }
- },
- handlePrint() {
- this.downLoad.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
- this.downLoad.getdataListParm.parammaps.lpplantype = this.table.getdataListParm.parammaps.lpplantype
- this.downLoad.getdataListParm.parammaps.times = this.table.getdataListParm.parammaps.times
- this.downLoad.getdataListParm.parammaps.enable = this.table.getdataListParm.parammaps.enable
- this.downLoad.getdataListParm.parammaps.enable2 = this.table.getdataListParm.parammaps.enable2
- var exportTitle = ''
- if (this.table.getdataListParm.parammaps.plandimen == '1') {
- if (this.table.getdataListParm.parammaps.enable3 == '0') {
- this.downLoad.getdataListParm.name = 'downloadPlanTLJDTMR'
- exportTitle = this.table.getdataListParm.parammaps.mydate + '投料简打'
- } else if (this.table.getdataListParm.parammaps.enable3 == '1') {
- this.downLoad.getdataListParm.name = 'downloadPlanTLLDTMR'
- exportTitle = this.table.getdataListParm.parammaps.mydate + '累加投料'
- } else if (this.table.getdataListParm.parammaps.enable3 == '2') {
- this.downLoad.getdataListParm.name = 'downloadPlanSLJDTMR'
- exportTitle = this.table.getdataListParm.parammaps.mydate + '撒料简打'
- } else if (this.table.getdataListParm.parammaps.enable3 == '3') {
- this.downLoad.getdataListParm.name = 'downloadPlanTSLJDTMR'
- exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料简打'
- } else if (this.table.getdataListParm.parammaps.enable3 == '4') {
- this.downLoad.getdataListParm.name = 'downloadPlanTSLLDTMR'
- exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料累加'
- } else if (this.table.getdataListParm.parammaps.enable3 == '5') {
- this.downLoad.getdataListParm.name = 'downloadPlanBZJDTMR'
- exportTitle = this.table.getdataListParm.parammaps.mydate + '包装简打'
- } else {
- this.downLoad.getdataListParm.name = 'downloadPlanSFJDTMR'
- exportTitle = this.table.getdataListParm.parammaps.mydate + '实发简打'
- }
- } else {
- if (this.table.getdataListParm.parammaps.enable3 == '0') {
- this.downLoad.getdataListParm.name = 'downloadPlanTLJD'
- exportTitle = this.table.getdataListParm.parammaps.mydate + '投料简打'
- } else if (this.table.getdataListParm.parammaps.enable3 == '1') {
- this.downLoad.getdataListParm.name = 'downloadPlanTLLD'
- exportTitle = this.table.getdataListParm.parammaps.mydate + '累加投料'
- } else if (this.table.getdataListParm.parammaps.enable3 == '2') {
- this.downLoad.getdataListParm.name = 'downloadPlanSLJD'
- exportTitle = this.table.getdataListParm.parammaps.mydate + '撒料简打'
- } else if (this.table.getdataListParm.parammaps.enable3 == '3') {
- this.downLoad.getdataListParm.name = 'downloadPlanTSLJD'
- exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料简打'
- } else if (this.table.getdataListParm.parammaps.enable3 == '4') {
- this.downLoad.getdataListParm.name = 'downloadPlanTSLLD'
- exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料累加'
- } else if (this.table.getdataListParm.parammaps.enable3 == '5') {
- this.downLoad.getdataListParm.name = 'downloadPlanBZJD'
- exportTitle = this.table.getdataListParm.parammaps.mydate + '包装简打'
- } else {
- this.downLoad.getdataListParm.name = 'downloadPlanSFJD'
- exportTitle = this.table.getdataListParm.parammaps.mydate + '实发简打'
- }
- }
- GetReportform(this.downLoad.getdataListParm).then(response => {
- if (response.data.list !== null) {
- this.downLoad.labelList = []
- var filterValArr = []
- for (let i = 0; i < response.data.list.data1.length; i++) {
- this.downLoad.labelList.push(response.data.list.data1[i].label)
- filterValArr.push(response.data.list.data1[i].prop)
- }
- this.downLoad.list = response.data.list.data2
- } else {
- this.downLoad.list = []
- }
- let data = []
- for(let i=0;i<filterValArr.length;i++){
- let obj = {}
- obj.field = filterValArr[i]
- obj.columnSize = i
- for(let j=i;j<this.downLoad.labelList.length;j++){
- obj.displayName = this.downLoad.labelList[i]
- }
- if(obj.field !== undefined && obj.displayName !== undefined){
- data.push(obj)
- }
- for(let i=0;i<this.downLoad.list.length;i++){
- if(this.downLoad.list[i][obj.displayName] == null || this.downLoad.list[i][obj.displayName] == undefined){
- this.downLoad.list[i][obj.displayName] = ''
- }
- }
- }
- console.log(this.downLoad.list)
- printJS({
- printable:this.downLoad.list,
- properties:data,
- type:'json',
- header:exportTitle,
- //样式设置
- gridStyle:'border:1px solid #ccc;',
- gridHeaderStyle:'border:1px solid #ccc;text-align:center'
- })
- })
- },
- handleDelete(){
- if (this.selectList.length == 0) {
- this.$message({ type: 'error', message: '请选择计划', duration: 2000 })
- } else {
- MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
- confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
- }).then(() => {
- console.log(this.selectList)
- this.requestParam.common = { 'returnmap': '0' }
- this.requestParam.data = []
- this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
- this.requestParam.data[0].children = []
- this.requestParam.data[0].children[0] = { 'name': 'delDownloadedplan', 'type': 'e', 'parammaps': {
- id: '@insertSpotList.id',
- pastureid: '@insertSpotList.pastureid'
- }}
- ExecDataByConfig(this.requestParam).then(response => {
- console.log('删除保存发送参数', this.requestParam)
- if (response.msg === 'fail') {
- this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
- } else {
- this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
- this.getList()
- }
- })
- })
- }
- },
- handleDataUpload(){
- let a = Cookies.get('url')
- let b = a.search(8081)
- let c = a.substring(0,a.search(8081)) + '8082'
- let d = a.substring(0,a.lastIndexOf('/'))
- console.log(d)
- let url = ''
- if(b == -1){
- url = d + ':8082'
- }else{
- url = c
- }
- let _url = url + '/authdata/feeding/push'
- let data = {
- date:parseTime(new Date(), '{y}-{m}-{d}'),
- pastureId:Cookies.get('pastureid')
- }
- console.log(_url,'_url')
- postJson2(_url, data).then(response => {
- if(response.msg == 'ok'){
- this.$notify({ title: '', message: response.data, type: 'success', duration: 2000 })
- }else{
- this.$notify({ title: '上传失败', message: response.data, type: 'warning', duration: 2000 })
- }
- })
- },
- handleUpdate2(row){
- for (let i = 0; i < this.table2.list.length; i++) {
- if (this.table2.list[i].Edit == true) {
- this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
- return false
- }
- }
- // 编辑true,不可编辑false
- row.Edit = true
- row.NoEdit = false
- // 新增false,编辑false,编辑保存true
- row.isUpdate = false
- row.isUpdateSave = true
- },
- updateData2(row,type){
- const url = 'authdata/dailydata/edit'
- const data = {}
- data.pid = row.pid
- data.weight = row.weight
- data.sort = row.sort
- // 饲料
- if(type == '0'){
- data.location = 0
- data.fid = row.fid
- }else{
- // 车辆||栏舍
- data.location = 1
- data.fbarid = row.fbarid
- }
- data.date = this.table.getdataListParm.parammaps.mydate
- data.sort = row.sort
- postJson(url, data).then(response => {
- if(response.msg == 'ok'){
- this.$notify({ title: '', message: '修改成功', type: 'success', duration: 2000 })
- this.getList2()
- this.getList3()
- }else{
- this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
- }
- })
- },
- updateCancel2(row){
- row.Edit = false
- row.NoEdit = true
- // 新增false,编辑true,编辑保存false
- row.isCreate = false
- row.isUpdate = true
- row.isUpdateSave = false
- this.getList2()
- },
- handleUpdate3(row){
- for (let i = 0; i < this.table3.list.length; i++) {
- if (this.table3.list[i].Edit == true) {
- this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
- return false
- }
- }
- // 编辑true,不可编辑false
- row.Edit = true
- row.NoEdit = false
- // 新增false,编辑false,编辑保存true
- row.isUpdate = false
- row.isUpdateSave = true
- },
- updateData3(row,type){
- const url = 'authdata/dailydata/edit'
- const data = {}
- data.pid = row.pid
- data.weight = row.weight
- data.sort = row.sort
- // 饲料
- if(type == '0'){
- data.location = 0
- data.fid = row.fid
- }else{
- // 车辆||栏舍
- data.location = 1
- data.fbarid = row.fbarid
- }
- data.date = this.table.getdataListParm.parammaps.mydate
- data.sort = row.sort
- postJson(url, data).then(response => {
- if(response.msg == 'ok'){
- this.$notify({ title: '', message: '修改成功', type: 'success', duration: 2000 })
- this.getList2()
- this.getList3()
- }else{
- this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
- }
- })
- },
- updateCancel3(row){
- row.Edit = false
- row.NoEdit = true
- // 新增false,编辑true,编辑保存false
- row.isCreate = false
- row.isUpdate = true
- row.isUpdateSave = false
- this.getList3()
- },
- changeDriver(value,row){
- const url = 'authdata/PostDataByName'
- const data = {
- name:'updateDownloadedplanDriver',
- parammaps:{
- driverId:value,
- id:row.id
- }
- }
- postJson(url, data).then(response => {
- if(response.msg == 'ok'){
- this.$notify({ title: '', message: '修改成功', type: 'success', duration: 2000 })
- this.getList()
- }else{
- this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
- }
- })
- },
- getIsSap() {
- GetDataByName(this.sapUpload.getdataListParm).then(response => {
- // console.log()
- if(response.data.list !== null){
- if(response.data.list[0].inforvalue == 1){
- this.sapUpload.isSap = true
- }else{
- this.sapUpload.isSap = false
- }
- console.log(this.sapUpload.isSap)
- }
- })
- },
- handleSAPUpload(){
- this.sapUpload.dialogStatus = 'sapUpload'
- this.sapUpload.dialogFormVisible = true
- },
- sapUploadData(){
- this.$refs['sapUpload'].validate(valid => {
- if (valid) {
- const url = 'authdata/sap/material'
- const data = {
- // "name":"xdmysapupload",
- "pastureid":Cookies.get('pastureid'),date:parseTime(this.sapUpload.temp.date, '{y}-{m}-{d}')
- }
- postJson(url, data).then(response => {
- if(response.msg == 'ok'){
- this.$notify({ title: '', message: '成功', type: 'success', duration: 2000 })
- this.sapUpload.dialogFormVisible = false
- this.getList()
- }else{
- this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
- }
- })
- }
- })
- },
- getIspalyUd(){
- let url = 'authdata/GetDataByName'
- let data = {
- "name":"getSysoptEnable","page":1,"offset":1,"pagecount":1,"returntype":"Map",
- "parammaps":{"pastureid":Cookies.get('pastureid'),"inforname":"gmUdSync"}
- }
- postJson(url,data).then(response => {
- if (response.msg !== 'fail') {
- if(response.data.list[0].inforvalue == 0){
- this.ispalyUd = false
- }else{
- this.ispalyUd = true
- }
- } else {
- this.$notify({ title: '请求失败', message: response.data, type: 'warning', duration: 2000 })
- }
- })
- },
- handleGetUd1(){
- this.sapUpload.dialogStatus = 'udload1'
- this.sapUpload.dialogFormVisible = true
- },
- udData1(){
- this.$refs['sapUpload'].validate(valid => {
- if (valid) {
- let url = 'authdata/gm/udutir/push'
- let data = {
- pastureId:Cookies.get('pastureid'),
- date:parseTime(this.sapUpload.temp.date, '{y}-{m}-{d}')
- }
- postJson(url,data).then(response => {
- if (response.msg !== 'fail') {
- this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
- this.sapUpload.dialogFormVisible = false
- this.getList()
- } else {
- this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
- }
- })
- }
- })
- },
- handleGetUd2(){
- this.sapUpload.dialogStatus = 'udload2'
- this.sapUpload.dialogFormVisible = true
- },
- udData2(){
- this.$refs['sapUpload'].validate(valid => {
- if (valid) {
- let url = 'authdata/gm/udbarfeedremain/push'
- let data = {
- pastureId:Cookies.get('pastureid'),
- date:parseTime(this.sapUpload.temp.date, '{y}-{m}-{d}')
- }
- postJson(url,data).then(response => {
- if (response.msg !== 'fail') {
- this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
- this.sapUpload.dialogFormVisible = false
- this.getList()
- } else {
- this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
- }
- })
- }
- })
- },
- handleGetUd3(){
- this.sapUpload.dialogStatus = 'udload3'
- this.sapUpload.dialogFormVisible = true
- },
- udData3(){
- this.$refs['sapUpload'].validate(valid => {
- if (valid) {
- let url = 'authdata/gm/udmaterialIssue/push'
- let data = {
- pastureId:Cookies.get('pastureid'),
- date:parseTime(this.sapUpload.temp.date, '{y}-{m}-{d}')
- }
- postJson(url,data).then(response => {
- if (response.msg !== 'fail') {
- this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
- this.sapUpload.dialogFormVisible = false
- this.getList()
- } else {
- this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
- }
- })
- }
- })
- },
- handleRowEmpty(row,plan){
- console.log(row,'row')
- MessageBox.confirm('您确定清空该操作序号以下的所有数据,如果您清空的是搅拌车数据,将会同步清空撒料车数据?', {
- confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
- }).then(() => {
- console.log(this.selectList)
- this.requestParam.common = { 'returnmap': '0' }
- this.requestParam.data = []
- this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
- this.requestParam.data[0].children = []
- this.requestParam.data[0].children[0] = { 'name': 'delDownloadedplan', 'type': 'e', 'parammaps': {
- id: '@insertSpotList.id',
- pastureid: '@insertSpotList.pastureid'
- }}
- const url = 'authdata/PostDataByName'
- const data = {
- name:'clearDeleteDownloadedplan',
- parammaps:{
- pid:row.pid,
- lpplantype:this.table3.getdataListParm.parammaps.lpplantype,
- plan:plan,
- sort:row.sort
- }
- }
- postJson(url,data).then(response => {
- console.log('清空保存发送参数', this.requestParam)
- if (response.msg === 'fail') {
- this.$notify({ title: '清除失败', message: response.data, type: 'warning', duration: 2000 })
- } else {
- this.$notify({ title: '', message: '清除成功', type: 'success', duration: 2000 })
- // this.getList()
- this.getList2()
- this.getList3()
- }
- })
- })
- },
- handleQuickcompletion(){
- if (this.selectList.length == 0) {
- this.$message({ type: 'error', message: '请先选择计划', duration: 2000 })
- } else {
- MessageBox.confirm('您是否确定勾选的状态改为已执行的计划?', {
- confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
- }).then(() => {
- console.log(this.selectList)
- let arr = []
- for(let i=0;i<this.selectList.length;i++){
- arr.push(this.selectList[i].id)
- }
- const url = '/authdata/plan/artificial/edit'
- const data = {
- planId:arr.join()
- }
- postJson(url,data).then(response => {
- console.log('快速完成保存发送参数', this.requestParam)
- if (response.msg === 'fail') {
- this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
- } else {
- this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
- this.getList()
- }
- })
- })
- }
- }
- }
- }
- </script>
- <style>
- .el-table .warning-row {
- background: oldlace;
- }
- .el-table .success-row {
- background: #f0f9eb;
- }
- @page{
- size: auto A4 landscape;
- margin: 3mm;
- }
- .agreeCon {
- background: #fff;
- box-sizing: border-box;
- padding: 2rem 3rem 4rem;
- }
- </style>
- <style lang="scss" scoped>
- .app-container{background: #fff;}
- .operation{}
- .search{margin-top:10px;}
- .table{margin-bottom:20px;}
- .template{
- background: #fff;
- position: relative;
- }
- .table2{
- // float: left;width: 50%;
- background: #fff;
- position: relative;
- .content-table{margin-top: 20px;}
- .contentOperation{right: -50px;z-index: 1;}
- }
- .table3{
- // float: left;width: 50%;
- background: #fff;
- position: relative;
- .content-table{margin-top: 20px;}
- .contentOperation{right: -50px;z-index: 1;}
- }
- /deep/.el-input.is-disabled .el-input__inner{
- color:#000
- }
- </style>
|