index.vue 139 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073
  1. <template>
  2. <div class="app-container">
  3. <!-- 配方模板表 -->
  4. <div ref="template" class="template">
  5. <div class="recipeTemplate">
  6. <p>日执行计划</p>
  7. </div>
  8. <div class="search">
  9. <el-date-picker v-model="table.getdataListParm.parammaps.mydate" type="date" placeholder="选择日期" style="width: 150px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :clearable="false" @change="changeDate" />
  10. <el-button class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore" />
  11. <el-button class="el-icon-arrow-right elIconArrowRight" @click="handleNext" />
  12. <el-select v-model="table.getdataListParm.parammaps.lpplantype" filterable placeholder="计划类型" class="filter-item" clearable style="width: 120px;" @change="changePlanType">
  13. <el-option v-for="item in planTypeList" :key="item.value" :label="item.lable" :value="item.value" />
  14. </el-select>
  15. <el-select v-model="table.getdataListParm.parammaps.times" filterable placeholder="班次" class="filter-item" style="width: 120px;" clearable @change="changeFrequency">
  16. <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
  17. </el-select>
  18. <el-select v-model="table.getdataListParm.parammaps.printType" filterable placeholder="打印类型" class="filter-item" :clearable="false" style="width: 120px;">
  19. <el-option v-for="item in printingTypeList" :key="item.value" :label="item.lable" :value="item.value" />
  20. </el-select>
  21. <el-select v-model="table.getdataListParm.parammaps.plandimen" filterable placeholder="计划维度" class="filter-item" style="width: 120px;" :clearable="false">
  22. <el-option v-for="item in planningDimensionList" :key="item.value" :label="item.lable" :value="item.value" />
  23. </el-select>
  24. <el-select v-model="table.getdataListParm.parammaps.enable3" filterable placeholder="导出类型" class="filter-item" style="width: 120px;" :clearable="false">
  25. <el-option v-for="item in exportTypeList" :key="item.value" :label="item.lable" :value="item.value" />
  26. </el-select>
  27. <el-select v-model="table.getdataListParm.parammaps.tmrname" filterable placeholder="TMR名称" class="filter-item" style="width: 120px;" :clearable="false">
  28. <el-option v-for="item in tmrDownList" :key="item.tmrname" :label="item.tmrname" :value="item.tmrtname" />
  29. </el-select>
  30. <el-select v-model="table.getdataListParm.parammaps.iscompleted" filterable placeholder="执行状态" class="filter-item" style="width: 120px;" :clearable="false">
  31. <el-option v-for="item in iscompletedList" :key="item.value" :label="item.lable" :value="item.value" />
  32. </el-select>
  33. <el-button class="successBorder" @click="form_search">查询</el-button>
  34. <el-button class="export" icon="el-icon-upload2" @click="handleExport">导出</el-button>
  35. <el-button class="export" icon="el-icon-upload2" @click="handlePrint">打印</el-button>
  36. <el-button class="export" style="margin-left: -5px;" @click="form_deleteRecord">删除记录</el-button>
  37. </div>
  38. <div class="operation" style="margin-bottom: 10px;">
  39. <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="handleCreate">新生成</el-button>
  40. <el-button v-if="isRoleEdit" class="success" icon="el-icon-edit-outline" @click="handleRevisePlan">修改计划</el-button>
  41. <el-button v-if="isRoleEdit" class="copy" icon="el-icon-copy-document" @click="handleCopy">复制计划</el-button>
  42. <el-button v-if="isOrder && isRoleEdit" icon="el-icon-sort" class="success" @click="handleChangeOrder">更改顺序</el-button>
  43. <div v-else style="margin-left: 10px;display: inline-block;">
  44. <el-button v-if="isRoleEdit" icon="el-icon-folder-checked" class="success" @click="saveChangeOrder">保存</el-button>
  45. <el-button v-if="isRoleEdit" icon="el-icon-close" class="sortCancel" @click="cancelChangeOrder">取消</el-button>
  46. </div>
  47. <el-button v-if="isRoleEdit" class="success" icon="el-icon-open" @click="handleTakeEffect">生效</el-button>
  48. <el-button v-if="isRoleEdit" class="danger" icon="el-icon-turn-off" @click="handleDisable">禁用</el-button>
  49. <el-button v-if="dataSynchronization2.isDataSynchronization" class="success" icon="el-icon-plus" @click="form_updata">上传计划</el-button>
  50. <el-button v-if="dataSynchronization.isDataSynchronization && isRoleEdit" class="success" @click="handleDataSynchronization">数据同步</el-button>
  51. <el-button v-if="dataSynchronization3.isDataSynchronization&&isRoleEdit" class="success" @click="handleDataUpload">数据上传</el-button>
  52. <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" @click="handleDelete">删除</el-button>
  53. <el-button v-if="isRoleEdit && sapUpload.isSap" class="success" icon="el-icon-upload2" @click="handleSAPUpload">SAP上传</el-button>
  54. <el-button v-if="isRoleEdit && ispalyUd" class="success" icon="el-icon-plus" @click="handleGetUd1">搅拌数据上传</el-button>
  55. <el-button v-if="isRoleEdit && ispalyUd" class="success" icon="el-icon-plus" @click="handleGetUd2">剩料上传</el-button>
  56. <el-button v-if="isRoleEdit && ispalyUd" class="success" icon="el-icon-plus" @click="handleGetUd3">撒料上传</el-button>
  57. </div>
  58. <!-- 日执行计划 -->
  59. <div class="table">
  60. <el-table
  61. id="table1"
  62. ref="parent"
  63. :key="table.tableKey"
  64. v-loading="table.listLoading"
  65. element-loading-text="给我一点时间"
  66. :data="table.list"
  67. border
  68. fit
  69. highlight-current-row
  70. style="width: 98%;"
  71. row-key="sort"
  72. :row-style="rowStyle"
  73. :cell-style="cellStyle"
  74. class="elTable table-fixed"
  75. :row-class-name="tableRowClassName"
  76. :height="370"
  77. @row-click="tableRowClick"
  78. @selection-change="handleSelect"
  79. >
  80. <el-table-column type="selection" min-width="50" />
  81. <el-table-column label="序号" align="center" prop="sort" width="50px" />
  82. <el-table-column label="计划名称" min-width="90px" align="center">
  83. <template slot-scope="scope">
  84. <span>{{ scope.row.projname }}</span>
  85. </template>
  86. </el-table-column>
  87. <el-table-column label="计划类型" prop="weight" min-width="90px" align="center" :formatter="lpplantype" />
  88. <el-table-column label="TMR编号" min-width="90px" align="center">
  89. <template slot-scope="scope">
  90. <span>{{ scope.row.tmrtname }}</span>
  91. </template>
  92. </el-table-column>
  93. <el-table-column label="驾驶员" min-width="150px" align="center">
  94. <template slot-scope="scope">
  95. <!-- <span>{{ scope.row.driver }}</span> -->
  96. <el-select v-model="scope.row.driverId" :disabled="scope.row.havebutton == 1" filterable placeholder="驾驶员" class="filter-item" style="width:95%;padding:10px 0;" :clearable="false" @change="(value)=> {changeDriver(value, scope.row)}">
  97. <el-option v-for="item in driverList" :key="item.id" :label="item.drivername" :value="item.id" />
  98. </el-select>
  99. </template>
  100. </el-table-column>
  101. <el-table-column label="已执行" min-width="70px" align="center">
  102. <template slot-scope="scope">
  103. <div v-if="scope.row.havebutton == 0" style="background: #009A69;color:#fff;line-height:30px;">否</div>
  104. <div v-else style="background: #c7c7ca ;line-height:30px;">是</div>
  105. </template>
  106. </el-table-column>
  107. <el-table-column label="班次" min-width="80px" align="center">
  108. <template slot-scope="scope">
  109. <span>{{ scope.row.times }}</span>
  110. </template>
  111. </el-table-column>
  112. <el-table-column label="理论量" min-width="80px" align="center">
  113. <template slot-scope="scope">
  114. <span>{{ scope.row.lweight }}</span>
  115. </template>
  116. </el-table-column>
  117. <el-table-column label="启用" min-width="70px" align="center">
  118. <template slot-scope="scope">
  119. <el-switch v-if="dataDisabled == false" v-model="scope.row.enable" :disabled="scope.row.havebutton == 1" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.row)" />
  120. <el-switch v-else v-model="scope.row.enable" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.row)" />
  121. </template>
  122. </el-table-column>
  123. <el-table-column label="时间" min-width="80px" align="center">
  124. <template slot-scope="scope">
  125. <span>{{ scope.row.plantime }}</span>
  126. </template>
  127. </el-table-column>
  128. <el-table-column label="配方名称" min-width="100px" align="center">
  129. <template slot-scope="scope">
  130. <b style="font-size: 28px;line-height: 30px;">{{ scope.row.ftname }}</b>
  131. </template>
  132. </el-table-column>
  133. <el-table-column label="牛头数" min-width="80px" align="center">
  134. <template slot-scope="scope">
  135. <span>{{ scope.row.cowcount }}</span>
  136. </template>
  137. </el-table-column>
  138. <el-table-column label="描述" min-width="80px" align="center">
  139. <template slot-scope="scope">
  140. <span>{{ scope.row.display }}</span>
  141. </template>
  142. </el-table-column>
  143. <el-table-column label="发料位" min-width="80px" align="left">
  144. <template slot-scope="scope">
  145. <span>{{ scope.row.barnames }}</span>
  146. </template>
  147. </el-table-column>
  148. <el-table-column align="center" width="100" label="操作" class-name="small-padding fixed-width" fixed="right">
  149. <template slot-scope="{row}">
  150. <el-button class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
  151. </template>
  152. </el-table-column>
  153. </el-table>
  154. <span v-if="table.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ table.total }}条</span>
  155. </div>
  156. </div>
  157. <!-- 预混料 -->
  158. <div v-if="table3.getdataListParm.parammaps.lpplantype == 4" class="content">
  159. <el-row :gutter="20">
  160. <el-col :span="12">
  161. <div class="table2">
  162. <div class="contentOperation">
  163. <p>计划详情</p>
  164. </div>
  165. <div class="content-table">
  166. <el-table
  167. :key="table2.tableKey"
  168. v-loading="table2.listLoading"
  169. element-loading-text="给我一点时间"
  170. :data="table2.list"
  171. fit
  172. border
  173. highlight-current-row
  174. style="width: 100%;"
  175. height="450"
  176. :row-style="rowStyle"
  177. :cell-style="cellStyle"
  178. class="elTable table-fixed"
  179. :span-method="objectSpanMethod"
  180. >
  181. <el-table-column label="操作序号" width="90px" align="center">
  182. <template slot-scope="scope">
  183. <span>{{ scope.row.sort }}</span>
  184. </template>
  185. </el-table-column>
  186. <el-table-column label="饲料名称" prop="fname" min-width="90px" align="center">
  187. <template slot-scope="scope">
  188. <span>{{ scope.row.fname }}</span>
  189. </template>
  190. </el-table-column>
  191. <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
  192. <template slot-scope="scope">
  193. <span v-if="scope.row.NoEdit">{{ scope.row.weight }}</span>
  194. <el-input v-if="scope.row.Edit" v-model="scope.row.weight" type="number" maxlength="32" style="width:95%;padding:10px 0;" />
  195. </template>
  196. </el-table-column>
  197. <el-table-column label="小计" prop="description" min-width="90px" align="center">
  198. <template slot-scope="scope">
  199. <span>{{ scope.row.subtotal }}</span>
  200. </template>
  201. </el-table-column>
  202. <el-table-column label="操作" align="left" min-width="200" class-name="small-padding">
  203. <template slot-scope="{row}">
  204. <el-button v-if="row.isUpdate && isRoleEdit" :disabled="table2.getdataListParm.parammaps.havebutton == 1" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate2(row)" />
  205. <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
  206. <el-button v-if="row.isUpdateSave" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData2(row,'0')" />
  207. <span v-if="row.isUpdateSave" class="centerSpan">|</span>
  208. <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel2(row)" />
  209. </template>
  210. </el-table-column>
  211. </el-table>
  212. </div>
  213. </div>
  214. </el-col>
  215. </el-row>
  216. </div>
  217. <!-- 撒料 -->
  218. <div v-if="table3.getdataListParm.parammaps.lpplantype == 0" class="content">
  219. <el-row :gutter="20">
  220. <el-col :span="12">
  221. <div class="table2">
  222. <div class="contentOperation">
  223. <p>计划详情</p>
  224. </div>
  225. <div class="content-table">
  226. <el-table
  227. :key="table2.tableKey"
  228. v-loading="table2.listLoading"
  229. element-loading-text="给我一点时间"
  230. :data="table2.list"
  231. fit
  232. border
  233. highlight-current-row
  234. style="width: 100%;"
  235. height="450"
  236. :row-style="rowStyle"
  237. :cell-style="cellStyle"
  238. class="elTable table-fixed"
  239. :span-method="objectSpanMethod"
  240. >
  241. <el-table-column label="操作序号" min-width="90px" align="center">
  242. <template slot-scope="scope">
  243. <span>{{ scope.row.sort }}</span>
  244. </template>
  245. </el-table-column>
  246. <el-table-column label="饲料名称" prop="fname" min-width="90px" align="center">
  247. <template slot-scope="scope">
  248. <span>{{ scope.row.fname }}</span>
  249. </template>
  250. </el-table-column>
  251. <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
  252. <template slot-scope="scope">
  253. <span v-if="scope.row.NoEdit">{{ scope.row.weight }}</span>
  254. <el-input v-if="scope.row.Edit" v-model="scope.row.weight" type="number" maxlength="32" style="width:95%;padding:10px 0;" />
  255. </template>
  256. </el-table-column>
  257. <el-table-column label="小计" prop="description" min-width="90px" align="center">
  258. <template slot-scope="scope">
  259. <span>{{ scope.row.subtotal }}</span>
  260. </template>
  261. </el-table-column>
  262. <el-table-column label="操作" align="left" min-width="200" class-name="small-padding">
  263. <template slot-scope="{row}">
  264. <el-button v-if="row.isUpdate && isRoleEdit" :disabled="table2.getdataListParm.parammaps.havebutton == 1" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate2(row)" />
  265. <el-button v-if="row.isUpdateSave" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData2(row,'0')" />
  266. <span v-if="row.isUpdateSave" class="centerSpan">|</span>
  267. <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel2(row)" />
  268. </template>
  269. </el-table-column>
  270. </el-table>
  271. </div>
  272. </div>
  273. </el-col>
  274. <el-col :span="12">
  275. <div class="table3">
  276. <div class="contentOperation">
  277. <p>栏舍详情</p>
  278. </div>
  279. <div class="content-table">
  280. <el-table
  281. :key="table3.tableKey"
  282. v-loading="table3.listLoading"
  283. element-loading-text="给我一点时间"
  284. :data="table3.list"
  285. height="450"
  286. fit
  287. border
  288. highlight-current-row
  289. style="width: 100%;"
  290. :row-style="rowStyle"
  291. :cell-style="cellStyle"
  292. class="elTable table-fixed"
  293. >
  294. <el-table-column label=" 操作序号" min-width="90px" align="center">
  295. <template slot-scope="scope">
  296. <span>{{ scope.row.sort }}</span>
  297. </template>
  298. </el-table-column>
  299. <el-table-column label="栏舍" min-width="90px" align="center">
  300. <template slot-scope="scope">
  301. <span>{{ scope.row.fname }}</span>
  302. </template>
  303. </el-table-column>
  304. <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
  305. <template slot-scope="scope">
  306. <span v-if="scope.row.NoEdit">{{ scope.row.weight }}</span>
  307. <el-input v-if="scope.row.Edit" v-model="scope.row.weight" type="number" maxlength="32" style="width:95%;padding:10px 0;" />
  308. </template>
  309. </el-table-column>
  310. <el-table-column label="操作" align="left" min-width="200" class-name="small-padding">
  311. <template slot-scope="{row}">
  312. <el-button v-if="row.isUpdate && isRoleEdit" :disabled="table3.getdataListParm.parammaps.havebutton == 1" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate3(row)" />
  313. <el-button v-if="row.isUpdateSave" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData3(row,'1')" />
  314. <span v-if="row.isUpdateSave" class="centerSpan">|</span>
  315. <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel3(row)" />
  316. </template>
  317. </el-table-column>
  318. </el-table>
  319. </div>
  320. </div>
  321. </el-col>
  322. </el-row>
  323. </div>
  324. <!-- 剩料 -->
  325. <div v-if="table3.getdataListParm.parammaps.lpplantype == 3" class="content">
  326. <el-row :gutter="20">
  327. <el-col :span="12"><div class="table2">
  328. <div class="contentOperation">
  329. <p>计划详情</p>
  330. </div>
  331. <div class="content-table">
  332. <el-table
  333. :key="table2.tableKey"
  334. v-loading="table2.listLoading"
  335. element-loading-text="给我一点时间"
  336. :data="table2.list"
  337. fit
  338. border
  339. highlight-current-row
  340. style="width: 100%;"
  341. height="450"
  342. :row-style="rowStyle"
  343. :cell-style="cellStyle"
  344. class="elTable table-fixed"
  345. :span-method="objectSpanMethod"
  346. >
  347. <el-table-column label="操作序号" min-width="130px" align="center">
  348. <template slot-scope="scope">
  349. <span>{{ scope.row.sort }}</span>
  350. </template>
  351. </el-table-column>
  352. <el-table-column label="取料栏舍" prop="fname" min-width="130px" align="center">
  353. <template slot-scope="scope">
  354. <span>{{ scope.row.fname }}</span>
  355. </template>
  356. </el-table-column>
  357. <el-table-column label="处理方式" prop="useinbar" min-width="130px" align="center">
  358. <template slot-scope="scope">
  359. <span>{{ scope.row.useinbar }}</span>
  360. </template>
  361. </el-table-column>
  362. <el-table-column label="小计" prop="description" min-width="130px" align="center">
  363. <template slot-scope="scope">
  364. <span>{{ scope.row.subtotal }}</span>
  365. </template>
  366. </el-table-column>
  367. </el-table>
  368. </div>
  369. </div>
  370. </el-col>
  371. <el-col :span="12">
  372. <div class="table3">
  373. <div class="contentOperation">
  374. <p>栏舍详情</p>
  375. </div>
  376. <div class="content-table">
  377. <el-table
  378. :key="table3.tableKey"
  379. v-loading="table3.listLoading"
  380. element-loading-text="给我一点时间"
  381. :data="table3.list"
  382. height="450"
  383. fit
  384. border
  385. highlight-current-row
  386. style="width: 100%;"
  387. :row-style="rowStyle"
  388. :cell-style="cellStyle"
  389. class="elTable table-fixed"
  390. >
  391. <el-table-column label="操作序号" min-width="130px" align="center">
  392. <template slot-scope="scope">
  393. <span>{{ scope.row.sort }}</span>
  394. </template>
  395. </el-table-column>
  396. <el-table-column label="转投栏舍" min-width="130px" align="center">
  397. <template slot-scope="scope">
  398. <span>{{ scope.row.fname }}</span>
  399. </template>
  400. </el-table-column>
  401. </el-table>
  402. </div>
  403. </div>
  404. </el-col>
  405. </el-row>
  406. </div>
  407. <!-- 撒料计划-混料 -->
  408. <div v-if="table3.getdataListParm.parammaps.lpplantype == 1 || table3.getdataListParm.parammaps.lpplantype == 5" class="content">
  409. <el-row :gutter="20">
  410. <el-col :span="12">
  411. <div class="table2">
  412. <div class="contentOperation">
  413. <p>计划详情</p>
  414. </div>
  415. <div class="content-table">
  416. <el-table
  417. :key="table2.tableKey"
  418. v-loading="table2.listLoading"
  419. element-loading-text="给我一点时间"
  420. :data="table2.list"
  421. fit
  422. border
  423. highlight-current-row
  424. style="width: 100%;"
  425. height="450"
  426. :row-style="rowStyle"
  427. :cell-style="cellStyle"
  428. class="elTable table-fixed"
  429. :span-method="objectSpanMethod"
  430. >
  431. <el-table-column label="操作序号" min-width="90px" align="center">
  432. <template slot-scope="scope">
  433. <span>{{ scope.row.sort }}</span>
  434. </template>
  435. </el-table-column>
  436. <el-table-column label="饲料名称" prop="fname" min-width="90px" align="center">
  437. <template slot-scope="scope">
  438. <span>{{ scope.row.fname }}</span>
  439. </template>
  440. </el-table-column>
  441. <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
  442. <template slot-scope="scope">
  443. <span v-if="scope.row.NoEdit">{{ scope.row.weight }}</span>
  444. <el-input v-if="scope.row.Edit" v-model="scope.row.weight" type="number" maxlength="32" style="width:95%;padding:10px 0;" />
  445. </template>
  446. </el-table-column>
  447. <el-table-column label="小计" prop="description" min-width="90px" align="center">
  448. <template slot-scope="scope">
  449. <span>{{ scope.row.subtotal }}</span>
  450. </template>
  451. </el-table-column>
  452. <el-table-column label="操作" align="left" min-width="200" class-name="small-padding">
  453. <template slot-scope="{row}">
  454. <el-button v-if="row.isUpdate && isRoleEdit" :disabled="table2.getdataListParm.parammaps.havebutton == 1" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate2(row)" />
  455. <el-button v-if="row.isUpdateSave" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData2(row,'0')" />
  456. <span v-if="row.isUpdateSave" class="centerSpan">|</span>
  457. <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel2(row)" />
  458. </template>
  459. </el-table-column>
  460. </el-table>
  461. </div>
  462. </div>
  463. </el-col>
  464. <el-col :span="12">
  465. <div class="table3">
  466. <div class="contentOperation">
  467. <p>栏舍详情</p>
  468. </div>
  469. <div class="content-table">
  470. <el-table
  471. :key="table3.tableKey"
  472. v-loading="table3.listLoading"
  473. element-loading-text="给我一点时间"
  474. :data="table3.list"
  475. height="450"
  476. fit
  477. border
  478. highlight-current-row
  479. style="width: 100%;"
  480. :row-style="rowStyle"
  481. :cell-style="cellStyle"
  482. class="elTable table-fixed"
  483. >
  484. <el-table-column label=" 操作序号" min-width="90px" align="center">
  485. <template slot-scope="scope">
  486. <span>{{ scope.row.sort }}</span>
  487. </template>
  488. </el-table-column>
  489. <el-table-column label="撒料车辆" min-width="90px" align="center">
  490. <template slot-scope="scope">
  491. <span>{{ scope.row.fname }}</span>
  492. </template>
  493. </el-table-column>
  494. <el-table-column label="设计重量(KG)" min-width="130px" align="center">
  495. <template slot-scope="scope">
  496. <span v-if="scope.row.NoEdit">{{ scope.row.weight }}</span>
  497. <el-input v-if="scope.row.Edit" v-model="scope.row.weight" type="number" maxlength="32" style="width:95%;padding:10px 0;" />
  498. </template>
  499. </el-table-column>
  500. <el-table-column label="操作" align="left" min-width="200" class-name="small-padding">
  501. <template slot-scope="{row}">
  502. <el-button v-if="row.isUpdate && isRoleEdit" :disabled="table3.getdataListParm.parammaps.havebutton == 1" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate3(row)" />
  503. <el-button v-if="row.isUpdateSave" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData3(row,'1')" />
  504. <span v-if="row.isUpdateSave" class="centerSpan">|</span>
  505. <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel3(row)" />
  506. </template>
  507. </el-table-column>
  508. </el-table>
  509. </div>
  510. </div>
  511. </el-col>
  512. </el-row>
  513. </div>
  514. <!-- 撒料计划-撒料 -->
  515. <div v-if="table3.getdataListParm.parammaps.lpplantype == 2" class="content">
  516. <el-row :gutter="20">
  517. <el-col :span="12">
  518. <div class="table3">
  519. <div class="contentOperation">
  520. <p>栏舍详情</p>
  521. </div>
  522. <div class="content-table">
  523. <el-table
  524. :key="table3.tableKey"
  525. v-loading="table3.listLoading"
  526. element-loading-text="给我一点时间"
  527. :data="table3.list"
  528. height="450"
  529. fit
  530. border
  531. highlight-current-row
  532. style="width: 100%;"
  533. :row-style="rowStyle"
  534. :cell-style="cellStyle"
  535. class="elTable table-fixed"
  536. >
  537. <el-table-column label="操作序号" min-width="90px" align="center">
  538. <template slot-scope="scope">
  539. <span>{{ scope.row.sort }}</span>
  540. </template>
  541. </el-table-column>
  542. <el-table-column label="撒料车辆" min-width="90px" align="center">
  543. <template slot-scope="scope">
  544. <span>{{ scope.row.fname }}</span>
  545. </template>
  546. </el-table-column>
  547. <el-table-column label="设计重量(KG)" min-width="130px" align="center">
  548. <template slot-scope="scope">
  549. <span v-if="scope.row.NoEdit">{{ scope.row.weight }}</span>
  550. <el-input v-if="scope.row.Edit" v-model="scope.row.weight" type="number" maxlength="32" style="width:95%;padding:10px 0;" />
  551. </template>
  552. </el-table-column>
  553. <el-table-column label="小计" prop="description" min-width="90px" align="center">
  554. <template slot-scope="scope">
  555. <span>{{ scope.row.subtotal }}</span>
  556. </template>
  557. </el-table-column>
  558. <el-table-column label="操作" align="left" min-width="200" class-name="small-padding">
  559. <template slot-scope="{row}">
  560. <el-button v-if="row.isUpdate && isRoleEdit" :disabled="table3.getdataListParm.parammaps.havebutton == 1" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate3(row)" />
  561. <el-button v-if="row.isUpdateSave" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData3(row,'0')" />
  562. <span v-if="row.isUpdateSave" class="centerSpan">|</span>
  563. <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel3(row)" />
  564. </template>
  565. </el-table-column>
  566. </el-table>
  567. </div>
  568. </div>
  569. </el-col>
  570. <el-col :span="12">
  571. <div class="table2">
  572. <div class="contentOperation">
  573. <p>计划详情</p>
  574. </div>
  575. <div class="content-table">
  576. <el-table
  577. :key="table2.tableKey"
  578. v-loading="table2.listLoading"
  579. element-loading-text="给我一点时间"
  580. :data="table2.list"
  581. fit
  582. border
  583. highlight-current-row
  584. style="width: 100%;"
  585. height="450"
  586. :row-style="rowStyle"
  587. :cell-style="cellStyle"
  588. class="elTable table-fixed"
  589. >
  590. <el-table-column label="操作序号" min-width="90px" align="center">
  591. <template slot-scope="scope">
  592. <span>{{ scope.row.sort }}</span>
  593. </template>
  594. </el-table-column>
  595. <el-table-column label="栏舍名称" prop="fname" min-width="90px" align="center">
  596. <template slot-scope="scope">
  597. <span>{{ scope.row.fname }}</span>
  598. </template>
  599. </el-table-column>
  600. <el-table-column label="设计重量(KG)" prop="weight" width="130px" align="center">
  601. <template slot-scope="scope">
  602. <span v-if="scope.row.NoEdit">{{ scope.row.weight }}</span>
  603. <el-input v-if="scope.row.Edit" v-model="scope.row.weight" type="number" maxlength="32" style="width:95%;padding:10px 0;" />
  604. </template>
  605. </el-table-column>
  606. <el-table-column label="操作" align="left" min-width="200" class-name="small-padding">
  607. <template slot-scope="{row}">
  608. <el-button v-if="row.isUpdate && isRoleEdit" :disabled="table2.getdataListParm.parammaps.havebutton == 1" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate2(row)" />
  609. <el-button v-if="row.isUpdateSave" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData2(row,'1')" />
  610. <span v-if="row.isUpdateSave" class="centerSpan">|</span>
  611. <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel2(row)" />
  612. </template>
  613. </el-table-column>
  614. </el-table>
  615. </div>
  616. </div>
  617. </el-col>
  618. </el-row>
  619. </div>
  620. <!-- 新生成 -->
  621. <el-dialog :title="textMap[newGeneration.dialogStatus]" :destroy-on-close="true" :visible.sync="newGeneration.dialogFormVisible" :close-on-click-modal="false" width="30%">
  622. <div class="newGeneration" v-loading="newGenerationLoading" >
  623. <el-form ref="temp" :rules="newGeneration.rules" :model="newGeneration.temp" label-position="right" label-width="100px" style="width: 100%;margin:0 auto 50px">
  624. <el-row v-if="newGeneration.dialogStatus== 'newGeneration'">
  625. <el-col :span="24">
  626. <el-form-item label="时间范围:" prop="inputDatetime">
  627. <el-date-picker v-model="newGeneration.temp.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 100%;" :clearable="false" :picker-options="pickerOptions2" />
  628. </el-form-item>
  629. </el-col>
  630. </el-row>
  631. <el-row v-else>
  632. <el-col :span="24">
  633. <el-form-item label="时间范围:" prop="copyInputDatetime">
  634. <el-date-picker v-model="newGeneration.temp.copyInputDatetime" :picker-options="pickerOptions" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 100%;" :clearable="false" />
  635. </el-form-item>
  636. </el-col>
  637. </el-row>
  638. <p v-if="newGeneration.temp.tips == true || newGeneration.dialogStatus == 'copy'" style="font-weight: 700;color: red;text-align: center;">注:撒料计划中存在未分配完栏舍,如下所示;建议及时进行分配</p>
  639. <div style="height: 200px;overflow: auto;">
  640. <div v-if="myMaxTimes == 1">
  641. <div>第一班:</div>
  642. <div v-for="(item,index) in tipsList.one" :key="index+'A'" >
  643. <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
  644. <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
  645. <span v-for="(item2,index2) in item.arrList" :key="index2+'a'">
  646. {{item2.barname}}
  647. </span>
  648. </span>
  649. </div>
  650. </div>
  651. <div v-else-if="myMaxTimes == 2">
  652. <div>第一班:</div>
  653. <div v-for="(item,index) in tipsList.one" :key="index+'B'" >
  654. <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
  655. <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
  656. <span v-for="(item2,index2) in item.arrList" :key="index2+'b'">
  657. {{item2.barname}}
  658. </span>
  659. </span>
  660. </div>
  661. <div>第二班:</div>
  662. <div v-for="(item,index) in tipsList.two" :key="index+'C'" >
  663. <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
  664. <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
  665. <span v-for="(item2,index2) in item.arrList" :key="index2+'c'">
  666. {{item2.barname}}
  667. </span>
  668. </span>
  669. </div>
  670. </div>
  671. <div v-else-if="myMaxTimes == 3">
  672. <div>第一班:</div>
  673. <div v-for="(item,index) in tipsList.one" :key="index+'D'" >
  674. <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
  675. <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
  676. <span v-for="(item2,index2) in item.arrList" :key="index2+'d'">
  677. {{item2.barname}}
  678. </span>
  679. </span>
  680. </div>
  681. <div>第二班:</div>
  682. <div v-for="(item,index) in tipsList.two" :key="index+'E'" >
  683. <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
  684. <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
  685. <span v-for="(item2,index2) in item.arrList" :key="index2+'e'">
  686. {{item2.barname}}
  687. </span>
  688. </span>
  689. </div>
  690. <div>第三班:</div>
  691. <div v-for="(item,index) in tipsList.three" :key="index+'F'" >
  692. <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
  693. <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
  694. <span v-for="(item2,index2) in item.arrList" :key="index2+'f'">
  695. {{item2.barname}}
  696. </span>
  697. </span>
  698. </div>
  699. </div>
  700. <div v-else>
  701. <div>第一班:</div>
  702. <div v-for="(item,index) in tipsList.one" :key="index+'G'" >
  703. <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
  704. <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
  705. <span v-for="(item2,index2) in item.arrList" :key="index2+'g'">
  706. {{item2.barname}}
  707. </span>
  708. </span>
  709. </div>
  710. <div>第二班:</div>
  711. <div v-for="(item,index) in tipsList.two" :key="index+'H'" >
  712. <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
  713. <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
  714. <span v-for="(item2,index2) in item.arrList" :key="index2+'h'">
  715. {{item2.barname}}
  716. </span>
  717. </span>
  718. </div>
  719. <div>第三班:</div>
  720. <div v-for="(item,index) in tipsList.three" :key="index+'I'" >
  721. <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
  722. <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
  723. <span v-for="(item2,index2) in item.arrList" :key="index2+'i'">
  724. {{item2.barname}}
  725. </span>
  726. </span>
  727. </div>
  728. <div>第四班:</div>
  729. <div v-for="(item,index) in tipsList.four" :key="index+'J'" >
  730. <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
  731. <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
  732. <span v-for="(item2,index2) in item.arrList" :key="index2+'j'">
  733. {{item2.barname}}
  734. </span>
  735. </span>
  736. </div>
  737. </div>
  738. </div>
  739. </el-form>
  740. <div slot="footer" class="dialog-footer" style="bottom:20px">
  741. <el-button class="cancelClose" @click="newGeneration.dialogFormVisible = false;getList()">取消</el-button>
  742. <el-button v-if="newGeneration.dialogStatus== 'newGeneration'" class="save" :disabled="isokDisable" @click="newGenerationData()">确认</el-button>
  743. <el-button v-else class="save" :disabled="isokDisable" @click="copyData()">确认</el-button>
  744. </div>
  745. </div>
  746. </el-dialog>
  747. <!-- 历史记录 -->
  748. <el-dialog :fullscreen="dialogFull" :destroy-on-close="true" :visible.sync="historyRecord.dialogFormVisible" :close-on-click-modal="false" width="90%">
  749. <template slot="title">
  750. <div class="avue-crud__dialog__header">
  751. <span class="el-dialog__title">
  752. <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
  753. {{ textMap[historyRecord.dialogStatus] }}
  754. </span>
  755. <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
  756. <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
  757. <svg-icon v-else icon-class="fullscreen" />
  758. </div>
  759. </div>
  760. </template>
  761. <div class="historyRecord">
  762. <keep-alive>
  763. <component :is="historyRecord.myComponent" ref="historyRecord" />
  764. </keep-alive>
  765. </div>
  766. <div slot="footer" class="dialog-footer">
  767. <el-button class="cancelClose cancelClose1" @click="historyRecord.dialogFormVisible = false; ">关闭</el-button>
  768. </div>
  769. </el-dialog>
  770. <!-- 正在同步中 -->
  771. <el-dialog :destroy-on-close="true" :visible.sync="dataSynchronization.dialogFormVisible" :close-on-click-modal="false" width="30%">
  772. <div class="dataSynchronization" style="text-align: center;font-size: 18px;">
  773. <i class="el-icon-loading" />
  774. <span>正在同步</span>
  775. <div slot="footer" class="dialog-footer" style="bottom:10px">
  776. <el-button class="miniPrimary" @click="dataSynchronization.dialogFormVisible = false;">确认</el-button>
  777. </div>
  778. </div>
  779. </el-dialog>
  780. <!-- 修改计划 -->
  781. <RevisePlan :show.sync="isShowDialog" :parent-active-name="activeName" :parent-date="parentDate" />
  782. <!-- 删除记录 -->
  783. <el-dialog :title="textMap[deleteRecord.dialogStatus]" :destroy-on-close="true" :visible.sync="deleteRecord.dialogFormVisible" :close-on-click-modal="false" width="90%">
  784. <div class="deleteRecord">
  785. <div class="search">
  786. <el-date-picker v-model="deleteRecord.mydate" type="date" placeholder="选择日期" style="width: 150px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :clearable="false" @change="changeDeleteRecordDate" />
  787. </div>
  788. <div class="table">
  789. <el-table
  790. :key="deleteRecord.tableKey"
  791. v-loading="deleteRecord.listLoading"
  792. element-loading-text="给我一点时间"
  793. :data="deleteRecord.list"
  794. border
  795. fit
  796. highlight-current-row
  797. style="width: 98%;"
  798. row-key="sort"
  799. :row-style="rowStyle"
  800. :cell-style="cellStyle"
  801. class="elTable table-fixed"
  802. :height="370"
  803. >
  804. <el-table-column label="序号" align="center" prop="sort" width="50px" />
  805. <el-table-column label="计划名称" min-width="90px" align="center" prop="projname" />
  806. <el-table-column label="计划类型" prop="weight" min-width="90px" align="center" :formatter="lpplantype" />
  807. <el-table-column label="TMR编号" min-width="90px" align="center" prop="tmrtname" />
  808. <el-table-column label="驾驶员" min-width="90px" align="center" prop="driver" />
  809. <el-table-column label="已执行" min-width="70px" align="center">
  810. <template slot-scope="scope">
  811. <span v-if="scope.row.havebutton == 0">否</span>
  812. <span v-else>是</span>
  813. </template>
  814. </el-table-column>
  815. <el-table-column label="班次" min-width="80px" align="center" prop="times" />
  816. <el-table-column label="理论量" min-width="80px" align="center" prop="lweight" />
  817. <el-table-column label="启用" min-width="70px" align="center">
  818. <template slot-scope="scope">
  819. <el-switch v-if="dataDisabled == false" disabled v-model="scope.row.enable" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.row)" />
  820. <el-switch v-else v-model="scope.row.enable" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.row)" />
  821. </template>
  822. </el-table-column>
  823. <el-table-column label="时间" min-width="80px" align="center" prop="plantime" />
  824. <el-table-column label="配方名称" min-width="100px" align="center" prop="ftname" />
  825. <el-table-column label="牛头数" min-width="80px" align="center" prop="cowcount" />
  826. <el-table-column label="描述" min-width="80px" align="center" prop="display" />
  827. <el-table-column label="发料位" min-width="80px" align="left" prop="barnames" />
  828. </el-table>
  829. <span v-if="deleteRecord.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ deleteRecord.total }}条</span>
  830. </div>
  831. <div slot="footer" class="dialog-footer" style="bottom:20px">
  832. <el-button class="cancelClose1" @click="deleteRecord.dialogFormVisible = false;getList()">取消</el-button>
  833. </div>
  834. </div>
  835. </el-dialog>
  836. <el-dialog :title="textMap[sapUpload.dialogStatus]" :destroy-on-close="true" :visible.sync="sapUpload.dialogFormVisible" :close-on-click-modal="false" width="30%">
  837. <div class="sapUpload">
  838. <el-form ref="sapUpload" :rules="sapUpload.rules" :model="sapUpload.temp" label-position="right" label-width="100px" style="width: 100%;margin:0 auto 50px">
  839. <el-row>
  840. <el-col :span="24">
  841. <el-form-item label="时间:" prop="date">
  842. <el-date-picker v-model="sapUpload.temp.date" :clearable="false" class="filter-item" type="date" />
  843. </el-form-item>
  844. </el-col>
  845. </el-row>
  846. </el-form>
  847. <div slot="footer" class="dialog-footer" style="bottom:20px">
  848. <el-button class="cancelClose" @click="sapUpload.dialogFormVisible = false;getList()">取消</el-button>
  849. <el-button class="save" v-if="sapUpload.dialogStatus == 'sapUpload'" :disabled="isokDisable" @click="sapUploadData()">确认</el-button>
  850. <el-button class="save" v-else-if="sapUpload.dialogStatus == 'udload1'" :disabled="isokDisable" @click="udData1()">确认</el-button>
  851. <el-button class="save" v-else-if="sapUpload.dialogStatus == 'udload2'" :disabled="isokDisable" @click="udData2()">确认</el-button>
  852. <el-button class="save" v-else-if="sapUpload.dialogStatus == 'udload3'" :disabled="isokDisable" @click="udData3()">确认</el-button>
  853. </div>
  854. </div>
  855. </el-dialog>
  856. </div>
  857. </template>
  858. <script>
  859. import { GetDataByName, GetDataByNames, ExecDataByConfig, PostDataByName, getDorm, GetReportform, checkButtons,postJson,postJson2,SyncSCJH } from '@/api/common'
  860. import RevisePlan from './revisePlan.vue'
  861. import printJS from 'print-js'
  862. import { parseTime, json2excel,handleTableSpan, handleObjectSpanMethod } from '@/utils/index.js'
  863. import Cookies from 'js-cookie'
  864. import Sortable from 'sortablejs'
  865. import { MessageBox } from 'element-ui'
  866. export default {
  867. name: 'DailyExecutionPlan',
  868. components: {
  869. RevisePlan
  870. },
  871. data() {
  872. return {
  873. newGenerationLoading:false,
  874. dialogFull: false,
  875. isRoleEdit: [],
  876. dataDisabled: false,
  877. requestParams: [
  878. // { name: 'getDictByName', offset: 0, pagecount: 0, params: ['牲畜父类'] }
  879. ],
  880. planTypeList: [{ lable: '预混计划', value: '4' }, { lable: '撒料计划', value: '0' }, { lable: '剩料计划', value: '3' }, { lable: '撒料计划-混料', value: '1' }, { lable: '撒料计划-撒料', value: '2' }, { lable: '预称重计划', value: '5' }], // 计划类型
  881. printingTypeList: [{ lable: '精料', value: '1' }, { lable: '铲车', value: '2' }], // 打印类型
  882. frequencyList: [], // 班次
  883. planningDimensionList: [{ lable: '发料顺序', value: '0' }, { lable: 'TMR', value: '1' }], // 发料顺序
  884. exportTypeList: [{ lable: '投料简打', value: '0' }, { lable: '累加投料', value: '1' }, { lable: '撒料简打', value: '2' }, { lable: '投撒料简打', value: '3' }, { lable: '投撒料累加', value: '4' }, { lable: '包装简打', value: '5' }, { lable: '实发简打', value: '6' }], // 导出类型
  885. iscompletedList: [{ lable: '是', value: '1' },{ lable: '否', value: '0' } ],
  886. // 班次
  887. maxTime: {
  888. getMaxTimesParm: {
  889. name: 'getSysoptEnable',
  890. page: 1,
  891. offset: 1,
  892. pagecount: 1,
  893. returntype: 'Map',
  894. parammaps: {
  895. pastureid: Cookies.get('pastureid'),
  896. inforname: 'times'
  897. }
  898. }
  899. },
  900. isOrder: true,
  901. table: {
  902. getdataListParm: {
  903. name: 'getDownloadedplanList',
  904. page: 1,
  905. offset: 1,
  906. pagecount: '',
  907. returntype: 'Map',
  908. parammaps: {
  909. pastureid: Cookies.get('pastureid'),
  910. barid: '',
  911. mydate: parseTime(new Date(), '{y}-{m}-{d}'),
  912. times: '',
  913. lpplantype: '',
  914. printType: '',
  915. plandimen: '0',
  916. enable3: '0',
  917. iscompleted:"",
  918. tmrname:"",
  919. }
  920. },
  921. tableKey: 0,
  922. list: [],
  923. total: 0,
  924. listLoading: false
  925. },
  926. // 计划内容操作详情
  927. table2: {
  928. getdataListParm: {
  929. name: 'getDownloadplandtl1ListV2',
  930. page: 1,
  931. offset: 1,
  932. returntype: 'Map',
  933. parammaps: {
  934. pastureid: Cookies.get('pastureid'),
  935. date: '',
  936. id: ''
  937. }
  938. },
  939. tableKey: 0,
  940. list: [],
  941. total: 0,
  942. listLoading: false
  943. },
  944. // 计划内容 舍栏详情
  945. table3: {
  946. getdataListParm: {
  947. name: 'getDownloadplandt2ListV2',
  948. page: 1,
  949. offset: 1,
  950. returntype: 'Map',
  951. parammaps: {
  952. pastureid: Cookies.get('pastureid'),
  953. date: '',
  954. id: ''
  955. }
  956. },
  957. tableKey: 0,
  958. list: [],
  959. total: 0,
  960. listLoading: false
  961. },
  962. // 新生成
  963. newGeneration: {
  964. dialogFormVisible: false,
  965. dialogStatus: '',
  966. getdataListParm: {
  967. name: 'checkLLPIsDistribution',
  968. page: 1,
  969. offset: 1,
  970. pagecount: 1,
  971. returntype: 'Map',
  972. parammaps: {
  973. pastureid: Cookies.get('pastureid')
  974. }
  975. },
  976. temp: {
  977. inputDatetime: [parseTime(new Date(), '{y}-{m}-{d}'), parseTime(new Date(), '{y}-{m}-{d}')],
  978. tips:''
  979. },
  980. rules: {
  981. inputDatetime: [{ type: 'array', required: true, message: '必填', trigger: 'blur' }],
  982. copyInputDatetime: [{ type: 'array', required: true, message: '必填', trigger: 'blur' }]
  983. }
  984. },
  985. pickerMinDate: '',
  986. pickerOptions: {
  987. onPick: ({ maxDate, minDate }) => {
  988. this.pickerMinDate = minDate.getTime()
  989. if (maxDate) {
  990. this.pickerMinDate = ''
  991. }
  992. },
  993. disabledDate: (time) => {
  994. if (this.pickerMinDate !== '') {
  995. const one = 31 * 24 * 3600 * 1000
  996. const minTime = this.pickerMinDate
  997. const maxTime = this.pickerMinDate + one
  998. return time.getTime() < minTime || time.getTime() > maxTime - 8.64e7
  999. }
  1000. return time.getTime() < Date.now() - 8.64e7
  1001. }
  1002. },
  1003. pickerOptions2: {
  1004. onPick: ({ maxDate, minDate }) => {
  1005. this.pickerMinDate = minDate.getTime()
  1006. if (maxDate) {
  1007. this.pickerMinDate = ''
  1008. }
  1009. },
  1010. disabledDate: (time) => {
  1011. if (this.pickerMinDate !== '') {
  1012. const one = 14 * 24 * 3600 * 1000
  1013. const minTime = this.pickerMinDate
  1014. const maxTime = this.pickerMinDate + one
  1015. return time.getTime() < minTime || time.getTime() > maxTime - 8.64e7
  1016. }
  1017. return time.getTime() < Date.now() - 8.64e7
  1018. }
  1019. },
  1020. historyRecord: {
  1021. dialogFormVisible: false,
  1022. dialogStatus: '',
  1023. myComponent: null
  1024. },
  1025. dataSynchronization: {
  1026. dialogFormVisible: false,
  1027. dialogStatus: '',
  1028. getdataListParm: {
  1029. name: 'getSysoptEnable',
  1030. page: 1,
  1031. offset: 1,
  1032. pagecount: 1,
  1033. returntype: 'Map',
  1034. parammaps: {
  1035. pastureid: Cookies.get('pastureid'),
  1036. inforname: 'isDataSync'
  1037. }
  1038. },
  1039. isDataSynchronization: false
  1040. },
  1041. dataSynchronization2: {
  1042. dialogFormVisible: false,
  1043. dialogStatus: '',
  1044. getdataListParm: {
  1045. name: 'getSysoptEnable',
  1046. page: 1,
  1047. offset: 1,
  1048. pagecount: 1,
  1049. returntype: 'Map',
  1050. parammaps: {
  1051. pastureid: Cookies.get('pastureid'),
  1052. inforname: 'zcSync'
  1053. }
  1054. },
  1055. isDataSynchronization: false
  1056. },
  1057. dataSynchronization3: {
  1058. dialogFormVisible: false,
  1059. dialogStatus: '',
  1060. getdataListParm: {
  1061. name: 'getSysoptEnable',
  1062. page: 1,
  1063. offset: 1,
  1064. pagecount: 1,
  1065. returntype: 'Map',
  1066. parammaps: {
  1067. pastureid: Cookies.get('pastureid'),
  1068. inforname: 'wgSap'
  1069. }
  1070. },
  1071. isDataSynchronization: false
  1072. },
  1073. textMap: {
  1074. newGeneration: '新生成',
  1075. historyRecord: '历史记录',
  1076. revisePlan: '修改计划',
  1077. copy: '复制计划',
  1078. deleteRecord:'删除记录',
  1079. sapUpload:'SAP上传',
  1080. udload1:'搅拌数据上传',
  1081. udload2:'剩料上传',
  1082. udload3:'撒料上传',
  1083. },
  1084. isokDisable: false,
  1085. requestParam: {},
  1086. rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
  1087. cellStyle: { padding: 0 + 'px' },
  1088. isShowDialog: false,
  1089. activeName: '栏舍配方',
  1090. parentDate: '',
  1091. downLoad: {
  1092. getdataListParm: {
  1093. name: '',
  1094. page: 1,
  1095. offset: 1,
  1096. pagecount: '',
  1097. returntype: 'Map',
  1098. parammaps: {
  1099. pastureid: Cookies.get('pastureid'),
  1100. date: ''
  1101. }
  1102. },
  1103. list: [],
  1104. labelList: []
  1105. },
  1106. tmrDownList:[],
  1107. getTmrListParam: {
  1108. name: 'getDownloadedplanTmrNameUnfinished',
  1109. page: 1,
  1110. offset: 1,
  1111. pagecount: 10,
  1112. returntype: 'Map',
  1113. parammaps: {
  1114. pastureid: Cookies.get('pastureid'),
  1115. mydate: parseTime(new Date(), '{y}-{m}-{d}')
  1116. }
  1117. },
  1118. myMaxTimes:'',
  1119. tipsList:[],
  1120. spanObj: {},
  1121. mergekeys: ['sort', 'description'],
  1122. deleteRecord:{
  1123. dialogFormVisible: false,
  1124. dialogStatus: '',
  1125. total:0,
  1126. tableKey:0,
  1127. listLoading:false,
  1128. list:[],
  1129. mydate: parseTime(new Date(), '{y}-{m}-{d}')
  1130. },
  1131. selectList: [],
  1132. driverList:[],
  1133. sapUpload:{
  1134. dialogFormVisible: false,
  1135. dialogStatus: '',
  1136. temp:{
  1137. date: parseTime(new Date(), '{y}-{m}-{d}')
  1138. },
  1139. rules: {
  1140. date: [{ required: true, message: '必填', trigger: 'blur' }],
  1141. },
  1142. getdataListParm: {
  1143. name: 'getSysoptEnable',
  1144. page: 1,
  1145. offset: 1,
  1146. pagecount: 1,
  1147. returntype: 'Map',
  1148. parammaps: {
  1149. pastureid: Cookies.get('pastureid'),
  1150. inforname: 'xdmysapupload'
  1151. }
  1152. },
  1153. isSap: false,
  1154. },
  1155. ispalyUd: false
  1156. }
  1157. },
  1158. created() {
  1159. this.getIspalyUd()
  1160. this.parentDate = this.table.getdataListParm.parammaps.mydate
  1161. console.log(this.parentDate, 'this.parentDate')
  1162. this.getDataSynchronization()
  1163. this.getDataSynchronization2()
  1164. this.getDataSynchronization3()
  1165. this.getButtons()
  1166. this.getList()
  1167. this.getDownList()
  1168. this.getIsDisplay()
  1169. this.getIsSap()
  1170. this.getTMRList()
  1171. this.getDriverList()
  1172. },
  1173. mounted() {
  1174. this.getTmrListParam.parammaps.mydate = parseTime(new Date(), '{y}-{m}-{d}')
  1175. },
  1176. methods: {
  1177. getDriverList(){
  1178. const url = 'authdata/GetDataByName'
  1179. const data = {
  1180. "name":"getDriverList",
  1181. "page":1,"offset":1,"pagecount":50,
  1182. "returntype":"Map",
  1183. "parammaps":{"pastureid":Cookies.get('pastureid')}
  1184. }
  1185. postJson(url, data).then(response => {
  1186. if(response.data !== null){
  1187. this.driverList = response.data.list
  1188. }else{
  1189. this.driverList = []
  1190. }
  1191. })
  1192. },
  1193. getTMRList(){
  1194. this.getTmrListParam.parammaps.mydate = this.table.getdataListParm.parammaps.mydate
  1195. GetDataByName(this.getTmrListParam).then(response => {
  1196. if (response.data.list !== null) {
  1197. this.tmrDownList = response.data.list
  1198. }
  1199. })
  1200. },
  1201. getButtons() {
  1202. const Edit = 'DailyExecutionPlan'
  1203. const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
  1204. this.isRoleEdit = isRoleEdit
  1205. },
  1206. getDataSynchronization() {
  1207. GetDataByName(this.dataSynchronization.getdataListParm).then(response => {
  1208. // console.log(response.data.list[0])
  1209. if(response.data.list !== null){
  1210. if (response.data.list[0].inforvalue == 0) {
  1211. this.dataSynchronization.isDataSynchronization = false
  1212. } else {
  1213. this.dataSynchronization.isDataSynchronization = true
  1214. }
  1215. }
  1216. })
  1217. },
  1218. getDataSynchronization2() {
  1219. GetDataByName(this.dataSynchronization2.getdataListParm).then(response => {
  1220. if(response.data.list !== null){
  1221. if (response.data.list[0].inforvalue == 0) {
  1222. this.dataSynchronization2.isDataSynchronization = false
  1223. } else {
  1224. this.dataSynchronization2.isDataSynchronization = true
  1225. }
  1226. }
  1227. })
  1228. },
  1229. getDataSynchronization3() {
  1230. GetDataByName(this.dataSynchronization3.getdataListParm).then(response => {
  1231. // console.log(response.data.list[0])
  1232. if (response.data.list[0].inforvalue == 0) {
  1233. this.dataSynchronization3.isDataSynchronization = false
  1234. } else {
  1235. this.dataSynchronization3.isDataSynchronization = true
  1236. }
  1237. })
  1238. },
  1239. form_updata() {
  1240. var send_data = {
  1241. name: 'syncSCJH',
  1242. page: 1,
  1243. offset: 1,
  1244. pagecount: 1,
  1245. returntype: 'Map',
  1246. parammaps: {
  1247. // pastureid: Cookies.get('pastureid'),
  1248. // inforname: 'isDataSync'
  1249. }
  1250. }
  1251. SyncSCJH(send_data).then(response => {
  1252. if (response.msg === 'fail') {
  1253. this.$notify({ title: '上传失败', message: response.data, type: 'warning', duration: 2000 })
  1254. } else {
  1255. this.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
  1256. }
  1257. })
  1258. },
  1259. getIsDisplay() {
  1260. GetDataByName(this.maxTime.getMaxTimesParm).then(response => {
  1261. console.log(response.data.list[0].inforvalue)
  1262. this.myMaxTimes = response.data.list[0].inforvalue
  1263. if (response.data.list[0].inforvalue == 1) {
  1264. this.frequencyList = [{ id: '1', name: '第一班' }]
  1265. } else if (response.data.list[0].inforvalue == 2) {
  1266. this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }]
  1267. } else if (response.data.list[0].inforvalue == 3) {
  1268. this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }]
  1269. } else if (response.data.list[0].inforvalue == 4) {
  1270. this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }, { id: '4', name: '第四班' }]
  1271. } else if (response.data.list[0].inforvalue == 5) {
  1272. this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }, { id: '4', name: '第四班' }, { id: '5', name: '第五班' }]
  1273. } else if (response.data.list[0].inforvalue == 6) {
  1274. this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }, { id: '4', name: '第四班' }, { id: '5', name: '第五班' }, { id: '6', name: '第六班' }]
  1275. }
  1276. })
  1277. },
  1278. getDownList() {
  1279. GetDataByNames(this.requestParams).then(response => {
  1280. // this.livestockTypeList = response.data.getDictByName.list
  1281. })
  1282. },
  1283. // -------------------日执行计划-----------------------------
  1284. handleBefore() {
  1285. if (this.table.getdataListParm.parammaps.mydate !== '' && this.table.getdataListParm.parammaps.mydate !== null) {
  1286. this.table.getdataListParm.parammaps.mydate = new Date(this.table.getdataListParm.parammaps.mydate)
  1287. var start = new Date(this.table.getdataListParm.parammaps.mydate.setDate(this.table.getdataListParm.parammaps.mydate.getDate() - 1))
  1288. // var start = this.table.getdataListParm.parammaps.mydate - 1
  1289. this.table.getdataListParm.parammaps.mydate = parseTime(start, '{y}-{m}-{d}')
  1290. // this.$forceUpdate()
  1291. this.parentDate = this.table.getdataListParm.parammaps.mydate
  1292. this.getTMRList()
  1293. this.getList()
  1294. }
  1295. var d = this.table.getdataListParm.parammaps.mydate
  1296. var curDate = parseTime(new Date(), '{y}-{m}-{d}')
  1297. if (d < curDate) {
  1298. this.dataDisabled = true
  1299. } else {
  1300. this.dataDisabled = false
  1301. }
  1302. console.log(this.dataDisabled)
  1303. },
  1304. handleNext() {
  1305. if (this.table.getdataListParm.parammaps.mydate !== '' && this.table.getdataListParm.parammaps.mydate !== null) {
  1306. this.table.getdataListParm.parammaps.mydate = new Date(this.table.getdataListParm.parammaps.mydate)
  1307. var stop = new Date(this.table.getdataListParm.parammaps.mydate.setDate(this.table.getdataListParm.parammaps.mydate.getDate() + 1))
  1308. this.table.getdataListParm.parammaps.mydate = parseTime(stop, '{y}-{m}-{d}')
  1309. this.parentDate = this.table.getdataListParm.parammaps.mydate
  1310. this.getTMRList()
  1311. this.getList()
  1312. }
  1313. var d = this.table.getdataListParm.parammaps.mydate
  1314. var curDate = parseTime(new Date(), '{y}-{m}-{d}')
  1315. if (d < curDate) {
  1316. this.dataDisabled = true
  1317. } else {
  1318. this.dataDisabled = false
  1319. }
  1320. console.log(this.dataDisabled)
  1321. },
  1322. getList() {
  1323. this.table.listLoading = true
  1324. GetDataByName(this.table.getdataListParm).then(response => {
  1325. console.log('table数据', response.data.list)
  1326. if (response.data.list !== null) {
  1327. // var obj = { 'id': '580999', 'havebutton': '0', 'lpplantype': 2, 'pid': '3283220207862547456', 'times': '第二班', 'projname': '2.666' }
  1328. // response.data.list[6] = obj
  1329. this.getIsColor(response.data.list)
  1330. this.table.list = response.data.list
  1331. this.table.pageNum = response.data.pageNum
  1332. this.table.pageSize = response.data.pageSize
  1333. this.table.total = response.data.total
  1334. console.log('计划类型', response.data.list[0].lpplantype)
  1335. this.table2.getdataListParm.parammaps.havebutton = response.data.list[0].havebutton
  1336. this.table3.getdataListParm.parammaps.havebutton = response.data.list[0].havebutton
  1337. if (response.data.list[0].lpplantype == 0) {
  1338. // 撒料
  1339. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  1340. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  1341. this.table2.getdataListParm.parammaps.useinbartype = ''
  1342. this.table3.getdataListParm.parammaps.useinbartype = ''
  1343. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1344. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1345. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  1346. this.table3.getdataListParm.parammaps.id = response.data.list[0].id
  1347. this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
  1348. this.getList2()
  1349. this.getList3()
  1350. } else if (response.data.list[0].lpplantype == 1) {
  1351. // 撒料计划-混料
  1352. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  1353. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  1354. this.table2.getdataListParm.parammaps.useinbartype = ''
  1355. this.table3.getdataListParm.parammaps.useinbartype = ''
  1356. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1357. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1358. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  1359. this.table3.getdataListParm.parammaps.id = response.data.list[0].id
  1360. this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
  1361. this.getList2()
  1362. this.getList3()
  1363. } else if (response.data.list[0].lpplantype == 2) {
  1364. // 撒料计划-撒料
  1365. this.table2.getdataListParm.name = 'getDownloadplandt2ListV2'
  1366. this.table3.getdataListParm.name = 'getDownloadplandtl1ListV2'
  1367. this.table2.getdataListParm.parammaps.useinbartype = ''
  1368. this.table3.getdataListParm.parammaps.useinbartype = ''
  1369. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1370. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1371. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  1372. this.table3.getdataListParm.parammaps.id = response.data.list[0].id
  1373. this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
  1374. this.getList2()
  1375. this.getList3()
  1376. } else if (response.data.list[0].lpplantype == 3) {
  1377. // 剩料
  1378. this.table2.getdataListParm.name = 'getDownloadplandt2ListV2'
  1379. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  1380. this.table2.getdataListParm.parammaps.useinbartype = 0
  1381. this.table3.getdataListParm.parammaps.useinbartype = 1
  1382. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1383. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1384. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  1385. this.table3.getdataListParm.parammaps.id = response.data.list[0].id
  1386. this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
  1387. this.getList2()
  1388. this.getList3()
  1389. } else if (response.data.list[0].lpplantype == 4) {
  1390. // 预混
  1391. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  1392. this.table2.getdataListParm.parammaps.useinbartype = ''
  1393. this.table3.getdataListParm.parammaps.useinbartype = ''
  1394. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  1395. this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
  1396. this.getList2()
  1397. } else if (response.data.list[0].lpplantype == 5) {
  1398. // 预称重计划
  1399. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  1400. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  1401. this.table2.getdataListParm.parammaps.useinbartype = ''
  1402. this.table3.getdataListParm.parammaps.useinbartype = ''
  1403. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1404. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1405. this.table2.getdataListParm.parammaps.id = response.data.list[0].id
  1406. this.table3.getdataListParm.parammaps.id = response.data.list[0].id
  1407. this.table3.getdataListParm.parammaps.lpplantype = response.data.list[0].lpplantype
  1408. this.getList2()
  1409. this.getList3()
  1410. }
  1411. } else {
  1412. this.table.list = []
  1413. this.table3.getdataListParm.parammaps.lpplantype = ''
  1414. this.table2.getdataListParm.parammaps.id = ''
  1415. this.table3.getdataListParm.parammaps.id = ''
  1416. // this.getList2()
  1417. // this.getList3()
  1418. this.table2.list = []
  1419. this.table3.list = []
  1420. }
  1421. setTimeout(() => {
  1422. this.table.listLoading = false
  1423. }, 100)
  1424. })
  1425. },
  1426. form_search() {
  1427. this.getTMRList()
  1428. this.table.getdataListParm.offset = 1
  1429. this.getList()
  1430. },
  1431. handleEnableChange(row) {
  1432. this.requestParam.name = 'updatedownloadenable'
  1433. this.requestParam.parammaps = {}
  1434. this.requestParam.parammaps.pastureid = row.pastureid
  1435. this.requestParam.parammaps.id = row.id
  1436. this.requestParam.parammaps.enable = row.enable
  1437. PostDataByName(this.requestParam).then(response => {
  1438. if (response.msg === 'fail') {
  1439. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1440. } else {
  1441. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  1442. this.getList()
  1443. }
  1444. })
  1445. },
  1446. getIsColor(arr) {
  1447. var map = {}
  1448. var dest = []
  1449. for (var i = 0; i < arr.length; i++) {
  1450. var ai = arr[i]
  1451. if (!map[ai.pid]) {
  1452. dest.push({
  1453. pid: ai.pid,
  1454. data: [ai]
  1455. })
  1456. map[ai.pid] = ai
  1457. } else {
  1458. for (var j = 0; j < dest.length; j++) {
  1459. var dj = dest[j]
  1460. if (dj.pid == ai.pid) {
  1461. dj.data.push(ai)
  1462. break
  1463. }
  1464. }
  1465. }
  1466. }
  1467. console.log(dest)
  1468. var newArr1 = []
  1469. for (var i = 0; i < dest.length; i++) {
  1470. var newArr = dest[i].data
  1471. for (var j = 0; j < dest[i].data.length; j++) {
  1472. dest[i].data[j].isColor = i
  1473. newArr1.push(dest[i].data[j])
  1474. }
  1475. }
  1476. console.log(newArr1)
  1477. this.table.list = newArr1
  1478. },
  1479. tableRowClassName({ row }) {
  1480. if (row.isColor % 2 == 0) {
  1481. return 'warning-row'
  1482. } else {
  1483. return 'success-row'
  1484. }
  1485. },
  1486. lpplantype: function(cellValue) {
  1487. if (cellValue.lpplantype == 0) {
  1488. return '撒料计划'
  1489. } else if (cellValue.lpplantype == 1) {
  1490. return '撒料计划-混料'
  1491. } else if (cellValue.lpplantype == 2) {
  1492. return '撒料计划-撒料'
  1493. } else if (cellValue.lpplantype == 3) {
  1494. return '剩料计划'
  1495. } else if (cellValue.lpplantype == 4) {
  1496. return '预混计划'
  1497. } else if (cellValue.lpplantype == 5) {
  1498. return '预称重计划'
  1499. }
  1500. },
  1501. changeDate(val) {
  1502. console.log('选择了日期', val)
  1503. this.getList()
  1504. // this.getList2()
  1505. // this.getList3()
  1506. var d = this.table.getdataListParm.parammaps.mydate
  1507. var curDate = parseTime(new Date(), '{y}-{m}-{d}')
  1508. if (d < curDate) {
  1509. this.dataDisabled = true
  1510. } else {
  1511. this.dataDisabled = false
  1512. }
  1513. console.log(this.dataDisabled)
  1514. this.parentDate = this.table.getdataListParm.parammaps.mydate
  1515. console.log(this.parentDate, 'this.parentDate')
  1516. },
  1517. changePlanType(val) {
  1518. console.log('选择了计划类型', val)
  1519. this.getList()
  1520. this.getList2()
  1521. this.getList3()
  1522. },
  1523. changeFrequency(val) {
  1524. console.log('选择了班次', val)
  1525. this.getList()
  1526. this.getList2()
  1527. this.getList3()
  1528. },
  1529. // 日执行计划行点击
  1530. tableRowClick(row, column, event) {
  1531. console.log(row, column, event)
  1532. console.log('点击计划类型', row.lpplantype)
  1533. this.table2.getdataListParm.parammaps.havebutton = row.havebutton
  1534. this.table3.getdataListParm.parammaps.havebutton = row.havebutton
  1535. // 撒料计划0/撒料计划-混料1/撒料计划-撒料2/剩料计划3/预混计划4/预称重计划5
  1536. if (row.lpplantype == 0) {
  1537. // 撒料
  1538. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  1539. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  1540. this.table2.getdataListParm.parammaps.useinbartype = ''
  1541. this.table3.getdataListParm.parammaps.useinbartype = ''
  1542. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1543. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1544. this.table2.getdataListParm.parammaps.id = row.id
  1545. this.table3.getdataListParm.parammaps.id = row.id
  1546. this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
  1547. this.getList2()
  1548. this.getList3()
  1549. } else if (row.lpplantype == 1) {
  1550. // 撒料计划-混料
  1551. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  1552. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  1553. this.table2.getdataListParm.parammaps.useinbartype = ''
  1554. this.table3.getdataListParm.parammaps.useinbartype = ''
  1555. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1556. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1557. this.table2.getdataListParm.parammaps.id = row.id
  1558. this.table3.getdataListParm.parammaps.id = row.id
  1559. this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
  1560. this.getList2()
  1561. this.getList3()
  1562. } else if (row.lpplantype == 2) {
  1563. // 撒料计划-撒料
  1564. this.table2.getdataListParm.name = 'getDownloadplandt2ListV2'
  1565. this.table3.getdataListParm.name = 'getDownloadplandtl1ListV2'
  1566. this.table2.getdataListParm.parammaps.useinbartype = ''
  1567. this.table3.getdataListParm.parammaps.useinbartype = ''
  1568. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1569. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1570. this.table2.getdataListParm.parammaps.id = row.id
  1571. this.table3.getdataListParm.parammaps.id = row.id
  1572. this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
  1573. this.getList2()
  1574. this.getList3()
  1575. console.log(this.table3.getdataListParm.parammaps.lpplantype)
  1576. } else if (row.lpplantype == 3) {
  1577. // 剩料
  1578. this.table2.getdataListParm.name = 'getDownloadplandt2ListV2'
  1579. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  1580. this.table2.getdataListParm.parammaps.useinbartype = 0
  1581. this.table3.getdataListParm.parammaps.useinbartype = 1
  1582. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1583. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1584. this.table2.getdataListParm.parammaps.id = row.id
  1585. this.table3.getdataListParm.parammaps.id = row.id
  1586. this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
  1587. this.getList2()
  1588. this.getList3()
  1589. } else if (row.lpplantype == 4) {
  1590. // 预混
  1591. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  1592. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  1593. this.table2.getdataListParm.parammaps.useinbartype = ''
  1594. this.table3.getdataListParm.parammaps.useinbartype = ''
  1595. this.table2.getdataListParm.parammaps.id = row.id
  1596. this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
  1597. this.getList2()
  1598. } else if (row.lpplantype == 5) {
  1599. // 预称重计划
  1600. this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
  1601. this.table3.getdataListParm.name = 'getDownloadplandt2ListV2'
  1602. this.table2.getdataListParm.parammaps.useinbartype = ''
  1603. this.table3.getdataListParm.parammaps.useinbartype = ''
  1604. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1605. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1606. this.table2.getdataListParm.parammaps.id = row.id
  1607. this.table3.getdataListParm.parammaps.id = row.id
  1608. this.table3.getdataListParm.parammaps.lpplantype = row.lpplantype
  1609. this.getList2()
  1610. this.getList3()
  1611. }
  1612. this.$forceUpdate()
  1613. },
  1614. // 计划内容操作详情
  1615. getList2() {
  1616. this.table2.listLoading = true
  1617. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1618. GetDataByName(this.table2.getdataListParm).then(response => {
  1619. console.log('table数据', response.data.list)
  1620. if (response.data.list !== null) {
  1621. for (let i = 0; i < response.data.list.length; i++) {
  1622. this.$set(response.data.list[i], 'Edit', false) // 编辑
  1623. this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
  1624. this.$set(response.data.list[i], 'isCreate', false) // 新增操作
  1625. this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
  1626. this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
  1627. }
  1628. this.table2.list = response.data.list
  1629. // 撒料计划0/撒料计划-混料1/撒料计划-撒料2/剩料计划3/预混计划4
  1630. if (this.table3.getdataListParm.parammaps.lpplantype == 0 || this.table3.getdataListParm.parammaps.lpplantype == 1 || this.table3.getdataListParm.parammaps.lpplantype == 4) {
  1631. const arr = []
  1632. var a = 0
  1633. let b = this.table2.list[0].sort
  1634. let c = 0
  1635. for (let i = 0; i < this.table2.list.length; i++) {
  1636. if (b !== parseInt(this.table2.list[i].sort)) {
  1637. b = this.table2.list[i].sort
  1638. // arr.push({ 'sort': '小计', 'weight': a.toFixed(parseInt(Cookies.get('decimal'))) })
  1639. a = 0
  1640. }
  1641. a = a + parseFloat(this.table2.list[i].weight)
  1642. c = c + parseFloat(this.table2.list[i].weight)
  1643. arr.push(this.table2.list[i])
  1644. }
  1645. // arr.push({ 'sort': '小计', 'weight': a.toFixed(parseInt(Cookies.get('decimal'))) })
  1646. arr.push({ 'sort': '总计', 'weight': c.toFixed(parseInt(Cookies.get('decimal'))) })
  1647. this.table2.list = arr
  1648. }
  1649. if (this.table3.getdataListParm.parammaps.lpplantype == 2) {
  1650. const arr = []
  1651. var aa = 0
  1652. let bb = this.table2.list[0].sort
  1653. let cc = 0
  1654. for (let i = 0; i < this.table2.list.length; i++) {
  1655. if (bb !== parseInt(this.table2.list[i].sort)) {
  1656. bb = this.table2.list[i].sort
  1657. aa = 0
  1658. }
  1659. aa = aa + parseFloat(this.table2.list[i].weight)
  1660. cc = cc + parseFloat(this.table2.list[i].weight)
  1661. arr.push(this.table2.list[i])
  1662. }
  1663. arr.push({ 'sort': '总计', 'weight': cc.toFixed(parseInt(Cookies.get('decimal'))) })
  1664. this.table2.list = arr
  1665. console.log('this.table2.list', this.table2.list)
  1666. console.log(this.table3.getdataListParm.parammaps.lpplantype)
  1667. }
  1668. console.log(this.table2.list)
  1669. this.table2.pageNum = response.data.pageNum
  1670. this.table2.pageSize = response.data.pageSize
  1671. this.table2.total = response.data.total
  1672. } else {
  1673. this.table2.list = []
  1674. }
  1675. this.handleSpan()
  1676. setTimeout(() => {
  1677. this.table2.listLoading = false
  1678. }, 100)
  1679. })
  1680. },
  1681. // 计划内容栏舍详情
  1682. getList3() {
  1683. this.table3.listLoading = true
  1684. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1685. GetDataByName(this.table3.getdataListParm).then(response => {
  1686. console.log('table数据', response.data.list)
  1687. if (response.data.list !== null) {
  1688. for (let i = 0; i < response.data.list.length; i++) {
  1689. this.$set(response.data.list[i], 'Edit', false) // 编辑
  1690. this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
  1691. this.$set(response.data.list[i], 'isCreate', false) // 新增操作
  1692. this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
  1693. this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
  1694. }
  1695. this.table3.list = response.data.list
  1696. if (this.table3.getdataListParm.parammaps.lpplantype == 0) {
  1697. const arr = []
  1698. var a = 0
  1699. let b = this.table3.list[0].sort
  1700. let c = 0
  1701. for (let i = 0; i < this.table3.list.length; i++) {
  1702. if (b !== parseInt(this.table3.list[i].sort)) {
  1703. b = this.table3.list[i].sort
  1704. a = 0
  1705. }
  1706. a = a + parseFloat(this.table3.list[i].weight)
  1707. c = c + parseFloat(this.table3.list[i].weight)
  1708. arr.push(this.table3.list[i])
  1709. }
  1710. arr.push({ 'sort': '总计', 'weight': c.toFixed(parseInt(Cookies.get('decimal'))) })
  1711. this.table3.list = arr
  1712. }
  1713. this.table3.pageNum = response.data.pageNum
  1714. this.table3.pageSize = response.data.pageSize
  1715. this.table3.total = response.data.total
  1716. } else {
  1717. this.table3.list = []
  1718. }
  1719. setTimeout(() => {
  1720. this.table3.listLoading = false
  1721. }, 100)
  1722. })
  1723. },
  1724. // 新生成
  1725. handleCreate() {
  1726. console.log('点击了新生成')
  1727. this.newGeneration.temp.inputDatetime = [parseTime(new Date(), '{y}-{m}-{d}'), parseTime(new Date(), '{y}-{m}-{d}')]
  1728. GetDataByName(this.newGeneration.getdataListParm).then(response => {
  1729. console.log('table数据', response.data.list)
  1730. if (response.data.list !== null) {
  1731. if (response.data.list[0].vmsg == '存在未分配') {
  1732. this.newGeneration.temp.tips = true
  1733. this.$message({ type: 'warning', message: '撒料计划中存在未分配完栏舍,建议及时进行分配', duration: 2000 })
  1734. this.getTips()
  1735. }else{
  1736. this.newGeneration.temp.tips = false
  1737. this.newGeneration.dialogStatus = 'newGeneration'
  1738. this.newGeneration.dialogFormVisible = true
  1739. }
  1740. }
  1741. })
  1742. },
  1743. getTips(){
  1744. const url = 'authdata/feedp/undistribute'
  1745. const data = {}
  1746. // data.times = 1
  1747. data.times = this.myMaxTimes
  1748. data.pastureid = Cookies.get('pastureid')
  1749. this.tipsList = []
  1750. postJson(url, data).then(response => {
  1751. if(response.data !== null){
  1752. this.tipsList = response.data
  1753. // if(this.myMaxTimes == 1){
  1754. // this.tipsList = response.data.one
  1755. // }else if(this.myMaxTimes == 2){
  1756. // this.tipsList.push(response.data.one,response.data.two)
  1757. // }else if(this.myMaxTimes == 3){
  1758. // this.tipsList.push(response.data.one,response.data.two,response.data.three)
  1759. // }else if(this.myMaxTimes == 4){
  1760. // this.tipsList.push(response.data.one,response.data.two,response.data.three,response.data.four)
  1761. // }
  1762. }else{
  1763. this.tipsList = []
  1764. }
  1765. console.log('this.tipsList==>',this.tipsList)
  1766. this.newGeneration.dialogStatus = 'newGeneration'
  1767. this.newGeneration.dialogFormVisible = true
  1768. })
  1769. },
  1770. DateDiff(sDate1, sDate2) {
  1771. console.log(sDate1, sDate2)
  1772. var aDate, oDate1, oDate2, iDays
  1773. aDate = sDate1.split('-')
  1774. oDate1 = new Date(aDate[0], aDate[1], aDate[2]) // 转换为12-18-2006格式
  1775. aDate = sDate2.split('-')
  1776. oDate2 = new Date(aDate[0], aDate[1], aDate[2])
  1777. iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 / 24) // 把相差的毫秒数转换为天数
  1778. this.newGeneration.temp.days = parseInt(iDays) + 1
  1779. return iDays
  1780. },
  1781. newGenerationData() {
  1782. console.log('点击了新生成保存', this.newGeneration.temp)
  1783. this.newGenerationLoading = true
  1784. this.isokDisable = true
  1785. this.$refs['temp'].validate(valid => {
  1786. if (valid) {
  1787. this.newGeneration.temp.startTime = parseTime(this.newGeneration.temp.inputDatetime[0], '{y}-{m}-{d}')
  1788. this.newGeneration.temp.stopTime = parseTime(this.newGeneration.temp.inputDatetime[1], '{y}-{m}-{d}')
  1789. this.DateDiff(this.newGeneration.temp.stopTime, this.newGeneration.temp.startTime)
  1790. this.requestParam = {}
  1791. this.requestParam.common = { 'returnmap': '0' }
  1792. this.requestParam.data = []
  1793. this.requestParam.data[0] = { 'name': 'checkDLPIsStart', 'type': 'v', 'parammaps': {
  1794. pastureid: Cookies.get('pastureid'),
  1795. startTime: this.newGeneration.temp.startTime
  1796. }}
  1797. this.requestParam.data[1] = { 'name': 'checkPreMixStorage', 'type': 'e', 'parammaps': {
  1798. pastureid: Cookies.get('pastureid'),
  1799. days: this.newGeneration.temp.days
  1800. }}
  1801. this.requestParam.data[2] = { 'name': 'createdownloadedplan', 'type': 'e', 'parammaps': {
  1802. pastureid: Cookies.get('pastureid'),
  1803. startTime: this.newGeneration.temp.startTime,
  1804. stopTime: this.newGeneration.temp.stopTime
  1805. }}
  1806. ExecDataByConfig(this.requestParam).then(response => {
  1807. console.log('新生成保存发送参数', this.requestParam)
  1808. if (response.msg === 'fail') {
  1809. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1810. this.isokDisable = false
  1811. this.newGenerationLoading = false
  1812. } else {
  1813. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  1814. this.newGeneration.dialogFormVisible = false
  1815. this.getList()
  1816. this.isokDisable = false
  1817. this.newGenerationLoading = false
  1818. }
  1819. })
  1820. }
  1821. })
  1822. },
  1823. // 修改计划
  1824. handleRevisePlan(data) {
  1825. this.dialogFull = false
  1826. var arr = []
  1827. if (this.table.list.length > 0) {
  1828. for (let i = 0; i < this.table.list.length; i++) {
  1829. if (this.table.list[i].havebutton == 1) {
  1830. arr.push(this.table.list[i])
  1831. }
  1832. }
  1833. }
  1834. if (arr.length !== this.table.list.length) {
  1835. console.log('点击了修改计划1', this.activeName)
  1836. this.isShowDialog = true
  1837. this.activeName = '栏舍配方'
  1838. console.log('点击了修改计划2', this.activeName)
  1839. } else {
  1840. this.$message({ type: 'error', message: '当前日期不可修改计划,请重新选择日期' })
  1841. }
  1842. },
  1843. handleExport() {
  1844. this.downLoad.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  1845. this.downLoad.getdataListParm.parammaps.lpplantype = this.table.getdataListParm.parammaps.lpplantype
  1846. this.downLoad.getdataListParm.parammaps.times = this.table.getdataListParm.parammaps.times
  1847. this.downLoad.getdataListParm.parammaps.enable = this.table.getdataListParm.parammaps.enable
  1848. this.downLoad.getdataListParm.parammaps.enable2 = this.table.getdataListParm.parammaps.enable2
  1849. var exportTitle = ''
  1850. if (this.table.getdataListParm.parammaps.plandimen == '1') {
  1851. if (this.table.getdataListParm.parammaps.enable3 == '0') {
  1852. this.downLoad.getdataListParm.name = 'downloadPlanTLJDTMR'
  1853. exportTitle = this.table.getdataListParm.parammaps.mydate + '投料简打'
  1854. } else if (this.table.getdataListParm.parammaps.enable3 == '1') {
  1855. this.downLoad.getdataListParm.name = 'downloadPlanTLLDTMR'
  1856. exportTitle = this.table.getdataListParm.parammaps.mydate + '累加投料'
  1857. } else if (this.table.getdataListParm.parammaps.enable3 == '2') {
  1858. this.downLoad.getdataListParm.name = 'downloadPlanSLJDTMR'
  1859. exportTitle = this.table.getdataListParm.parammaps.mydate + '撒料简打'
  1860. } else if (this.table.getdataListParm.parammaps.enable3 == '3') {
  1861. this.downLoad.getdataListParm.name = 'downloadPlanTSLJDTMR'
  1862. exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料简打'
  1863. } else if (this.table.getdataListParm.parammaps.enable3 == '4') {
  1864. this.downLoad.getdataListParm.name = 'downloadPlanTSLLDTMR'
  1865. exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料累加'
  1866. } else if (this.table.getdataListParm.parammaps.enable3 == '5') {
  1867. this.downLoad.getdataListParm.name = 'downloadPlanBZJDTMR'
  1868. exportTitle = this.table.getdataListParm.parammaps.mydate + '包装简打'
  1869. } else {
  1870. this.downLoad.getdataListParm.name = 'downloadPlanSFJDTMR'
  1871. exportTitle = this.table.getdataListParm.parammaps.mydate + '实发简打'
  1872. }
  1873. } else {
  1874. if (this.table.getdataListParm.parammaps.enable3 == '0') {
  1875. this.downLoad.getdataListParm.name = 'downloadPlanTLJD'
  1876. exportTitle = this.table.getdataListParm.parammaps.mydate + '投料简打'
  1877. } else if (this.table.getdataListParm.parammaps.enable3 == '1') {
  1878. this.downLoad.getdataListParm.name = 'downloadPlanTLLD'
  1879. exportTitle = this.table.getdataListParm.parammaps.mydate + '累加投料'
  1880. } else if (this.table.getdataListParm.parammaps.enable3 == '2') {
  1881. this.downLoad.getdataListParm.name = 'downloadPlanSLJD'
  1882. exportTitle = this.table.getdataListParm.parammaps.mydate + '撒料简打'
  1883. } else if (this.table.getdataListParm.parammaps.enable3 == '3') {
  1884. this.downLoad.getdataListParm.name = 'downloadPlanTSLJD'
  1885. exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料简打'
  1886. } else if (this.table.getdataListParm.parammaps.enable3 == '4') {
  1887. this.downLoad.getdataListParm.name = 'downloadPlanTSLLD'
  1888. exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料累加'
  1889. } else if (this.table.getdataListParm.parammaps.enable3 == '5') {
  1890. this.downLoad.getdataListParm.name = 'downloadPlanBZJD'
  1891. exportTitle = this.table.getdataListParm.parammaps.mydate + '包装简打'
  1892. } else {
  1893. this.downLoad.getdataListParm.name = 'downloadPlanSFJD'
  1894. exportTitle = this.table.getdataListParm.parammaps.mydate + '实发简打'
  1895. }
  1896. }
  1897. GetReportform(this.downLoad.getdataListParm).then(response => {
  1898. if (response.data.list !== null) {
  1899. this.downLoad.labelList = []
  1900. var filterValArr = []
  1901. for (let i = 0; i < response.data.list.data1.length; i++) {
  1902. this.downLoad.labelList.push(response.data.list.data1[i].label)
  1903. filterValArr.push(response.data.list.data1[i].prop)
  1904. }
  1905. this.downLoad.list = response.data.list.data2
  1906. } else {
  1907. this.downLoad.list = []
  1908. }
  1909. var multiHeaderArr = []
  1910. for (let i = 0; i < this.downLoad.labelList.length; i++) {
  1911. if (i == 0) {
  1912. multiHeaderArr.push(exportTitle)
  1913. } else {
  1914. multiHeaderArr.push('')
  1915. }
  1916. }
  1917. import('@/vendor/Export5Excel').then(excel => {
  1918. const multiHeader = [
  1919. multiHeaderArr
  1920. ]
  1921. const multiHeader2 = [
  1922. this.downLoad.labelList
  1923. ]
  1924. const filterVal = filterValArr
  1925. const data = this.downLoad.list.map((v) => filterVal.map((j) => v[j]))
  1926. const merges = []
  1927. excel.export_json_to_excel({ multiHeader, multiHeader2, data, filename: exportTitle, merges })
  1928. })
  1929. })
  1930. },
  1931. rowDrop() {
  1932. console.log(document.querySelector('#table1 .el-table__body-wrapper tbody'))
  1933. const tbody = document.querySelector('#table1 .el-table__body-wrapper tbody')
  1934. // this.sorTable()
  1935. const that = this
  1936. var sortable = Sortable.create(tbody, {
  1937. disabled: that.dropState,
  1938. onChoose({ newIndex, oldIndex }) {
  1939. console.log(that.isOrder, 'that.isOrder == false')
  1940. console.log(that.dropState, 'that.dropState')
  1941. if (that.dropState == true || that.isOrder == true) {
  1942. sortable.destroy()
  1943. }
  1944. },
  1945. onEnd(evt) {
  1946. var tableList = [...that.table.list] // 保留拖动前数据
  1947. const targetRow = that.table.list.splice(evt.oldIndex, 1)[0] // 拖动数据
  1948. const targetRow2 = that.table.list[evt.newIndex] // 拖动后下方数据
  1949. const targetRow3 = that.table.list[evt.newIndex - 1] // 拖动后上方数据
  1950. console.log(targetRow, 'targetRow')
  1951. console.log(targetRow2, 'targetRow2')
  1952. console.log(targetRow3, 'targetRow3')
  1953. that.table.list.splice(evt.newIndex, 0, targetRow)
  1954. // ==========
  1955. // 已执行的计划不可拖动
  1956. if (targetRow.havebutton == 1) {
  1957. that.$nextTick(() => {
  1958. that.$set(that.table, 'list', tableList)
  1959. })
  1960. that.$message({ type: 'error', message: '因已执行的计划不可调整顺序', duration: 2000 })
  1961. return false
  1962. }
  1963. // 相同班次之间可以拖动
  1964. // if (targetRow2 !== undefined && targetRow3 !== undefined) {
  1965. // if (targetRow.times !== targetRow2.times && targetRow.times !== targetRow3.times) {
  1966. // that.$nextTick(() => {
  1967. // that.$set(that.table, 'list', tableList)
  1968. // })
  1969. // that.$message({ type: 'error', message: '因班次不同不可调整顺序', duration: 2000 })
  1970. // return false
  1971. // }
  1972. // } else if (targetRow2 !== undefined && targetRow3 == undefined) {
  1973. // if (targetRow.times !== targetRow2.times) {
  1974. // that.$nextTick(() => {
  1975. // that.$set(that.table, 'list', tableList)
  1976. // })
  1977. // that.$message({ type: 'error', message: '因班次不同不可调整顺序', duration: 2000 })
  1978. // return false
  1979. // }
  1980. // } else if (targetRow2 == undefined && targetRow3 !== undefined) {
  1981. // if (targetRow.times !== targetRow3.times) {
  1982. // that.$nextTick(() => {
  1983. // that.$set(that.table, 'list', tableList)
  1984. // })
  1985. // that.$message({ type: 'error', message: '因班次不同不可调整顺序', duration: 2000 })
  1986. // return false
  1987. // }
  1988. // }
  1989. // 撒料计划0,
  1990. // 撒料计划-混料1
  1991. // 撒料计划-撒料2
  1992. // 剩料计划3
  1993. // 预混计划4
  1994. // 预称重计划5
  1995. if (targetRow.lpplantype == 1) { // 拖动数据为撒料计划-混料
  1996. if (targetRow2 == undefined) {
  1997. that.$nextTick(() => {
  1998. that.$set(that.table, 'list', tableList)
  1999. })
  2000. } else if (targetRow2 !== undefined && targetRow2.pid == targetRow.pid) {
  2001. that.$nextTick(() => {
  2002. that.$set(that.table, 'list', tableList)
  2003. })
  2004. } else {
  2005. var pidArr = [] // pid相同的值
  2006. var pidArr1 = [] //
  2007. var index // 索引
  2008. for (let i = 0; i < tableList.length; i++) {
  2009. if (tableList[i].pid == targetRow.pid) {
  2010. pidArr.push(tableList[i])
  2011. } else {
  2012. pidArr1.push(tableList[i])
  2013. }
  2014. }
  2015. // 找到对应上方pid 的ID
  2016. // 比如说id 580243 找到对应的索引
  2017. if (targetRow3 !== undefined) {
  2018. for (let i = 0; i < pidArr1.length; i++) {
  2019. if (pidArr1[i].id == targetRow3.id) {
  2020. index = i
  2021. }
  2022. }
  2023. } else {
  2024. for (let i = 0; i < pidArr1.length; i++) {
  2025. if (pidArr1[i].id == targetRow2.id) {
  2026. index = i - 1
  2027. }
  2028. }
  2029. }
  2030. pidArr1.splice(index + 1, 0, ...pidArr)
  2031. console.log(pidArr1)
  2032. that.$nextTick(() => {
  2033. that.table.list = pidArr1
  2034. })
  2035. }
  2036. if (targetRow2 !== undefined && targetRow3 !== undefined) {
  2037. if (targetRow2.pid == targetRow3.pid) {
  2038. that.$nextTick(() => {
  2039. that.$set(that.table, 'list', tableList)
  2040. })
  2041. that.$message({ type: 'error', message: '不可将其他计划拖动至预称重计划之间', duration: 2000 })
  2042. return false
  2043. }
  2044. }
  2045. } else if (targetRow.lpplantype == 5) { // 拖动数据为预称重计划
  2046. if (targetRow2 !== undefined) {
  2047. console.log(targetRow3, targetRow2, 'zhidao')
  2048. if (targetRow3 !== undefined) {
  2049. if (targetRow3.pid !== targetRow.pid && targetRow2.pid !== targetRow.pid) {
  2050. that.$nextTick(() => {
  2051. that.$set(that.table, 'list', tableList)
  2052. })
  2053. that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
  2054. return false
  2055. } else {
  2056. console.log('wojinlaile', targetRow2, targetRow)
  2057. if (targetRow3.lpplantype == 0 && targetRow2.pid !== targetRow.pid) {
  2058. that.$nextTick(() => {
  2059. that.$set(that.table, 'list', tableList)
  2060. })
  2061. that.$message({ type: 'error', message: '预称重计划不可拖动至撒料计划下方', duration: 2000 })
  2062. return false
  2063. }
  2064. if (targetRow2.lpplantype !== 5 && targetRow3.lpplantype !== 5) {
  2065. that.$nextTick(() => {
  2066. that.$set(that.table, 'list', tableList)
  2067. })
  2068. that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
  2069. return false
  2070. }
  2071. }
  2072. } else {
  2073. if (targetRow2.pid !== targetRow.pid) {
  2074. that.$nextTick(() => {
  2075. that.$set(that.table, 'list', tableList)
  2076. })
  2077. that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
  2078. return false
  2079. } else {
  2080. if (targetRow2.pid !== targetRow.pid) {
  2081. that.$nextTick(() => {
  2082. that.$set(that.table, 'list', tableList)
  2083. })
  2084. that.$message({ type: 'error', message: '预称重计划不可拖动至撒料计划下方', duration: 2000 })
  2085. return false
  2086. }
  2087. }
  2088. }
  2089. } else {
  2090. if (targetRow2 == undefined) {
  2091. that.$nextTick(() => {
  2092. that.$set(that.table, 'list', tableList)
  2093. })
  2094. that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
  2095. return false
  2096. } else if (targetRow3.pid !== targetRow.pid) {
  2097. that.$nextTick(() => {
  2098. that.$set(that.table, 'list', tableList)
  2099. })
  2100. that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
  2101. return false
  2102. } else {
  2103. if (targetRow3.lpplantype == 0) {
  2104. that.$nextTick(() => {
  2105. that.$set(that.table, 'list', tableList)
  2106. })
  2107. that.$message({ type: 'error', message: '预称重计划不可拖动至撒料计划下方', duration: 2000 })
  2108. return false
  2109. }
  2110. }
  2111. }
  2112. if (targetRow2 !== undefined && targetRow3 !== undefined) {
  2113. if (targetRow2.pid !== targetRow.pid && targetRow3.pid !== targetRow.pid) {
  2114. that.$nextTick(() => {
  2115. that.$set(that.table, 'list', tableList)
  2116. })
  2117. that.$message({ type: 'error', message: '不可将其他计划拖动至预称重计划之间', duration: 2000 })
  2118. return false
  2119. } else if (targetRow3.pid == targetRow.pid && (targetRow3.lpplantype == 1 || targetRow3.lpplantype == 2)) {
  2120. that.$nextTick(() => {
  2121. that.$set(that.table, 'list', tableList)
  2122. })
  2123. that.$message({ type: 'error', message: '预称重计划不可拖动至其他位置', duration: 2000 })
  2124. return false
  2125. }
  2126. }
  2127. } else if (targetRow.lpplantype == 2) { // 拖动数据为撒料计划-撒料
  2128. if (targetRow2 == undefined) {
  2129. if (targetRow3.pid !== targetRow.pid) {
  2130. that.$nextTick(() => {
  2131. that.$set(that.table, 'list', tableList)
  2132. })
  2133. that.$message({ type: 'error', message: '撒料计划-撒料不可拖动至其他位置', duration: 2000 })
  2134. return false
  2135. }
  2136. } else {
  2137. if (targetRow2.lpplantype == 1 && (targetRow2.pid == targetRow.pid || targetRow2 == undefined)) {
  2138. // 拖动数据下方为撒料计划-混料时且pid相同,不可拖动,提示
  2139. that.$nextTick(() => {
  2140. that.$set(that.table, 'list', tableList)
  2141. })
  2142. that.$message({ type: 'error', message: '撒料计划-撒料不可拖动至撒料计划-混料上方', duration: 2000 })
  2143. return false
  2144. } else if (targetRow.lpplantype == 2 && (targetRow2.pid == targetRow.pid || targetRow3.pid == targetRow.pid || targetRow2 == undefined || targetRow3 == undefined)) {
  2145. console.log('正常拖动')
  2146. } else {
  2147. that.$nextTick(() => {
  2148. that.$set(that.table, 'list', tableList)
  2149. })
  2150. that.$message({ type: 'error', message: '撒料计划-撒料不可拖动至其他位置', duration: 2000 })
  2151. return false
  2152. }
  2153. }
  2154. if (targetRow2 !== undefined && targetRow3 !== undefined) {
  2155. if (targetRow2.pid == targetRow3.pid) {
  2156. that.$nextTick(() => {
  2157. that.$set(that.table, 'list', tableList)
  2158. })
  2159. that.$message({ type: 'error', message: '不可将其他计划拖动至预称重计划之间', duration: 2000 })
  2160. return false
  2161. }
  2162. }
  2163. } else if (targetRow.lpplantype == 0) { // 拖动数据为撒料计划
  2164. console.log('遍历有相同的pid,一起跟着拖动3')
  2165. var pidArr = [] // pid相同的值
  2166. var pidArr1 = [] //
  2167. var index // 索引
  2168. for (let i = 0; i < tableList.length; i++) {
  2169. if (tableList[i].pid == targetRow.pid) {
  2170. pidArr.push(tableList[i])
  2171. } else {
  2172. pidArr1.push(tableList[i])
  2173. }
  2174. }
  2175. if (pidArr.length > 0) {
  2176. // 找到对应上方pid 的ID
  2177. // 比如说id 580243 找到对应的索引
  2178. if (targetRow3 !== undefined) {
  2179. for (let i = 0; i < pidArr1.length; i++) {
  2180. if (pidArr1[i].id == targetRow3.id) {
  2181. index = i
  2182. }
  2183. }
  2184. } else {
  2185. for (let i = 0; i < pidArr1.length; i++) {
  2186. if (pidArr1[i].id == targetRow2.id) {
  2187. index = i - 1
  2188. }
  2189. }
  2190. }
  2191. pidArr1.splice(index + 1, 0, ...pidArr)
  2192. console.log(pidArr1)
  2193. that.$nextTick(() => {
  2194. that.table.list = pidArr1
  2195. })
  2196. }
  2197. if (targetRow2 !== undefined && targetRow3 !== undefined) {
  2198. if (targetRow2.pid == targetRow3.pid) {
  2199. that.$nextTick(() => {
  2200. that.$set(that.table, 'list', tableList)
  2201. })
  2202. that.$message({ type: 'error', message: '不可拖动至其他计划中间;', duration: 2000 })
  2203. return false
  2204. }
  2205. }
  2206. } else if (targetRow.lpplantype == 3 || targetRow.lpplantype == 4) {
  2207. if (targetRow2 !== undefined && targetRow3 !== undefined) {
  2208. if (targetRow2.pid == targetRow3.pid) {
  2209. if (targetRow2.lpplantype == 5 && targetRow3.lpplantype == 5) {
  2210. that.$nextTick(() => {
  2211. that.$set(that.table, 'list', tableList)
  2212. })
  2213. that.$message({ type: 'error', message: '不可拖动至预称重计划跟预称重计划之间', duration: 2000 })
  2214. return false
  2215. } else if (targetRow.pid == targetRow2.pid && targetRow.lpplantype == 3 && targetRow2.lpplantype == 3 || targetRow.pid == targetRow3.pid && targetRow.lpplantype == 3 && targetRow3.lpplantype == 3) {
  2216. console.log('剩料之间可以互相拖动')
  2217. console.log(tableList)
  2218. } else {
  2219. that.$nextTick(() => {
  2220. that.$set(that.table, 'list', tableList)
  2221. })
  2222. // 撒料计划0,
  2223. // 撒料计划-混料1
  2224. // 撒料计划-撒料2
  2225. // 剩料计划3
  2226. // 预混计划4
  2227. // 预称重计划5
  2228. if (targetRow3.lpplantype == 0) {
  2229. that.$set(targetRow3, 'mylpplantype', '撒料计划')
  2230. } else if (targetRow3.lpplantype == 1) {
  2231. that.$set(targetRow3, 'mylpplantype', '撒料计划-混料')
  2232. } else if (targetRow3.lpplantype == 2) {
  2233. that.$set(targetRow3, 'mylpplantype', '撒料计划-撒料')
  2234. } else if (targetRow3.lpplantype == 3) {
  2235. that.$set(targetRow3, 'mylpplantype', '剩料计划')
  2236. } else if (targetRow3.lpplantype == 4) {
  2237. that.$set(targetRow3, 'mylpplantype', '预混计划')
  2238. } else if (targetRow3.lpplantype == 5) {
  2239. that.$set(targetRow3, 'mylpplantype', '预称重计划')
  2240. }
  2241. if (targetRow2.lpplantype == 0) {
  2242. that.$set(targetRow2, 'mylpplantype', '撒料计划')
  2243. } else if (targetRow2.lpplantype == 1) {
  2244. that.$set(targetRow2, 'mylpplantype', '撒料计划-混料')
  2245. } else if (targetRow2.lpplantype == 2) {
  2246. that.$set(targetRow2, 'mylpplantype', '撒料计划-撒料')
  2247. } else if (targetRow2.lpplantype == 3) {
  2248. that.$set(targetRow2, 'mylpplantype', '剩料计划')
  2249. } else if (targetRow2.lpplantype == 4) {
  2250. that.$set(targetRow2, 'mylpplantype', '预混计划')
  2251. } else if (targetRow2.lpplantype == 5) {
  2252. that.$set(targetRow2, 'mylpplantype', '预称重计划')
  2253. }
  2254. var message = '不可拖动至' + targetRow3.mylpplantype + '跟' + targetRow2.mylpplantype + '之间'
  2255. that.$message({ type: 'error', message: message, duration: 2000 })
  2256. return false
  2257. }
  2258. }
  2259. }
  2260. // ========
  2261. // var pidArr = [] // pid相同的值
  2262. // var pidArr1 = [] //
  2263. // var index // 索引
  2264. // for (let i = 0; i < tableList.length; i++) {
  2265. // if (tableList[i].pid == targetRow.pid) {
  2266. // pidArr.push(tableList[i])
  2267. // } else {
  2268. // pidArr1.push(tableList[i])
  2269. // }
  2270. // }
  2271. // if (pidArr.length > 0) {
  2272. // // 找到对应上方pid 的ID
  2273. // // 比如说id 580243 找到对应的索引
  2274. // if (targetRow3 !== undefined) {
  2275. // for (let i = 0; i < pidArr1.length; i++) {
  2276. // if (pidArr1[i].id == targetRow3.id) {
  2277. // index = i
  2278. // }
  2279. // }
  2280. // } else {
  2281. // for (let i = 0; i < pidArr1.length; i++) {
  2282. // if (pidArr1[i].id == targetRow2.id) {
  2283. // index = i - 1
  2284. // }
  2285. // }
  2286. // }
  2287. // pidArr1.splice(index + 1, 0, ...pidArr)
  2288. // console.log(pidArr1)
  2289. // that.$nextTick(() => {
  2290. // that.table.list = pidArr1
  2291. // })
  2292. // }
  2293. // if (targetRow2 !== undefined && targetRow3 !== undefined) {
  2294. // if (targetRow2.pid == targetRow3.pid) {
  2295. // that.$nextTick(() => {
  2296. // that.$set(that.table, 'list', tableList)
  2297. // })
  2298. // that.$message({ type: 'error', message: '不可将其他计划拖动至预称重计划之间9999', duration: 2000 })
  2299. // return false
  2300. // }
  2301. // }
  2302. }
  2303. // ===
  2304. }
  2305. })
  2306. },
  2307. // 复制
  2308. handleCopy() {
  2309. if (this.table.list.length > 0) {
  2310. this.newGeneration.temp = {}
  2311. this.newGeneration.dialogStatus = 'copy'
  2312. this.newGeneration.dialogFormVisible = true
  2313. } else {
  2314. this.$message({ type: 'error', message: '当前无计划可复制' })
  2315. }
  2316. },
  2317. copyData() {
  2318. console.log(this.newGeneration.temp.copyInputDatetime)
  2319. this.isokDisable = true
  2320. setTimeout(() => {
  2321. this.isokDisable = false
  2322. }, 5000)
  2323. this.$refs['temp'].validate(valid => {
  2324. if (valid) {
  2325. this.requestParam.name = 'copydownloadedplan'
  2326. this.requestParam.parammaps = {}
  2327. this.requestParam.parammaps.pastureid = Cookies.get('pastureid')
  2328. this.requestParam.parammaps.date = this.table.getdataListParm.parammaps.mydate
  2329. this.requestParam.parammaps.startTime = parseTime(this.newGeneration.temp.copyInputDatetime[0], '{y}-{m}-{d}')
  2330. this.requestParam.parammaps.stopTime = parseTime(this.newGeneration.temp.copyInputDatetime[1], '{y}-{m}-{d}')
  2331. PostDataByName(this.requestParam).then(response => {
  2332. if (response.msg === 'fail') {
  2333. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  2334. } else {
  2335. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  2336. this.newGeneration.dialogFormVisible = false
  2337. this.getList()
  2338. }
  2339. })
  2340. }
  2341. })
  2342. },
  2343. handleChangeOrder() {
  2344. // 拖动顺序
  2345. this.isOrder = false
  2346. this.rowDrop()
  2347. },
  2348. saveChangeOrder() {
  2349. // 保存顺序
  2350. var sortList = []
  2351. for (let i = 0; i < this.table.list.length; i++) {
  2352. var obj = {}
  2353. obj.sort = i
  2354. obj.pastureid = this.table.list[i].pastureid
  2355. obj.id = this.table.list[i].id
  2356. sortList.push(obj)
  2357. }
  2358. console.log(sortList)
  2359. this.requestParam = {}
  2360. this.requestParam.common = { 'returnmap': '0' }
  2361. this.requestParam.data = []
  2362. this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': sortList }}
  2363. this.requestParam.data[0].children = []
  2364. this.requestParam.data[0].children[0] = { 'name': 'updatedownloadesort', 'type': 'e', 'parammaps': {
  2365. id: '@insertSpotList.id',
  2366. pastureid: '@insertSpotList.pastureid',
  2367. sort: '@insertSpotList.sort'
  2368. }}
  2369. ExecDataByConfig(this.requestParam).then(response => {
  2370. console.log('顺序切换保存发送参数', this.requestParam)
  2371. if (response.msg === 'fail') {
  2372. this.$notify({ title: '顺序切换失败', message: response.data, type: 'warning', duration: 2000 })
  2373. } else {
  2374. this.$notify({ title: '', message: '顺序切换成功', type: 'success', duration: 2000 })
  2375. this.getList()
  2376. this.isOrder = true
  2377. }
  2378. })
  2379. },
  2380. cancelChangeOrder() {
  2381. // 取消顺序
  2382. this.getList()
  2383. this.isOrder = true
  2384. },
  2385. handleDataSynchronization() {
  2386. MessageBox.confirm('是否确认同步数据?', {
  2387. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  2388. }).then(() => {
  2389. this.requestParam = {}
  2390. this.requestParam.pastureid = Cookies.get('pastureid')
  2391. // this.$alert('正在同步', { confirmButtonText: '确定' })
  2392. this.dataSynchronization.dialogFormVisible = true
  2393. getDorm(this.requestParam).then(response => {
  2394. console.log(response)
  2395. if (response.msg == 'ok') {
  2396. this.dataSynchronization.dialogFormVisible = false
  2397. this.$notify({ title: '同步成功', message: '同步成功', type: 'success', duration: 2000 })
  2398. } else {
  2399. this.$notify({ title: '同步失败', message: response.data, type: 'warning', duration: 2000 })
  2400. this.dataSynchronization.dialogFormVisible = false
  2401. }
  2402. })
  2403. }).catch(() => {
  2404. this.$message({ type: 'info', message: '已取消数据同步' })
  2405. })
  2406. },
  2407. handleRowDelete(row) {
  2408. console.log('删除')
  2409. MessageBox.confirm('是否确认删除此信息?', {
  2410. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  2411. }).then(() => {
  2412. this.selectList = []
  2413. this.requestParam = {}
  2414. this.requestParam.name = 'delDownloadedplan'
  2415. this.requestParam.parammaps = {}
  2416. this.requestParam.parammaps.pastureid = row.pastureid
  2417. this.requestParam.parammaps.id = row.id
  2418. PostDataByName(this.requestParam).then(response => {
  2419. if (response.msg === 'fail') {
  2420. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  2421. } else {
  2422. this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
  2423. this.getList()
  2424. }
  2425. })
  2426. }).catch(() => {
  2427. this.$message({ type: 'info', message: '已取消删除' })
  2428. })
  2429. },
  2430. handleSpan() {
  2431. this.mergekeys.forEach(key => {
  2432. this.spanObj[key] = []
  2433. let position = 0
  2434. this.table2.list.forEach((item, index) => {
  2435. if (index === 0) {
  2436. this.spanObj[key].push(1)
  2437. position = 0
  2438. } else {
  2439. if (key == 'description') {
  2440. if (this.table2.list[index][key] === this.table2.list[index - 1][key] && this.table2.list[index]['sort'] === this.table2.list[index - 1]['sort']) {
  2441. this.spanObj[key][position] += 1
  2442. this.spanObj[key].push(0)
  2443. } else {
  2444. this.spanObj[key].push(1)
  2445. position = index
  2446. }
  2447. } else {
  2448. if (this.table2.list[index][key] === this.table2.list[index - 1][key]) {
  2449. this.spanObj[key][position] += 1
  2450. this.spanObj[key].push(0)
  2451. } else {
  2452. this.spanObj[key].push(1)
  2453. position = index
  2454. }
  2455. }
  2456. }
  2457. })
  2458. })
  2459. },
  2460. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  2461. for (let i = 0; i < this.mergekeys.length; i++) {
  2462. if (column.property === this.mergekeys[i]) {
  2463. const _row = this.spanObj[this.mergekeys[i]][rowIndex]
  2464. const _col = _row > 0 ? 1 : 0
  2465. return {
  2466. rowspan: _row,
  2467. colspan: _col
  2468. }
  2469. }
  2470. }
  2471. },
  2472. form_deleteRecord(){
  2473. this.deleteRecord.dialogStatus = 'deleteRecord'
  2474. this.deleteRecord.dialogFormVisible = true
  2475. this.deleteRecord.mydate = this.table.getdataListParm.parammaps.mydate
  2476. this.getDeleteRecordList()
  2477. },
  2478. changeDeleteRecordDate(){
  2479. this.getDeleteRecordList()
  2480. },
  2481. getDeleteRecordList(){
  2482. const url = 'authdata/GetDataByName'
  2483. const data = {}
  2484. data.name = 'getDownloadedplanDeleteList'
  2485. data.page = 1
  2486. data.offset = 1
  2487. data.pagecount = ""
  2488. data.returntype = "Map"
  2489. data.parammaps = {}
  2490. data.parammaps.pastureid = Cookies.get('pastureid')
  2491. data.parammaps.mydate = this.deleteRecord.mydate
  2492. postJson(url, data).then(response => {
  2493. if(response.data !== null){
  2494. this.deleteRecord.list = response.data.list
  2495. }else{
  2496. this.deleteRecord.list = []
  2497. }
  2498. this.deleteRecord.total = response.data.total
  2499. })
  2500. },
  2501. handleSelect(val) {
  2502. console.log('勾选数据', val)
  2503. this.selectList = val
  2504. },
  2505. handleTakeEffect() {
  2506. if (this.selectList.length == 0) {
  2507. this.$message({ type: 'error', message: '请选择车次信息', duration: 2000 })
  2508. } else {
  2509. MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否生效?', {
  2510. confirmButtonText: '确认',
  2511. cancelButtonText: '取消',
  2512. type: 'warning'
  2513. }).then(() => {
  2514. for (let i = 0; i < this.selectList.length; i++) {
  2515. // this.$set(this.selectList[i], 'enable', '1')
  2516. this.selectList[i].enable = 1
  2517. }
  2518. console.log('生效', this.selectList)
  2519. this.requestParam.common = {
  2520. 'returnmap': '0'
  2521. }
  2522. this.requestParam.data = []
  2523. this.requestParam.data[0] = {
  2524. 'name': 'insertSpotList',
  2525. 'resultmaps': {
  2526. 'list': this.selectList
  2527. }
  2528. }
  2529. this.requestParam.data[0].children = []
  2530. this.requestParam.data[0].children[0] = {
  2531. 'name': 'updateDownloadedplanEnable',
  2532. 'type': 'e',
  2533. 'parammaps': {
  2534. enable: '@insertSpotList.enable',
  2535. id: '@insertSpotList.id',
  2536. pastureid: '@insertSpotList.pastureid'
  2537. }
  2538. }
  2539. ExecDataByConfig(this.requestParam).then(response => {
  2540. console.log('生效保存发送参数', this.requestParam)
  2541. if (response.msg === 'fail') {
  2542. this.$notify({ title: '生效失败', message: response.data, type: 'warning', duration: 2000 })
  2543. } else {
  2544. this.$notify({ title: '成功', message: '生效成功', type: 'success', duration: 2000 })
  2545. this.getList()
  2546. }
  2547. })
  2548. })
  2549. }
  2550. },
  2551. handleDisable() {
  2552. if (this.selectList.length == 0) {
  2553. this.$message({type: 'error', message: '请选择车次信息', duration: 2000 })
  2554. } else {
  2555. MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否禁用?', {
  2556. confirmButtonText: '确认',
  2557. cancelButtonText: '取消',
  2558. type: 'warning'
  2559. }).then(() => {
  2560. for (let i = 0; i < this.selectList.length; i++) {
  2561. // this.$set(this.selectList[i], 'enable', '1')
  2562. this.selectList[i].enable = 0
  2563. }
  2564. console.log('禁用', this.selectList)
  2565. this.requestParam.common = {
  2566. 'returnmap': '0'
  2567. }
  2568. this.requestParam.data = []
  2569. this.requestParam.data[0] = {
  2570. 'name': 'insertSpotList',
  2571. 'resultmaps': {
  2572. 'list': this.selectList
  2573. }
  2574. }
  2575. this.requestParam.data[0].children = []
  2576. this.requestParam.data[0].children[0] = {
  2577. 'name': 'updateDownloadedplanEnable',
  2578. 'type': 'e',
  2579. 'parammaps': {
  2580. enable: '@insertSpotList.enable',
  2581. id: '@insertSpotList.id',
  2582. pastureid: '@insertSpotList.pastureid'
  2583. }
  2584. }
  2585. ExecDataByConfig(this.requestParam).then(response => {
  2586. console.log('禁用保存发送参数', this.requestParam)
  2587. if (response.msg === 'fail') {
  2588. this.$notify({ title: '禁用失败', message: response.data, type: 'warning', duration: 2000 })
  2589. } else {
  2590. this.$notify({ title: '成功', message: '禁用成功', type: 'success', duration: 2000 })
  2591. this.getList()
  2592. }
  2593. })
  2594. })
  2595. }
  2596. },
  2597. handlePrint() {
  2598. this.downLoad.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.mydate
  2599. this.downLoad.getdataListParm.parammaps.lpplantype = this.table.getdataListParm.parammaps.lpplantype
  2600. this.downLoad.getdataListParm.parammaps.times = this.table.getdataListParm.parammaps.times
  2601. this.downLoad.getdataListParm.parammaps.enable = this.table.getdataListParm.parammaps.enable
  2602. this.downLoad.getdataListParm.parammaps.enable2 = this.table.getdataListParm.parammaps.enable2
  2603. var exportTitle = ''
  2604. if (this.table.getdataListParm.parammaps.plandimen == '1') {
  2605. if (this.table.getdataListParm.parammaps.enable3 == '0') {
  2606. this.downLoad.getdataListParm.name = 'downloadPlanTLJDTMR'
  2607. exportTitle = this.table.getdataListParm.parammaps.mydate + '投料简打'
  2608. } else if (this.table.getdataListParm.parammaps.enable3 == '1') {
  2609. this.downLoad.getdataListParm.name = 'downloadPlanTLLDTMR'
  2610. exportTitle = this.table.getdataListParm.parammaps.mydate + '累加投料'
  2611. } else if (this.table.getdataListParm.parammaps.enable3 == '2') {
  2612. this.downLoad.getdataListParm.name = 'downloadPlanSLJDTMR'
  2613. exportTitle = this.table.getdataListParm.parammaps.mydate + '撒料简打'
  2614. } else if (this.table.getdataListParm.parammaps.enable3 == '3') {
  2615. this.downLoad.getdataListParm.name = 'downloadPlanTSLJDTMR'
  2616. exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料简打'
  2617. } else if (this.table.getdataListParm.parammaps.enable3 == '4') {
  2618. this.downLoad.getdataListParm.name = 'downloadPlanTSLLDTMR'
  2619. exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料累加'
  2620. } else if (this.table.getdataListParm.parammaps.enable3 == '5') {
  2621. this.downLoad.getdataListParm.name = 'downloadPlanBZJDTMR'
  2622. exportTitle = this.table.getdataListParm.parammaps.mydate + '包装简打'
  2623. } else {
  2624. this.downLoad.getdataListParm.name = 'downloadPlanSFJDTMR'
  2625. exportTitle = this.table.getdataListParm.parammaps.mydate + '实发简打'
  2626. }
  2627. } else {
  2628. if (this.table.getdataListParm.parammaps.enable3 == '0') {
  2629. this.downLoad.getdataListParm.name = 'downloadPlanTLJD'
  2630. exportTitle = this.table.getdataListParm.parammaps.mydate + '投料简打'
  2631. } else if (this.table.getdataListParm.parammaps.enable3 == '1') {
  2632. this.downLoad.getdataListParm.name = 'downloadPlanTLLD'
  2633. exportTitle = this.table.getdataListParm.parammaps.mydate + '累加投料'
  2634. } else if (this.table.getdataListParm.parammaps.enable3 == '2') {
  2635. this.downLoad.getdataListParm.name = 'downloadPlanSLJD'
  2636. exportTitle = this.table.getdataListParm.parammaps.mydate + '撒料简打'
  2637. } else if (this.table.getdataListParm.parammaps.enable3 == '3') {
  2638. this.downLoad.getdataListParm.name = 'downloadPlanTSLJD'
  2639. exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料简打'
  2640. } else if (this.table.getdataListParm.parammaps.enable3 == '4') {
  2641. this.downLoad.getdataListParm.name = 'downloadPlanTSLLD'
  2642. exportTitle = this.table.getdataListParm.parammaps.mydate + '投撒料累加'
  2643. } else if (this.table.getdataListParm.parammaps.enable3 == '5') {
  2644. this.downLoad.getdataListParm.name = 'downloadPlanBZJD'
  2645. exportTitle = this.table.getdataListParm.parammaps.mydate + '包装简打'
  2646. } else {
  2647. this.downLoad.getdataListParm.name = 'downloadPlanSFJD'
  2648. exportTitle = this.table.getdataListParm.parammaps.mydate + '实发简打'
  2649. }
  2650. }
  2651. GetReportform(this.downLoad.getdataListParm).then(response => {
  2652. if (response.data.list !== null) {
  2653. this.downLoad.labelList = []
  2654. var filterValArr = []
  2655. for (let i = 0; i < response.data.list.data1.length; i++) {
  2656. this.downLoad.labelList.push(response.data.list.data1[i].label)
  2657. filterValArr.push(response.data.list.data1[i].prop)
  2658. }
  2659. this.downLoad.list = response.data.list.data2
  2660. } else {
  2661. this.downLoad.list = []
  2662. }
  2663. let data = []
  2664. for(let i=0;i<filterValArr.length;i++){
  2665. let obj = {}
  2666. obj.field = filterValArr[i]
  2667. obj.columnSize = i
  2668. for(let j=i;j<this.downLoad.labelList.length;j++){
  2669. obj.displayName = this.downLoad.labelList[i]
  2670. }
  2671. if(obj.field !== undefined && obj.displayName !== undefined){
  2672. data.push(obj)
  2673. }
  2674. for(let i=0;i<this.downLoad.list.length;i++){
  2675. if(this.downLoad.list[i][obj.displayName] == null || this.downLoad.list[i][obj.displayName] == undefined){
  2676. this.downLoad.list[i][obj.displayName] = ''
  2677. }
  2678. }
  2679. }
  2680. console.log(this.downLoad.list)
  2681. printJS({
  2682. printable:this.downLoad.list,
  2683. properties:data,
  2684. type:'json',
  2685. header:exportTitle,
  2686. //样式设置
  2687. gridStyle:'border:1px solid #ccc;',
  2688. gridHeaderStyle:'border:1px solid #ccc;text-align:center'
  2689. })
  2690. })
  2691. },
  2692. handleDelete(){
  2693. if (this.selectList.length == 0) {
  2694. this.$message({ type: 'error', message: '请选择计划', duration: 2000 })
  2695. } else {
  2696. MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
  2697. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  2698. }).then(() => {
  2699. console.log(this.selectList)
  2700. this.requestParam.common = { 'returnmap': '0' }
  2701. this.requestParam.data = []
  2702. this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
  2703. this.requestParam.data[0].children = []
  2704. this.requestParam.data[0].children[0] = { 'name': 'delDownloadedplan', 'type': 'e', 'parammaps': {
  2705. id: '@insertSpotList.id',
  2706. pastureid: '@insertSpotList.pastureid'
  2707. }}
  2708. ExecDataByConfig(this.requestParam).then(response => {
  2709. console.log('删除保存发送参数', this.requestParam)
  2710. if (response.msg === 'fail') {
  2711. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  2712. } else {
  2713. this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
  2714. this.getList()
  2715. }
  2716. })
  2717. })
  2718. }
  2719. },
  2720. handleDataUpload(){
  2721. let a = Cookies.get('url')
  2722. let b = a.search(8081)
  2723. let c = a.substring(0,a.search(8081)) + '8082'
  2724. let d = a.substring(0,a.lastIndexOf('/'))
  2725. console.log(d)
  2726. let url = ''
  2727. if(b == -1){
  2728. url = d + ':8082'
  2729. }else{
  2730. url = c
  2731. }
  2732. let _url = url + '/authdata/feeding/push'
  2733. let data = {
  2734. date:parseTime(new Date(), '{y}-{m}-{d}'),
  2735. pastureId:Cookies.get('pastureid')
  2736. }
  2737. console.log(_url,'_url')
  2738. postJson2(_url, data).then(response => {
  2739. if(response.msg == 'ok'){
  2740. this.$notify({ title: '', message: response.data, type: 'success', duration: 2000 })
  2741. }else{
  2742. this.$notify({ title: '上传失败', message: response.data, type: 'warning', duration: 2000 })
  2743. }
  2744. })
  2745. },
  2746. handleUpdate2(row){
  2747. for (let i = 0; i < this.table2.list.length; i++) {
  2748. if (this.table2.list[i].Edit == true) {
  2749. this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
  2750. return false
  2751. }
  2752. }
  2753. // 编辑true,不可编辑false
  2754. row.Edit = true
  2755. row.NoEdit = false
  2756. // 新增false,编辑false,编辑保存true
  2757. row.isUpdate = false
  2758. row.isUpdateSave = true
  2759. },
  2760. updateData2(row,type){
  2761. const url = 'authdata/dailydata/edit'
  2762. const data = {}
  2763. data.pid = row.pid
  2764. data.weight = row.weight
  2765. data.sort = row.sort
  2766. // 饲料
  2767. if(type == '0'){
  2768. data.location = 0
  2769. data.fid = row.fid
  2770. }else{
  2771. // 车辆||栏舍
  2772. data.location = 1
  2773. data.fbarid = row.fbarid
  2774. }
  2775. data.date = this.table.getdataListParm.parammaps.mydate
  2776. data.sort = row.sort
  2777. postJson(url, data).then(response => {
  2778. if(response.msg == 'ok'){
  2779. this.$notify({ title: '', message: '修改成功', type: 'success', duration: 2000 })
  2780. this.getList2()
  2781. this.getList3()
  2782. }else{
  2783. this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
  2784. }
  2785. })
  2786. },
  2787. updateCancel2(row){
  2788. row.Edit = false
  2789. row.NoEdit = true
  2790. // 新增false,编辑true,编辑保存false
  2791. row.isCreate = false
  2792. row.isUpdate = true
  2793. row.isUpdateSave = false
  2794. this.getList2()
  2795. },
  2796. handleUpdate3(row){
  2797. for (let i = 0; i < this.table3.list.length; i++) {
  2798. if (this.table3.list[i].Edit == true) {
  2799. this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
  2800. return false
  2801. }
  2802. }
  2803. // 编辑true,不可编辑false
  2804. row.Edit = true
  2805. row.NoEdit = false
  2806. // 新增false,编辑false,编辑保存true
  2807. row.isUpdate = false
  2808. row.isUpdateSave = true
  2809. },
  2810. updateData3(row,type){
  2811. const url = 'authdata/dailydata/edit'
  2812. const data = {}
  2813. data.pid = row.pid
  2814. data.weight = row.weight
  2815. data.sort = row.sort
  2816. // 饲料
  2817. if(type == '0'){
  2818. data.location = 0
  2819. data.fid = row.fid
  2820. }else{
  2821. // 车辆||栏舍
  2822. data.location = 1
  2823. data.fbarid = row.fbarid
  2824. }
  2825. data.date = this.table.getdataListParm.parammaps.mydate
  2826. data.sort = row.sort
  2827. postJson(url, data).then(response => {
  2828. if(response.msg == 'ok'){
  2829. this.$notify({ title: '', message: '修改成功', type: 'success', duration: 2000 })
  2830. this.getList2()
  2831. this.getList3()
  2832. }else{
  2833. this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
  2834. }
  2835. })
  2836. },
  2837. updateCancel3(row){
  2838. row.Edit = false
  2839. row.NoEdit = true
  2840. // 新增false,编辑true,编辑保存false
  2841. row.isCreate = false
  2842. row.isUpdate = true
  2843. row.isUpdateSave = false
  2844. this.getList3()
  2845. },
  2846. changeDriver(value,row){
  2847. const url = 'authdata/PostDataByName'
  2848. const data = {
  2849. name:'updateDownloadedplanDriver',
  2850. parammaps:{
  2851. driverId:value,
  2852. id:row.id
  2853. }
  2854. }
  2855. postJson(url, data).then(response => {
  2856. if(response.msg == 'ok'){
  2857. this.$notify({ title: '', message: '修改成功', type: 'success', duration: 2000 })
  2858. this.getList()
  2859. }else{
  2860. this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
  2861. }
  2862. })
  2863. },
  2864. getIsSap() {
  2865. GetDataByName(this.sapUpload.getdataListParm).then(response => {
  2866. // console.log()
  2867. if(response.data.list !== null){
  2868. if(response.data.list[0].inforvalue == 1){
  2869. this.sapUpload.isSap = true
  2870. }else{
  2871. this.sapUpload.isSap = false
  2872. }
  2873. console.log(this.sapUpload.isSap)
  2874. }
  2875. })
  2876. },
  2877. handleSAPUpload(){
  2878. this.sapUpload.dialogStatus = 'sapUpload'
  2879. this.sapUpload.dialogFormVisible = true
  2880. },
  2881. sapUploadData(){
  2882. this.$refs['sapUpload'].validate(valid => {
  2883. if (valid) {
  2884. const url = 'authdata/sap/material'
  2885. const data = {
  2886. // "name":"xdmysapupload",
  2887. "pastureid":Cookies.get('pastureid'),date:parseTime(this.sapUpload.temp.date, '{y}-{m}-{d}')
  2888. }
  2889. postJson(url, data).then(response => {
  2890. if(response.msg == 'ok'){
  2891. this.$notify({ title: '', message: '成功', type: 'success', duration: 2000 })
  2892. this.sapUpload.dialogFormVisible = false
  2893. this.getList()
  2894. }else{
  2895. this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
  2896. }
  2897. })
  2898. }
  2899. })
  2900. },
  2901. getIspalyUd(){
  2902. let url = 'authdata/GetDataByName'
  2903. let data = {
  2904. "name":"getSysoptEnable","page":1,"offset":1,"pagecount":1,"returntype":"Map",
  2905. "parammaps":{"pastureid":Cookies.get('pastureid'),"inforname":"gmUdSync"}
  2906. }
  2907. postJson(url,data).then(response => {
  2908. if (response.msg !== 'fail') {
  2909. if(response.data.list[0].inforvalue == 0){
  2910. this.ispalyUd = false
  2911. }else{
  2912. this.ispalyUd = true
  2913. }
  2914. } else {
  2915. this.$notify({ title: '请求失败', message: response.data, type: 'warning', duration: 2000 })
  2916. }
  2917. })
  2918. },
  2919. handleGetUd1(){
  2920. this.sapUpload.dialogStatus = 'udload1'
  2921. this.sapUpload.dialogFormVisible = true
  2922. },
  2923. udData1(){
  2924. this.$refs['sapUpload'].validate(valid => {
  2925. if (valid) {
  2926. let url = 'authdata/gm/udutir/push'
  2927. let data = {
  2928. pastureId:Cookies.get('pastureid'),
  2929. date:parseTime(this.sapUpload.temp.date, '{y}-{m}-{d}')
  2930. }
  2931. postJson(url,data).then(response => {
  2932. if (response.msg !== 'fail') {
  2933. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  2934. this.sapUpload.dialogFormVisible = false
  2935. this.getList()
  2936. } else {
  2937. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  2938. }
  2939. })
  2940. }
  2941. })
  2942. },
  2943. handleGetUd2(){
  2944. this.sapUpload.dialogStatus = 'udload2'
  2945. this.sapUpload.dialogFormVisible = true
  2946. },
  2947. udData2(){
  2948. this.$refs['sapUpload'].validate(valid => {
  2949. if (valid) {
  2950. let url = 'authdata/gm/udbarfeedremain/push'
  2951. let data = {
  2952. pastureId:Cookies.get('pastureid'),
  2953. date:parseTime(this.sapUpload.temp.date, '{y}-{m}-{d}')
  2954. }
  2955. postJson(url,data).then(response => {
  2956. if (response.msg !== 'fail') {
  2957. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  2958. this.sapUpload.dialogFormVisible = false
  2959. this.getList()
  2960. } else {
  2961. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  2962. }
  2963. })
  2964. }
  2965. })
  2966. },
  2967. handleGetUd3(){
  2968. this.sapUpload.dialogStatus = 'udload3'
  2969. this.sapUpload.dialogFormVisible = true
  2970. },
  2971. udData3(){
  2972. this.$refs['sapUpload'].validate(valid => {
  2973. if (valid) {
  2974. let url = 'authdata/gm/udmaterialIssue/push'
  2975. let data = {
  2976. pastureId:Cookies.get('pastureid'),
  2977. date:parseTime(this.sapUpload.temp.date, '{y}-{m}-{d}')
  2978. }
  2979. postJson(url,data).then(response => {
  2980. if (response.msg !== 'fail') {
  2981. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  2982. this.sapUpload.dialogFormVisible = false
  2983. this.getList()
  2984. } else {
  2985. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  2986. }
  2987. })
  2988. }
  2989. })
  2990. }
  2991. }
  2992. }
  2993. </script>
  2994. <style>
  2995. .el-table .warning-row {
  2996. background: oldlace;
  2997. }
  2998. .el-table .success-row {
  2999. background: #f0f9eb;
  3000. }
  3001. @page{
  3002. size: auto A4 landscape;
  3003. margin: 3mm;
  3004. }
  3005. .agreeCon {
  3006. background: #fff;
  3007. box-sizing: border-box;
  3008. padding: 2rem 3rem 4rem;
  3009. }
  3010. </style>
  3011. <style lang="scss" scoped>
  3012. .app-container{background: #fff;}
  3013. .operation{}
  3014. .search{margin-top:10px;}
  3015. .table{margin-bottom:20px;}
  3016. .template{
  3017. background: #fff;
  3018. position: relative;
  3019. }
  3020. .table2{
  3021. // float: left;width: 50%;
  3022. background: #fff;
  3023. position: relative;
  3024. .content-table{margin-top: 20px;}
  3025. .contentOperation{right: -50px;z-index: 1;}
  3026. }
  3027. .table3{
  3028. // float: left;width: 50%;
  3029. background: #fff;
  3030. position: relative;
  3031. .content-table{margin-top: 20px;}
  3032. .contentOperation{right: -50px;z-index: 1;}
  3033. }
  3034. </style>