index.vue 153 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283
  1. <template>
  2. <div ref="appContainer" class="app-container">
  3. <div ref="myContainer" class="myContainer">
  4. <!-- 配方模板表 -->
  5. <div ref="template" class="template">
  6. <div class="recipeTemplate">
  7. <p>配方模板表</p>
  8. </div>
  9. <div class="search">
  10. <el-select v-model="table.getdataListParm.parammaps.ccname" filterable placeholder="牲畜类别" class="filter-item" clearable>
  11. <el-option v-for="item in livestockTypeList" :key="item.value" :label="item.label" :value="item.label" />
  12. </el-select>
  13. <el-select v-model="table.getdataListParm.parammaps.fttype" filterable placeholder="配方类型" class="filter-item" style="width: 120px;" clearable>
  14. <el-option v-for="item in formulaTypeList" :key="item.value" :label="item.label" :value="item.label" />
  15. </el-select>
  16. <el-select v-model="table.getdataListParm.parammaps.source" filterable placeholder="来源" class="filter-item" style="width: 120px;" clearable>
  17. <el-option v-for="item in sourceList" :key="item.id" :label="item.name" :value="item.id" />
  18. </el-select>
  19. <el-select v-model="table.getdataListParm.parammaps.enable" filterable placeholder="是否启用" class="filter-item" style="width: 120px;" clearable>
  20. <el-option v-for="item in enableList" :key="item.id" :label="item.name" :value="item.id" />
  21. </el-select>
  22. <div ref="selectInput" class="filter-item selectInput">
  23. <el-input v-model="table.getdataListParm.parammaps.all" type="text" placeholder="请点击选择搜索条件" class="Input" />
  24. <i v-if="arrowDown" icon="el-icon-arrow-down" class="el-icon-arrow-down" />
  25. <i v-if="arrowUp" icon="el-icon-arrow-up" class="el-icon-arrow-up" />
  26. <ul v-if="arrowUp" class="selectUl">
  27. <li><a>配方名称</a><el-input v-model="table.getdataListParm.parammaps.tname" clearable style="width: 245px;" /></li>
  28. <li><a>备注</a><el-input v-model="table.getdataListParm.parammaps.remark" clearable style="width: 245px;" /></li>
  29. <li />
  30. <!-- <li><a>来源</a><el-input v-model="table.getdataListParm.parammaps.source" clearable style="width: 245px;" /></li> -->
  31. <li>
  32. <div style="float: right;">
  33. <el-button class="downminCancel" @click="arrowUp=false;arrowDown=true;">取消</el-button>
  34. <el-button class="miniPrimary" @click="handleSearch">搜索</el-button>
  35. </div>
  36. </li>
  37. </ul>
  38. </div>
  39. <el-button class="successBorder" @click="handleSearch">查询</el-button>
  40. <el-button class="successBorder" @click="handleRefresh">重置</el-button>
  41. </div>
  42. <div class="operation">
  43. <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="handleCreate">新增</el-button>
  44. <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" @click="handleDelete">删除</el-button>
  45. <el-button v-if="isRoleEdit" class="copy" icon="el-icon-copy-document" @click="handleCopy">复制</el-button>
  46. <el-button v-if="isRoleEdit" class="success" icon="el-icon-open" @click="handleTakeEffect">生效</el-button>
  47. <el-button v-if="isRoleEdit" class="danger" icon="el-icon-turn-off" @click="handleDisable">禁用</el-button>
  48. <el-upload style="float: right;margin-right: 15px;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
  49. <el-button v-if="isRoleEdit" class="export" icon="el-icon-download" style="float: right;">导入</el-button>
  50. </el-upload>
  51. <el-dropdown style="float: right;">
  52. <el-button class="export" icon="el-icon-upload2">导出</el-button>
  53. <el-dropdown-menu slot="dropdown">
  54. <el-dropdown-item @click.native="handleExport(1)">导出模板</el-dropdown-item>
  55. <el-dropdown-item @click.native="handleExport(2)">导出数据</el-dropdown-item>
  56. </el-dropdown-menu>
  57. </el-dropdown>
  58. <el-button class="export" style="float: right;" @click="handleRecipeRecord">配方记录</el-button>
  59. </div>
  60. <div ref="table" class="table">
  61. <el-table
  62. :key="table.tableKey"
  63. v-loading="table.listLoading"
  64. element-loading-text="给我一点时间"
  65. :data="table.list"
  66. border
  67. fit
  68. highlight-current-row
  69. style="width: 98%;"
  70. :row-style="rowStyle"
  71. :cell-style="cellStyle"
  72. class="elTable table-fixed"
  73. :height="myheight"
  74. @row-click="tableRowClick"
  75. @selection-change="handleSelectionChange"
  76. >
  77. <el-table-column type="selection" align="center" width="50" />
  78. <el-table-column label="序号" align="center" type="index" width="50px" />
  79. <el-table-column label="配方名称" min-width="90px" align="center">
  80. <template slot-scope="scope">
  81. <span v-if="scope.row.NoEdit">{{ scope.row.tname }}</span>
  82. <el-input v-if="scope.row.Edit" v-model.trim="scope.row.tname" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:98%;padding:10px 0;" />
  83. </template>
  84. </el-table-column>
  85. <el-table-column label="配方编码" min-width="110px" align="center">
  86. <template slot-scope="scope">
  87. <span v-if="scope.row.NoEdit">{{ scope.row.tcode }}</span>
  88. <!-- <el-input v-if="scope.row.Edit" v-model.trim="scope.row.tcode" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:98%;padding:10px 0;" /> -->
  89. <el-input v-if="scope.row.Edit" v-model.trim="scope.row.tcode" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" disabled maxlength="32" style="width:98%;padding:10px 0;" />
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="配方颜色" min-width="70px" align="center">
  93. <template slot-scope="scope">
  94. <el-color-picker v-model="scope.row.tcolor" size="mini" :predefine="predefineColors" style="vertical-align: middle;" :disabled="scope.row.NoEdit" />
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="牲畜类别" min-width="130px" align="center">
  98. <template slot-scope="scope">
  99. <span v-if="scope.row.NoEdit">{{ scope.row.ccname }}</span>
  100. <el-select v-if="scope.row.Edit" v-model="scope.row.ccid" filterable placeholder="牲畜类别" class="filter-item" style="width:95%;padding:10px 0;" @change="changeLivestockType">
  101. <el-option v-for="item in livestockTypeList" :key="item.value" :label="item.label" :value="item.value" />
  102. </el-select>
  103. </template>
  104. </el-table-column>
  105. <el-table-column label="配方类型" min-width="130px" align="center">
  106. <template slot-scope="scope">
  107. <span v-if="scope.row.NoEdit">{{ scope.row.fttype }}</span>
  108. <el-select v-if="scope.row.Edit && scope.row.isCreate == true" v-model="scope.row.fttypeid" filterable placeholder="配方类型" class="filter-item" style="width:95%;padding:10px 0;" @change="changeFormulaType">
  109. <el-option v-for="item in formulaTypeList" :key="item.value" :label="item.label" :value="item.value" />
  110. </el-select>
  111. <el-select v-if="scope.row.Edit && scope.row.isUpdateSave == true" v-model="scope.row.fttypeid" disabled filterable placeholder="配方类型" class="filter-item" style="width:95%;padding:10px 0;" @change="changeFormulaType">
  112. <el-option v-for="item in formulaTypeList" :key="item.value" :label="item.label" :value="item.value" />
  113. </el-select>
  114. </template>
  115. </el-table-column>
  116. <el-table-column label="来源" min-width="90px" align="center">
  117. <template slot-scope="scope">
  118. <span>{{ scope.row.source }}</span>
  119. </template>
  120. </el-table-column>
  121. <el-table-column label="备注" min-width="90px" align="center">
  122. <template slot-scope="scope">
  123. <span v-if="scope.row.NoEdit">{{ scope.row.remark }}</span>
  124. <el-input v-if="scope.row.Edit" v-model="scope.row.remark" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="255" style="width:95%;padding:10px 0;" />
  125. </template>
  126. </el-table-column>
  127. <el-table-column label="版本号" min-width="90px" align="center">
  128. <template slot-scope="scope">
  129. <span>{{ scope.row.version }}</span>
  130. </template>
  131. </el-table-column>
  132. <el-table-column label="是否启用" min-width="90px" align="center">
  133. <template slot-scope="scope">
  134. <el-switch v-model="scope.row.enable" :disabled="scope.row.NoEdit==true" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.$index, scope.row)" />
  135. </template>
  136. </el-table-column>
  137. <el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width" fixed="right">
  138. <template slot-scope="{row}">
  139. <el-button v-if="row.NoEdit && isRoleEdit && ispastureuse==0" icon="el-icon-tickets" class="miniSuccess" @click="handleRowRecipeRecord(row)" />
  140. <span v-if="row.NoEdit && isRoleEdit && ispastureuse ==0" icon="el-icon-data-line" class="centerSpan">|</span>
  141. <el-button v-if="row.isCreate && isRoleEdit" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="createData(row)" />
  142. <span v-if="row.isCreate && isRoleEdit" class="centerSpan">|</span>
  143. <el-button v-if="row.isCreate && isRoleEdit" class="minCancel" icon="el-icon-close" @click="createCancel(row)" />
  144. <el-button v-if="row.isUpdate && isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
  145. <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
  146. <el-button v-if="row.isUpdate && isRoleEdit" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
  147. <el-button v-if="row.isUpdateSave && isRoleEdit" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData(row)" />
  148. <span v-if="row.isUpdateSave && isRoleEdit" class="centerSpan">|</span>
  149. <el-button v-if="row.isUpdateSave && isRoleEdit" class="minCancel" icon="el-icon-close" @click="updateCancel(row)" />
  150. <span v-if="row.NoEdit && isRoleEdit && ispastureuse ==0" icon="el-icon-data-line" class="centerSpan">|</span>
  151. <el-button v-if="row.NoEdit && isRoleEdit && ispastureuse==0" icon="el-icon-data-line" class="miniSuccess" @click="handleFormulationEvaluation(row)" />
  152. </template>
  153. </el-table-column>
  154. </el-table>
  155. </div>
  156. <span v-if="table.listLoading == false" style="margin-right: 30px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;">共{{ table.total }}条</span>
  157. </div>
  158. <!-- 配方详情表 -->
  159. <div v-if="isDetail" ref="detail" class="detail">
  160. <div class="recipeTemplate">
  161. <p>配方详情表</p>
  162. </div>
  163. <div class="operation">
  164. <el-button v-if="isRoleEdit" style="float: left;" icon="el-icon-plus" class="success" @click="handleCreate2">新增</el-button>
  165. <el-button v-if="isRoleEdit" style="float: left;" icon="el-icon-delete" class="danger" @click="handleDelete2">删除</el-button>
  166. <el-button v-if="isRoleEdit" style="float: left;" class="success" icon="el-icon-takeaway-box" @click="handleSyntheticPremix">合成预混料</el-button>
  167. <el-button v-if="isOrder && isRoleEdit" icon="el-icon-sort" style="float: left;" class="success" @click="handleChangeOrder">更改顺序</el-button>
  168. <div v-else style="float: left;margin-left: 10px;">
  169. <el-button v-if="isRoleEdit" icon="el-icon-folder-checked" class="success" @click="saveChangeOrder">保存</el-button>
  170. <el-button v-if="isRoleEdit" icon="el-icon-close" class="sortCancel" @click="cancelChangeOrder">取消</el-button>
  171. </div>
  172. <div ref="selectInput2" class="filter-item selectInput" style="margin: 0 10px;">
  173. <el-input v-model="table2.getdataListParm.parammaps.all" type="text" name="" value="" placeholder="请点击选择搜索条件" class="Input" />
  174. <i v-if="arrowDown2" icon="el-icon-arrow-down" class="el-icon-arrow-down" />
  175. <i v-if="arrowUp2" icon="el-icon-arrow-up" class="el-icon-arrow-up" />
  176. <ul v-if="arrowUp2" class="selectUl">
  177. <li>
  178. <a style="width: 130px;">饲料名称</a>
  179. <el-select v-model="table2.getdataListParm.parammaps.fname" filterable placeholder="" style="width:190px;">
  180. <el-option v-for="item in feedNameList" :key="item.id" :label="item.fname" :value="item.fname" />
  181. </el-select>
  182. </li>
  183. <li><a style="width: 130px;">饲料组名称</a><el-input v-model="table2.getdataListParm.parammaps.feedgroup" style="width: 190px;" /></li>
  184. <li><a style="width: 130px;">重量</a><el-input v-model="table2.getdataListParm.parammaps.fweight" style="width: 190px;" /></li>
  185. <li>
  186. <a style="width: 130px;">搅拌延时</a>
  187. <el-select v-model="table2.getdataListParm.parammaps.autosecondname" filterable placeholder="" style="width:190px;" clearable>
  188. <el-option v-for="item in mixingDelayList" :key="item.id" :label="item.name" :value="item.name" />
  189. </el-select>
  190. </li>
  191. <li>
  192. <a style="width: 130px;">是否锁定牛头数比例</a>
  193. <el-select v-model="table2.getdataListParm.parammaps.islockcount" placeholder="" style="width:190px;" clearable>
  194. <el-option v-for="item in lockBullsList" :key="item.id" :label="item.name" :value="item.id" />
  195. </el-select>
  196. </li>
  197. <li><a style="width: 130px;">顺序</a><el-input v-model="table2.getdataListParm.parammaps.sort" style="width: 190px;" /></li>
  198. <li>
  199. <div style="float: right;">
  200. <el-button class="downminCancel" @click="arrowUp2=false;arrowDown2=true;">取消</el-button>
  201. <el-button class="miniPrimary" @click="handleSearch2">搜索</el-button>
  202. </div>
  203. </li>
  204. </ul>
  205. </div>
  206. <el-button class="successBorder" @click="handleSearch2">查询</el-button>
  207. <el-button class="successBorder" @click="handleRefresh2">重置</el-button>
  208. <el-button class="hide" @click="handleCloseTable2">隐藏</el-button>
  209. <el-button v-if="isEnlarge" class="hide2" @click="handleEnlarge">放大</el-button>
  210. <el-button v-else class="hide2" @click="handleNarrow">缩小</el-button>
  211. </div>
  212. <div v-if="isEnlarge" class="table2">
  213. <el-table
  214. id="table2"
  215. ref="table2"
  216. :key="table2.tableKey"
  217. v-loading="table2.listLoading"
  218. element-loading-text="给我一点时间"
  219. :data="table2.list"
  220. border
  221. fit
  222. highlight-current-row
  223. style="width: 98%;"
  224. :row-style="rowStyle"
  225. :cell-style="cellStyle"
  226. class="elTable"
  227. row-key="id"
  228. show-summary
  229. :max-height="220"
  230. :summary-method="getSummaries"
  231. @selection-change="handleSelectionChange2"
  232. @cell-dblclick="celldblclick"
  233. >
  234. <el-table-column type="selection" width="50" />
  235. <el-table-column label="序号" align="center" type="index" width="50px" />
  236. <el-table-column label="饲料组" min-width="120px" align="center">
  237. <template slot-scope="scope">
  238. <span v-if="scope.row.groupNoEdit">{{ scope.row.feedgroup }}</span>
  239. <el-input v-if="scope.row.groupEdit" v-model="scope.row.feedgroup" :disabled="scope.row.isGroupDisabled" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:95%;padding:10px 0;" />
  240. </template>
  241. </el-table-column>
  242. <el-table-column label="饲料名称" min-width="120px" align="center">
  243. <template slot-scope="scope">
  244. <span v-if="scope.row.NoEdit">{{ scope.row.fname }}</span>
  245. <el-select v-if="scope.row.Edit" v-model="scope.row.fid" filterable placeholder="" class="filter-item" style="width:95%;padding:10px 0;" @change="(value)=> {changeFname(value, scope.row)}">
  246. <el-option v-for="item in feedNameList" :key="item.id" :label="item.fname" :value="item.id" />
  247. </el-select>
  248. </template>
  249. </el-table-column>
  250. <el-table-column label="重量(KG)" prop="fweight" width="120px" align="center">
  251. <template slot-scope="scope">
  252. <span v-if="scope.row.NoEdit">{{ scope.row.fweight }}</span>
  253. <el-input v-if="scope.row.Edit" v-model="scope.row.fweight" placeholder="重量" step="0.0001" type="number" style="width:95%;padding:10px 0;" />
  254. </template>
  255. </el-table-column>
  256. <el-table-column label="搅拌延时(min)" min-width="80px" align="center">
  257. <template slot-scope="scope">
  258. <span v-if="scope.row.NoEdit">{{ scope.row.autosecond }}</span>
  259. <el-select v-if="scope.row.Edit" v-model="scope.row.autosecond" filterable placeholder="搅拌延时" class="filter-item" style="width:95%;padding:10px 0;">
  260. <el-option v-for="item in mixingDelayList" :key="item.id" :label="item.name" :value="item.id" />
  261. </el-select>
  262. <!-- <div v-if="scope.row.Edit">
  263. <el-input-number v-model="num" style="width:50%;padding:10px 0;dispaly:inline-block;" :controls='false' :precision="2"/>
  264. <span>-</span>
  265. <el-input-number v-model="num" style="width:45%;padding:10px 0;dispaly:inline-block;" :controls='false' :precision="2"/>
  266. </div> -->
  267. </template>
  268. </el-table-column>
  269. <el-table-column v-if="lockCount.isLockCount" label="是否锁定牛头数比例" min-width="80px" align="center">
  270. <template slot-scope="scope">
  271. <span v-if="scope.row.NoEdit && scope.row.islockcount == '0'">否</span>
  272. <span v-if="scope.row.NoEdit && scope.row.islockcount == '1'">是</span>
  273. <el-select v-if="scope.row.Edit" v-model="scope.row.islockcount" placeholder="" class="filter-item" style="width:95%;padding:10px 0;">
  274. <el-option v-for="item in lockBullsList" :key="item.id" :label="item.name" :value="item.id" />
  275. </el-select>
  276. </template>
  277. </el-table-column>
  278. <el-table-column label="顺序" min-width="70px" align="center">
  279. <template slot-scope="scope">
  280. <span v-if="scope.row.NoEdit">{{ scope.row.sort }}</span>
  281. <el-input v-if="scope.row.Edit" v-model="scope.row.sort" step="0.01" type="number" style="width:95%;padding:10px 0;" min-number="0" @blur="blurSort(scope.row)" />
  282. </template>
  283. </el-table-column>
  284. <el-table-column label="操作" align="center" width="120" class-name="small-padding fixed-width" fixed="right">
  285. <template slot-scope="{row}">
  286. <el-button v-if="row.isCreate && isRoleEdit" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="createData2(row)" />
  287. <span v-if="row.isCreate && isRoleEdit" class="centerSpan">|</span>
  288. <el-button v-if="row.isCreate && isRoleEdit" class="minCancel" icon="el-icon-close" @click="createCancel2(row)" />
  289. <el-button v-if="row.isUpdate && isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate2(row)" />
  290. <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
  291. <el-button v-if="row.isUpdate && isRoleEdit" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete2(row)" />
  292. <el-button v-if="row.isUpdateSave && isRoleEdit" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData2(row)" />
  293. <span v-if="row.isUpdateSave && isRoleEdit" class="centerSpan">|</span>
  294. <el-button v-if="row.isUpdateSave && isRoleEdit" class="minCancel" icon="el-icon-close" @click="updateCancel2(row)" />
  295. <span v-if="parseInt(row.preftid)>0 && row.isUpdateSave==false && isRoleEdit" class="centerSpan">|</span>
  296. <el-button v-if="parseInt(row.preftid)>0 && row.isUpdateSave==false && isRoleEdit" icon="el-icon-connection" class="miniSuccess" @click="handleSplitPremix(row)" />
  297. </template>
  298. </el-table-column>
  299. </el-table>
  300. </div>
  301. <div v-else class="table2">
  302. <el-table
  303. id="table2"
  304. ref="mytable2"
  305. :key="table2.tableKey"
  306. v-loading="table2.listLoading"
  307. element-loading-text="给我一点时间"
  308. :data="table2.list"
  309. border
  310. fit
  311. highlight-current-row
  312. style="width: 98%;"
  313. :row-style="rowStyle"
  314. :cell-style="cellStyle"
  315. class="elTable"
  316. row-key="id"
  317. show-summary
  318. :max-height="enlargeHeight"
  319. :summary-method="getSummaries"
  320. @selection-change="handleSelectionChange2"
  321. @cell-dblclick="celldblclick"
  322. >
  323. <el-table-column type="selection" width="50" />
  324. <el-table-column label="序号" align="center" type="index" width="50px" />
  325. <el-table-column label="饲料组" min-width="120px" align="center">
  326. <template slot-scope="scope">
  327. <span v-if="scope.row.groupNoEdit">{{ scope.row.feedgroup }}</span>
  328. <el-input v-if="scope.row.groupEdit" v-model="scope.row.feedgroup" :disabled="scope.row.isGroupDisabled" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:95%;padding:10px 0;" />
  329. </template>
  330. </el-table-column>
  331. <el-table-column label="饲料名称" min-width="120px" align="center">
  332. <template slot-scope="scope">
  333. <span v-if="scope.row.NoEdit">{{ scope.row.fname }}</span>
  334. <el-select v-if="scope.row.Edit" v-model="scope.row.fid" filterable placeholder="" class="filter-item" style="width:95%;padding:10px 0;" @change="(value)=> {changeFname(value, scope.row)}">
  335. <el-option v-for="item in feedNameList" :key="item.id" :label="item.fname" :value="item.id" />
  336. </el-select>
  337. </template>
  338. </el-table-column>
  339. <el-table-column label="重量(KG)" prop="fweight" width="120px" align="center">
  340. <template slot-scope="scope">
  341. <span v-if="scope.row.NoEdit">{{ scope.row.fweight }}</span>
  342. <el-input v-if="scope.row.Edit" v-model="scope.row.fweight" placeholder="重量" step="0.0001" type="number" style="width:95%;padding:10px 0;" />
  343. </template>
  344. </el-table-column>
  345. <el-table-column label="搅拌延时(min)" min-width="80px" align="center">
  346. <template slot-scope="scope">
  347. <span v-if="scope.row.NoEdit">{{ scope.row.autosecond }}</span>
  348. <el-select v-if="scope.row.Edit" v-model="scope.row.autosecond" filterable placeholder="搅拌延时" class="filter-item" style="width:95%;padding:10px 0;">
  349. <el-option v-for="item in mixingDelayList" :key="item.id" :label="item.name" :value="item.id" />
  350. </el-select>
  351. </template>
  352. </el-table-column>
  353. <el-table-column v-if="lockCount.isLockCount" label="是否锁定牛头数比例" min-width="80px" align="center">
  354. <template slot-scope="scope">
  355. <span v-if="scope.row.NoEdit && scope.row.islockcount == '0'">否</span>
  356. <span v-if="scope.row.NoEdit && scope.row.islockcount == '1'">是</span>
  357. <el-select v-if="scope.row.Edit" v-model="scope.row.islockcount" placeholder="" class="filter-item" style="width:95%;padding:10px 0;">
  358. <el-option v-for="item in lockBullsList" :key="item.id" :label="item.name" :value="item.id" />
  359. </el-select>
  360. </template>
  361. </el-table-column>
  362. <el-table-column label="顺序" min-width="70px" align="center">
  363. <template slot-scope="scope">
  364. <span v-if="scope.row.NoEdit">{{ scope.row.sort }}</span>
  365. <el-input v-if="scope.row.Edit" v-model="scope.row.sort" step="0.01" type="number" style="width:95%;padding:10px 0;" min-number="0" @blur="blurSort(scope.row)" />
  366. </template>
  367. </el-table-column>
  368. <el-table-column label="操作" align="center" width="120" class-name="small-padding fixed-width" fixed="right">
  369. <template slot-scope="{row}">
  370. <el-button v-if="row.isCreate && isRoleEdit" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="createData2(row)" />
  371. <span v-if="row.isCreate && isRoleEdit" class="centerSpan">|</span>
  372. <el-button v-if="row.isCreate && isRoleEdit" class="minCancel" icon="el-icon-close" @click="createCancel2(row)" />
  373. <el-button v-if="row.isUpdate && isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate2(row)" />
  374. <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
  375. <el-button v-if="row.isUpdate && isRoleEdit" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete2(row)" />
  376. <el-button v-if="row.isUpdateSave && isRoleEdit" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData2(row)" />
  377. <span v-if="row.isUpdateSave && isRoleEdit" class="centerSpan">|</span>
  378. <el-button v-if="row.isUpdateSave && isRoleEdit" class="minCancel" icon="el-icon-close" @click="updateCancel2(row)" />
  379. <span v-if="parseInt(row.preftid)>0 && row.isUpdateSave==false && isRoleEdit" class="centerSpan">|</span>
  380. <el-button v-if="parseInt(row.preftid)>0 && row.isUpdateSave==false && isRoleEdit" icon="el-icon-connection" class="miniSuccess" @click="handleSplitPremix(row)" />
  381. </template>
  382. </el-table-column>
  383. </el-table>
  384. </div>
  385. </div>
  386. </div>
  387. <!-- 配方模板表 -->
  388. <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="template.dialogFormVisible" :close-on-click-modal="false" width="90%">
  389. <template slot="title">
  390. <div class="avue-crud__dialog__header">
  391. <span class="el-dialog__title">
  392. <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
  393. {{ textMap[template.dialogStatus] }}
  394. </span>
  395. <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
  396. <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
  397. <svg-icon v-else icon-class="fullscreen" />
  398. </div>
  399. </div>
  400. </template>
  401. <div class="dialogMinHeight" style="overflow-y: auto;margin-bottom: 0px;overflow-x: hidden;">
  402. <div ref="templateDialog" class="templateDialog">
  403. <div class="recipeTemplate">
  404. <p>配方模板表</p>
  405. </div>
  406. <div class="operation1">
  407. <el-date-picker v-model="template.table.getdataListParm.parammaps.date" type="date" placeholder="请选择历史记录时间" :clearable="false" style="width: 180px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="changeDate" />
  408. <!-- <el-button class="successBorder" @click="handleApplication">应用</el-button> -->
  409. </div>
  410. <div class="search">
  411. <el-select v-model="template.table.getdataListParm.parammaps.ccname" placeholder="牲畜类别" class="filter-item" clearable>
  412. <el-option v-for="item in livestockTypeList" :key="item.value" :label="item.label" :value="item.label" />
  413. </el-select>
  414. <el-select v-model="template.table.getdataListParm.parammaps.fttype" placeholder="配方类型" class="filter-item" style="width: 120px;" clearable>
  415. <el-option v-for="item in formulaTypeList" :key="item.value" :label="item.label" :value="item.label" />
  416. </el-select>
  417. <el-select v-model="template.table.getdataListParm.parammaps.enable" placeholder="是否启用" class="filter-item" style="margin-left:10px;width: 120px;" clearable>
  418. <el-option v-for="item in enableList" :key="item.id" :label="item.name" :value="item.id" />
  419. </el-select>
  420. <div ref="selectInput" class="filter-item selectInput">
  421. <el-input type="text" name="" value="" placeholder="请点击选择搜索条件" class="Input" />
  422. <i v-if="arrowDown" icon="el-icon-arrow-down" class="el-icon-arrow-down" />
  423. <i v-if="arrowUp" icon="el-icon-arrow-up" class="el-icon-arrow-up" />
  424. <ul v-if="arrowUp" class="selectUl">
  425. <li><a>配方名称</a><el-input v-model="template.table.getdataListParm.parammaps.tname" style="width: 245px;" /></li>
  426. <li><a>备注</a><el-input v-model="template.table.getdataListParm.parammaps.remark" style="width: 245px;" /></li>
  427. <li><a>来源</a><el-input v-model="template.table.getdataListParm.parammaps.source" style="width: 245px;" /></li>
  428. <li>
  429. <div style="float: right;">
  430. <el-button class="downminCancel" @click="arrowUp=false;arrowDown=true;">取消</el-button>
  431. <el-button class="miniPrimary" @click="handleDialogSearch">搜索</el-button>
  432. </div>
  433. </li>
  434. </ul>
  435. </div>
  436. <el-button class="successBorder" @click="handleDialogSearch" style="margin-left:10px;">查询</el-button>
  437. <el-button class="successBorder" @click="handleDialogRefresh" style="margin-left:10px;">重置</el-button>
  438. </div>
  439. <div class="table">
  440. <el-table
  441. :key="template.table.tableKey"
  442. v-loading="template.table.listLoading"
  443. element-loading-text="给我一点时间"
  444. :data="template.table.list"
  445. border
  446. fit
  447. highlight-current-row
  448. style="width: 98%;"
  449. :row-style="rowStyle"
  450. :height="myheight2"
  451. :cell-style="cellStyle"
  452. class="elTable table-fixed"
  453. @row-click="tableRowClickDialog"
  454. >
  455. <el-table-column v-if="template.dialogStatus == 'RecipeRecord'" label="序号" align="center" type="index" width="50px" />
  456. <el-table-column v-else label="序号" align="center" type="index" width="50px">
  457. <template slot-scope="scope">
  458. <span>{{ scope.$index + (template.table.pageNum-1) * template.table.pageSize + 1 }}</span>
  459. </template>
  460. </el-table-column>
  461. <el-table-column label="配方名称" min-width="130px" align="center">
  462. <template slot-scope="scope">
  463. <span>{{ scope.row.tname }}</span>
  464. </template>
  465. </el-table-column>
  466. <el-table-column label="配方编码" min-width="90px" align="center">
  467. <template slot-scope="scope">
  468. <span>{{ scope.row.tcode }}</span>
  469. </template>
  470. </el-table-column>
  471. <el-table-column label="配方颜色" min-width="110px" align="center">
  472. <template slot-scope="scope">
  473. <el-color-picker v-model="scope.row.tcolor" size="mini" :predefine="predefineColors" style="vertical-align: middle;" />
  474. </template>
  475. </el-table-column>
  476. <el-table-column label="牲畜类别" min-width="110px" align="center">
  477. <template slot-scope="scope">
  478. <span>{{ scope.row.ccname }}</span>
  479. </template>
  480. </el-table-column>
  481. <el-table-column label="配方类型" min-width="110px" align="center">
  482. <template slot-scope="scope">
  483. <span>{{ scope.row.fttype }}</span>
  484. </template>
  485. </el-table-column>
  486. <el-table-column label="来源" min-width="90px" align="center">
  487. <template slot-scope="scope">
  488. <span>{{ scope.row.source }}</span>
  489. </template>
  490. </el-table-column>
  491. <el-table-column label="备注" min-width="90px" align="center">
  492. <template slot-scope="scope">
  493. <span>{{ scope.row.remark }}</span>
  494. </template>
  495. </el-table-column>
  496. <el-table-column label="版本号" min-width="90px" align="center">
  497. <template slot-scope="scope">
  498. <span>{{ scope.row.version }}</span>
  499. </template>
  500. </el-table-column>
  501. <el-table-column label="版本时间" min-width="90px" align="center">
  502. <template slot-scope="scope">
  503. <span>{{ scope.row.versiontime }}</span>
  504. </template>
  505. </el-table-column>
  506. <el-table-column label="是否启用" min-width="90px" align="center">
  507. <template slot-scope="scope">
  508. <el-switch v-model="scope.row.enable" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
  509. </template>
  510. </el-table-column>
  511. </el-table>
  512. </div>
  513. </div>
  514. <div v-if="isDetailDialog" id="detailDialog2" ref="detailDialog2" class="detailDialog" style="margin-top: 30px;height: 200px;overflow-y: auto;overflow-x: hidden;">
  515. <div class="recipeTemplate">
  516. <p>配方详情表</p>
  517. </div>
  518. <div class="operation">
  519. <div ref="selectInput2" class="filter-item selectInput">
  520. <el-input type="text" name="" value="" placeholder="请点击选择搜索条件" class="Input" />
  521. <i v-if="arrowDown2" icon="el-icon-arrow-down" class="el-icon-arrow-down" />
  522. <i v-if="arrowUp2" icon="el-icon-arrow-up" class="el-icon-arrow-up" />
  523. <ul v-if="arrowUp2" class="selectUl">
  524. <li>
  525. <a style="width: 130px;">饲料名称</a>
  526. <el-select v-model="template.table2.getdataListParm.parammaps.fname" filterable placeholder="" style="width:245px;">
  527. <el-option v-for="item in feedNameList" :key="item.id" :label="item.fname" :value="item.fname" />
  528. </el-select>
  529. </li>
  530. <li><a style="width: 130px;">饲料组名称</a><el-input v-model="template.table2.getdataListParm.parammaps.feedgroup" style="width: 245px;" /></li>
  531. <li><a style="width: 130px;">重量</a><el-input v-model="template.table2.getdataListParm.parammaps.fweight" style="width: 245px;" /></li>
  532. <li>
  533. <a style="width: 130px;">搅拌延时</a>
  534. <el-select v-model="template.table2.getdataListParm.parammaps.autosecondname" filterable placeholder="" style="width:245px;">
  535. <el-option v-for="item in mixingDelayList" :key="item.id" :label="item.name" :value="item.name" />
  536. </el-select>
  537. </li>
  538. <li>
  539. <a style="width: 130px;">是否锁定牛头数比例</a>
  540. <el-select v-model="template.table2.getdataListParm.parammaps.islockcount" placeholder="" style="width:245px;">
  541. <el-option v-for="item in lockBullsList" :key="item.id" :label="item.name" :value="item.id" />
  542. </el-select>
  543. </li>
  544. <li><a style="width: 130px;">顺序</a><el-input v-model="template.table2.getdataListParm.parammaps.sort" style="width: 245px;" /></li>
  545. <li>
  546. <div style="float: right;">
  547. <el-button class="downminCancel" @click="arrowUp2=false;arrowDown2=true;">取消</el-button>
  548. <el-button class="miniPrimary" @click="handleDialogSearch2">搜索</el-button>
  549. </div>
  550. </li>
  551. </ul>
  552. </div>
  553. <el-button class="successBorder" @click="handleDialogSearch2">查询</el-button>
  554. <el-button class="successBorder" @click="handleDialogRefresh2">重置</el-button>
  555. <el-button class="hide" @click="handleDialogCloseTable2">隐藏</el-button>
  556. </div>
  557. <div class="table2">
  558. <el-table
  559. id="templateTable2"
  560. :key="template.table2.tableKey"
  561. v-loading="template.table2.listLoading"
  562. element-loading-text="给我一点时间"
  563. :data="template.table2.list"
  564. border
  565. fit
  566. highlight-current-row
  567. style="width: 98%;"
  568. :summary-method="getTemplateTable2Summaries"
  569. show-summary
  570. :row-style="rowStyle"
  571. :cell-style="cellStyle"
  572. class="elTable table-fixed"
  573. row-key="id"
  574. >
  575. <el-table-column label="饲料组" min-width="130px" align="center">
  576. <template slot-scope="scope">
  577. <span>{{ scope.row.feedgroup }}</span>
  578. </template>
  579. </el-table-column>
  580. <el-table-column label="饲料名称" min-width="130px" align="center">
  581. <template slot-scope="scope">
  582. <span>{{ scope.row.fname }}</span>
  583. </template>
  584. </el-table-column>
  585. <el-table-column label="重量(KG)" prop="fweight" min-width="200px" align="center">
  586. <template slot-scope="scope">
  587. <span>{{ scope.row.fweight }}</span>
  588. </template>
  589. </el-table-column>
  590. <el-table-column label="搅拌延时(min)" min-width="130px" align="center">
  591. <template slot-scope="scope">
  592. <span>{{ scope.row.autosecondname }}</span>
  593. </template>
  594. </el-table-column>
  595. <el-table-column label="是否锁定牛头数比例" min-width="130px" align="center">
  596. <template slot-scope="scope">
  597. <span v-if="scope.row.islockcount == '0'">否</span>
  598. <span v-if="scope.row.islockcount == '1'">是</span>
  599. </template>
  600. </el-table-column>
  601. <el-table-column label="顺序" min-width="130px" align="center">
  602. <template slot-scope="scope">
  603. <span>{{ scope.row.sort }}</span>
  604. </template>
  605. </el-table-column>
  606. </el-table>
  607. </div>
  608. </div>
  609. </div>
  610. <div slot="footer" class="dialog-footer">
  611. <el-button class="cancelClose cancelClose1" @click="template.dialogFormVisible = false; ">关闭</el-button>
  612. </div>
  613. </el-dialog>
  614. <!-- 合成预混料 -->
  615. <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="detail.dialogFormVisible" :close-on-click-modal="false" width="90%">
  616. <template slot="title">
  617. <div class="avue-crud__dialog__header">
  618. <span class="el-dialog__title">
  619. <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
  620. {{ textMap[detail.dialogStatus] }}
  621. </span>
  622. <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
  623. <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
  624. <svg-icon v-else icon-class="fullscreen" />
  625. </div>
  626. </div>
  627. </template>
  628. <div class="detailDialog">
  629. <h2>饲料</h2>
  630. <div class="table1">
  631. <el-table
  632. :key="detail.tableKey"
  633. v-loading="detail.listLoading"
  634. element-loading-text="给我一点时间"
  635. :data="detail.list"
  636. fit
  637. highlight-current-row
  638. style="width: 100%;"
  639. :row-style="rowStyle"
  640. :cell-style="cellStyle"
  641. class="elTable table-fixed"
  642. show-summary
  643. >
  644. <el-table-column label="序号" align="center" type="index" width="50px" />
  645. <el-table-column label="饲料名称" min-width="130px" align="center">
  646. <template slot-scope="scope">
  647. <span>{{ scope.row.fname }}</span>
  648. </template>
  649. </el-table-column>
  650. <el-table-column prop="fweight" label="重量(KG)" />
  651. <el-table-column label="搅拌延时(min)" min-width="110px" align="center">
  652. <template slot-scope="scope">
  653. <span>{{ scope.row.autosecond }}</span>
  654. </template>
  655. </el-table-column>
  656. <el-table-column v-if="lockCount.isLockCount" label="是否锁定牛头数比例" min-width="130px" align="center">
  657. <template slot-scope="scope">
  658. <span v-if="scope.row.islockcount == '0'">否</span>
  659. <span v-if="scope.row.islockcount == '1'">是</span>
  660. </template>
  661. </el-table-column>
  662. <el-table-column label="顺序" min-width="110px" align="center">
  663. <template slot-scope="scope">
  664. <span>{{ scope.row.sort }}</span>
  665. </template>
  666. </el-table-column>
  667. </el-table>
  668. </div>
  669. <h2>合成预混料</h2>
  670. <div class="table2" style="margin-bottom: 50px;">
  671. <el-table
  672. :key="detail.tableKey2"
  673. v-loading="detail.listLoading2"
  674. element-loading-text="给我一点时间"
  675. :data="detail.list2"
  676. border
  677. fit
  678. highlight-current-row
  679. style="width: 100%;"
  680. :row-style="rowStyle"
  681. :cell-style="cellStyle"
  682. class="elTable table-fixed"
  683. >
  684. <el-table-column label="配方名称" min-width="130px" align="center">
  685. <template slot-scope="scope">
  686. <el-input v-model="scope.row.tname" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:95%;padding:10px 0;" :disabled="detail.disabled" />
  687. </template>
  688. </el-table-column>
  689. <el-table-column label="配方颜色" min-width="130px" align="center">
  690. <template slot-scope="scope">
  691. <el-color-picker v-model="scope.row.tcolor" size="mini" :predefine="predefineColors" style="vertical-align: middle;" :disabled="detail.disabled" />
  692. </template>
  693. </el-table-column>
  694. <el-table-column label="牲畜类别" min-width="130px" align="center">
  695. <template slot-scope="scope">
  696. <el-select v-model="scope.row.ccid" placeholder="选择牲畜父类" class="filter-item" style="width:95%;padding:10px 0;" :disabled="detail.disabled" @change="changeLivestockType2">
  697. <el-option v-for="item in livestockTypeList" :key="item.value" :label="item.label" :value="item.value" />
  698. </el-select>
  699. </template>
  700. </el-table-column>
  701. <el-table-column label="配方类型" min-width="110px" align="center">
  702. <template slot-scope="scope">
  703. <span>{{ scope.row.fttype }}</span>
  704. </template>
  705. </el-table-column>
  706. <el-table-column label="来源" min-width="110px" align="center">
  707. <template slot-scope="scope">
  708. <span>{{ scope.row.source }}</span>
  709. </template>
  710. </el-table-column>
  711. <el-table-column label="备注" min-width="130px" align="center">
  712. <template slot-scope="scope">
  713. <el-input v-model="scope.row.remark" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:95%;padding:10px 0;" :disabled="detail.disabled" />
  714. </template>
  715. </el-table-column>
  716. <el-table-column label="是否启用" min-width="130px" align="center">
  717. <template slot-scope="scope">
  718. <el-switch v-model="scope.row.enable" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" :disabled="detail.disabled" />
  719. </template>
  720. </el-table-column>
  721. </el-table>
  722. </div>
  723. <div slot="footer" class="dialog-footer">
  724. <el-button class="cancelClose" @click="detail.dialogFormVisible = false; ">关闭</el-button>
  725. <el-button class="save" :disabled="isokDisable" @click="syntheticPremixData()">确认</el-button>
  726. </div>
  727. </div>
  728. </el-dialog>
  729. <!-- 历史记录 -->
  730. <el-dialog :title="textMap[historyRecord.dialogStatus]" :destroy-on-close="true" :visible.sync="historyRecord.dialogFormVisible" :close-on-click-modal="false" width="90%">
  731. <div class="historyRecord">
  732. <keep-alive>
  733. <component :is="historyRecord.myComponent" ref="historyRecord" />
  734. </keep-alive>
  735. </div>
  736. <div slot="footer" class="dialog-footer" style="bottom: 10px;">
  737. <el-button class="cancelClose1" @click="historyRecord.dialogFormVisible = false; ">关闭</el-button>
  738. </div>
  739. </el-dialog>
  740. <!-- 行内配方记录 -->
  741. <el-dialog :title="textMap[rowRecipeRecord.dialogStatus]" :destroy-on-close="true" :visible.sync="rowRecipeRecord.dialogFormVisible" :close-on-click-modal="false" width="90%">
  742. <div class="rowRecipeRecord">
  743. <div class="search">
  744. <el-date-picker ref="inputDatetime" v-model="rowRecipeRecord.getdataListParm.parammaps.inputDatetime" class="filter-item inputDatetime" type="daterange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
  745. <el-button class="successBorder" @click="handleRowRecipeRecordSearch">查询</el-button>
  746. </div>
  747. <div class="table">
  748. <el-table
  749. :key="rowRecipeRecord.tableKey"
  750. v-loading="rowRecipeRecord.listLoading"
  751. element-loading-text="给我一点时间"
  752. :data="rowRecipeRecord.list"
  753. border
  754. highlight-current-row
  755. style="width: 100%;"
  756. :row-style="rowStyle"
  757. :cell-style="cellStyle"
  758. class="elTable table-fixed"
  759. >
  760. <el-table-column label="序号" align="center" type="index" width="50px">
  761. <template slot-scope="scope">
  762. <span>{{ scope.$index + (rowRecipeRecord.pageNum-1) * rowRecipeRecord.pageSize + 1 }}</span>
  763. </template>
  764. </el-table-column>
  765. <!-- <el-table-column label="序号" width="60px" align="center" prop="sort" /> -->
  766. <el-table-column label="修改时间" width="100px" align="center" prop="datetime1" />
  767. <el-table-column label="饲料名称(单位:kg)" min-width="800px" align="center">
  768. <template slot-scope="scope">
  769. <div v-for="element in scope.row.arrList" :key="element.name" class="list-group-item2 item" style="width:150px;float: left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin: 5px 5px;padding: 0;height: 30px;">
  770. <el-tooltip v-if="element.change== 'red'" placement="top" :open-delay="1000">
  771. <div slot="content">{{ element.name }}( {{ element.weight }} / {{ element.Eweight }} )</div>
  772. <span :style="{'color':element.change}" style="display: block;height:30px;line-height: 30px;">
  773. {{ element.name }}( {{ element.weight }} / {{ element.Eweight }} )
  774. </span>
  775. </el-tooltip>
  776. <el-tooltip v-else placement="top" :open-delay="1000">
  777. <div slot="content">{{ element.name }}( {{ element.weight }})</div>
  778. <span :style="{'color':element.change}" style="display: block;height:30px;line-height: 30px;">
  779. {{ element.name }}( {{ element.weight }})
  780. </span>
  781. </el-tooltip>
  782. </div>
  783. </template>
  784. </el-table-column>
  785. </el-table>
  786. <pagination v-show="rowRecipeRecord.total>=0" :total="rowRecipeRecord.total" :page.sync="rowRecipeRecord.getdataListParm.offset" :limit.sync="rowRecipeRecord.getdataListParm.pagecount" @pagination="getRowRecipeRecordList()" />
  787. </div>
  788. </div>
  789. <div slot="footer" class="dialog-footer" style="bottom: 10px;">
  790. <el-button class="cancelClose1" @click="rowRecipeRecord.dialogFormVisible = false; ">关闭</el-button>
  791. </div>
  792. </el-dialog>
  793. </div>
  794. </template>
  795. <script>
  796. import { GetDataByName, GetDataByNames, PostDataByName, failproccess, checkButtons, postJson, ExecDataByConfig, formatNum } from '@/api/common'
  797. import Sortable from 'sortablejs'
  798. import { MessageBox } from 'element-ui'
  799. import Cookies from 'js-cookie'
  800. import { json2excel } from '@/utils/index.js'
  801. import axios from 'axios'
  802. import { getToken } from '@/utils/auth'
  803. import { parseTime } from '@/utils/index.js'
  804. import Pagination from '@/components/Pagination'
  805. export default {
  806. name: 'RecipeTemplate',
  807. components: { Pagination },
  808. data() {
  809. return {
  810. dialogFull: false,
  811. predefineColors: [
  812. '#E57373', '#F06292', '#BA68C8', '#9575CD', '#7986CB', '#64B5F6', '#4FC3F7', '#4DD0E1', '#4DB6AC', '#81C784', '#AED581', '#DCE775', '#FFF176', '#FFD54F', '#FFB74D', '#FF8A65', '#A1887F', '#E0E0E0', '#90A4AE'
  813. ],
  814. isRoleEdit: [],
  815. myheight: document.documentElement.clientHeight - 265,
  816. requestParams: [
  817. { name: 'getDictByName', offset: 0, pagecount: 0, params: ['牲畜父类'] },
  818. { name: 'getDictByName2', offset: 0, pagecount: 0, params: ['配方类型'] },
  819. { name: 'getFeedAndPre', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }}
  820. ],
  821. enableList: [{ id: '0', name: '否' }, { id: '1', name: '是' }], // 是否启用
  822. lockBullsList: [{ id: '0', name: '否' }, { id: '1', name: '是' }], // 是否锁定牛头数比例
  823. livestockTypeList: [], // 牲畜类别
  824. formulaTypeList: [], // 配方类型
  825. feedNameList: [], // 饲料名称
  826. mixingDelayList: [{ id: '0', name: '0' }, { id: '1', name: '1' }, { id: '2', name: '2' }, { id: '3', name: '3' }, { id: '4', name: '4' }, { id: '5', name: '5' }, { id: '6', name: '6' }, { id: '7', name: '7' }, { id: '8', name: '8' }, { id: '9', name: '9' }, { id: '10', name: '10' }, { id: '11', name: '11' }, { id: '12', name: '12' }, { id: '13', name: '13' }, { id: '14', name: '14' }, { id: '15', name: '15' }], // 搅拌延时
  827. selectHistoryTimeList: [{ id: 0, name: '2020-06-10' }, { id: 1, name: '2020-06-11' }, { id: 2, name: '2020-06-12' }, { id: 3, name: '2020-06-13' }], // 请选择历史记录时间
  828. arrowDown: true,
  829. arrowUp: false,
  830. ispastureuse: Cookies.get('ispastureuse'),
  831. table: {
  832. getdataListParm: {
  833. name: 'getFTList',
  834. page: 1,
  835. offset: 1,
  836. pagecount: '',
  837. returntype: 'Map',
  838. parammaps: {
  839. pastureid: Cookies.get('pastureid'),
  840. tname: '',
  841. ccid: '',
  842. ccname: '',
  843. fttypeid: '',
  844. fttype: '',
  845. remark: '',
  846. enable: '',
  847. source: ''
  848. }
  849. },
  850. tableKey: 0,
  851. list: [],
  852. total: 0,
  853. listLoading: true,
  854. temp: {}
  855. },
  856. lockCount: {
  857. getdataListParm: {
  858. name: 'getSysoptEnable',
  859. page: 1,
  860. offset: 1,
  861. pagecount: 30,
  862. returntype: 'Map',
  863. parammaps: {
  864. pastureid: Cookies.get('pastureid'),
  865. inforname: 'isLockCount'
  866. }
  867. },
  868. isLockCount: false // 是否显示是否锁定牛头数比例
  869. },
  870. isDetail: false,
  871. arrowDown2: true,
  872. arrowUp2: false,
  873. table2: {
  874. getDryweightParm: {
  875. name: 'getFTdryweight',
  876. page: 1,
  877. offset: 1,
  878. pagecount: 10,
  879. returntype: 'Map',
  880. parammaps: {
  881. pastureid: '',
  882. ftid: ''
  883. }
  884. },
  885. dryweight: '',
  886. getdataListParm: {
  887. name: 'getFTdetailList',
  888. page: 1,
  889. offset: 1,
  890. pagecount: '',
  891. returntype: 'Map',
  892. parammaps: {
  893. pastureid: Cookies.get('pastureid'),
  894. fname: '',
  895. feedgroup: '',
  896. fweight: '',
  897. autosecondname: '',
  898. islockcount: '',
  899. sort: ''
  900. }
  901. },
  902. tableKey: 0,
  903. list: [],
  904. total: 0,
  905. listLoading: true,
  906. temp: {},
  907. updateList: {}
  908. },
  909. isDetailDialog: false,
  910. template: {
  911. dialogFormVisible: false,
  912. dialogStatus: '',
  913. table: {
  914. getdataListParm: {
  915. name: 'getFTListDate',
  916. page: 1,
  917. offset: 1,
  918. pagecount: '',
  919. returntype: 'Map',
  920. parammaps: {
  921. pastureid: Cookies.get('pastureid'),
  922. tname: '',
  923. ccid: '',
  924. ccname: '',
  925. fttype: '',
  926. remark: '',
  927. enable: '',
  928. date: '',
  929. source: ''
  930. }
  931. },
  932. tableKey: 0,
  933. total: 0,
  934. listLoading: true,
  935. list: []
  936. },
  937. table2: {
  938. getdataListParm: {
  939. name: 'getFTdetailListDate',
  940. page: 1,
  941. offset: 1,
  942. pagecount: 10,
  943. returntype: 'Map',
  944. parammaps: {
  945. pastureid: Cookies.get('pastureid'),
  946. fname: '',
  947. fweight: '',
  948. islockcount: '',
  949. sort: '',
  950. feedgroup: '',
  951. autosecondname: ''
  952. }
  953. },
  954. tableKey: 0,
  955. total: 0,
  956. listLoading: true,
  957. list: []
  958. },
  959. // 历史日期
  960. getdataDateParm: {
  961. name: 'getFTMaxDate',
  962. page: 1,
  963. offset: 1,
  964. pagecount: 10,
  965. returntype: 'Map',
  966. parammaps: {
  967. pastureid: Cookies.get('pastureid')
  968. }
  969. }
  970. },
  971. isOrder: true,
  972. detail: {
  973. dialogFormVisible: false,
  974. dialogStatus: '',
  975. tableKey: 0,
  976. total: 0,
  977. listLoading: true,
  978. list: [],
  979. tableKey2: 0,
  980. total2: 0,
  981. listLoading2: false,
  982. list2: [{ tname: '', tcolor: '#ccc', ccid: '', fttype: '预混配方', fttypeid: '2', source: '自定义', remark: '', 'enable': 1 }],
  983. getdataListParm: {
  984. name: 'getFTDetailCompare',
  985. page: 1,
  986. offset: 1,
  987. pagecount: 10,
  988. returntype: 'Map',
  989. parammaps: {}
  990. },
  991. list3: [],
  992. disabled: false,
  993. getdataListParm2: {
  994. name: 'getFTCompare',
  995. page: 1,
  996. offset: 1,
  997. pagecount: 10,
  998. returntype: 'Map',
  999. parammaps: {}
  1000. }
  1001. },
  1002. selectList: [],
  1003. selectList2: [],
  1004. textMap: {
  1005. RecipeRecord: '配方记录',
  1006. SyntheticPremix: '合成预混料',
  1007. historyRecord: '历史记录',
  1008. detail: '饲料详情',
  1009. rowRecipeRecordTxt: '配方修改记录'
  1010. },
  1011. requestParam: {},
  1012. requestParam2: {},
  1013. download: {
  1014. getdataListParm: {
  1015. name: 'getFTList',
  1016. page: 1,
  1017. offset: 1,
  1018. pagecount: 0,
  1019. returntype: 'Map',
  1020. parammaps: {
  1021. pastureid: Cookies.get('pastureid'),
  1022. tname: '',
  1023. ccid: '',
  1024. ccname: '',
  1025. fttypeid: '',
  1026. fttype: '',
  1027. remark: '',
  1028. enable: ''
  1029. }
  1030. },
  1031. list: []
  1032. },
  1033. historyRecord: {
  1034. dialogStatus: '',
  1035. dialogFormVisible: false
  1036. },
  1037. isokDisable: false,
  1038. rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
  1039. cellStyle: { padding: 0 + 'px' },
  1040. dropState: false,
  1041. myheight2: 0,
  1042. height: 0,
  1043. rowRecipeRecord: {
  1044. dialogStatus: '',
  1045. dialogFormVisible: false,
  1046. getdataListParm: {
  1047. name: 'getFitHistory1', 'name1': 'getFitHistory2', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
  1048. parammaps: { inputDatetime: '', pastureid: '', fitid: '' }
  1049. },
  1050. tableKey: 0, total: 0, listLoading: true, list: []
  1051. },
  1052. isEnlarge: true,
  1053. // enlargeHeight: document.documentElement.clientHeight - 85 - 165 + 50,
  1054. enlargeHeight: document.documentElement.clientHeight - 85 - 165 + 50,
  1055. getTcodeParm: {
  1056. name: 'getTcode', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
  1057. parammaps: { pastureid: '', fttypeid: '' }
  1058. },
  1059. sourceList: [{ id: '0', name: '自定义' }, { id: '1', name: '集团下发未调整' }, { id: '2', name: '集团下发有调整' }, { id: '3', name: '导入' }]
  1060. }
  1061. },
  1062. computed: {
  1063. // 设置请求头
  1064. headers() {
  1065. return {
  1066. token: getToken()
  1067. }
  1068. },
  1069. uploadData() {
  1070. return {
  1071. name: 'checkfttype,checkbigcowclass,checkFeed,insertFTUpload,insertFTdetailUpload',
  1072. importParams: '配方名称,牲畜类别,配方类型,备注,饲料组,饲料名称,重量(kg),搅拌延时(min),是否锁定牛头数比例',
  1073. sheetname: 'Sheet1',
  1074. // 登录牧场
  1075. pastureid: Cookies.get('pastureid'),
  1076. // 日期参数
  1077. dateParams: '',
  1078. // 必填参数
  1079. requiredParams: '配方名称,牲畜类别,配方类型,饲料名称,重量(kg),搅拌延时(min),是否锁定牛头数比例',
  1080. // 为数值的参数
  1081. numParams: '重量(kg),搅拌延时(min)'
  1082. }
  1083. },
  1084. // 设置上传地址
  1085. uploadExcelUrl() {
  1086. return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
  1087. }
  1088. },
  1089. mounted() {
  1090. document.addEventListener('click', (e) => {
  1091. if (this.$refs.selectInput !== undefined) {
  1092. if (!this.$refs.selectInput.contains(e.target)) {
  1093. this.arrowDown = true
  1094. this.arrowUp = false
  1095. } else {
  1096. this.arrowDown = false
  1097. this.arrowUp = true
  1098. }
  1099. }
  1100. if (this.$refs.selectInput2 !== undefined) {
  1101. if (!this.$refs.selectInput2.contains(e.target)) {
  1102. this.arrowDown2 = true
  1103. this.arrowUp2 = false
  1104. } else {
  1105. this.arrowDown2 = false
  1106. this.arrowUp2 = true
  1107. }
  1108. }
  1109. })
  1110. },
  1111. created() {
  1112. this.getList()
  1113. this.getButtons()
  1114. this.getDownList()
  1115. this.getIsLockCount()
  1116. },
  1117. methods: {
  1118. getButtons() {
  1119. const Edit = 'FormulationEvaluation'
  1120. const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
  1121. this.isRoleEdit = isRoleEdit
  1122. },
  1123. getSummaries(param) {
  1124. const { columns, data } = param
  1125. const sums = []
  1126. columns.forEach((column, index) => {
  1127. if (index === 0) {
  1128. sums[index] = '合计'
  1129. return
  1130. }
  1131. if (column.property !== undefined) {
  1132. // 加了prop属性的el-table-column 才能找到column.property
  1133. const values = data.map(item => Number(item[column.property]))
  1134. if (!values.every(value => isNaN(value))) {
  1135. sums[index] = values.reduce((prev, curr) => {
  1136. const value = Number(curr)
  1137. if (!isNaN(value)) {
  1138. return prev + curr // 多行相加
  1139. } else {
  1140. return prev
  1141. }
  1142. }, 0)
  1143. sums[index] = sums[index].toFixed(4) + '(干物质量:' + this.table2.dryweight + ')'
  1144. } else {
  1145. sums[index] = ''
  1146. }
  1147. }
  1148. })
  1149. // console.log(sums, 'sums[index]')
  1150. return sums
  1151. },
  1152. getDryWeight() {
  1153. GetDataByName(this.table2.getDryweightParm).then(response => {
  1154. console.log('干物质数据', response.data.list)
  1155. if (response.data.list[0].dryweight !== undefined) {
  1156. this.table2.dryweight = response.data.list[0].dryweight
  1157. } else {
  1158. this.table2.dryweight = ''
  1159. }
  1160. })
  1161. },
  1162. getTemplateTable2Summaries(param) {
  1163. const { columns, data } = param
  1164. const sums = []
  1165. columns.forEach((column, index) => {
  1166. if (index === 0) {
  1167. sums[index] = '合计'
  1168. return
  1169. }
  1170. const values = data.map(item => Number(item[column.property]))
  1171. if (!values.every(value => isNaN(value))) {
  1172. sums[index] = values.reduce((prev, curr) => {
  1173. const value = Number(curr)
  1174. if (!isNaN(value)) {
  1175. return prev + curr
  1176. } else {
  1177. return prev
  1178. }
  1179. }, 0)
  1180. // 后台待发
  1181. sums[index] += '(干物质量:' + this.template.table2.getdataListParm.parammaps.dryweight + ')'
  1182. } else {
  1183. sums[index] = ''
  1184. }
  1185. })
  1186. return sums
  1187. },
  1188. getDownList() {
  1189. GetDataByNames(this.requestParams).then(response => {
  1190. this.livestockTypeList = response.data.getDictByName.list
  1191. this.formulaTypeList = response.data.getDictByName2.list
  1192. this.feedNameList = response.data.getFeedAndPre.list
  1193. })
  1194. },
  1195. // -------------------模板-----------------------------
  1196. getList() {
  1197. this.table.listLoading = true
  1198. GetDataByName(this.table.getdataListParm).then(response => {
  1199. console.log('配方模板table数据', response.data.list)
  1200. if (response.data.list !== null) {
  1201. for (let i = 0; i < response.data.list.length; i++) {
  1202. this.$set(response.data.list[i], 'Edit', false) // 编辑
  1203. this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
  1204. this.$set(response.data.list[i], 'isCreate', false) // 新增操作
  1205. this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
  1206. this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
  1207. }
  1208. this.table.list = response.data.list
  1209. this.table.pageNum = response.data.pageNum
  1210. this.table.pageSize = response.data.pageSize
  1211. this.table.total = response.data.total
  1212. } else {
  1213. this.table.list = []
  1214. this.isDetail = false
  1215. }
  1216. setTimeout(() => {
  1217. this.table.listLoading = false
  1218. }, 100)
  1219. })
  1220. },
  1221. getList3() {
  1222. this.table.listLoading = true
  1223. GetDataByName(this.table.getdataListParm).then(response => {
  1224. console.log('table数据', response.data.list)
  1225. if (response.data.list !== null) {
  1226. for (let i = 0; i < response.data.list.length; i++) {
  1227. this.$set(response.data.list[i], 'Edit', false) // 编辑
  1228. this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
  1229. this.$set(response.data.list[i], 'isCreate', false) // 新增操作
  1230. this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
  1231. this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
  1232. }
  1233. this.table.list = response.data.list
  1234. this.table.pageNum = response.data.pageNum
  1235. this.table.pageSize = response.data.pageSize
  1236. this.table.total = response.data.total
  1237. } else {
  1238. this.table.list = []
  1239. this.isDetail = false
  1240. }
  1241. setTimeout(() => {
  1242. this.table.listLoading = false
  1243. }, 100)
  1244. })
  1245. },
  1246. handleSearch() {
  1247. console.log('点击了查询')
  1248. this.table.getdataListParm.offset = 1
  1249. this.getList()
  1250. this.table.getdataListParm.parammaps.all = ''
  1251. var obj = {}
  1252. obj.tname = this.table.getdataListParm.parammaps.tname
  1253. obj.remark = this.table.getdataListParm.parammaps.remark
  1254. // obj.source = this.table.getdataListParm.parammaps.source
  1255. Object.getOwnPropertyNames(obj).forEach((key) => {
  1256. console.log(key, obj[key])
  1257. if (obj[key] !== '') {
  1258. this.table.getdataListParm.parammaps.all += obj[key] + '/'
  1259. }
  1260. })
  1261. if (this.table.getdataListParm.parammaps.all.charAt(this.table.getdataListParm.parammaps.all.length - 1) == '/') {
  1262. this.table.getdataListParm.parammaps.all = this.table.getdataListParm.parammaps.all.slice(0, this.table.getdataListParm.parammaps.all.length - 1)
  1263. }
  1264. this.arrowDown = true
  1265. this.arrowUp = false
  1266. },
  1267. handleRefresh() {
  1268. console.log('点击了重置')
  1269. this.table.getdataListParm.offset = 1
  1270. this.table.getdataListParm.parammaps.ccid = ''
  1271. this.table.getdataListParm.parammaps.ccname = ''
  1272. this.table.getdataListParm.parammaps.fttype = ''
  1273. this.table.getdataListParm.parammaps.tname = ''
  1274. this.table.getdataListParm.parammaps.remark = ''
  1275. this.table.getdataListParm.parammaps.enable = ''
  1276. this.table.getdataListParm.parammaps.source = ''
  1277. this.table.getdataListParm.parammaps.all = ''
  1278. this.getList()
  1279. },
  1280. // 模板新增
  1281. handleCreate() {
  1282. // 编辑true/不可编辑false
  1283. // 新增操true,编辑false,编辑保存false
  1284. for (let i = 0; i < this.table.list.length; i++) {
  1285. if (this.table.list[i].Edit === true) {
  1286. this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
  1287. return false
  1288. }
  1289. }
  1290. this.table.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'enable': 1, 'tname': '', tcode: '', 'tcolor': '#ccc', 'ccid': '', 'ccname': '', 'fttype': '', 'fttypeid': '', 'source': '自定义', 'remark': '' })
  1291. console.log('点击了新增this.table.list====>', this.table.list)
  1292. this.table.temp = this.table.list[0]
  1293. this.getTcodeList()
  1294. },
  1295. getTcodeList() {
  1296. this.getTcodeParm.parammaps.pastureid = Cookies.get('pastureid')
  1297. console.log(this.table.temp, 'this.table.temp')
  1298. GetDataByName(this.getTcodeParm).then(response => {
  1299. if (response.data.list !== null) {
  1300. this.table.temp.tcode = response.data.list[0].tcode
  1301. } else {
  1302. this.table.temp.tcode = ''
  1303. }
  1304. })
  1305. },
  1306. // 畜生类别
  1307. changeLivestockType(item) {
  1308. this.table.temp.ccname = this.livestockTypeList.find(obj => obj.value === item).label
  1309. },
  1310. // 配方类型
  1311. changeFormulaType(item) {
  1312. this.table.temp.fttype = this.formulaTypeList.find(obj => obj.value === item).label
  1313. },
  1314. createData(row) {
  1315. console.log('点击了新增保存', row)
  1316. this.table.temp.tname = row.tname
  1317. this.table.temp.tcode = row.tcode
  1318. this.table.temp.tcolor = row.tcolor
  1319. this.table.temp.ccid = row.ccid
  1320. this.table.temp.ccname = this.table.temp.ccname
  1321. this.table.temp.fttype = this.table.temp.fttype
  1322. this.table.temp.fttypeid = row.fttypeid
  1323. this.table.temp.source = row.source
  1324. this.table.temp.remark = row.remark
  1325. this.table.temp.enable = row.enable
  1326. this.table.temp.pastureid = Cookies.get('pastureid')
  1327. if (this.table.temp.tname == '' && this.table.temp.ccid == '' && this.table.temp.fttypeid == '') {
  1328. this.$message({ type: 'error', message: '配方名称/牲畜类别/配方类型不能为空', duration: 2000 })
  1329. return false
  1330. } else if (this.table.temp.ccid == '' && this.table.temp.fttypeid == '') {
  1331. this.$message({ type: 'error', message: '牲畜类别/配方类型不能为空', duration: 2000 })
  1332. return false
  1333. } else if (this.table.temp.tname == '') {
  1334. this.$message({ type: 'error', message: '配方名称不能为空', duration: 2000 })
  1335. return false
  1336. } else if (this.table.temp.ccid == '') {
  1337. this.$message({ type: 'error', message: '牲畜类别不能为空', duration: 2000 })
  1338. return false
  1339. } else if (this.table.temp.fttypeid == '') {
  1340. this.$message({ type: 'error', message: '配方类型不能为空', duration: 2000 })
  1341. return false
  1342. }
  1343. const pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]")
  1344. // if (pattern.test(this.table.temp.tname)) {
  1345. // this.$message({ type: 'error', message: '配方名称不可输入特殊字符', duration: 2000 })
  1346. // return false
  1347. // }
  1348. if (pattern.test(this.table.temp.tcode)) {
  1349. this.$message({ type: 'error', message: '配方编码不可输入特殊字符', duration: 2000 })
  1350. return false
  1351. }
  1352. console.log(this.table.temp)
  1353. this.isokDisable = true
  1354. setTimeout(() => {
  1355. this.isokDisable = false
  1356. }, 1000)
  1357. this.requestParam2.name = 'checkNumber'
  1358. this.requestParam2.parammaps = {}
  1359. this.requestParam2.parammaps.number = this.table.temp.tcode
  1360. GetDataByName(this.requestParam2).then(response => {
  1361. console.log('table数据', response.data.list)
  1362. if (response.data.list[0].vmsg !== '输入非法字符') {
  1363. this.saveCreateData()
  1364. } else {
  1365. this.$notify({ type: 'error', message: '配方编码不可输入特殊字符', duration: 2000 })
  1366. }
  1367. })
  1368. },
  1369. saveCreateData() {
  1370. this.requestParam.name = 'insertFT'
  1371. this.requestParam.parammaps = this.table.temp
  1372. PostDataByName(this.requestParam).then(response => {
  1373. console.log('新增保存发送参数', this.requestParam)
  1374. if (response.msg !== 'fail') {
  1375. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  1376. this.getList()
  1377. let data = {}
  1378. data.name = 'insertFeedtemplethistory'
  1379. data.parammaps = this.table.temp
  1380. PostDataByName(data).then(response => {
  1381. if (response.msg !== 'fail') {
  1382. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  1383. this.getList()
  1384. } else {
  1385. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1386. }
  1387. })
  1388. } else {
  1389. const isRepeat = new RegExp('Duplicate entry :feedtemplet.tCode')
  1390. if (isRepeat.test(response.data)) {
  1391. this.$notify({ type: 'error', message: '配方编码不可重复,请重新录入', duration: 2000 })
  1392. } else {
  1393. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1394. }
  1395. }
  1396. })
  1397. },
  1398. createCancel(row) {
  1399. console.log('点击了新增取消')
  1400. for (let i = 0; i < this.table.list.length; i++) {
  1401. if (row.myId === this.table.list[i].myId) {
  1402. var listIndex = this.table.list.indexOf(this.table.list[i])
  1403. }
  1404. if (listIndex > -1) {
  1405. this.table.list.splice(listIndex, 1)
  1406. return
  1407. }
  1408. }
  1409. },
  1410. // 模板编辑
  1411. handleUpdate(row) {
  1412. for (let i = 0; i < this.table.list.length; i++) {
  1413. if (this.table.list[i].Edit == true) {
  1414. this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
  1415. return false
  1416. }
  1417. }
  1418. // 编辑true,不可编辑false
  1419. row.Edit = true
  1420. row.NoEdit = false
  1421. // 新增false,编辑false,编辑保存true
  1422. row.isCreate = false
  1423. row.isUpdate = false
  1424. row.isUpdateSave = true
  1425. if (row.ccname !== undefined) {
  1426. row.ccid = String(row.ccid)
  1427. }
  1428. this.table.temp.ccname = row.ccname
  1429. row.fttypeid = String(row.fttypeid)
  1430. this.table.temp.fttype = row.fttype
  1431. },
  1432. updateData(row) {
  1433. console.log('点击了编辑保存', row)
  1434. this.table.temp.tname = row.tname
  1435. this.table.temp.tcode = row.tcode
  1436. this.table.temp.tcolor = row.tcolor
  1437. this.table.temp.ccid = row.ccid
  1438. this.table.temp.fttypeid = row.fttypeid
  1439. this.table.temp.source = row.source
  1440. this.table.temp.remark = row.remark
  1441. this.table.temp.enable = row.enable
  1442. this.table.temp.ccname = this.table.temp.ccname
  1443. this.table.temp.fttype = this.table.temp.fttype
  1444. this.table.temp.pastureid = row.pastureid
  1445. this.table.temp.id = row.id
  1446. if (this.table.temp.tname == '' && this.table.temp.ccid == '' && this.table.temp.fttypeid == '') {
  1447. this.$message({ type: 'error', message: '配方名称/牲畜类别/配方类型不能为空', duration: 2000 })
  1448. return false
  1449. } else if (this.table.temp.ccid == '' && this.table.temp.fttypeid == '') {
  1450. this.$message({ type: 'error', message: '牲畜类别/配方类型不能为空', duration: 2000 })
  1451. return false
  1452. } else if (this.table.temp.tname == '') {
  1453. this.$message({ type: 'error', message: '配方名称不能为空', duration: 2000 })
  1454. return false
  1455. } else if (this.table.temp.ccid == '') {
  1456. this.$message({ type: 'error', message: '牲畜类别不能为空', duration: 2000 })
  1457. return false
  1458. } else if (this.table.temp.fttypeid == '') {
  1459. this.$message({ type: 'error', message: '配方类型不能为空', duration: 2000 })
  1460. return false
  1461. }
  1462. const pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]")
  1463. // if (pattern.test(this.table.temp.tname)) {
  1464. // this.$message({ type: 'error', message: '配方名称不可输入特殊字符', duration: 2000 })
  1465. // return false
  1466. // }
  1467. if (pattern.test(this.table.temp.tcode)) {
  1468. this.$message({ type: 'error', message: '配方编码不可输入特殊字符', duration: 2000 })
  1469. return false
  1470. }
  1471. console.log(this.table.temp)
  1472. this.isokDisable = true
  1473. setTimeout(() => {
  1474. this.isokDisable = false
  1475. }, 1000)
  1476. this.requestParam2.name = 'checkNumber'
  1477. this.requestParam2.parammaps = {}
  1478. this.requestParam2.parammaps.number = this.table.temp.tcode
  1479. GetDataByName(this.requestParam2).then(response => {
  1480. console.log('table数据', response.data.list)
  1481. if (response.data.list[0].vmsg !== '输入非法字符') {
  1482. this.saveUpdateData()
  1483. } else {
  1484. this.$notify({ type: 'error', message: '配方编码不可输入特殊字符', duration: 2000 })
  1485. }
  1486. })
  1487. },
  1488. saveUpdateData() {
  1489. this.requestParam.name = 'updateFT'
  1490. this.requestParam.parammaps = this.table.temp
  1491. PostDataByName(this.requestParam).then(response => {
  1492. console.log('新增保存发送参数', this.requestParam)
  1493. if (response.msg !== 'fail') {
  1494. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  1495. this.getList()
  1496. } else {
  1497. const isRepeat = new RegExp('Duplicate entry :feedtemplet.tCode')
  1498. if (isRepeat.test(response.data)) {
  1499. this.$notify({ type: 'error', message: '配方编码不可重复,请重新录入', duration: 2000 })
  1500. } else {
  1501. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1502. }
  1503. }
  1504. })
  1505. },
  1506. updateCancel(row) {
  1507. console.log('点击了编辑取消')
  1508. // 编辑false,不可编辑true
  1509. row.Edit = false
  1510. row.NoEdit = true
  1511. // 新增false,编辑true,编辑保存false
  1512. row.isCreate = false
  1513. row.isUpdate = true
  1514. row.isUpdateSave = false
  1515. this.getList()
  1516. },
  1517. // 删除
  1518. handleRowDelete(row) {
  1519. console.log('点击了行内删除')
  1520. MessageBox.confirm('是否确认删除此信息?', {
  1521. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  1522. }).then(() => {
  1523. this.requestParam.common = { 'returnmap': '0' }
  1524. this.requestParam.data = []
  1525. this.requestParam.data[0] = { 'name': 'checkdeleteFT', 'type': 'v', 'parammaps': {
  1526. pastureid: row.pastureid,
  1527. id: row.id
  1528. }}
  1529. this.requestParam.data[1] = { 'name': 'deleteFT', 'type': 'e', 'parammaps': {
  1530. pastureid: row.pastureid,
  1531. id: row.id
  1532. }}
  1533. ExecDataByConfig(this.requestParam).then(response => {
  1534. console.log('新增保存发送参数', this.requestParam)
  1535. if (response.msg === 'fail') {
  1536. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  1537. } else {
  1538. this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
  1539. this.getList()
  1540. this.isDetail = false
  1541. }
  1542. })
  1543. }).catch(() => {
  1544. this.$message({ type: 'info', message: '已取消删除' })
  1545. })
  1546. },
  1547. handleSelectionChange(val) {
  1548. console.log('勾选数据', val)
  1549. this.selectList = val
  1550. },
  1551. handleDelete() {
  1552. console.log('点击了删除')
  1553. if (this.selectList.length == 0) {
  1554. this.$message({ type: 'error', message: '请选择配方', duration: 2000 })
  1555. } else {
  1556. MessageBox.confirm('是否确认删除此信息?', {
  1557. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  1558. }).then(() => {
  1559. console.log(this.selectList)
  1560. this.requestParam.common = { 'returnmap': '0' }
  1561. this.requestParam.data = []
  1562. this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
  1563. this.requestParam.data[0].children = []
  1564. this.requestParam.data[0].children[0] = { 'name': 'checkdeleteFT', 'type': 'v', 'parammaps': {
  1565. id: '@insertSpotList.id',
  1566. pastureid: '@insertSpotList.pastureid'
  1567. }}
  1568. this.requestParam.data[0].children[1] = { 'name': 'deleteFT', 'type': 'e', 'parammaps': {
  1569. id: '@insertSpotList.id',
  1570. pastureid: '@insertSpotList.pastureid'
  1571. }}
  1572. ExecDataByConfig(this.requestParam).then(response => {
  1573. console.log('删除保存发送参数', this.requestParam)
  1574. if (response.msg === 'fail') {
  1575. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  1576. } else {
  1577. this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
  1578. this.getList()
  1579. }
  1580. })
  1581. })
  1582. }
  1583. },
  1584. // 复制
  1585. handleCopy() {
  1586. if (this.selectList.length == 0) {
  1587. this.$message({ type: 'error', message: '请选择配方', duration: 2000 })
  1588. } else {
  1589. MessageBox.confirm('是否确认复制此信息?', {
  1590. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  1591. }).then(() => {
  1592. console.log(this.selectList)
  1593. this.requestParam.common = { 'returnmap': '0' }
  1594. this.requestParam.data = []
  1595. this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
  1596. this.requestParam.data[0].children = []
  1597. this.requestParam.data[0].children[0] = { 'name': 'copyFT', 'type': 'e', 'parammaps': {
  1598. ftid: '@insertSpotList.id',
  1599. pastureid: '@insertSpotList.pastureid'
  1600. }}
  1601. ExecDataByConfig(this.requestParam).then(response => {
  1602. console.log('复制保存发送参数', this.requestParam)
  1603. if (response.msg === 'fail') {
  1604. this.$notify({ title: '复制失败', message: response.data, type: 'warning', duration: 2000 })
  1605. } else {
  1606. this.$notify({ title: '', message: '复制成功', type: 'success', duration: 2000 })
  1607. this.getList()
  1608. }
  1609. })
  1610. })
  1611. }
  1612. },
  1613. // 配方记录
  1614. handleRecipeRecord() {
  1615. console.log('点击了配方记录')
  1616. this.template.dialogStatus = 'RecipeRecord'
  1617. this.dialogFull = false
  1618. this.template.dialogFormVisible = true
  1619. this.template.table.getdataListParm.parammaps.ccname = ''
  1620. this.template.table.getdataListParm.parammaps.fttype = ''
  1621. this.template.table.getdataListParm.parammaps.enable = ''
  1622. this.template.table.getdataListParm.parammaps.tname = ''
  1623. this.template.table.getdataListParm.parammaps.remark = ''
  1624. this.template.table.getdataListParm.parammaps.source = ''
  1625. this.template.table.getdataListParm.offset = 1
  1626. this.getDateList()
  1627. this.isDetailDialog = false
  1628. this.myheight2 = document.documentElement.clientHeight - 85 - 265
  1629. },
  1630. // 历史时间
  1631. getDateList() {
  1632. GetDataByName(this.template.getdataDateParm).then(response => {
  1633. console.log('table数据', response.data.list)
  1634. if (response.data.list !== null) {
  1635. this.template.table.getdataListParm.parammaps.date = response.data.list[0].maxdate
  1636. this.getTemplateDialogList()
  1637. } else {
  1638. this.template.table.getdataListParm.parammaps.date = ''
  1639. }
  1640. })
  1641. },
  1642. // 配方记录-模板
  1643. getTemplateDialogList() {
  1644. this.template.table.listLoading = true
  1645. GetDataByName(this.template.table.getdataListParm).then(response => {
  1646. console.log('table数据', response.data.list)
  1647. if (response.data.list !== null) {
  1648. this.template.table.list = response.data.list
  1649. this.template.table.pageNum = response.data.pageNum
  1650. this.template.table.pageSize = response.data.pageSize
  1651. this.template.table.total = response.data.total
  1652. } else {
  1653. this.template.table.list = []
  1654. this.template.table2.list = []
  1655. }
  1656. setTimeout(() => {
  1657. this.template.table.listLoading = false
  1658. }, 100)
  1659. })
  1660. },
  1661. handleDialogSearch() {
  1662. this.template.table.getdataListParm.offset = 1
  1663. this.getTemplateDialogList()
  1664. this.arrowDown = true
  1665. this.arrowUp = false
  1666. },
  1667. handleDialogRefresh() {
  1668. this.template.table.getdataListParm.parammaps.ccname = ''
  1669. this.template.table.getdataListParm.parammaps.fttype = ''
  1670. this.template.table.getdataListParm.parammaps.enable = ''
  1671. this.template.table.getdataListParm.parammaps.tname = ''
  1672. this.template.table.getdataListParm.parammaps.remark = ''
  1673. this.template.table.getdataListParm.parammaps.source = ''
  1674. this.template.table.getdataListParm.offset = 1
  1675. this.getTemplateDialogList()
  1676. },
  1677. // 配方记录-模板行点击
  1678. tableRowClickDialog(row, column, event) {
  1679. console.log('配方记录-模板行点击')
  1680. this.isDetailDialog = true
  1681. this.template.table2.getdataListParm.parammaps.date = this.template.table.getdataListParm.parammaps.date
  1682. this.template.table2.getdataListParm.parammaps.version = row.version
  1683. this.template.table2.getdataListParm.parammaps.ftid = row.id
  1684. this.template.table2.getdataListParm.parammaps.dryweight = row.dryweight
  1685. this.myheight2 = document.documentElement.clientHeight - 85 - 265 - 185
  1686. this.getDialogList()
  1687. this.getDownList()
  1688. // aiaiaiai
  1689. },
  1690. getDialogList() {
  1691. this.template.table2.listLoading = true
  1692. GetDataByName(this.template.table2.getdataListParm).then(response => {
  1693. console.log('table数据', response.data.list)
  1694. if (response.data.list !== null) {
  1695. this.template.table2.list = response.data.list
  1696. this.template.table2.pageNum = response.data.pageNum
  1697. this.template.table2.pageSize = response.data.pageSize
  1698. this.template.table2.total = response.data.total
  1699. } else {
  1700. this.template.table2.list = []
  1701. }
  1702. this.$nextTick(function() {
  1703. document.querySelector('#detailDialog2').scrollIntoView()
  1704. // window.scrollTo({
  1705. // 'top': this.$refs.detailDialog2.clientHeight
  1706. // })
  1707. })
  1708. setTimeout(() => {
  1709. this.template.table2.listLoading = false
  1710. }, 100)
  1711. })
  1712. },
  1713. handleDialogSearch2() {
  1714. console.log('点击了查询')
  1715. this.arrowDown2 = true
  1716. this.arrowUp2 = false
  1717. this.template.table2.getdataListParm.offset = 1
  1718. this.getDialogList2()
  1719. },
  1720. handleDialogRefresh2() {
  1721. console.log('点击了重置')
  1722. this.template.table2.getdataListParm.parammaps.fname = ''
  1723. this.template.table2.getdataListParm.parammaps.feedgroup = ''
  1724. this.template.table2.getdataListParm.parammaps.fweight = ''
  1725. this.template.table2.getdataListParm.parammaps.autosecondname = ''
  1726. this.template.table2.getdataListParm.parammaps.islockcount = '0'
  1727. this.template.table2.getdataListParm.parammaps.sort = ''
  1728. this.template.table2.getdataListParm.offset = 1
  1729. this.getDialogList2()
  1730. },
  1731. getDialogList2() {
  1732. this.template.table2.listLoading = true
  1733. GetDataByName(this.template.table2.getdataListParm).then(response => {
  1734. console.log('table数据', response.data.list)
  1735. if (response.data.list !== null) {
  1736. this.template.table2.list = response.data.list
  1737. this.template.table2.pageNum = response.data.pageNum
  1738. this.template.table2.pageSize = response.data.pageSize
  1739. this.template.table2.total = response.data.total
  1740. } else {
  1741. this.template.table2.list = []
  1742. }
  1743. this.$nextTick(function() {
  1744. window.scrollTo({
  1745. 'top': this.$refs.templateDialog.clientHeight
  1746. })
  1747. })
  1748. setTimeout(() => {
  1749. this.template.table2.listLoading = false
  1750. }, 100)
  1751. })
  1752. },
  1753. // 导出
  1754. handleExport(item) {
  1755. if (item == 1) {
  1756. console.log('点击了导出模板')
  1757. const requestParam = this.requestParam
  1758. const url = process.env.VUE_APP_BASE_API + 'file/导入导出模板/配方计划/配方模板导入模板.xlsx' // 请求下载文件的地址
  1759. console.log(url)
  1760. axios({
  1761. method: 'GET',
  1762. url: url,
  1763. data: requestParam,
  1764. headers: { token: getToken(), optname: 'insertcustomdoc' },
  1765. responseType: 'blob'
  1766. }).then(res => {
  1767. if (!res) return
  1768. this.percentage = 99
  1769. setTimeout(() => {
  1770. this.isPercentage = false
  1771. }, 2000)
  1772. const blob = new Blob([res.data], {
  1773. type: 'application/octet-stream;charset=utf-8'
  1774. })
  1775. const url = window.URL.createObjectURL(blob)
  1776. const aLink = document.createElement('a')
  1777. aLink.style.display = 'none'
  1778. aLink.href = url
  1779. const docname = '配方模板导入模板.xlsx'
  1780. aLink.setAttribute('download', docname) // 下载的文件
  1781. document.body.appendChild(aLink)
  1782. aLink.click()
  1783. document.body.removeChild(aLink)
  1784. window.URL.revokeObjectURL(url)
  1785. })
  1786. } else {
  1787. console.log('点击了导出数据')
  1788. this.download.getdataListParm.name = 'downloadFTList'
  1789. this.download.getdataListParm.parammaps = this.table.getdataListParm.parammaps
  1790. GetDataByName(this.download.getdataListParm).then(response => {
  1791. if (response.data.list !== null) {
  1792. for (let i = 0; i < response.data.list.length; i++) {
  1793. if (response.data.list[i].islockcount == 0) {
  1794. this.$set(response.data.list[i], 'islockcount', '否')
  1795. } else {
  1796. this.$set(response.data.list[i], 'islockcount', '是')
  1797. }
  1798. if (response.data.list[i].enable == 0) {
  1799. this.$set(response.data.list[i], 'enable', '否')
  1800. } else {
  1801. this.$set(response.data.list[i], 'enable', '是')
  1802. }
  1803. }
  1804. this.download.list = response.data.list
  1805. } else {
  1806. this.download.list = []
  1807. }
  1808. var excelDatas = [
  1809. {
  1810. tHeader: ['配方名称', '配方编码', '牲畜类别', '配方类型', '来源', '备注', '是否启用', '饲料组', '饲料名称', '重量(kg)', '搅拌延时(min)', '是否锁定牛头数比例', '顺序'],
  1811. filterVal: ['tname', 'tcode', 'ccname', 'fttype', 'source', 'remark', 'enable', 'feedgroup', 'fname', 'fweight', 'autosecond', 'islockcount', 'sort'],
  1812. tableDatas: this.download.list,
  1813. sheetName: 'Sheet1'
  1814. }
  1815. ]
  1816. json2excel(excelDatas, '配方模板', true, 'xlsx')
  1817. })
  1818. }
  1819. },
  1820. beforeImport(file) {
  1821. const isLt2M = file.size / 1024 / 1024 < 2
  1822. if (!isLt2M) {
  1823. this.$message.error('上传文件大小不能超过 2MB!')
  1824. }
  1825. return isLt2M
  1826. },
  1827. handleImportSuccess(res, file) {
  1828. this.getList()
  1829. if (res.msg === 'ok') {
  1830. this.$message({ title: '成功', message: '导入成功:' + res.data.success + '条!', type: 'success', duration: 2000 })
  1831. if (res.data.err_count > 0) {
  1832. this.$notify({ title: '失败', message: '导入失败:' + res.data.err_count + '条!', type: 'danger', duration: 2000 })
  1833. import('@/vendor/Export2Excel').then(excel => {
  1834. const list1 = res.data.result
  1835. const tHeader = [
  1836. '配方名称', '牲畜类别', '配方类型', '备注', '饲料组', '饲料名称', '重量(kg)', '搅拌延时(min)', '是否锁定牛头数比例', '错误信息'
  1837. ]
  1838. const filterVal = [
  1839. '配方名称', '牲畜类别', '配方类型', '备注', '饲料组', '饲料名称', '重量(kg)', '搅拌延时(min)', '是否锁定牛头数比例', 'error_msg'
  1840. ]
  1841. const data1 = this.formatJson(filterVal, list1)
  1842. excel.export_json_to_excel({ header: tHeader, data: data1, filename: '配方模板导入报错信息', autoWidth: true, bookType: 'xlsx' })
  1843. })
  1844. }
  1845. } else {
  1846. const isRepeat = new RegExp('Duplicate entry :feedtemplet_tname')
  1847. if (isRepeat.test(res.data)) {
  1848. this.$notify({ type: 'error', message: '配方名称不可重复,请重新录入', duration: 2000 })
  1849. return false
  1850. }
  1851. this.$notify({ title: '失败', message: '上传失败', type: 'danger', duration: 2000 })
  1852. }
  1853. },
  1854. formatJson(filterVal, jsonData) {
  1855. return jsonData.map(v =>
  1856. filterVal.map(j => {
  1857. if (j === 'timestamp') {
  1858. return parseTime(v[j])
  1859. } else {
  1860. return v[j]
  1861. }
  1862. })
  1863. )
  1864. },
  1865. changeDate() {
  1866. this.getTemplateDialogList()
  1867. },
  1868. // 应用
  1869. handleApplication() {
  1870. console.log('点击了应用')
  1871. MessageBox.confirm('是否确认将' + this.template.table.getdataListParm.parammaps.date + '的数据应用到当前?', {
  1872. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  1873. }).then(() => {
  1874. this.requestParam.name = 'applyFTdate'
  1875. this.requestParam.parammaps = {}
  1876. this.requestParam.parammaps.pastureid = Cookies.get('pastureid')
  1877. this.requestParam.parammaps.date = this.template.table.getdataListParm.parammaps.date
  1878. PostDataByName(this.requestParam).then(response => {
  1879. if (response.msg === 'fail') {
  1880. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1881. } else {
  1882. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  1883. this.getTemplateDialogList()
  1884. this.getList()
  1885. }
  1886. })
  1887. }).catch(() => {
  1888. this.$message({ type: 'info', message: '已取消应用' })
  1889. })
  1890. },
  1891. // 模板行点击
  1892. tableRowClick(row, column, event) {
  1893. for (let i = 0; i < this.table.list.length; i++) {
  1894. if (this.table.list[i].Edit == true) {
  1895. return false
  1896. }
  1897. }
  1898. if (this.isOrder == false) {
  1899. this.$message({ type: 'error', message: '请保存或取消当前更改顺序操作', duration: 2000 })
  1900. } else {
  1901. if (column.label !== '操作') {
  1902. this.isDetail = true // 点击行显示详情
  1903. this.table2.getdataListParm.parammaps.ftid = row.id
  1904. this.table2.getdataListParm.parammaps.fttypeid = row.fttypeid
  1905. this.table2.getdataListParm.parammaps.dryweight = row.dryweight
  1906. if (row.fttype == '预混配方') {
  1907. this.requestParams[2].parammaps.type = '1'
  1908. } else {
  1909. this.requestParams[2].parammaps.type = ''
  1910. }
  1911. this.myheight = document.documentElement.clientHeight - 85 - 265 - 185
  1912. this.getList2()
  1913. this.getDownList()
  1914. }
  1915. }
  1916. },
  1917. handleCloseTable2() {
  1918. this.isDetail = false
  1919. this.myheight = ''
  1920. this.isEnlarge = true
  1921. },
  1922. handleDialogCloseTable2() {
  1923. this.isDetailDialog = false
  1924. this.myheight2 = document.documentElement.clientHeight - 85 - 265
  1925. },
  1926. // -------------------详情-----------------------------
  1927. // 获取是否显示是否锁定牛头数
  1928. getIsLockCount() {
  1929. GetDataByName(this.lockCount.getdataListParm).then(response => {
  1930. console.log(response.data.list)
  1931. if (response.data.list[0].inforvalue == 0) {
  1932. this.lockCount.isLockCount = false
  1933. } else {
  1934. this.lockCount.isLockCount = true
  1935. }
  1936. })
  1937. },
  1938. // 详情
  1939. getList2() {
  1940. this.table2.listLoading = true
  1941. GetDataByName(this.table2.getdataListParm).then(response => {
  1942. console.log('table数据', response.data.list)
  1943. if (response.data.list !== null) {
  1944. for (let i = 0; i < response.data.list.length; i++) {
  1945. this.$set(response.data.list[i], 'Edit', false) // 编辑
  1946. this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
  1947. this.$set(response.data.list[i], 'groupEdit', false) // 饲料组编辑
  1948. this.$set(response.data.list[i], 'isGroupDisabled', false) // 饲料组编辑禁止编辑
  1949. this.$set(response.data.list[i], 'groupNoEdit', true) // 饲料组不可编辑
  1950. this.$set(response.data.list[i], 'isCreate', false) // 新增操作
  1951. this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
  1952. this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
  1953. }
  1954. this.table2.getDryweightParm.parammaps = this.table2.getdataListParm.parammaps
  1955. this.getDryWeight()
  1956. // for (let i = 0; i < response.data.list.length; i++) {
  1957. // console.log(response.data.list[i].fweight, '===12333')
  1958. // }
  1959. this.table2.list = response.data.list
  1960. this.table2.pageNum = response.data.pageNum
  1961. this.table2.pageSize = response.data.pageSize
  1962. this.table2.total = response.data.total
  1963. } else {
  1964. this.table2.list = []
  1965. }
  1966. setTimeout(() => {
  1967. this.table2.listLoading = false
  1968. }, 100)
  1969. })
  1970. },
  1971. // 行拖拽
  1972. rowDrop() {
  1973. console.log(document.querySelector('#table2 .el-table__body-wrapper tbody'))
  1974. const tbody = document.querySelector('#table2 .el-table__body-wrapper tbody')
  1975. // this.sorTable()
  1976. const that = this
  1977. // Sortable.create(tbody, {
  1978. var sortable = Sortable.create(tbody, {
  1979. disabled: that.dropState,
  1980. onChoose({ newIndex, oldIndex }) {
  1981. console.log(that.isOrder, 'that.isOrder == false')
  1982. console.log(that.dropState, 'that.dropState')
  1983. if (that.dropState == true || that.isOrder == true) {
  1984. sortable.destroy()
  1985. }
  1986. },
  1987. onEnd({ newIndex, oldIndex }) {
  1988. const currRow = that.table2.list.splice(oldIndex, 1)[0]
  1989. that.table2.list.splice(newIndex, 0, currRow)
  1990. console.log('索引', newIndex)
  1991. console.log('拖动数据', currRow)
  1992. console.log('上', that.table2.list[newIndex - 1])
  1993. console.log('下', that.table2.list[newIndex + 1])
  1994. if (that.table2.list[newIndex - 1] === undefined) { // 拖动至最上方无值 // 顺序等于0,其他+1 // 饲料组等于饲料名称
  1995. for (let i = 0; i < that.table2.list.length; i++) {
  1996. that.table2.list[i].sort = parseInt(that.table2.list[i].sort) + 1 // 其他的顺序+1
  1997. }
  1998. currRow.sort = 0
  1999. currRow.feedgroup = currRow.fname
  2000. console.log('拖动至最上方无值')
  2001. } else if (currRow.sort == that.table2.list[newIndex - 1].sort) { // 拖动值顺序等于上值顺序
  2002. currRow.sort = that.table2.list[newIndex - 1].sort
  2003. console.log('拖动值顺序等于上值顺序')
  2004. } else if (that.table2.list[newIndex + 1] == undefined) { // 拖动至最下方无值 // 顺序等于上方顺序+1 // 饲料组等于饲料名称
  2005. currRow.sort = parseInt(that.table2.list[newIndex - 1].sort) + 1
  2006. currRow.feedgroup = currRow.fname
  2007. console.log('拖动至最下方无值')
  2008. } else if (currRow.sort == that.table2.list[newIndex + 1].sort) { // 拖动值顺序等于下值顺序
  2009. currRow.sort == that.table2.list[newIndex + 1].sort
  2010. console.log('拖动值顺序等于下值顺序')
  2011. } else if (that.table2.list[newIndex - 1].sort == that.table2.list[newIndex + 1].sort) { // 拖动至上下顺序一致,顺序/饲料组与上下保持一致
  2012. currRow.sort = that.table2.list[newIndex - 1].sort
  2013. currRow.feedgroup = that.table2.list[newIndex - 1].feedgroup
  2014. console.log('拖动至上下顺序一致')
  2015. } else if (that.table2.list[newIndex - 1].sort !== undefined && that.table2.list[newIndex + 1].sort !== undefined) { // 拖动至上下都有值
  2016. console.log('上下')
  2017. if (parseInt(that.table2.list[newIndex - 1].sort) + 1 == that.table2.list[newIndex + 1].sort) {
  2018. console.log(newIndex)
  2019. for (let i = newIndex; i < that.table2.list.length; i++) {
  2020. that.table2.list[i].sort = parseInt(that.table2.list[i].sort) + 1
  2021. }
  2022. }
  2023. currRow.sort = parseInt(that.table2.list[newIndex - 1].sort) + 1
  2024. currRow.feedgroup = currRow.fname
  2025. console.log(that.table2.list[newIndex + 1].sort)
  2026. }
  2027. }
  2028. })
  2029. console.log(sortable.option('disabled'))
  2030. },
  2031. handleChangeOrder() {
  2032. this.isOrder = false
  2033. this.rowDrop()
  2034. },
  2035. saveChangeOrder() {
  2036. // 保存顺序
  2037. console.log(this.table2.list)
  2038. this.requestParam = {}
  2039. this.requestParam.common = { 'returnmap': '0' }
  2040. this.requestParam.data = []
  2041. this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.table2.list }}
  2042. this.requestParam.data[0].children = []
  2043. this.requestParam.data[0].children[0] = { 'name': 'updateFTdetailSort', 'type': 'e', 'parammaps': {
  2044. id: '@insertSpotList.id',
  2045. pastureid: '@insertSpotList.pastureid',
  2046. sort: '@insertSpotList.sort',
  2047. feedgroup: '@insertSpotList.feedgroup'
  2048. }}
  2049. ExecDataByConfig(this.requestParam).then(response => {
  2050. console.log('顺序切换保存发送参数', this.requestParam)
  2051. if (response.msg === 'fail') {
  2052. this.$notify({ title: '顺序切换失败', message: response.data, type: 'warning', duration: 2000 })
  2053. } else {
  2054. this.$notify({ title: '', message: '顺序切换成功', type: 'success', duration: 2000 })
  2055. this.getList2()
  2056. this.getList3()
  2057. this.isOrder = true
  2058. }
  2059. })
  2060. },
  2061. cancelChangeOrder() {
  2062. // 取消顺序
  2063. this.getList2()
  2064. this.isOrder = true
  2065. },
  2066. handleSearch2() {
  2067. console.log('点击了查询')
  2068. this.arrowDown2 = true
  2069. this.arrowUp2 = false
  2070. this.table2.getdataListParm.offset = 1
  2071. // fname, feedgroup, fweight, autosecondname, islockcount, sort
  2072. // this.table2.getdataListParm.parammaps.all = this.table2.getdataListParm.parammaps.fname + ' ' + this.table2.getdataListParm.parammaps.feedgroup + ' ' + this.table2.getdataListParm.parammaps.fweight + ' ' + this.table2.getdataListParm.parammaps.autosecondname + ' ' + this.table2.getdataListParm.parammaps.islockcount + ' ' + this.table2.getdataListParm.parammaps.sort
  2073. this.table2.getdataListParm.parammaps.all = ''
  2074. var obj = {}
  2075. obj.fname = this.table2.getdataListParm.parammaps.fname
  2076. obj.feedgroup = this.table2.getdataListParm.parammaps.feedgroup
  2077. obj.fweight = this.table2.getdataListParm.parammaps.fweight
  2078. obj.autosecondname = this.table2.getdataListParm.parammaps.autosecondname
  2079. if (this.table2.getdataListParm.parammaps.islockcount !== '') {
  2080. if (this.table2.getdataListParm.parammaps.islockcount == 0) {
  2081. this.table2.getdataListParm.parammaps.islockcount = '否'
  2082. } else {
  2083. this.table2.getdataListParm.parammaps.islockcount = '是'
  2084. }
  2085. }
  2086. obj.islockcount = this.table2.getdataListParm.parammaps.islockcount
  2087. obj.sort = this.table2.getdataListParm.parammaps.sort
  2088. Object.getOwnPropertyNames(obj).forEach((key) => {
  2089. console.log(key, obj[key])
  2090. if (obj[key] !== '') {
  2091. this.table2.getdataListParm.parammaps.all += obj[key] + '/'
  2092. }
  2093. })
  2094. if (this.table2.getdataListParm.parammaps.all.charAt(this.table2.getdataListParm.parammaps.all.length - 1) == '/') {
  2095. this.table2.getdataListParm.parammaps.all = this.table2.getdataListParm.parammaps.all.slice(0, this.table2.getdataListParm.parammaps.all.length - 1)
  2096. }
  2097. this.getList2()
  2098. },
  2099. handleRefresh2() {
  2100. console.log('点击了重置')
  2101. this.table2.getdataListParm.parammaps.fname = ''
  2102. this.table2.getdataListParm.parammaps.feedgroup = ''
  2103. this.table2.getdataListParm.parammaps.fweight = ''
  2104. this.table2.getdataListParm.parammaps.autosecondname = ''
  2105. this.table2.getdataListParm.parammaps.islockcount = '0'
  2106. this.table2.getdataListParm.parammaps.sort = ''
  2107. this.table2.getdataListParm.parammaps.all = ''
  2108. this.table2.getdataListParm.offset = 1
  2109. this.getList2()
  2110. },
  2111. // 详情新增
  2112. handleCreate2() {
  2113. console.log('点击了详情新增', this.table2.list)
  2114. // 编辑true/不可编辑false
  2115. // 新增操true,编辑false,编辑保存false
  2116. console.log(11)
  2117. for (let i = 0; i < this.table2.list.length; i++) {
  2118. if (this.table2.list[i].Edit === true) {
  2119. console.log(123)
  2120. this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
  2121. return false
  2122. }
  2123. }
  2124. console.log(this.table2.list)
  2125. if (this.table2.list.length == 0) {
  2126. var mysort = 0
  2127. } else {
  2128. var mysort = parseInt(this.table2.list[this.table2.list.length - 1].sort) + 1
  2129. }
  2130. this.table2.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'groupEdit': false, 'groupNoEdit': true, 'enable': 1, 'feedgroup': '', 'fid': '', 'fname': '', 'fweight': '', 'autosecond': '0', 'islockcount': '0', 'sort': mysort })
  2131. console.log(this.table2.list)
  2132. },
  2133. changeFname(item, row) {
  2134. console.log(item, row)
  2135. this.table2.temp.fname = this.feedNameList.find(obj => obj.id == item).fname
  2136. row.fname = this.feedNameList.find(obj => obj.id == item).fname
  2137. if (this.feedNameList.find(obj => obj.id == item).ispreft == '0') {
  2138. this.table2.temp.preftid = '0'
  2139. } else {
  2140. this.table2.temp.preftid = item
  2141. }
  2142. if (row.sort == '') {
  2143. row.feedgroup = this.table2.temp.fname
  2144. } else {
  2145. if (row.isCreate == true) { // 新增状态下
  2146. for (let i = 1; i < this.table2.list.length; i++) {
  2147. if (this.table2.list[i].sort == row.sort) {
  2148. console.log(this.table2.list[i])
  2149. row.feedgroup = this.table2.list[i].feedgroup
  2150. break
  2151. } else {
  2152. row.feedgroup = this.table2.temp.fname
  2153. }
  2154. }
  2155. } else if (row.isUpdateSave == true) { // 编辑状态下
  2156. var Arr = []
  2157. for (let i = 0; i < this.table2.list.length; i++) {
  2158. Arr.push(this.table2.list[i].sort)
  2159. }
  2160. var Count = 0
  2161. for (let i = 0; i < Arr.length; i++) {
  2162. if (Arr[i] == row.sort) {
  2163. Count++
  2164. }
  2165. }
  2166. for (let i = 0; i < this.table2.list.length; i++) {
  2167. if (Count > 1) {
  2168. row.feedgroup = this.table2.list[i].feedgroup
  2169. console.log(this.table2.list[i].feedgroup)
  2170. break
  2171. } else if (Count == 1) {
  2172. row.feedgroup = this.table2.temp.fname
  2173. console.log(222, this.table2.temp.fname)
  2174. }
  2175. }
  2176. }
  2177. }
  2178. },
  2179. bort(row) {
  2180. if (row.isCreate == true) {
  2181. if (row.sort !== '') {
  2182. for (let i = 1; i < this.table2.list.length; i++) {
  2183. if (this.table2.list[i].sort == parseInt(row.sort)) {
  2184. row.feedgroup = this.table2.list[i].feedgroup
  2185. return false
  2186. } else {
  2187. row.feedgroup = row.fname
  2188. }
  2189. }
  2190. } else {
  2191. row.feedgroup = row.fname
  2192. }
  2193. } else if (row.isUpdateSave == true) {
  2194. if (row.sort !== '') {
  2195. for (let i = 0; i < this.table2.list.length; i++) {
  2196. if (this.table2.list[i].sort == row.sort) {
  2197. console.log('失去焦点,行内顺序与表格某顺序相同时', this.table2.list[i])
  2198. if (this.table2.list[i].id !== row.id) {
  2199. row.isGroupDisabled = true
  2200. row.feedgroup = this.table2.list[i].feedgroup
  2201. break
  2202. }
  2203. } else {
  2204. console.log('失去焦点,行内顺序与表格某顺序不相同时')
  2205. row.isGroupDisabled = true
  2206. row.feedgroup = row.fname
  2207. }
  2208. }
  2209. } else {
  2210. row.feedgroup = row.fname
  2211. }
  2212. }
  2213. },
  2214. createData2(row) {
  2215. console.log('点击了详情新增保存1', row)
  2216. this.table2.temp.pastureid = Cookies.get('pastureid')
  2217. this.table2.temp.ftid = this.table2.getdataListParm.parammaps.ftid
  2218. this.table2.temp.fid = row.fid
  2219. this.table2.temp.fname = this.table2.temp.fname
  2220. this.table2.temp.fweight = row.fweight
  2221. this.table2.temp.islockcount = row.islockcount
  2222. this.table2.temp.sort = row.sort
  2223. this.table2.temp.feedgroup = row.feedgroup
  2224. this.table2.temp.preftid = this.table2.temp.preftid
  2225. this.table2.temp.autosecond = row.autosecond
  2226. if (this.table2.temp.fid == '' && this.table2.temp.fweight == '' && this.table2.temp.autosecond == '') {
  2227. this.$message({ type: 'error', message: '饲料名称/重量/搅拌延时不能为空', duration: 2000 })
  2228. return false
  2229. } else if (this.table2.temp.fweight == '' && this.table2.temp.autosecond == '') {
  2230. this.$message({ type: 'error', message: '重量/搅拌延时不能为空', duration: 2000 })
  2231. return false
  2232. } else if (this.table2.temp.fid == '') {
  2233. this.$message({ type: 'error', message: '饲料名称不能为空', duration: 2000 })
  2234. return false
  2235. } else if (this.table2.temp.fweight == '') {
  2236. this.$message({ type: 'error', message: '重量不能为空', duration: 2000 })
  2237. return false
  2238. } else if (this.table2.temp.autosecond == '') {
  2239. this.$message({ type: 'error', message: '搅拌延时不能为空', duration: 2000 })
  2240. return false
  2241. }
  2242. if (this.table2.temp.sort !== '') {
  2243. this.table2.temp.sort = this.table2.temp.sort
  2244. } else {
  2245. console.log(this.table2.list.length)
  2246. if (this.table2.list.length == 1) {
  2247. this.table2.temp.sort = 0
  2248. } else {
  2249. this.table2.temp.sort = parseInt(this.table2.list[this.table2.list.length - 1].sort) + 1
  2250. row.sort = parseInt(this.table2.list[this.table2.list.length - 1].sort) + 1
  2251. }
  2252. }
  2253. if (this.table2.getdataListParm.parammaps.fttypeid == 2) {
  2254. if (parseInt(this.table2.temp.preftid) > 0) {
  2255. this.$message({ type: 'error', message: '饲料名称不能选择预混配方', duration: 2000 })
  2256. return false
  2257. }
  2258. }
  2259. // 校验顺序是否>=0
  2260. var ruleSort = /^\d+$/
  2261. if (!ruleSort.test(this.table2.temp.sort)) {
  2262. this.$message({ type: 'error', message: '饲料顺序不可为负数或小数', duration: 2000 })
  2263. return false
  2264. }
  2265. // 检验重量>0
  2266. this.table2.temp.fweight = formatNum(this.table2.temp.fweight, 4) // 根据默认参数设置小数位数
  2267. row.fweight = formatNum(row.fweight, 4)
  2268. // return
  2269. // var ruleWeight = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
  2270. if (this.table2.temp.fweight == 0) {
  2271. this.$message({ type: 'error', message: '重量请输入正数,最多保留四位小数', duration: 2000 })
  2272. return false
  2273. }
  2274. this.isokDisable = true
  2275. setTimeout(() => {
  2276. this.isokDisable = false
  2277. }, 1000)
  2278. let dateTime = parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
  2279. this.requestParam.common = { 'returnmap': '0' }
  2280. this.requestParam.createdate = dateTime
  2281. this.requestParam.data = []
  2282. this.requestParam.data[0] = { 'name': 'insertFTdetail', 'type': 'e', 'parammaps': {
  2283. pastureid: this.table2.temp.pastureid,
  2284. ftid: this.table2.getdataListParm.parammaps.ftid,
  2285. fid: row.fid,
  2286. fname: this.table2.temp.fname,
  2287. fweight: String(row.fweight),
  2288. islockcount: row.islockcount,
  2289. sort: row.sort,
  2290. feedgroup: row.feedgroup,
  2291. preftid: this.table2.temp.preftid,
  2292. autosecond: row.autosecond
  2293. }}
  2294. this.requestParam.data[1] = { 'name': 'updateFPbyFTChange', 'type': 'e', 'parammaps': {
  2295. pastureid: this.table2.temp.pastureid,
  2296. ftid: this.table2.getdataListParm.parammaps.ftid,
  2297. type: this.table2.getdataListParm.parammaps.fttypeid,
  2298. status: 0
  2299. }}
  2300. this.requestParam.data[2] = { 'name': 'updateftversion', 'type': 'e', 'parammaps': {
  2301. pastureid: this.table2.getdataListParm.parammaps.pastureid,
  2302. id: this.table2.getdataListParm.parammaps.ftid
  2303. }}
  2304. this.requestParam.data[3] = { 'name': 'insertFitHistory', 'type': 'e', 'parammaps': {
  2305. weight: row.fweight,
  2306. preftid: this.table2.temp.preftid,
  2307. pastureid: this.table2.getdataListParm.parammaps.pastureid,
  2308. ftid: this.table2.getdataListParm.parammaps.ftid,
  2309. dateTime: dateTime,
  2310. slid: 0,
  2311. fid: row.fid
  2312. }}
  2313. this.requestParam.data[4] = { 'name': 'insertFTHistory', 'type': 'e', 'parammaps': {
  2314. id:this.table2.getdataListParm.parammaps.ftid,
  2315. createdate:dateTime
  2316. }}
  2317. const url = 'authdata/ftdetail/edit'
  2318. const data = this.requestParam
  2319. postJson(url, data).then(response => {
  2320. if (response.msg !== 'fail') {
  2321. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  2322. this.getList2()
  2323. this.getList3()
  2324. } else {
  2325. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  2326. }
  2327. })
  2328. // ExecDataByConfig(this.requestParam).then(response => {
  2329. // console.log('新增保存发送参数', this.requestParam)
  2330. // if (response.msg !== 'fail') {
  2331. // this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  2332. // this.getList2()
  2333. // this.getList3()
  2334. // } else {
  2335. // this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  2336. // }
  2337. // })
  2338. },
  2339. createCancel2(row) {
  2340. console.log('点击了详情新增取消')
  2341. for (let i = 0; i < this.table2.list.length; i++) {
  2342. if (row.myId === this.table2.list[i].myId) {
  2343. var listIndex = this.table2.list.indexOf(this.table2.list[i])
  2344. }
  2345. if (listIndex > -1) {
  2346. this.table2.list.splice(listIndex, 1)
  2347. return
  2348. }
  2349. }
  2350. this.getDialogList()
  2351. },
  2352. // 详情编辑
  2353. handleUpdate2(row) {
  2354. console.log('详情编辑', row)
  2355. this.dropState = true
  2356. row.isGroupDisabled = false
  2357. row.islockcount = String(row.islockcount)
  2358. row.fid = String(row.fid)
  2359. row.autosecond = String(row.autosecond)
  2360. this.table2.temp.fname = row.fname
  2361. this.table2.temp.preftid = row.preftid
  2362. const rowArr = []
  2363. for (let i = 0; i < this.table2.list.length; i++) {
  2364. if (this.table2.list[i].Edit == true) {
  2365. this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
  2366. return false
  2367. }
  2368. rowArr.push(this.table2.list[i].sort)
  2369. }
  2370. var count = 0
  2371. for (let i = 0; i < rowArr.length; i++) {
  2372. if (rowArr[i] == row.sort) {
  2373. count++
  2374. }
  2375. }
  2376. // 判断是否有相同顺序,如果没有饲料组不可编辑,若有饲料组可编辑
  2377. if (count == 1) {
  2378. // 饲料组编辑false,不可编辑true
  2379. row.groupEdit = false
  2380. row.groupNoEdit = true
  2381. // 编辑true,不可编辑false
  2382. row.Edit = true
  2383. row.NoEdit = false
  2384. // 新增false,编辑false,编辑保存true
  2385. row.isCreate = false
  2386. row.isUpdate = false
  2387. row.isUpdateSave = true
  2388. } else if (count > 1) {
  2389. // 饲料组编辑true,不可编辑false
  2390. row.groupEdit = true
  2391. row.groupNoEdit = false
  2392. console.log(222)
  2393. // 编辑true,不可编辑false
  2394. row.Edit = true
  2395. row.NoEdit = false
  2396. // 新增false,编辑false,编辑保存true
  2397. row.isCreate = false
  2398. row.isUpdate = false
  2399. row.isUpdateSave = true
  2400. return false
  2401. }
  2402. this.table2.updateList = Object.assign({}, row)
  2403. },
  2404. updateData2(row) {
  2405. console.log('点击了详情编辑保存', row)
  2406. this.isokDisable = true
  2407. setTimeout(() => {
  2408. this.isokDisable = false
  2409. }, 1000)
  2410. this.table2.temp.pastureid = row.pastureid
  2411. this.table2.temp.ftid = this.table2.getdataListParm.parammaps.ftid
  2412. this.table2.temp.fid = row.fid
  2413. this.table2.temp.fname = this.table2.temp.fname
  2414. this.table2.temp.fweight = row.fweight
  2415. this.table2.temp.islockcount = row.islockcount
  2416. this.table2.temp.sort = row.sort
  2417. this.table2.temp.feedgroup = row.feedgroup
  2418. this.table2.temp.preftid = this.table2.temp.preftid
  2419. this.table2.temp.autosecond = row.autosecond
  2420. this.table2.temp.id = row.id
  2421. console.log('this.table2.updateList', this.table2.updateList)
  2422. console.log('temp', this.table2.temp)
  2423. // var status = ''
  2424. // if (parseFloat(this.table2.temp.fweight) > parseFloat(this.table2.updateList.fweight)) {
  2425. // status = 0
  2426. // } else {
  2427. // status = 1
  2428. // }
  2429. if (this.table2.temp.fid == '' && this.table2.temp.fweight == '' && this.table2.temp.autosecond == '') {
  2430. this.$message({ type: 'error', message: '饲料名称/重量/搅拌延时不能为空', duration: 2000 })
  2431. return false
  2432. } else if (this.table2.temp.fweight == '' && this.table2.temp.autosecond == '') {
  2433. this.$message({ type: 'error', message: '重量/搅拌延时不能为空', duration: 2000 })
  2434. return false
  2435. } else if (this.table2.temp.fid == '') {
  2436. this.$message({ type: 'error', message: '饲料名称不能为空', duration: 2000 })
  2437. return false
  2438. } else if (this.table2.temp.fweight == '') {
  2439. this.$message({ type: 'error', message: '重量不能为空', duration: 2000 })
  2440. return false
  2441. } else if (this.table2.temp.autosecond == '') {
  2442. this.$message({ type: 'error', message: '搅拌延时不能为空', duration: 2000 })
  2443. return false
  2444. }
  2445. if (this.table2.temp.sort !== '') {
  2446. this.table2.temp.sort = this.table2.temp.sort
  2447. } else {
  2448. this.table2.temp.sort = parseInt(this.table2.list[this.table2.list.length - 1].sort) + 1
  2449. }
  2450. if (this.table2.getdataListParm.parammaps.fttypeid == 2) {
  2451. if (parseInt(this.table2.temp.preftid) > 0) {
  2452. this.$message({ type: 'error', message: '饲料名称不能选择预混配方', duration: 2000 })
  2453. return false
  2454. }
  2455. }
  2456. // 校验顺序是否>=0
  2457. var ruleSort = /^\d+$/
  2458. if (!ruleSort.test(this.table2.temp.sort)) {
  2459. this.$message({ type: 'error', message: '饲料顺序不可为负数或小数', duration: 2000 })
  2460. return false
  2461. }
  2462. this.table2.temp.fweight = formatNum(this.table2.temp.fweight, 4) // 根据默认参数设置小数位数
  2463. row.fweight = formatNum(row.fweight, 4)
  2464. // 检验重量>0
  2465. // var ruleWeight = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
  2466. if (this.table2.temp.fweight == 0) {
  2467. this.$message({ type: 'error', message: '重量请输入正数,最多保留四位小数', duration: 2000 })
  2468. return false
  2469. }
  2470. console.log(row.fweight,'row.fweight')
  2471. let dateTime = parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
  2472. this.requestParam.common = { 'returnmap': '0' }
  2473. this.requestParam.createdate = dateTime
  2474. this.requestParam.data = []
  2475. this.requestParam.data[0] = { 'name': 'insertFitHistory', 'type': 'e', 'parammaps': {
  2476. pastureid: row.pastureid,
  2477. ftid: this.table2.getdataListParm.parammaps.ftid,
  2478. weight: String(row.fweight),
  2479. preftid: this.table2.temp.preftid,
  2480. dateTime: dateTime,
  2481. slid: this.table2.temp.id,
  2482. fid: row.fid
  2483. }}
  2484. this.requestParam.data[1] = { 'name': 'updateFTdetail', 'type': 'e', 'parammaps': {
  2485. pastureid: row.pastureid,
  2486. ftid: this.table2.getdataListParm.parammaps.ftid,
  2487. fid: row.fid,
  2488. fname: this.table2.temp.fname,
  2489. fweight: String(row.fweight),
  2490. islockcount: row.islockcount,
  2491. sort: row.sort,
  2492. feedgroup: row.feedgroup,
  2493. preftid: this.table2.temp.preftid,
  2494. autosecond: row.autosecond,
  2495. id: row.id
  2496. }}
  2497. this.requestParam.data[2] = { 'name': 'updateFPbyFTChange', 'type': 'e', 'parammaps': {
  2498. pastureid: row.pastureid,
  2499. ftid: this.table2.getdataListParm.parammaps.ftid,
  2500. type: this.table2.getdataListParm.parammaps.fttypeid,
  2501. // status: status
  2502. }}
  2503. this.requestParam.data[3] = { 'name': 'updateFTdetailbySort', 'type': 'e', 'parammaps': {
  2504. pastureid: row.pastureid,
  2505. ftid: this.table2.getdataListParm.parammaps.ftid,
  2506. sort: row.sort,
  2507. feedgroup: row.feedgroup
  2508. }}
  2509. this.requestParam.data[4] = { 'name': 'updateFTdetailGroup', 'type': 'e', 'parammaps': {
  2510. pastureid: this.table2.getdataListParm.parammaps.pastureid,
  2511. ftid: this.table2.getdataListParm.parammaps.ftid
  2512. }}
  2513. this.requestParam.data[5] = { 'name': 'insertFTHistory', 'type': 'e', 'parammaps': {
  2514. id:this.table2.getdataListParm.parammaps.ftid,
  2515. createdate:dateTime
  2516. }}
  2517. const url = 'authdata/ftdetail/edit'
  2518. const data = this.requestParam
  2519. postJson(url, data).then(response => {
  2520. if (response.msg !== 'fail') {
  2521. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  2522. this.getList2()
  2523. this.getList3()
  2524. this.dropState = false
  2525. } else {
  2526. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  2527. }
  2528. })
  2529. // ExecDataByConfig(this.requestParam).then(response => {
  2530. // console.log('新增保存发送参数', this.requestParam)
  2531. // if (response.msg !== 'fail') {
  2532. // this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  2533. // this.getList2()
  2534. // this.getList3()
  2535. // this.dropState = false
  2536. // } else {
  2537. // this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  2538. // }
  2539. // })
  2540. },
  2541. updateCancel2(row) {
  2542. console.log('点击了详情编辑取消')
  2543. // 饲料组编辑false,不可编辑true
  2544. row.groupEdit = false
  2545. row.groupNoEdit = true
  2546. // 编辑false,不可编辑true
  2547. row.Edit = false
  2548. row.NoEdit = true
  2549. // 新增false,编辑true,编辑保存false
  2550. row.isCreate = false
  2551. row.isUpdate = true
  2552. row.isUpdateSave = false
  2553. this.getList2()
  2554. this.dropState = false
  2555. },
  2556. // 详情删除
  2557. handleRowDelete2(row) {
  2558. console.log('点击了行内删除')
  2559. MessageBox.confirm('是否确认删除此信息?', {
  2560. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  2561. }).then(() => {
  2562. console.log(this.table2.list.length)
  2563. let dateTime = parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
  2564. if (this.table2.list.length > 1) {
  2565. this.requestParam.common = { 'returnmap': '0' }
  2566. this.requestParam.createdate = dateTime
  2567. this.requestParam.data = []
  2568. this.requestParam.data[0] = { 'name': 'insertFitHistory', 'type': 'e', 'parammaps': {
  2569. pastureid: row.pastureid,
  2570. ftid: this.table2.getdataListParm.parammaps.ftid,
  2571. weight: 0,
  2572. preftid: row.preftid,
  2573. dateTime: dateTime,
  2574. slid: row.id,
  2575. fid: row.fid
  2576. }}
  2577. this.requestParam.data[1] = { 'name': 'deleteFTdetail', 'type': 'e', 'parammaps': {
  2578. pastureid: row.pastureid,
  2579. id: row.id
  2580. }}
  2581. this.requestParam.data[2] = { 'name': 'updateFPbyFTChange', 'type': 'e', 'parammaps': {
  2582. pastureid: row.pastureid,
  2583. ftid: this.table2.getdataListParm.parammaps.ftid,
  2584. type: this.table2.getdataListParm.parammaps.fttypeid,
  2585. status: 1
  2586. }}
  2587. this.requestParam.data[3] = { 'name': 'updateftversion', 'type': 'e', 'parammaps': {
  2588. pastureid: this.table2.getdataListParm.parammaps.pastureid,
  2589. id: this.table2.getdataListParm.parammaps.ftid
  2590. }}
  2591. this.requestParam.data[4] = { 'name': 'insertFTHistory', 'type': 'e', 'parammaps': {
  2592. id:this.table2.getdataListParm.parammaps.ftid,
  2593. createdate:dateTime
  2594. }}
  2595. } else {
  2596. this.requestParam.common = { 'returnmap': '0' }
  2597. this.requestParam.createdate = dateTime
  2598. this.requestParam.data = []
  2599. this.requestParam.data[0] = { 'name': 'insertFitHistory', 'type': 'e', 'parammaps': {
  2600. pastureid: row.pastureid,
  2601. ftid: this.table2.getdataListParm.parammaps.ftid,
  2602. weight: 0,
  2603. preftid: row.preftid,
  2604. dateTime: dateTime,
  2605. slid: row.id,
  2606. fid: row.fid
  2607. }}
  2608. // this.requestParam.data[1] = { 'name': 'checkdeleteFT', 'type': 'v', 'parammaps': {
  2609. // pastureid: this.table2.getdataListParm.parammaps.pastureid,
  2610. // id: this.table2.getdataListParm.parammaps.ftid
  2611. // }}
  2612. this.requestParam.data[1] = { 'name': 'deleteFTdetail', 'type': 'e', 'parammaps': {
  2613. pastureid: row.pastureid,
  2614. id: row.id
  2615. }}
  2616. this.requestParam.data[2] = { 'name': 'updateFPbyFTChange', 'type': 'e', 'parammaps': {
  2617. pastureid: row.pastureid,
  2618. ftid: this.table2.getdataListParm.parammaps.ftid,
  2619. type: this.table2.getdataListParm.parammaps.fttypeid,
  2620. status: 1
  2621. }}
  2622. this.requestParam.data[3] = { 'name': 'updateftversion', 'type': 'e', 'parammaps': {
  2623. pastureid: this.table2.getdataListParm.parammaps.pastureid,
  2624. id: this.table2.getdataListParm.parammaps.ftid
  2625. }}
  2626. this.requestParam.data[4] = { 'name': 'insertFTHistory', 'type': 'e', 'parammaps': {
  2627. id:this.table2.getdataListParm.parammaps.ftid,
  2628. createdate:dateTime
  2629. }}
  2630. }
  2631. const url = 'authdata/ftdetail/edit'
  2632. const data = this.requestParam
  2633. postJson(url, data).then(response => {
  2634. if (response.msg !== 'fail') {
  2635. this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
  2636. this.getList2()
  2637. this.getList3()
  2638. } else {
  2639. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  2640. }
  2641. })
  2642. // ExecDataByConfig(this.requestParam).then(response => {
  2643. // console.log('新增保存发送参数', this.requestParam)
  2644. // if (response.msg === 'fail') {
  2645. // this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  2646. // } else {
  2647. // this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
  2648. // this.getList2()
  2649. // this.getList3()
  2650. // }
  2651. // })
  2652. }).catch(() => {
  2653. this.$message({ type: 'info', message: '已取消删除' })
  2654. })
  2655. },
  2656. handleSelectionChange2(val) {
  2657. console.log('勾选数据', val)
  2658. this.selectList2 = val
  2659. },
  2660. celldblclick(row, column, cell, event) {
  2661. console.log(row, '=====')
  2662. this.handleUpdate2(row)
  2663. },
  2664. handleDelete2() {
  2665. console.log('点击了删除')
  2666. if (this.selectList2.length == 0) {
  2667. this.$message({ type: 'error', message: '请选择配方详情', duration: 2000 })
  2668. } else {
  2669. MessageBox.confirm('是否确认删除此信息?', {
  2670. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  2671. }).then(() => {
  2672. console.log(this.table2.list.length - this.selectList2.length)
  2673. let dateTime = parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
  2674. if (this.table2.list.length - this.selectList2.length > 0) {
  2675. this.requestParam.common = { 'returnmap': '0' }
  2676. this.requestParam.createdate = dateTime
  2677. this.requestParam.data = []
  2678. this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList2 }}
  2679. this.requestParam.data[0].children = []
  2680. this.requestParam.data[0].children[0] = { 'name': 'insertFitHistory', 'type': 'e', 'parammaps': {
  2681. pastureid: '@insertSpotList.pastureid',
  2682. ftid: '@insertSpotList.ftid',
  2683. weight: 0,
  2684. preftid: '@insertSpotList.preftid',
  2685. dateTime: dateTime,
  2686. slid: '@insertSpotList.id',
  2687. fid: '@insertSpotList.fid'
  2688. }}
  2689. this.requestParam.data[0].children[1] = { 'name': 'deleteFTdetail', 'type': 'e', 'parammaps': {
  2690. id: '@insertSpotList.id',
  2691. pastureid: '@insertSpotList.pastureid'
  2692. }}
  2693. this.requestParam.data[1] = { 'name': 'updateftversion', 'type': 'e', 'parammaps': {
  2694. pastureid: this.table2.getdataListParm.parammaps.pastureid,
  2695. id: this.table2.getdataListParm.parammaps.ftid
  2696. }}
  2697. this.requestParam.data[2] = { 'name': 'updateFPbyFTChange', 'type': 'e', 'parammaps': {
  2698. pastureid: this.table2.getdataListParm.parammaps.pastureid,
  2699. ftid:this.table2.getdataListParm.parammaps.ftid,
  2700. type: this.table2.getdataListParm.parammaps.fttypeid,
  2701. status: 1
  2702. }}
  2703. this.requestParam.data[3] = { 'name': 'insertFTHistory', 'type': 'e', 'parammaps': {
  2704. id:this.table2.getdataListParm.parammaps.ftid,
  2705. createdate:dateTime
  2706. }}
  2707. const url = 'authdata/ftdetail/edit'
  2708. const data = this.requestParam
  2709. postJson(url, data).then(response => {
  2710. if (response.msg !== 'fail') {
  2711. this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
  2712. this.getList2()
  2713. this.getList3()
  2714. } else {
  2715. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  2716. }
  2717. })
  2718. } else {
  2719. this.requestParam.common = { 'returnmap': '0' }
  2720. this.requestParam.data = []
  2721. // this.requestParam.data[0] = { 'name': 'checkdeleteFT', 'type': 'v', 'parammaps': {
  2722. // pastureid: this.table2.getdataListParm.parammaps.pastureid,
  2723. // id: this.table2.getdataListParm.parammaps.ftid
  2724. // }}
  2725. // this.requestParam.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList2 }}
  2726. // this.requestParam.data[1].children = []
  2727. // this.requestParam.data[1].children[0] = { 'name': 'deleteFTdetail', 'type': 'e', 'parammaps': {
  2728. // id: '@insertSpotList.id',
  2729. // pastureid: '@insertSpotList.pastureid'
  2730. // }}
  2731. this.requestParam.data[0] = { 'name': 'updateftversion', 'type': 'e', 'parammaps': {
  2732. pastureid: this.table2.getdataListParm.parammaps.pastureid,
  2733. id: this.table2.getdataListParm.parammaps.ftid
  2734. }}
  2735. // this.requestParam.data[3] = { 'name': 'updateFPbyFTChange', 'type': 'e', 'parammaps': {
  2736. // pastureid: this.table2.getdataListParm.parammaps.pastureid,
  2737. // ftid:this.table2.getdataListParm.parammaps.ftid,
  2738. // type: this.table2.getdataListParm.parammaps.fttypeid,
  2739. // status: 1
  2740. // }}
  2741. ExecDataByConfig(this.requestParam).then(response => {
  2742. console.log('删除保存发送参数', this.requestParam)
  2743. if (response.msg === 'fail') {
  2744. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  2745. } else {
  2746. const url = 'authdata/ftdetai/del'
  2747. const data = {}
  2748. data.parammaps = {}
  2749. data.parammaps.pastureid = this.table2.getdataListParm.parammaps.pastureid
  2750. data.parammaps.ftid = this.table2.getdataListParm.parammaps.ftid
  2751. data.parammaps.type = this.table2.getdataListParm.parammaps.fttypeid
  2752. postJson(url, data).then(response => {
  2753. if (response.msg !== 'fail') {
  2754. this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
  2755. this.getList2()
  2756. this.getList3()
  2757. } else {
  2758. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  2759. }
  2760. })
  2761. }
  2762. })
  2763. }
  2764. })
  2765. }
  2766. },
  2767. // 拆分预混料
  2768. handleSplitPremix(row) {
  2769. console.log('点击了拆分预混料')
  2770. MessageBox.confirm('是否确认拆分当前预混料?', {
  2771. confirmButtonText: '确认',
  2772. cancelButtonText: '取消',
  2773. type: 'warning'
  2774. }).then(() => {
  2775. this.requestParam.name = 'splitFTpre'
  2776. this.requestParam.parammaps = {}
  2777. this.requestParam.parammaps.ftid = this.table2.getdataListParm.parammaps.ftid
  2778. this.requestParam.parammaps.preftid = row.preftid
  2779. this.requestParam.parammaps.ftdid = row.id
  2780. this.requestParam.parammaps.pastureid = row.pastureid
  2781. this.requestParam.parammaps.feedgroup = row.feedgroup
  2782. this.requestParam.parammaps.sort = row.sort
  2783. this.requestParam.parammaps.fweight = row.fweight
  2784. PostDataByName(this.requestParam).then(response => {
  2785. if (response.msg === 'fail') {
  2786. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  2787. } else {
  2788. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  2789. this.getList2()
  2790. this.getList3()
  2791. }
  2792. })
  2793. }).catch(() => {
  2794. this.$message({
  2795. type: 'info',
  2796. message: '已取消删除'
  2797. })
  2798. })
  2799. },
  2800. // 合成预混料
  2801. handleSyntheticPremix() {
  2802. console.log('点击了合成预混料', this.selectList2)
  2803. this.dialogFull = false
  2804. if (this.table2.getdataListParm.parammaps.fttypeid == 2) {
  2805. this.$message({ type: 'error', message: '预混配方不可合成预混料', duration: 2000 })
  2806. return false
  2807. } else {
  2808. if (this.selectList2.length > 1) {
  2809. for (let i = 0; i < this.selectList2.length; i++) {
  2810. if (parseInt(this.selectList2[i].preftid) > 0) {
  2811. this.$message({ type: 'error', message: '不可选择预混料', duration: 2000 })
  2812. return false
  2813. }
  2814. }
  2815. if (this.selectList2[0].splitftpreid !== undefined) {
  2816. this.detail.getdataListParm.parammaps.ftid = this.selectList2[0].splitftpreid
  2817. this.detail.getdataListParm.parammaps.pastureid = this.selectList2[0].pastureid
  2818. GetDataByName(this.detail.getdataListParm).then(response => {
  2819. if (response.data.list !== null) { // 不为空时得到比对数据
  2820. this.detail.list3 = response.data.list
  2821. const sortList = [] // 声明排序数组
  2822. var fweightSum = 0 // 总重量
  2823. for (let i = 0; i < this.selectList2.length; i++) {
  2824. const obj = {}
  2825. obj.fid = this.selectList2[i].fid
  2826. obj.fweight = this.selectList2[i].fweight
  2827. fweightSum = fweightSum + parseFloat(this.selectList2[i].fweight)
  2828. sortList.push(obj)
  2829. }
  2830. // 排序
  2831. sortList.sort(function(a, b) {
  2832. return a.fid.localeCompare(b.fid)
  2833. })
  2834. var a = 0
  2835. if (this.detail.list3.length == sortList.length) {
  2836. for (let i = 0; i < this.detail.list3.length; i++) {
  2837. if (this.detail.list3[i].fid == sortList[i].fid && (this.detail.list3[i].fweight / this.detail.list3[i].sumWeight).toFixed(3) == (sortList[i].fweight / fweightSum).toFixed(3)) {
  2838. a++
  2839. }
  2840. }
  2841. if (a == this.detail.list3.length) { // 如果相等,则该配方为原预混配方
  2842. this.detail.getdataListParm2.parammaps.ftid = this.selectList2[0].splitftpreid
  2843. this.detail.getdataListParm2.parammaps.pastureid = this.selectList2[0].pastureid
  2844. GetDataByName(this.detail.getdataListParm2).then(response => {
  2845. if (response.data.list !== null) {
  2846. this.detail.dialogStatus = 'SyntheticPremix'
  2847. this.detail.dialogFormVisible = true
  2848. this.detail.list = this.selectList2
  2849. this.detail.list2 = response.data.list
  2850. this.detail.disabled = true
  2851. setTimeout(() => {
  2852. this.detail.listLoading = false
  2853. }, 100)
  2854. } else {
  2855. this.detail.list2 = []
  2856. }
  2857. })
  2858. } else {
  2859. this.detail.dialogStatus = 'SyntheticPremix'
  2860. this.detail.dialogFormVisible = true
  2861. this.detail.list = this.selectList2
  2862. this.detail.disabled = false
  2863. this.detail.list2 = [{ tname: '', tcolor: '#ccc', ccid: '', fttype: '预混配方', fttypeid: '2', source: '自定义', remark: '', 'enable': 1 }]
  2864. setTimeout(() => {
  2865. this.detail.listLoading = false
  2866. }, 100)
  2867. }
  2868. } else {
  2869. this.detail.dialogStatus = 'SyntheticPremix'
  2870. this.detail.dialogFormVisible = true
  2871. this.detail.list = this.selectList2
  2872. this.detail.disabled = false
  2873. this.detail.list2 = [{ tname: '', tcolor: '#ccc', ccid: '', fttype: '预混配方', fttypeid: '2', source: '自定义', remark: '', 'enable': 1 }]
  2874. setTimeout(() => {
  2875. this.detail.listLoading = false
  2876. }, 100)
  2877. }
  2878. } else {
  2879. this.detail.list3 = []
  2880. this.detail.dialogStatus = 'SyntheticPremix'
  2881. this.detail.dialogFormVisible = true
  2882. this.detail.list = this.selectList2
  2883. this.detail.disabled = false
  2884. this.detail.list2 = [{ tname: '', tcolor: '#ccc', ccid: '', fttype: '预混配方', fttypeid: '2', source: '自定义', remark: '', 'enable': 1 }]
  2885. setTimeout(() => {
  2886. this.detail.listLoading = false
  2887. }, 100)
  2888. }
  2889. })
  2890. } else {
  2891. this.detail.dialogStatus = 'SyntheticPremix'
  2892. this.detail.dialogFormVisible = true
  2893. this.detail.list = this.selectList2
  2894. this.detail.disabled = false
  2895. this.detail.list2 = [{ tname: '', tcolor: '#ccc', ccid: '', fttype: '预混配方', fttypeid: '2', source: '自定义', remark: '', 'enable': 1 }]
  2896. setTimeout(() => {
  2897. this.detail.listLoading = false
  2898. }, 100)
  2899. }
  2900. } else {
  2901. this.$message({ type: 'error', message: '请选择俩条及以上饲料进行合成', duration: 2000 })
  2902. return false
  2903. }
  2904. }
  2905. },
  2906. // 畜生类别
  2907. changeLivestockType2(item) {
  2908. this.detail.list2[0].ccname = this.livestockTypeList.find(obj => obj.value === item).label
  2909. },
  2910. syntheticPremixData() {
  2911. console.log('点击了合成预混料确认')
  2912. if (this.detail.disabled == true) { // 原预混料
  2913. let sumFweight = 0
  2914. for (let i = 0; i < this.detail.list.length; i++) {
  2915. sumFweight += parseFloat(this.detail.list[i].fweight)
  2916. }
  2917. sumFweight = sumFweight.toFixed(3)
  2918. this.isokDisable = true
  2919. setTimeout(() => {
  2920. this.isokDisable = false
  2921. }, 1000)
  2922. this.requestParam.common = { 'returnmap': '0' }
  2923. this.requestParam.data = []
  2924. this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.detail.list }}
  2925. this.requestParam.data[0].children = []
  2926. this.requestParam.data[0].children[0] = { 'name': 'deleteFTdetail', 'type': 'e', 'parammaps': {
  2927. pastureid: '@insertSpotList.pastureid',
  2928. id: '@insertSpotList.id'
  2929. }}
  2930. this.requestParam.data[1] = { 'name': 'insertSpotList2', 'resultmaps': { 'list': this.detail.list2 }}
  2931. this.requestParam.data[1].children = []
  2932. this.requestParam.data[1].children[0] = { 'name': 'insertFTdetail', 'type': 'e', 'parammaps': {
  2933. pastureid: Cookies.get('pastureid'),
  2934. ftid: this.table2.getdataListParm.parammaps.ftid,
  2935. fid: this.detail.list2[0].id,
  2936. fname: '@insertSpotList2.tname',
  2937. fweight: sumFweight,
  2938. islockcount: '0',
  2939. sort: parseInt(this.table2.list[this.table2.list.length - 1].sort) + 1,
  2940. feedgroup: '@insertSpotList2.tname',
  2941. preftid: this.detail.list2[0].id,
  2942. autosecond: this.detail.list[0].autosecond
  2943. }}
  2944. ExecDataByConfig(this.requestParam).then(response => {
  2945. console.log('合成预混料保存发送参数', this.requestParam)
  2946. if (response.msg === 'fail') {
  2947. const tname = new RegExp("key 'tname'")
  2948. if (tname.test(response.data)) {
  2949. this.$message({ type: 'error', message: '预混配方已存在,不可重复生成', duration: 2000 })
  2950. } else {
  2951. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  2952. }
  2953. } else {
  2954. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  2955. this.detail.dialogFormVisible = false
  2956. this.getList3()
  2957. this.getList2()
  2958. this.getDownList()
  2959. }
  2960. })
  2961. } else { // 现生成预混料
  2962. if (this.detail.list2[0].tname == '' && this.detail.list2[0].ccid == '') {
  2963. this.$message({ type: 'error', message: '配方名称/牲畜类别/不能为空', duration: 2000 })
  2964. return false
  2965. } else if (this.detail.list2[0].tname == '') {
  2966. this.$message({ type: 'error', message: '配方名称不能为空', duration: 2000 })
  2967. return false
  2968. } else if (this.detail.list2[0].ccid == '') {
  2969. this.$message({ type: 'error', message: '牲畜类别不能为空', duration: 2000 })
  2970. return false
  2971. }
  2972. const pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]")
  2973. if (pattern.test(this.detail.list2[0].tname)) {
  2974. this.$message({ type: 'error', message: '配方名称不可输入特殊字符', duration: 2000 })
  2975. return false
  2976. }
  2977. let sumFweight = 0
  2978. for (let i = 0; i < this.detail.list.length; i++) {
  2979. sumFweight += parseFloat(this.detail.list[i].fweight)
  2980. }
  2981. sumFweight = sumFweight.toFixed(3)
  2982. console.log(sumFweight)
  2983. this.isokDisable = true
  2984. setTimeout(() => {
  2985. this.isokDisable = false
  2986. }, 1000)
  2987. if (this.detail.list2[0].tcolor == null) {
  2988. this.detail.list2[0].tcolor = '#CCCCCC'
  2989. }
  2990. this.requestParam.common = { 'returnmap': '0' }
  2991. this.requestParam.data = []
  2992. this.requestParam.data[0] = { 'name': 'insertFT', 'type': 'e', 'parammaps': {
  2993. pastureid: Cookies.get('pastureid'),
  2994. tcode: this.detail.list2[0].tcode,
  2995. tname: this.detail.list2[0].tname,
  2996. tcolor: this.detail.list2[0].tcolor,
  2997. ccid: this.detail.list2[0].ccid,
  2998. ccname: this.detail.list2[0].ccname,
  2999. fttype: this.detail.list2[0].fttype,
  3000. fttypeid: this.detail.list2[0].fttypeid,
  3001. source: this.detail.list2[0].source,
  3002. remark: this.detail.list2[0].remark,
  3003. enable: this.detail.list2[0].enable
  3004. }}
  3005. this.requestParam.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.detail.list }}
  3006. this.requestParam.data[1].children = []
  3007. this.requestParam.data[1].children[0] = { 'name': 'insertFTdetail', 'type': 'e', 'parammaps': {
  3008. pastureid: '@insertSpotList.pastureid',
  3009. ftid: '@insertFT.LastInsertId',
  3010. fid: '@insertSpotList.fid',
  3011. fname: '@insertSpotList.fname',
  3012. fweight: '@insertSpotList.fweight',
  3013. islockcount: '@insertSpotList.islockcount',
  3014. sort: '@insertSpotList.sort',
  3015. feedgroup: '@insertSpotList.feedgroup',
  3016. preftid: '@insertSpotList.preftid',
  3017. autosecond: '@insertSpotList.autosecond'
  3018. }}
  3019. this.requestParam.data[1].children[1] = { 'name': 'deleteFTdetail', 'type': 'e', 'parammaps': {
  3020. pastureid: '@insertSpotList.pastureid',
  3021. id: '@insertSpotList.id'
  3022. }}
  3023. this.requestParam.data[2] = { 'name': 'insertSpotList2', 'resultmaps': { 'list': this.detail.list2 }}
  3024. this.requestParam.data[2].children = []
  3025. this.requestParam.data[2].children[0] = { 'name': 'insertFTdetail', 'type': 'e', 'parammaps': {
  3026. pastureid: Cookies.get('pastureid'),
  3027. ftid: this.table2.getdataListParm.parammaps.ftid,
  3028. fid: '@insertFT.LastInsertId',
  3029. fname: '@insertSpotList2.tname',
  3030. fweight: sumFweight,
  3031. islockcount: '0',
  3032. sort: parseInt(this.table2.list[this.table2.list.length - 1].sort) + 1,
  3033. feedgroup: '@insertSpotList2.tname',
  3034. preftid: '@insertFT.LastInsertId',
  3035. autosecond: this.detail.list[0].autosecond
  3036. }}
  3037. ExecDataByConfig(this.requestParam).then(response => {
  3038. console.log('合成预混料保存发送参数', this.requestParam)
  3039. if (response.msg === 'fail') {
  3040. const tname = new RegExp("key 'tname'")
  3041. if (tname.test(response.data)) {
  3042. this.$message({ type: 'error', message: '预混配方已存在,不可重复生成', duration: 2000 })
  3043. } else {
  3044. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  3045. }
  3046. } else {
  3047. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  3048. this.detail.dialogFormVisible = false
  3049. this.getList3()
  3050. this.getList2()
  3051. this.getDownList()
  3052. }
  3053. })
  3054. }
  3055. },
  3056. handleFormulationEvaluation(row) {
  3057. console.log(row)
  3058. // this.$router.push({ path: '/statisticalAnalysis/FormulationEvaluation', query: { tname: row.tname }})
  3059. this.$router.push({
  3060. name: 'FormulationEvaluation',
  3061. params: {
  3062. tname: row.tname,
  3063. ftid: row.id,
  3064. pastureid: row.pastureid,
  3065. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  3066. inputDatetime: [new Date('startTime'), new Date('startTime')], // 日期后台待传
  3067. stopTime: parseTime(new Date(), '{y}-{m}-{d}')
  3068. }
  3069. })
  3070. },
  3071. // 配方记录
  3072. handleRowRecipeRecord(row) {
  3073. console.log(row)
  3074. this.rowRecipeRecord.temp = Object.assign({}, row)
  3075. this.rowRecipeRecord.dialogFormVisible = true
  3076. this.textMap.rowRecipeRecordTxt = '配方修改记录——配方:' + row.tname
  3077. this.rowRecipeRecord.dialogStatus = 'rowRecipeRecordTxt'
  3078. this.rowRecipeRecord.getdataListParm.parammaps.pastureid = row.pastureid
  3079. this.rowRecipeRecord.getdataListParm.parammaps.fitid = row.id
  3080. this.rowRecipeRecord.getdataListParm.parammaps.inputDatetime = []
  3081. this.getRowRecipeRecordList()
  3082. },
  3083. getRowRecipeRecordList() {
  3084. this.rowRecipeRecord.listLoading = true
  3085. this.rowRecipeRecord.getdataListParm.parammaps.fitid = this.rowRecipeRecord.temp.id
  3086. if (this.rowRecipeRecord.getdataListParm.parammaps.inputDatetime == null) {
  3087. this.rowRecipeRecord.getdataListParm.parammaps.inputDatetime = ''
  3088. this.rowRecipeRecord.getdataListParm.parammaps.startTime = ''
  3089. this.rowRecipeRecord.getdataListParm.parammaps.stopTime = ''
  3090. } else {
  3091. this.rowRecipeRecord.getdataListParm.parammaps.startTime = this.rowRecipeRecord.getdataListParm.parammaps.inputDatetime[0]
  3092. this.rowRecipeRecord.getdataListParm.parammaps.stopTime = this.rowRecipeRecord.getdataListParm.parammaps.inputDatetime[1]
  3093. }
  3094. const url = 'authdata/GetArrList'
  3095. const data = this.rowRecipeRecord.getdataListParm
  3096. postJson(url, data).then(response => {
  3097. if (response.data.list !== null) {
  3098. for (let i = 0; i < response.data.list.length; i++) {
  3099. if (response.data.list[i].arrList == null) {
  3100. this.$set(response.data.list[i], 'arrList', [])
  3101. }
  3102. }
  3103. this.rowRecipeRecord.list = response.data.list
  3104. this.rowRecipeRecord.pageNum = response.data.pageNum
  3105. this.rowRecipeRecord.pageSize = response.data.pageSize
  3106. this.rowRecipeRecord.total = response.data.total
  3107. } else {
  3108. this.rowRecipeRecord.list = []
  3109. this.rowRecipeRecord.total = 0
  3110. }
  3111. console.log(response.data, 'response.data')
  3112. setTimeout(() => {
  3113. this.rowRecipeRecord.listLoading = false
  3114. }, 100)
  3115. })
  3116. },
  3117. handleRowRecipeRecordSearch() {
  3118. this.getRowRecipeRecordList()
  3119. },
  3120. handleEnlarge() {
  3121. var height = (document.documentElement.clientHeight - 165 + 50).toString() + 'px'
  3122. // var height = (document.documentElement.clientHeight - 165 + 80).toString() + 'px'
  3123. // var height2 = '-' + (document.documentElement.clientHeight - 400).toString() + 'px'
  3124. var height2 = '-' + (this.$refs.template.offsetHeight).toString() + 'px'
  3125. // console.log(this.$refs.detail.offsetHeight)
  3126. // console.log(height2, 'height2')
  3127. this.isEnlarge = false
  3128. this.$refs.detail.style.top = height2
  3129. this.$refs.detail.style.height = height
  3130. this.$refs.appContainer.style.height = height
  3131. this.$refs.table2.style.height = 0
  3132. this.$refs.myContainer.style.posiiton = 'relative'
  3133. this.$refs.detail.style.posiiton = 'absolute'
  3134. },
  3135. handleNarrow() {
  3136. this.isEnlarge = true
  3137. this.$refs.detail.style.top = 0
  3138. this.$refs.detail.style.height = '300px'
  3139. this.$refs.myContainer.style.posiiton = ''
  3140. this.$refs.detail.style.posiiton = ''
  3141. this.$refs.detail.style.zIndex = ''
  3142. },
  3143. handleTakeEffect() {
  3144. if (this.selectList.length == 0) {
  3145. this.$message({ type: 'error', message: '请选择车次信息', duration: 2000 })
  3146. } else {
  3147. MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否生效?', {
  3148. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  3149. }).then(() => {
  3150. let ids = []
  3151. for (let i = 0; i < this.selectList.length; i++) {
  3152. ids.push(this.selectList[i].id)
  3153. }
  3154. var data = {}
  3155. data.parammaps = {}
  3156. data.parammaps.enable = 1
  3157. data.parammaps.id = ids.toString()
  3158. var url = 'authdata/feedtemplet/enable'
  3159. postJson(url,data).then(response => {
  3160. console.log('生效保存发送参数', data)
  3161. if (response.msg === 'fail') {
  3162. this.$notify({ title: '生效失败', message: response.data, type: 'warning', duration: 2000 })
  3163. } else {
  3164. this.$notify({ title: '', message: '生效成功', type: 'success', duration: 2000 })
  3165. this.getList()
  3166. }
  3167. })
  3168. })
  3169. }
  3170. },
  3171. handleDisable() {
  3172. if (this.selectList.length == 0) {
  3173. this.$message({ type: 'error', message: '请选择车次信息', duration: 2000 })
  3174. } else {
  3175. MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否禁用?', {
  3176. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  3177. }).then(() => {
  3178. let ids = []
  3179. for (let i = 0; i < this.selectList.length; i++) {
  3180. ids.push(this.selectList[i].id)
  3181. }
  3182. var data = {}
  3183. data.parammaps = {}
  3184. data.parammaps.enable = 0
  3185. data.parammaps.id = ids.toString()
  3186. console.log('禁用', data)
  3187. var url = 'authdata/feedtemplet/enable'
  3188. postJson(url,data).then(response => {
  3189. console.log('禁用保存发送参数', this.requestParam)
  3190. if (response.msg === 'fail') {
  3191. this.$notify({ title: '禁用失败', message: response.data, type: 'warning', duration: 2000 })
  3192. } else {
  3193. this.$notify({ title: '', message: '禁用成功', type: 'success', duration: 2000 })
  3194. this.getList()
  3195. }
  3196. })
  3197. })
  3198. }
  3199. }
  3200. }
  3201. }
  3202. </script>
  3203. <style lang="scss" scoped>
  3204. // .search{margin-top:10px;height: 40px;}
  3205. // .operation{height: 50px;}
  3206. .table{margin-top:5px;}
  3207. .table2{margin-top:10px;}
  3208. $width:350px;
  3209. $left:325px;
  3210. .selectInput{
  3211. position: relative;
  3212. display: inline-block;
  3213. .Input{width: $width;position: relative;}
  3214. .el-icon-arrow-down{width: 30px;height: 30px;position: absolute;left: $left;top:10px;color:#C0C4CC;}
  3215. .el-icon-arrow-up{width: 30px;height: 30px;position: absolute;left: $left;top:10px;color:#C0C4CC;}
  3216. .selectUl{
  3217. height:220px;overflow-y: auto;z-index: 111;width: $width;background: #fff;border: 1px solid #E4E7ED;box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);margin: -1px 0 0 0;padding: 6px 0; margin: 0;box-sizing: border-box;position: absolute;
  3218. li{
  3219. list-style: none;font-size: 14px; padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #606266; height: 50px; line-height: 50px; box-sizing: border-box; cursor: pointer;
  3220. a{float:left;width: 80px;}
  3221. a:hover{color: rgba(0, 204, 102, 0.71); font-weight: 700;}
  3222. }
  3223. }
  3224. }
  3225. .template{
  3226. background: #fff;
  3227. position: relative;
  3228. }
  3229. .app-container{background: #fff;}
  3230. .detail{
  3231. background: #fff;
  3232. overflow-y: hidden;
  3233. overflow-x: hidden;
  3234. // position: fixed;
  3235. // bottom: 0;
  3236. // right:0;
  3237. z-index: 3;
  3238. // width: calc(100% - 210px);
  3239. position: relative;
  3240. }
  3241. .hide2{float: right;right:0;}
  3242. .templateDialog{
  3243. background: #fff;
  3244. position: relative;
  3245. }
  3246. .detailDialog{
  3247. background: #fff;
  3248. position: relative;
  3249. }
  3250. .hide{float: right;margin-right: 60px;}
  3251. </style>
  3252. <style>
  3253. .el-color-dropdown__main-wrapper{display: none !important;}
  3254. .el-color-dropdown__value{display: none !important;}
  3255. .el-color-dropdown__btns .el-button--text{display: none !important;}
  3256. </style>