index.vue 157 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927
  1. <template>
  2. <div class="app-container">
  3. <div v-if="isPercentage" class="percentage" style="width: 210px;height: 90px;background: #fff;position: fixed;bottom: 0;left: 0;z-index: 9999999999999;">
  4. <h4 style="padding-left: 10px;line-height: 0;">导出进度:</h4>
  5. <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
  6. </div>
  7. <el-tabs v-model="activeName" @tab-click="handleClick">
  8. <el-tab-pane label="合同管理" name="first">
  9. <div v-if="isContractManagement" class="contractManagement">
  10. <div class="filter-container">
  11. <el-select v-model="tab1.contractManagement.getdataListParm.parammaps.pastureName" placeholder="牧场" style="width:120px" class="filter-item">
  12. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
  13. </el-select>
  14. <el-input v-model="tab1.contractManagement.getdataListParm.parammaps.contractCode" placeholder="合同编号" style="width: 140px;" class="filter-item" />
  15. <el-select v-model="tab1.contractManagement.getdataListParm.parammaps.statue" clearable placeholder="合同状态" class="filter-item" style="width: 120px;">
  16. <el-option v-for="item in contractStatusList" :key="item.id" :label="item.name" :value="item.name" />
  17. </el-select>
  18. <el-select v-model="tab1.contractManagement.getdataListParm.parammaps.providerName" filterable clearable style="width: 140px;" placeholder="供应商" class="filter-item">
  19. <el-option v-for="item in findAllProvider" :key="item.id" :label="item.name" :value="item.name" />
  20. </el-select>
  21. <el-select v-model="tab1.contractManagement.getdataListParm.parammaps.isZeroStock" clearable placeholder="是否零库存" class="filter-item" style="width: 120px;">
  22. <el-option v-for="item in isZeroInventoryList" :key="item.id" :label="item.name" :value="item.id" />
  23. </el-select>
  24. <el-date-picker ref="tab1InputDatetime1" v-model="tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
  25. <el-date-picker ref="tab1InputDatetime2" v-model="tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime2" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="审批日期" end-placeholder="审批日期" />
  26. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleTab1Filter">搜索</el-button>
  27. <div>
  28. <el-button v-if="tab1.contractManagement.isContractAdd" class="filter-item" type="primary" icon="el-icon-edit" @click="handleTab1Create">新增</el-button>
  29. <el-radio-group v-model="tab1.contractManagement.radioAll" style="margin-top:-9px" @change="changeContractManagementAll()">
  30. <el-radio-button label="全部" />
  31. <el-badge :value="pending.total" class="item">
  32. <el-radio-button label="待处理" />
  33. </el-badge>
  34. <el-radio-button label="已处理" />
  35. </el-radio-group>
  36. </div>
  37. </div>
  38. <el-table
  39. :key="tab1.contractManagement.tableKey"
  40. v-loading="tab1.contractManagement.listLoading"
  41. element-loading-text="给我一点时间"
  42. :data="tab1.contractManagement.list"
  43. border
  44. fit
  45. highlight-current-row
  46. style="width: 100%;"
  47. :row-style="rowStyle"
  48. :cell-style="cellStyle"
  49. class="elTable table-fixed"
  50. :max-height="myHeight"
  51. >
  52. <el-table-column label="序号" align="center" type="index" width="50px">
  53. <template slot-scope="scope">
  54. <span>{{ scope.$index + (tab1.contractManagement.pageNum-1) * tab1.contractManagement.pageSize + 1 }}</span>
  55. </template>
  56. </el-table-column>
  57. <el-table-column label="牧场" min-width="120px" align="center" prop="pastureName" />
  58. <el-table-column label="合同编号" min-width="120px" align="center" prop="contractCode" />
  59. <el-table-column label="合同状态" min-width="110px" align="center" prop="statued" />
  60. <el-table-column label="供应商" min-width="120px" align="center" prop="providerName" />
  61. <el-table-column label="合同开始日期" sortable min-width="120px" align="center" prop="startTime" />
  62. <el-table-column label="合同截止日期" sortable min-width="120px" align="center" prop="stopTime" />
  63. <el-table-column label="零库存" min-width="110px" align="center">
  64. <template slot-scope="scope">
  65. <span v-if="scope.row.isZeroStock == 0">否</span>
  66. <span v-if="scope.row.isZeroStock == 1">是</span>
  67. </template>
  68. </el-table-column>
  69. <el-table-column label="录入人" min-width="120px" align="center" prop="creatorMan" />
  70. <el-table-column label="录入时间" sortable min-width="120px" align="center" prop="creatorTime" />
  71. <el-table-column label="审批时间" sortable min-width="120px" align="center" prop="SHdateTime" />
  72. <el-table-column label="操作" align="center" width="350px" class-name="small-padding fixed-width" fixed="right">
  73. <template slot-scope="{row}">
  74. <el-button v-if="tab1.contractManagement.isContractSee" type="primary" size="mini" @click="form_see(row)">查看</el-button>
  75. <el-button v-if="tab1.contractManagement.isContractSee" type="primary" style="width:70px;" size="mini" @click="handleTab1DetailsSpareParts(row)">备件明细</el-button>
  76. <el-button v-if="tab1.contractManagement.isContractSee" type="primary" style="width:70px;" size="mini" @click="handleTab1ChangeRecord(row)">变更记录</el-button>
  77. <el-button v-if="tab1.contractManagement.isContractChange && (row.statued == '正常' || row.statued == '已过期')" :disabled="parseInt(row.pastureId) == 18 && parseInt(isGroupAdministrator) !== 18" type="warning" size="mini" @click="handleTab1Change(row)">变更</el-button>
  78. </template>
  79. <!-- //parseInt(row.pastureId) == 18 && parseInt(isGroupAdministrator) == 18 -->
  80. </el-table-column>
  81. </el-table>
  82. <pagination v-show="tab1.contractManagement.total>0" :total="tab1.contractManagement.total" :page.sync="tab1.contractManagement.getdataListParm.offset" :limit.sync="tab1.contractManagement.getdataListParm.pagecount" @pagination="getTab1List" />
  83. </div>
  84. <div v-if="isDetailsSpareParts" class="DetailsSpareParts">
  85. <div class="title" style="height: 30px;">
  86. <b style="font-size: 20px;float: left;">备件明细</b>
  87. <a style="float: right;font-weight: 600;font-size: 20px;" @click="handleTab1goBack()">&lt;返回</a>
  88. </div>
  89. <div class="filter-container">
  90. <el-input v-model="tab1.detailsSpareParts.getdataListParm.parammaps.partCode" placeholder="备件编号" style="width: 140px;" class="filter-item" />
  91. <el-input v-model="tab1.detailsSpareParts.getdataListParm.parammaps.partName" placeholder="备件名称" style="width: 140px;" class="filter-item" />
  92. <el-input v-model="tab1.detailsSpareParts.getdataListParm.parammaps.specification" placeholder="备件规格" style="width: 140px;" class="filter-item" />
  93. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleTab1Filter2">搜索</el-button>
  94. <!-- <el-button v-waves class="filter-item" type="success" icon="el-icon-edit" @click="change_enabled">启用</el-button> -->
  95. <el-button v-if="isContractJinyong" v-waves class="filter-item" type="danger" icon="el-icon-edit" @click="change_no">禁用</el-button>
  96. </div>
  97. <div class="filter-container">
  98. <el-button v-if="tab1.contractManagement.isContractAdd && parseInt(tab1.detailsSpareParts.detailsList.pastureId) == parseInt(isGroupAdministrator) || parseInt(isEmployeid) == 0" class="filter-item" type="primary" icon="el-icon-edit" :disabled="tab1.detailsSpareParts.detailsList.statued=='终止' || tab1.detailsSpareParts.detailsList.statued=='已过期' || tab1.detailsSpareParts.detailsList.statued=='新增未通过'" @click="handleTab1Create2">新增</el-button>
  99. <el-button v-if="tab1.contractManagement.isContractChange && parseInt(tab1.detailsSpareParts.detailsList.pastureId) == parseInt(isGroupAdministrator) || parseInt(isEmployeid) == 0" class="filter-item" type="primary" icon="el-icon-edit" :disabled="tab1.detailsSpareParts.detailsList.statued=='终止' || tab1.detailsSpareParts.detailsList.statued=='已过期' || tab1.detailsSpareParts.detailsList.statued=='新增未通过'" @click="handleTab1Change2">变更</el-button>
  100. <el-button v-if="tab1.contractManagement.isContractExport" class="filter-item" type="primary" icon="el-icon-edit" @click="handleTab1Export2">导出</el-button>
  101. </div>
  102. <el-table
  103. :key="tab1.detailsSpareParts.tableKey"
  104. v-loading="tab1.detailsSpareParts.listLoading"
  105. element-loading-text="给我一点时间"
  106. :data="tab1.detailsSpareParts.list"
  107. border
  108. fit
  109. highlight-current-row
  110. style="width: 100%;"
  111. :row-style="rowStyle"
  112. :cell-style="cellStyle"
  113. class="elTable table-fixed"
  114. @sort-change="tableSort1"
  115. @selection-change="handleSelectionChange"
  116. :max-height="myHeight"
  117. >
  118. <el-table-column type="selection" width="55" />
  119. <el-table-column label="序号" align="center" type="index" width="50px">
  120. <template slot-scope="scope">
  121. <span>{{ scope.$index + (tab1.detailsSpareParts.pageNum-1) * tab1.detailsSpareParts.pageSize + 1 }}</span>
  122. </template>
  123. </el-table-column>
  124. <el-table-column label="备件编号" min-width="120px" align="center" prop="partCode" />
  125. <el-table-column label="备件名称" min-width="120px" align="center" prop="partName" />
  126. <el-table-column label="备件规格" min-width="120px" align="center" prop="specification" />
  127. <el-table-column label="备件图片" prop="specifications" align="center" min-width="110px">
  128. <template slot-scope="scope">
  129. <el-popover placement="right" title="" trigger="hover">
  130. <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
  131. <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  132. </el-popover>
  133. </template>
  134. </el-table-column>
  135. <el-table-column label="备件品牌" min-width="120px" align="center" prop="brand" />
  136. <el-table-column label="计量单位" min-width="120px" align="center" prop="unit" />
  137. <el-table-column label="计划量" sortable min-width="120px" align="center" prop="planAmount" />
  138. <el-table-column label="单价" sortable min-width="120px" align="center" prop="price" />
  139. <!-- <el-table-column label="使用周期" min-width="120px" align="center" prop="lifeCycle" />
  140. <el-table-column label="合同差异项" min-width="120px" align="center" prop="contractVarianceItem" /> -->
  141. </el-table>
  142. <pagination v-show="tab1.detailsSpareParts.total>0" :total="tab1.detailsSpareParts.total" :page.sync="tab1.detailsSpareParts.getdataListParm.offset" :limit.sync="tab1.detailsSpareParts.getdataListParm.pagecount" @pagination="getTab1List2" />
  143. </div>
  144. <div v-if="isChangeRecord" class="ChangeRecord">
  145. <div class="title" style="height: 30px;">
  146. <b style="font-size: 20px;float: left;">变更记录</b>
  147. <a style="float: right;font-weight: 600;font-size: 20px;" @click="handleTab1goBack2()">&lt;返回</a>
  148. </div>
  149. <div class="filter-container">
  150. <el-input v-model="tab1.changeRecord.getdataListParm.parammaps.contractCode" placeholder="流水编号" style="width: 140px;" class="filter-item" />
  151. <el-select v-model="tab1.changeRecord.getdataListParm.parammaps.SHtype" clearable placeholder="变更类型" class="filter-item" style="width: 120px;">
  152. <el-option v-for="item in changeTypeList" :key="item.id" :label="item.name" :value="item.id" />
  153. </el-select>
  154. <el-select v-model="tab1.changeRecord.getdataListParm.parammaps.stuteSH" clearable placeholder="审核状态" class="filter-item" style="width: 120px;">
  155. <el-option v-for="item in auditStatusList" :key="item.id" :label="item.name" :value="item.id" />
  156. </el-select>
  157. <el-date-picker ref="tab1InputDatetime3" v-model="tab1.changeRecord.getdataListParm.parammaps.tab1InputDatetime3" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
  158. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleTab1Filter3">搜索</el-button>
  159. </div>
  160. <div class="filter-container">
  161. <el-radio-group v-model="tab1.changeRecord.radioAll" style="margin-top:-9px" @change="changeChangeRecordAll()">
  162. <el-radio-button label="全部" />
  163. <el-radio-button label="待处理" />
  164. <el-radio-button label="已处理" />
  165. </el-radio-group>
  166. </div>
  167. <el-table
  168. :key="tab1.changeRecord.tableKey"
  169. v-loading="tab1.changeRecord.listLoading"
  170. element-loading-text="给我一点时间"
  171. :data="tab1.changeRecord.list"
  172. border
  173. fit
  174. highlight-current-row
  175. style="width: 100%;"
  176. :row-style="rowStyle"
  177. :cell-style="cellStyle"
  178. class="elTable table-fixed"
  179. :max-height="myHeight"
  180. >
  181. <el-table-column label="序号" align="center" type="index" width="50px">
  182. <template slot-scope="scope">
  183. <span>{{ scope.$index + (tab1.changeRecord.pageNum-1) * tab1.changeRecord.pageSize + 1 }}</span>
  184. </template>
  185. </el-table-column>
  186. <el-table-column label="流水编号" min-width="120px" align="center" prop="contractCode" />
  187. <el-table-column label="变更类型" min-width="110px" align="center">
  188. <template slot-scope="scope">
  189. <span v-if="scope.row.SHtype == 0">新增合同</span>
  190. <span v-if="scope.row.SHtype == 1">新增备件</span>
  191. <span v-if="scope.row.SHtype == 2">变更备件</span>
  192. <span v-if="scope.row.SHtype == 3">合同变更</span>
  193. </template>
  194. </el-table-column>
  195. <el-table-column label="录入人" min-width="120px" align="center" prop="creatorMan" />
  196. <el-table-column label="录入时间" sortable min-width="120px" align="center" prop="creatorTime" />
  197. <el-table-column label="审核状态" min-width="110px" align="center">
  198. <template slot-scope="scope">
  199. <span v-if="scope.row.SHStatus == 2 || scope.row.SHStatus == 3 || scope.row.SHStatus == 5">审核中</span>
  200. <span v-if="scope.row.SHStatus == 4 || scope.row.SHStatus == 6 || scope.row.SHStatus == 8">未通过</span>
  201. <span v-if="scope.row.SHStatus == 7">通过</span>
  202. </template>
  203. </el-table-column>
  204. <el-table-column label="操作" align="center" width="350px" class-name="small-padding fixed-width" fixed="right">
  205. <template slot-scope="{row}">
  206. <el-button type="primary" size="mini" @click="handleTab1See3(row)">查看</el-button>
  207. <el-button v-if="tab1.changeRecord.isContractDelete && (row.SHStatus == 4 || row.SHStatus == 6 || row.SHStatus == 8)" type="success" size="mini" @click="handleTab1Update3(row)">编辑</el-button>
  208. <el-button v-if="tab1.changeRecord.isContractExamineZG && row.SHStatus == 2" type="success" style="display:inline-block" size="mini" @click="handleTab1Examine(row)">审核1</el-button>
  209. <el-button v-else type="success" style="display:none" size="mini" @click="handleTab1Examine(row)">审核1</el-button>
  210. <!-- 设备助理审核 -->
  211. <!-- <el-button v-if="tab1.changeRecord.isContractExamineZL && row.SHStatus == 3" type="success" style="display:inline-block" size="mini" @click="handleExamine2(row)">审核2</el-button>
  212. <el-button v-else type="success" style="display:none" size="mini" @click="handleExamine2(row)">审核2</el-button> -->
  213. <!-- 设备中心审核 -->
  214. <el-button v-if="tab1.changeRecord.isContractExamineZX && row.SHStatus == 5" type="success" style="display:inline-block" size="mini" @click="handleTab1Examine3(row)">审核2</el-button>
  215. <el-button v-else type="success" style="display:none" size="mini" @click="handleTab1Examine3(row)">审核2</el-button>
  216. <el-button v-if="tab1.changeRecord.isContractDelete && (row.SHStatus == 4 || row.SHStatus == 6 || row.SHStatus == 8) " type="danger" size="mini" @click="handleTab1Delete3(row)">删除</el-button>
  217. <el-button v-else style="display:none" type="danger" size="mini" @click="handleTab1Delete3(row)">删除</el-button>
  218. </template>
  219. </el-table-column>
  220. </el-table>
  221. <pagination v-show="tab1.changeRecord.total>0" :total="tab1.changeRecord.total" :page.sync="tab1.changeRecord.getdataListParm.offset" :limit.sync="tab1.changeRecord.getdataListParm.pagecount" @pagination="getTab1List3" />
  222. </div>
  223. </el-tab-pane>
  224. <el-tab-pane label="合同明细" name="second">
  225. <div class="filter-container">
  226. <el-select v-model="tab2.getdataListParm.parammaps.pastureName" placeholder="牧场" style="width:120px" class="filter-item">
  227. <el-option v-for="item in findAllPastureList2" :key="item.id" :label="item.name" :value="item.name" />
  228. </el-select>
  229. <el-input v-model="tab2.getdataListParm.parammaps.contractCode" placeholder="合同编号" style="width: 140px;" class="filter-item" />
  230. <el-select v-model="tab2.getdataListParm.parammaps.statue" clearable placeholder="合同状态" class="filter-item" style="width: 120px;">
  231. <el-option v-for="item in contractStatusList" :key="item.id" :label="item.name" :value="item.name" />
  232. </el-select>
  233. <el-select v-model="tab2.getdataListParm.parammaps.isZeroStock" clearable placeholder="是否零库存" class="filter-item" style="width: 120px;">
  234. <el-option v-for="item in isZeroInventoryList" :key="item.id" :label="item.name" :value="item.id" />
  235. </el-select>
  236. <el-input v-model="tab2.getdataListParm.parammaps.partCode" placeholder="备件编号" style="width: 140px;" class="filter-item" />
  237. <el-input v-model="tab2.getdataListParm.parammaps.partName" placeholder="备件名称" style="width: 140px;" class="filter-item" />
  238. <el-select v-model="tab2.getdataListParm.parammaps.providerName" filterable clearable style="width: 140px;" placeholder="供应商" class="filter-item">
  239. <el-option v-for="item in findAllProvider" :key="item.id" :label="item.name" :value="item.name" />
  240. </el-select>
  241. <el-date-picker ref="inputDatetime" v-model="tab2.getdataListParm.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
  242. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleTab2Filter">搜索</el-button>
  243. <el-button v-if="tab1.contractManagement.isContractExport" class="filter-item" type="primary" icon="el-icon-edit" @click="handleTab2Export">导出</el-button>
  244. </div>
  245. <el-table
  246. :key="tab2.tableKey"
  247. v-loading="tab2.listLoading"
  248. element-loading-text="给我一点时间"
  249. :data="tab2.list"
  250. border
  251. fit
  252. highlight-current-row
  253. style="width: 100%;"
  254. :row-style="rowStyle"
  255. :cell-style="cellStyle"
  256. class="elTable table-fixed"
  257. @sort-change="tableSort2"
  258. :max-height="myHeight"
  259. >
  260. <el-table-column label="序号" align="center" type="index" width="50px">
  261. <template slot-scope="scope">
  262. <span>{{ scope.$index + (tab2.pageNum-1) * tab2.pageSize + 1 }}</span>
  263. </template>
  264. </el-table-column>
  265. <el-table-column label="牧场" min-width="110px" align="center">
  266. <template slot-scope="scope">
  267. <span>{{ scope.row.pastureName }}</span>
  268. </template>
  269. </el-table-column>
  270. <el-table-column label="合同编号" min-width="130px" align="center">
  271. <template slot-scope="scope">
  272. <span>{{ scope.row.contractCode }}</span>
  273. </template>
  274. </el-table-column>
  275. <el-table-column label="合同状态" min-width="100px" align="center">
  276. <template slot-scope="scope">
  277. <span>{{ scope.row.statue }}</span>
  278. </template>
  279. </el-table-column>
  280. <el-table-column label="供应商" min-width="120px" align="center">
  281. <template slot-scope="scope">
  282. <span>{{ scope.row.providerName }}</span>
  283. </template>
  284. </el-table-column>
  285. <el-table-column label="合同开始日期" sortable prop="startTime" min-width="110px" align="center" />
  286. <el-table-column label="合同截止日期" sortable prop="stopTime" min-width="110px" align="center" />
  287. <el-table-column label="零库存" min-width="110px" align="center">
  288. <template slot-scope="scope">
  289. <span v-if="scope.row.isZeroStock == 0">否</span>
  290. <span v-if="scope.row.isZeroStock == 1">是</span>
  291. </template>
  292. </el-table-column>
  293. <el-table-column label="备件编号" min-width="110px" align="center">
  294. <template slot-scope="scope">
  295. <span>{{ scope.row.partCode }}</span>
  296. </template>
  297. </el-table-column>
  298. <el-table-column label="备件名称" min-width="110px" align="center">
  299. <template slot-scope="scope">
  300. <span>{{ scope.row.partName }}</span>
  301. </template>
  302. </el-table-column>
  303. <el-table-column label="备件规格" min-width="110px" align="center">
  304. <template slot-scope="scope">
  305. <span>{{ scope.row.specification }}</span>
  306. </template>
  307. </el-table-column>
  308. <el-table-column label="备件品牌" min-width="110px" align="center">
  309. <template slot-scope="scope">
  310. <span>{{ scope.row.brand }}</span>
  311. </template>
  312. </el-table-column>
  313. <el-table-column label="计量单位" min-width="110px" align="center">
  314. <template slot-scope="scope">
  315. <span>{{ scope.row.unit }}</span>
  316. </template>
  317. </el-table-column>
  318. <el-table-column label="计划量" sortable prop="planAmount" min-width="110px" align="center" />
  319. <el-table-column label="单价" sortable prop="price" min-width="110px" align="center" />
  320. <el-table-column label="备注" min-width="110px" align="center">
  321. <template slot-scope="scope">
  322. <span>{{ scope.row.remark }}</span>
  323. </template>
  324. </el-table-column>
  325. <el-table-column label="录入人" min-width="110px" align="center">
  326. <template slot-scope="scope">
  327. <span>{{ scope.row.creatorMan }}</span>
  328. </template>
  329. </el-table-column>
  330. <el-table-column label="录入日期" sortable prop="creatorTime" min-width="110px" align="center" />
  331. </el-table>
  332. <pagination v-show="tab2.total>0" :total="tab2.total" :page.sync="tab2.getdataListParm.offset" :limit.sync="tab2.getdataListParm.pagecount" @pagination="getTab2List" />
  333. </el-tab-pane>
  334. </el-tabs>
  335. <!-- 合同管理新增/查看/变更 -->
  336. <el-dialog :title="textMap[dialogStatus]" :visible.sync="tab1.contractManagement.create.dialogFormVisible" :close-on-click-modal="false" width="90%">
  337. <div class="app-add">
  338. <el-form ref="createTemp" :rules="rules" :model="tab1.contractManagement.create.temp" label-position="right" label-width="120px" style="width: 90%;margin:0 auto;">
  339. <el-row>
  340. <el-col :span="8">
  341. <el-form-item label="合同编号:" prop="contractCode">
  342. <el-input ref="contractCode" v-model="tab1.contractManagement.create.temp.contractCode" disabled />
  343. </el-form-item>
  344. </el-col>
  345. <el-col :span="8">
  346. <el-form-item label="牧场:" prop="pastureId">
  347. <el-select v-model="tab1.contractManagement.create.temp.pastureId" placeholder="牧场" class="filter-item" style="width:100%;" :disabled="disabled">
  348. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
  349. </el-select>
  350. </el-form-item>
  351. </el-col>
  352. <el-col :span="8">
  353. <el-form-item label="供应商:" prop="providerName">
  354. <el-autocomplete v-model="tab1.contractManagement.create.temp.providerName" :disabled="dialogStatus==='see' || tab1.contractManagement.isDisabled || dialogStatus==='change'" value-key="name" class="inline-input" :fetch-suggestions="providerSearch" placeholder="请输入供应商名称或供应商编号" style="width:100%;" @focus="handleFocusProvider" @blur="handleBlurProvider" @select="handleSelectProvider" />
  355. </el-form-item>
  356. </el-col>
  357. </el-row>
  358. <el-row>
  359. <el-col :span="8">
  360. <el-form-item label="开始日期:" prop="startTime">
  361. <el-date-picker v-model="tab1.contractManagement.create.temp.startTime" :disabled="dialogStatus==='see' || tab1.contractManagement.isDisabled || dialogStatus==='change'" type="date" placeholder="开始日期" :clearable="false" style="width:100%;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="changeTime" />
  362. </el-form-item>
  363. </el-col>
  364. <el-col :span="8">
  365. <el-form-item label="截止日期:" prop="stopTime">
  366. <el-date-picker v-model="tab1.contractManagement.create.temp.stopTime" style="width:100%;" :disabled="dialogStatus==='see' || tab1.contractManagement.isDisabled" type="date" :clearable="false" placeholder="截止日期" :picker-options="pickerOptions2" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="changeTime" />
  367. </el-form-item>
  368. </el-col>
  369. <el-col v-if="dialogStatus=='create'" :span="8">
  370. <el-form-item label="合同状态:" prop="statue">
  371. <el-select v-model="tab1.contractManagement.create.temp.statue" clearable placeholder="合同状态" class="filter-item" style="width: 100%;" disabled>
  372. <el-option v-for="item in contractStatus2List" :key="item.id" :label="item.name" :value="item.id" />
  373. </el-select>
  374. </el-form-item>
  375. </el-col>
  376. <el-col v-if="dialogStatus=='change' || dialogStatus=='see'" :span="8">
  377. <el-form-item label="合同状态:" prop="statued">
  378. <el-input ref="contractCode" v-model="tab1.contractManagement.create.temp.statued" placeholder="合同状态" disabled />
  379. </el-form-item>
  380. </el-col>
  381. </el-row>
  382. <el-row>
  383. <el-col :span="8">
  384. <el-form-item label="零库存:" prop="isZeroStock">
  385. <el-radio-group v-model="tab1.contractManagement.create.temp.isZeroStock" :disabled="dialogStatus==='see' || tab1.contractManagement.isDisabled || dialogStatus==='change'" @change="changeIsZero">
  386. <el-radio v-model="tab1.contractManagement.create.temp.isZeroStock" :label="1">是</el-radio>
  387. <el-radio v-model="tab1.contractManagement.create.temp.isZeroStock" :label="0">否</el-radio>
  388. </el-radio-group>
  389. </el-form-item>
  390. </el-col>
  391. <el-col :span="8">
  392. <el-form-item label="录入人:" prop="creatorId">
  393. <el-select ref="creatorId" v-model="tab1.contractManagement.create.temp.creatorId" :disabled="tab1.contractManagement.isDisabled || dialogStatus==='see' || dialogStatus==='change'" placeholder="录入人" class="filter-item" style="width:100%;" @change="changeCreatorMan">
  394. <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
  395. </el-select>
  396. </el-form-item>
  397. </el-col>
  398. <el-col :span="8">
  399. <el-form-item label="录入日期:" prop="creatorTime">
  400. <el-date-picker v-model="tab1.contractManagement.create.temp.creatorTime" :disabled="disabled" type="date" :picker-options="pickerOptions3" placeholder="录入日期" style="width:100%;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
  401. </el-form-item>
  402. </el-col>
  403. </el-row>
  404. <el-row>
  405. <el-col :span="8">
  406. <el-form-item label="备注:" prop="remark">
  407. <el-input ref="remark" v-model="tab1.contractManagement.create.temp.remark" placeholder="备注" :disabled="tab1.contractManagement.isDisabled || dialogStatus==='see' || dialogStatus==='change'" />
  408. </el-form-item>
  409. </el-col>
  410. <el-col v-if="dialogStatus !== 'see'" :span="8">
  411. <el-form-item label="同步牧场:" prop="synchronousPasture">
  412. <el-select v-model="tab1.contractManagement.create.temp.synchronousPasture" multiple collapse-tags placeholder="同步牧场" :disabled="isGroupAdministrator !== '18'">
  413. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
  414. </el-option>
  415. </el-select>
  416. </el-form-item>
  417. </el-col>
  418. <el-col v-else :span="16">
  419. <el-form-item label="同步牧场:" prop="pastureName2">
  420. <el-input v-model="tab1.contractManagement.create.temp.pastureName2" type="textarea" :rows="2" placeholder="同步牧场" :disabled="dialogStatus=='see'" />
  421. </el-form-item>
  422. </el-col>
  423. </el-row>
  424. <!-- <el-row v-if="dialogStatus == 'see'">
  425. <el-col>
  426. <el-form-item label="流程进度1" />
  427. <el-steps :active="tab1.contractManagement.create.temp.active" align-center finish-status="success">
  428. <el-step
  429. v-for="(item,index) in tab1.contractManagement.create.temp.activeList"
  430. :key="index"
  431. :title="item.title"
  432. :status="item.status"
  433. >
  434. <template slot="description">
  435. <div class="step-row">
  436. <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
  437. <div>{{ item.reason }}</div>
  438. </div>
  439. </template>
  440. </el-step>
  441. </el-steps>
  442. </el-col>
  443. </el-row> -->
  444. </el-form>
  445. <div slot="footer" class="dialog-footer" style="bottom:5px">
  446. <el-button v-if="dialogStatus =='change'" type="primary" @click="terminationData()">终止合同</el-button>
  447. <el-button v-if="dialogStatus !=='see'" type="primary" :disabled="isokDisable" @click="dialogStatus==='create'?add_dialog_save():changeData()">保存并关闭</el-button>
  448. <el-button @click="tab1.contractManagement.create.dialogFormVisible = false;getTab1List();tab1.contractManagement.create.temp.providerName=''">取消并关闭</el-button>
  449. </div>
  450. </div>
  451. </el-dialog>
  452. <!-- 备件明细新增/变更 -->
  453. <el-dialog :title="textMap[dialogStatus]" :visible.sync="tab1.detailsSpareParts.create.dialogFormVisible" :close-on-click-modal="false" width="90%">
  454. <div v-if="tab1.detailsSpareParts.updateList.SHtype !== 0 && tab1.detailsSpareParts.updateList.SHtype !== 3" class="app-add">
  455. <el-form ref="createTemp2" :rules="rules" :model="tab1.detailsSpareParts.create.temp" label-position="right" label-width="120px" style="width: 90%;margin:0 auto;">
  456. <el-row>
  457. <el-col :span="10">
  458. <el-form-item label="备件:" prop="partCode">
  459. <el-autocomplete v-model="tab1.detailsSpareParts.partCode" value-key="name1" class="inline-input" :fetch-suggestions="sparePartSearch" placeholder="请输入备件编号或备件名称或备件规格" style="width:550px" @select="handleSelectSparePart">
  460. <template slot-scope="{ item }">
  461. <b>备件编号:</b><div class="name" style="display: inline;">{{ item.partCode }}</div>&nbsp;
  462. | &nbsp;<b>备件名称:</b><span class="addr">{{ item.partName }}</span>&nbsp;
  463. | &nbsp;<b>备件规格:</b><span class="addr">{{ item.specification }}</span>
  464. </template>
  465. </el-autocomplete>
  466. </el-form-item>
  467. </el-col>
  468. </el-row>
  469. </el-form>
  470. <div v-if="dialogStatus=='tab1create2'" class="filter-container" style="float: right;">
  471. <el-button v-waves class="filter-item" type="info" icon="el-icon-tickets" @click="handleTab1DownloadTemp2">模板</el-button>
  472. <el-upload style="display: inline-block;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
  473. <el-button v-waves :disabled="tab1.detailsSpareParts.isDisabledImport" class="filter-item" type="warning" icon="el-icon-download">导入</el-button>
  474. </el-upload>
  475. </div>
  476. <el-table
  477. :key="tab1.detailsSpareParts.tableKeyAdd"
  478. v-loading="tab1.detailsSpareParts.listLoadingAdd"
  479. element-loading-text="给我一点时间"
  480. :data="tab1.detailsSpareParts.listAdd"
  481. border
  482. fit
  483. highlight-current-row
  484. style="width: 100%;"
  485. :row-style="rowStyle"
  486. :cell-style="cellStyle"
  487. class="elTable table-fixed"
  488. >
  489. <el-table-column label="序号" align="center" type="index" width="50px" />
  490. <el-table-column label="备件编号" min-width="90px" align="center">
  491. <template slot-scope="scope">
  492. <span>{{ scope.row.partCode }}</span>
  493. </template>
  494. </el-table-column>
  495. <el-table-column label="备件名称" min-width="80px" align="center">
  496. <template slot-scope="scope">
  497. <span>{{ scope.row.partName }}</span>
  498. </template>
  499. </el-table-column>
  500. <el-table-column label="备件规格" min-width="80px" align="center">
  501. <template slot-scope="scope">
  502. <span>{{ scope.row.specification }}</span>
  503. </template>
  504. </el-table-column>
  505. <el-table-column label="备件图片" prop="specifications" align="center" min-width="110px">
  506. <template slot-scope="scope">
  507. <el-popover placement="right" title="" trigger="hover">
  508. <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
  509. <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  510. </el-popover>
  511. </template>
  512. </el-table-column>
  513. <el-table-column label="备件品牌" min-width="120px" align="center">
  514. <template slot-scope="scope">
  515. <el-autocomplete v-model="scope.row.brand" value-key="brandName" class="inline-input" :fetch-suggestions="brandSearch" placeholder="请输入品牌" style="width:100%;" @focus="handleFocusBrand( scope.row)" @blur="handleBlurBrand(scope.row)" @select="(value)=> {handleSelectBrand(value, scope.row)}" />
  516. </template>
  517. </el-table-column>
  518. <el-table-column label="计量单位" min-width="60px" align="center">
  519. <template slot-scope="scope">
  520. <span>{{ scope.row.unit }}</span>
  521. </template>
  522. </el-table-column>
  523. <el-table-column label="计划量" min-width="70px" align="center" valign="middle">
  524. <template slot-scope="scope">
  525. <el-form :model="scope.row" :rules="rules">
  526. <el-form-item prop="planAmount">
  527. <el-input ref="planAmount" v-model="scope.row.planAmount" style="margin-top:15px" />
  528. </el-form-item>
  529. </el-form>
  530. </template>
  531. </el-table-column>
  532. <el-table-column label="单价" min-width="80px" align="center" valign="middle">
  533. <template slot-scope="scope">
  534. <el-input v-model="scope.row.price" />
  535. </template>
  536. </el-table-column>
  537. <!-- <el-table-column label="使用周期" min-width="110px" align="center" valign="middle">
  538. <template slot-scope="scope">
  539. <el-input v-model="scope.row.lifeCycle" />
  540. </template>
  541. </el-table-column>
  542. <el-table-column label="合同差异项" min-width="110px" align="center" valign="middle">
  543. <template slot-scope="scope">
  544. <el-input v-model="scope.row.contractVarianceItem" />
  545. </template>
  546. </el-table-column> -->
  547. <el-table-column label="操作" align="center" width="100px" class-name="small-padding fixed-width" fixed="right">
  548. <template slot-scope="{row}">
  549. <a class="del" :disabled="isokDisable" @click="partDelete(row)">删除</a>
  550. </template>
  551. </el-table-column>
  552. </el-table>
  553. </div>
  554. <div v-if="tab1.detailsSpareParts.updateList.SHtype == 0 || tab1.detailsSpareParts.updateList.SHtype == 3" class="app-add">
  555. <el-form ref="createTemp2" :rules="rules" :model="tab1.detailsSpareParts.create.temp" label-position="right" label-width="130px" style="width: 90%;margin:0 auto;">
  556. <el-row>
  557. <el-col :span="8">
  558. <el-form-item label="牧场:" prop="pastureName">
  559. <el-input ref="pastureName" v-model="tab1.detailsSpareParts.create.temp.pastureName" placeholder="牧场" disabled />
  560. </el-form-item>
  561. </el-col>
  562. <el-col :span="8">
  563. <el-form-item label="合同编号:" prop="contractCode">
  564. <el-input ref="contractCode" v-model="tab1.detailsSpareParts.create.temp.contractCode" placeholder="合同编号" disabled />
  565. </el-form-item>
  566. </el-col>
  567. <el-col :span="8">
  568. <el-form-item label="供应商:" prop="providerName">
  569. <el-input ref="providerName" v-model="tab1.detailsSpareParts.create.temp.providerName" placeholder="合同编号" disabled />
  570. </el-form-item>
  571. </el-col>
  572. </el-row>
  573. <el-row>
  574. <el-col :span="8">
  575. <el-form-item label="开始日期:" prop="startTime">
  576. <el-date-picker v-model="tab1.detailsSpareParts.create.temp.startTime" :disabled="tab1.detailsSpareParts.create.temp.SHtype == 3" type="date" placeholder="开始日期" :clearable="false" style="width:100%;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
  577. </el-form-item>
  578. </el-col>
  579. <el-col v-if="dialogStatus == 'tab1Update2' && tab1.detailsSpareParts.updateList.SHtype == 0" :span="8">
  580. <el-form-item label="截止日期:" prop="stopTime">
  581. <el-date-picker v-model="tab1.detailsSpareParts.create.temp.stopTime" type="date" placeholder="截止日期" :clearable="false" style="width:100%;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
  582. </el-form-item>
  583. </el-col>
  584. <el-col v-if="dialogStatus == 'tab1Update2' && tab1.detailsSpareParts.updateList.SHtype !== 0" :span="8">
  585. <el-form-item label="截止日期后:" prop="stopTimeHis">
  586. <el-date-picker v-model="tab1.detailsSpareParts.create.temp.stopTimeHis" type="date" placeholder="截止日期" :clearable="false" style="width:100%;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :picker-options="pickerOptions2" />
  587. </el-form-item>
  588. </el-col>
  589. <el-col :span="8">
  590. <el-form-item label="合同状态:" prop="statued">
  591. <span>{{ tab1.detailsSpareParts.create.temp.statued }}</span>
  592. </el-form-item>
  593. </el-col>
  594. </el-row>
  595. <el-row>
  596. <el-col :span="8">
  597. <el-form-item label="零库存:" prop="isZeroStock">
  598. <el-radio-group v-model="tab1.detailsSpareParts.create.temp.isZeroStock" :disabled="tab1.detailsSpareParts.create.temp.SHtype == 3">
  599. <el-radio v-model="tab1.detailsSpareParts.create.temp.isZeroStock" :label="1">是</el-radio>
  600. <el-radio v-model="tab1.detailsSpareParts.create.temp.isZeroStock" :label="0">否</el-radio>
  601. </el-radio-group>
  602. </el-form-item>
  603. </el-col>
  604. <el-col :span="8">
  605. <el-form-item label="录入人:" prop="creatorMan">
  606. <el-input ref="creatorMan" v-model="tab1.detailsSpareParts.create.temp.creatorMan" placeholder="录入人" disabled />
  607. </el-form-item>
  608. </el-col>
  609. <el-col :span="8">
  610. <el-form-item label="录入日期:" prop="creatorTime">
  611. <el-date-picker v-model="tab1.detailsSpareParts.create.temp.creatorTime" :disabled="tab1.detailsSpareParts.create.temp.SHtype == 3 || dialogStatus=='tab1Update2' " type="date" placeholder="截止日期" :clearable="false" style="width:100%;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
  612. </el-form-item>
  613. </el-col>
  614. </el-row>
  615. <el-row>
  616. <el-col :span="8">
  617. <el-form-item label="备注:" prop="remark">
  618. <el-input ref="remark" v-model="tab1.detailsSpareParts.create.temp.remark" placeholder="备注" />
  619. </el-form-item>
  620. </el-col>
  621. <el-col v-if="tab1.detailsSpareParts.create.temp.SHtype !== 0 && dialogStatus !=='tab1Update2'" :span="8">
  622. <el-form-item label="变更后截止日期:" prop="stopTimeHis">
  623. <el-date-picker v-model="tab1.detailsSpareParts.create.temp.stopTimeHis" :disabled="tab1.detailsSpareParts.create.temp.SHtype !== 3" type="date" placeholder="截止日期" :clearable="false" style="width:100%;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :picker-options="pickerOptions2" />
  624. </el-form-item>
  625. </el-col>
  626. </el-row>
  627. </el-form>
  628. </div>
  629. <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
  630. <el-button v-if="dialogStatus=='tab1create2'" type="primary" :disabled="isokDisable" @click="add_dialog_save2()">保存并关闭</el-button>
  631. <el-button v-if="dialogStatus=='tab1change2'" type="primary" :disabled="isokDisable" @click="changeData2()">保存并关闭</el-button>
  632. <el-button v-if="dialogStatus=='tab1Update2'" type="primary" :disabled="isokDisable" @click="edit_dialog_save2()">保存并关闭</el-button>
  633. <el-button @click="tab1.detailsSpareParts.create.dialogFormVisible = false;">关闭</el-button>
  634. </div>
  635. </el-dialog>
  636. <!-- 变更记录查看 -->
  637. <el-dialog :title="textMap[dialogStatus]" :visible.sync="tab1.changeRecord.see.dialogFormVisible" :close-on-click-modal="false" width="90%">
  638. <div class="app-see">
  639. <div class="app-contentcard">
  640. <el-form ref="seeTemp" :rules="rules" :model="tab1.changeRecord.see.temp" label-position="right" label-width="128px" style="width: 90%;margin:0 auto;">
  641. <div v-if="tab1.changeRecord.see.temp.SHtype == 0 || tab1.changeRecord.see.temp.SHtype == 3">
  642. <el-row>
  643. <el-col :span="8">
  644. <el-form-item label="牧场:" prop="pastureName">
  645. <span> {{ tab1.changeRecord.see.temp.pastureName }} </span>
  646. </el-form-item>
  647. </el-col>
  648. <el-col :span="8">
  649. <el-form-item label="合同编号:" prop="contractCode">
  650. <span> {{ tab1.changeRecord.see.temp.contractCode }} </span>
  651. </el-form-item>
  652. </el-col>
  653. <el-col :span="8">
  654. <el-form-item label="供应商:" prop="providerName">
  655. <span> {{ tab1.changeRecord.see.temp.providerName }} </span>
  656. </el-form-item>
  657. </el-col>
  658. </el-row>
  659. <el-row>
  660. <el-col :span="8">
  661. <el-form-item label="开始日期:" prop="startTime">
  662. <span> {{ tab1.changeRecord.see.temp.startTime }} </span>
  663. </el-form-item>
  664. </el-col>
  665. <el-col v-if="dialogStatus !== 'tab1See2'" :span="8">
  666. <el-form-item label="截止日期:" prop="stopTime">
  667. <span> {{ tab1.changeRecord.see.temp.stopTime }} </span>
  668. </el-form-item>
  669. </el-col>
  670. <el-col v-if="dialogStatus == 'tab1See2' && tab1.changeRecord.see.temp.SHtype !== 3 && tab1.changeRecord.see.temp.SHtype !== 0" :span="8">
  671. <el-form-item label="截止日期:" prop="stopTimeHis">
  672. <span> {{ tab1.changeRecord.see.temp.stopTimeHis }} </span>
  673. </el-form-item>
  674. </el-col>
  675. <el-col v-if="dialogStatus == 'tab1See2' && tab1.changeRecord.see.temp.SHtype == 3" :span="8">
  676. <el-form-item label="截止日期:" prop="stopTime">
  677. <span> {{ tab1.changeRecord.see.temp.stopTime }} </span>
  678. </el-form-item>
  679. </el-col>
  680. <el-col v-if="dialogStatus == 'tab1See2' && tab1.changeRecord.see.temp.SHtype == 0" :span="8">
  681. <el-form-item label="截止日期:" prop="stopTime">
  682. <span> {{ tab1.changeRecord.see.temp.stopTime }} </span>
  683. </el-form-item>
  684. </el-col>
  685. <el-col :span="8">
  686. <el-form-item label="合同状态:" prop="statued">
  687. <span>{{ tab1.changeRecord.see.temp.statued }}</span>
  688. </el-form-item>
  689. </el-col>
  690. </el-row>
  691. <el-row>
  692. <el-col :span="8">
  693. <el-form-item label="零库存:" prop="isZeroStock">
  694. <el-radio-group v-model="tab1.changeRecord.see.temp.isZeroStock" disabled>
  695. <el-radio v-model="tab1.changeRecord.see.temp.isZeroStock" :label="1">是</el-radio>
  696. <el-radio v-model="tab1.changeRecord.see.temp.isZeroStock" :label="0">否</el-radio>
  697. </el-radio-group>
  698. </el-form-item>
  699. </el-col>
  700. <el-col :span="8">
  701. <el-form-item label="录入人:" prop="creatorMan">
  702. <span> {{ tab1.changeRecord.see.temp.creatorMan }} </span>
  703. </el-form-item>
  704. </el-col>
  705. <el-col :span="8">
  706. <el-form-item label="录入日期:" prop="creatorTime">
  707. <span> {{ tab1.changeRecord.see.temp.creatorTime }} </span>
  708. </el-form-item>
  709. </el-col>
  710. </el-row>
  711. <el-row>
  712. <el-col :span="8">
  713. <el-form-item label="备注:" prop="remark">
  714. <span> {{ tab1.changeRecord.see.temp.remark }} </span>
  715. </el-form-item>
  716. </el-col>
  717. <el-col :span="8">
  718. <el-form-item label="共享牧场:" prop="pastureNamesOld">
  719. <span> {{ tab1.changeRecord.see.temp.pastureNamesOld }} </span>
  720. </el-form-item>
  721. </el-col>
  722. <el-col v-if="tab1.changeRecord.see.temp.SHtype == 3" :span="8">
  723. <el-form-item label="变更后截止日期:" prop="stopTimeHis">
  724. <span> {{ tab1.changeRecord.see.temp.stopTimeHis }} </span>
  725. </el-form-item>
  726. </el-col>
  727. </el-row>
  728. <el-row>
  729. <el-col :span="8">
  730. <el-form-item label="变更后共享牧场:" prop="pastureNamesNow">
  731. <span> {{ tab1.changeRecord.see.temp.pastureNamesNow }} </span>
  732. </el-form-item>
  733. </el-col>
  734. </el-row>
  735. </div>
  736. <div v-if="tab1.changeRecord.see.temp.SHtype == 1 || tab1.changeRecord.see.temp.SHtype == 2">
  737. <el-row>
  738. <el-col :span="8">
  739. <el-form-item label="流水编号:" prop="contractCode">
  740. <span> {{ tab1.changeRecord.see.temp.contractCode }} </span>
  741. </el-form-item>
  742. </el-col>
  743. <el-col :span="8">
  744. <el-form-item label="录入人:" prop="creatorMan">
  745. <span> {{ tab1.changeRecord.see.temp.creatorMan }} </span>
  746. </el-form-item>
  747. </el-col>
  748. <el-col :span="8">
  749. <el-form-item label="录入日期:" prop="creatorTime">
  750. <span> {{ tab1.changeRecord.see.temp.creatorTime }} </span>
  751. </el-form-item>
  752. </el-col>
  753. </el-row>
  754. </div>
  755. </el-form>
  756. <div v-if="tab1.changeRecord.see.temp.SHtype == 1">
  757. <el-table
  758. :key="tab1.changeRecord.see.tableKey"
  759. element-loading-text="给我一点时间"
  760. :data="tab1.changeRecord.see.list"
  761. border
  762. fit
  763. highlight-current-row
  764. style="width: 100%;"
  765. :row-style="rowStyle"
  766. :cell-style="cellStyle"
  767. class="elTable table-fixed"
  768. >
  769. <el-table-column label="序号" align="center" type="index" width="50px">
  770. <template slot-scope="scope">
  771. <span>{{ scope.$index + (tab1.changeRecord.see.pageNum-1) * tab1.changeRecord.see.pageSize + 1 }}</span>
  772. </template>
  773. </el-table-column>
  774. <el-table-column label="备件编号" min-width="110px" align="center">
  775. <template slot-scope="scope">
  776. <span>{{ scope.row.partCode }}</span>
  777. </template>
  778. </el-table-column>
  779. <el-table-column label="备件名称" min-width="130px" align="center">
  780. <template slot-scope="scope">
  781. <span>{{ scope.row.partName }}</span>
  782. </template>
  783. </el-table-column>
  784. <el-table-column label="备件规格" min-width="80px" align="center">
  785. <template slot-scope="scope">
  786. <span>{{ scope.row.specification }}</span>
  787. </template>
  788. </el-table-column>
  789. <el-table-column label="备件图片" prop="specifications" align="center" min-width="110px">
  790. <template slot-scope="scope">
  791. <el-popover placement="right" title="" trigger="hover">
  792. <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
  793. <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  794. </el-popover>
  795. </template>
  796. </el-table-column>
  797. <el-table-column label="备件品牌" min-width="80px" align="center">
  798. <template slot-scope="scope">
  799. <span>{{ scope.row.brand }}</span>
  800. </template>
  801. </el-table-column>
  802. <el-table-column label="计量单位" min-width="80px" align="center">
  803. <template slot-scope="scope">
  804. <span>{{ scope.row.unit }}</span>
  805. </template>
  806. </el-table-column>
  807. <el-table-column label="计划量" min-width="80px" align="center">
  808. <template slot-scope="scope">
  809. <span>{{ scope.row.planAmount }}</span>
  810. </template>
  811. </el-table-column>
  812. <el-table-column label="单价" min-width="80px" align="center">
  813. <template slot-scope="scope">
  814. <span>{{ scope.row.price }}</span>
  815. </template>
  816. </el-table-column>
  817. <el-table-column label="备注" min-width="80px" align="center">
  818. <template slot-scope="scope">
  819. <span>{{ scope.row.remark }}</span>
  820. </template>
  821. </el-table-column>
  822. </el-table>
  823. <pagination v-show="tab1.changeRecord.see.total>0" :total="tab1.changeRecord.see.total" :page.sync="tab1.changeRecord.see.getdataListParm.offset" :limit.sync="tab1.changeRecord.see.getdataListParm.pagecount" @pagination="getTab1List3See" />
  824. </div>
  825. <div v-if="tab1.changeRecord.see.temp.SHtype == 2">
  826. <el-table
  827. :key="tab1.changeRecord.see.tableKey"
  828. element-loading-text="给我一点时间"
  829. :data="tab1.changeRecord.see.list"
  830. border
  831. fit
  832. highlight-current-row
  833. style="width: 100%;"
  834. :row-style="rowStyle"
  835. :cell-style="cellStyle"
  836. class="elTable table-fixed"
  837. >
  838. <el-table-column label="序号" align="center" type="index" width="50px">
  839. <template slot-scope="scope">
  840. <span>{{ scope.$index + (tab1.changeRecord.see.pageNum-1) * tab1.changeRecord.see.pageSize + 1 }}</span>
  841. </template>
  842. </el-table-column>
  843. <el-table-column label="备件编号" min-width="110px" align="center">
  844. <template slot-scope="scope">
  845. <span>{{ scope.row.partCode }}</span>
  846. </template>
  847. </el-table-column>
  848. <el-table-column label="备件名称" min-width="130px" align="center">
  849. <template slot-scope="scope">
  850. <span>{{ scope.row.partName }}</span>
  851. </template>
  852. </el-table-column>
  853. <el-table-column label="备件规格" min-width="80px" align="center">
  854. <template slot-scope="scope">
  855. <span>{{ scope.row.specification }}</span>
  856. </template>
  857. </el-table-column>
  858. <el-table-column label="备件图片" prop="specifications" align="center" min-width="110px">
  859. <template slot-scope="scope">
  860. <el-popover placement="right" title="" trigger="hover">
  861. <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
  862. <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  863. </el-popover>
  864. </template>
  865. </el-table-column>
  866. <el-table-column label="备件品牌" min-width="80px" align="center">
  867. <template slot-scope="scope">
  868. <span>{{ scope.row.brandhis }}</span>
  869. </template>
  870. </el-table-column>
  871. <el-table-column label="变更后品牌" min-width="80px" align="center">
  872. <template slot-scope="scope">
  873. <span>{{ scope.row.brand }}</span>
  874. </template>
  875. </el-table-column>
  876. <el-table-column label="计量单位" min-width="80px" align="center">
  877. <template slot-scope="scope">
  878. <span>{{ scope.row.unit }}</span>
  879. </template>
  880. </el-table-column>
  881. <el-table-column label="计划量" min-width="80px" align="center">
  882. <template slot-scope="scope">
  883. <span>{{ scope.row.planAmounthis }}</span>
  884. </template>
  885. </el-table-column>
  886. <el-table-column label="变更后计划量" min-width="80px" align="center">
  887. <template slot-scope="scope">
  888. <span>{{ scope.row.planAmount }}</span>
  889. </template>
  890. </el-table-column>
  891. <el-table-column label="单价" min-width="80px" align="center">
  892. <template slot-scope="scope">
  893. <span>{{ scope.row.pricehis }}</span>
  894. </template>
  895. </el-table-column>
  896. <el-table-column label="变更后单价" min-width="80px" align="center">
  897. <template slot-scope="scope">
  898. <span>{{ scope.row.price }}</span>
  899. </template>
  900. </el-table-column>
  901. <el-table-column label="备注" min-width="80px" align="center">
  902. <template slot-scope="scope">
  903. <span>{{ scope.row.remark }}</span>
  904. </template>
  905. </el-table-column>
  906. </el-table>
  907. <pagination v-show="tab1.changeRecord.see.total>0" :total="tab1.changeRecord.see.total" :page.sync="tab1.changeRecord.see.getdataListParm.offset" :limit.sync="tab1.changeRecord.see.getdataListParm.pagecount" @pagination="getTab1List3See" />
  908. </div>
  909. <el-form ref="seeTemp" :rules="rules" :model="tab1.changeRecord.see.temp" label-position="right" label-width="120px" style="width: 90%;margin:0 auto;">
  910. <el-row>
  911. <el-col>
  912. <el-form-item label="流程进度" />
  913. <el-steps :active="tab1.changeRecord.see.active" align-center finish-status="success">
  914. <el-step
  915. v-for="(item,index) in tab1.changeRecord.see.activeList"
  916. :key="index"
  917. :title="item.title"
  918. :status="item.status"
  919. >
  920. <template slot="description">
  921. <div class="step-row">
  922. <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
  923. <div>{{ item.reason }}</div>
  924. </div>
  925. </template>
  926. </el-step>
  927. </el-steps>
  928. </el-col>
  929. </el-row>
  930. <el-row>
  931. <el-col>
  932. <el-form-item label="操作:">
  933. <!-- 设备主管审核 -->
  934. <el-button v-if="tab1.changeRecord.isContractExamineZG &&tab1.changeRecord.see.temp.SHStatus == 2" type="success" style="display:inline-block" @click="handleTab1Examine()">审核1</el-button>
  935. <el-button v-else type="success" style="display:none" @click="handleTab1Examine()">审核1</el-button>
  936. <!-- 设备助理审核 -->
  937. <!-- <el-button v-if="isContractExamineZL && seeTemp.SHStatus == 3" type="success" style="display:inline-block" @click="handleExamine2()">审核2</el-button>
  938. <el-button v-else type="success" style="display:none" @click="handleExamine2()">审核2</el-button> -->
  939. <!-- 设备中心审核 -->
  940. <el-button v-if="tab1.changeRecord.isContractExamineZX && tab1.changeRecord.see.temp.SHStatus == 5" type="success" style="display:inline-block" @click="handleTab1Examine3()">审核2</el-button>
  941. <el-button v-else type="success" style="display:none" @click="handleTab1Examine3()">审核2</el-button>
  942. </el-form-item>
  943. </el-col>
  944. </el-row>
  945. </el-form>
  946. </div>
  947. <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
  948. <el-button @click="tab1.changeRecord.see.dialogFormVisible = false">关闭</el-button>
  949. </div>
  950. </div>
  951. </el-dialog>
  952. <!-- 变更记录审核 -->
  953. <el-dialog :title="textMap[dialogStatus]" :visible.sync="tab1.changeRecord.examine.dialogFormVisible" :close-on-click-modal="false" width="30%">
  954. <div class="app-examine">
  955. <h3 style="width: 100%;margin:0 0 0 5%;line-height:50px;">请确认审核结果:</h3>
  956. <el-form ref="examineTemp" :rules="rules" :model="tab1.changeRecord.examine.temp" label-position="right" style="width: 50%;margin:0 auto;">
  957. <el-row style="width:88%;height:150px;margin:0 auto;">
  958. <el-col :span="20">
  959. <el-form-item>
  960. <el-radio-group v-model="tab1.changeRecord.examine.temp.statueSH" @change="changeExamineStatue">
  961. <el-radio :label="1" checked>通过</el-radio>
  962. <el-radio :label="2">不通过</el-radio>
  963. </el-radio-group>
  964. </el-form-item>
  965. </el-col>
  966. <el-col v-if="tab1.changeRecord.examine.isReason" :span="20">
  967. <el-input v-model="tab1.changeRecord.examine.temp.workflowNote" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入不通过原因" />
  968. </el-col>
  969. </el-row>
  970. </el-form>
  971. </div>
  972. <div slot="footer" class="dialog-footer">
  973. <el-button v-if="dialogStatus==='tab1examine'" type="primary" :disabled="isokDisable" @keyup.enter.native="createExamineData()" @click="createExamineData()">确认</el-button>
  974. <!-- <el-button v-if="dialogStatus==='tab1examine2'" type="primary" :disabled="isokDisable" @click="createExamineData2()">确认</el-button> -->
  975. <el-button v-if="dialogStatus==='tab1examine3'" type="primary" :disabled="isokDisable" @keyup.enter.native="createExamineData3()" @click="createExamineData3()">确认</el-button>
  976. <el-button @click="tab1.changeRecord.examine.dialogFormVisible = false;">关闭</el-button>
  977. </div>
  978. </el-dialog>
  979. </div>
  980. </template>
  981. <script>
  982. // 引入
  983. import { GetDataByName, GetDataByNames, checkButtons, ExecDataByConfig, UpdateDataRelation, PostDataByName, failproccess } from '@/api/common'
  984. import waves from '@/directive/waves'
  985. import { parseTime, json2excel, sortChange } from '@/utils/index.js'
  986. import Pagination from '@/components/Pagination'
  987. import Cookies from 'js-cookie'
  988. import { getToken } from '@/utils/auth'
  989. import { MessageBox } from 'element-ui'
  990. export default {
  991. inject: ['reload'],
  992. name: 'ContractManagement',
  993. components: { Pagination },
  994. directives: { waves },
  995. data() {
  996. return {
  997. selectList:[],
  998. contractCodese:'',
  999. isGroupAdministrator: Cookies.get('pastureid'),
  1000. isEmployeid: Cookies.get('employeid'),
  1001. isPercentage: false,
  1002. percentage: 1,
  1003. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  1004. cellStyle: { padding: 0 + 'px' },
  1005. buttons: [],
  1006. activeName: 'first',
  1007. contractStatusList: [{ id: '0', name: '正常' }, { id: '1', name: '已过期' }, { id: '2', name: '终止' }, { id: '3', name: '新增未通过' }],
  1008. contractStatus2List: [{ id: '1', name: '正常' }, { id: '0', name: '终止' }],
  1009. auditStatusList: [{ id: '0', name: '审核中' }, { id: '1', name: '已通过' }, { id: '2', name: '未通过' }], // 审核状态
  1010. changeTypeList: [{ id: '0', name: '新增合同' }, { id: '1', name: '新增备件' }, { id: '2', name: '变更备件' }, { id: '3', name: '合同变更' }],
  1011. isZeroInventoryList: [{ id: '0', name: '否' }, { id: '1', name: '是' }], // 是否零库存
  1012. findAllProvider: [], findAllAssetType: [], findAllPasture: [], findAllPastureList2: [], findAllDepart: [], findAllEmploye: [], findAllCategory: [],
  1013. requestParams: [
  1014. { name: 'findAllProvider', offset: 0, pagecount: 0, params: [] },
  1015. { name: 'findAllAssetType', offset: 0, pagecount: 0, params: [] },
  1016. { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
  1017. { name: 'findAllPastureForContract', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': 18 }},
  1018. { name: 'findAllDepart', offset: 0, pagecount: 0, params: [] },
  1019. { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': 18 }},
  1020. { name: 'findAllCategory', offset: 0, pagecount: 0, params: [] }
  1021. ],
  1022. isokDisable: false,
  1023. disabled: true,
  1024. rules: {},
  1025. textMap: {
  1026. create: '新增合同',
  1027. see: '查看详情',
  1028. change: '变更合同',
  1029. tab1create2: '新增备件',
  1030. tab1change2: '变更备件',
  1031. tab1examine: '审核',
  1032. tab1examine2: '审核2',
  1033. tab1examine3: '审核2',
  1034. tab1See2: '查看',
  1035. tab1Update2: '编辑'
  1036. },
  1037. dialogStatus: '',
  1038. isContractManagement: true, // 备件合同
  1039. isDetailsSpareParts: false, // 备件明细
  1040. isChangeRecord: false, // 变更记录
  1041. tab1: {
  1042. // 合同管理1
  1043. contractManagement: {
  1044. radioAll: '全部',
  1045. isContractAdd: [],
  1046. isContractExport: [],
  1047. isContractSee: [],
  1048. isContractChange: [],
  1049. isDisabled: false,
  1050. tableKey: 0,
  1051. listLoading: false,
  1052. total: 0,
  1053. list: [],
  1054. getdataListParm: {
  1055. name: 'providerPactListV2',
  1056. page: 1,
  1057. offset: 1,
  1058. pagecount: 10,
  1059. returntype: 'Map',
  1060. parammaps: {
  1061. loginid: Cookies.get('employeid'),
  1062. pastureName: Cookies.get('pasturename'),
  1063. contractCode: '',
  1064. statue: '',
  1065. stuteSH: '',
  1066. providerName: '',
  1067. tab1InputDatetime1: '',
  1068. startTime: '',
  1069. stopTime: '',
  1070. tab1InputDatetime2: '',
  1071. SHdateTimeF: '',
  1072. SHdateTimeE: '',
  1073. SHnums: 2
  1074. }
  1075. },
  1076. getParmCreateNumber: {
  1077. name: 'autoCreatCode',
  1078. page: 0,
  1079. offset: 0,
  1080. pagecount: 0,
  1081. returntype: 'Map',
  1082. parammaps: {
  1083. pastureId: Cookies.get('pastureid'),
  1084. codeType: 'HT'
  1085. }
  1086. },
  1087. create: {
  1088. dialogFormVisible: false,
  1089. temp: { contractCode: '', pastureId: Cookies.get('pastureid'), providerName: '', startTime: '', stopTime: '', statue: '', isZeroStock: 0, creatorId: Cookies.get('employeid'), creatorMan: Cookies.get('employename'), creatorTime: parseTime(new Date(), '{y}-{m}-{d}'), activeList: [], active: 3, workflowNote: '', synchronousPasture: [], synchronousPastureList: [] },
  1090. changeEchoParm: { name: 'getBigcontractPId', page: 0, offset: 0, pagecount: 0, returntype: 'Map', parammaps: {}}
  1091. }
  1092. },
  1093. // 合同管理-备件明细
  1094. detailsSpareParts: {
  1095. tableKey: 1,
  1096. listLoading: false,
  1097. total: 0,
  1098. list: [],
  1099. getdataListParm: {
  1100. name: 'getcontratListBybigV2',
  1101. page: 1,
  1102. offset: 1,
  1103. pagecount: 10,
  1104. returntype: 'Map',
  1105. parammaps: {
  1106. specification: '',
  1107. partName: '',
  1108. partCode: '',
  1109. pastureId: '',
  1110. providerId: '',
  1111. stopTime: '',
  1112. flag: '',
  1113. isZeroStock: '',
  1114. statue: ''
  1115. }
  1116. },
  1117. partCode: '',
  1118. requestSparePart: {
  1119. name: '',
  1120. page: 1,
  1121. offset: 1,
  1122. pagecount: 20,
  1123. returntype: 'Map',
  1124. parammaps: {}
  1125. },
  1126. detailsList: [],
  1127. updateList: [],
  1128. tableKeyAdd: 0,
  1129. listLoadingAdd: false,
  1130. listAdd: [],
  1131. requestBrand: {
  1132. name: 'getBrandByPartCode',
  1133. page: 0,
  1134. offset: 0,
  1135. pagecount: 10,
  1136. returntype: 'Map',
  1137. parammaps: {}
  1138. },
  1139. BrandList: [],
  1140. create: {
  1141. dialogFormVisible: false,
  1142. temp: { contractCode: '', pastureId: Cookies.get('pastureid'), providerName: '', startTime: '', stopTime: '', statue: '', isZeroStock: 0, creatorId: Cookies.get('employeid'), creatorMan: Cookies.get('employename'), creatorTime: parseTime(new Date(), '{y}-{m}-{d}'), activeList: [], active: 3, workflowNote: '' }
  1143. },
  1144. isDisabledImport: true,
  1145. clearImportExcelParm: {
  1146. name: 'deletecontract_upload',
  1147. page: 0,
  1148. offset: 0,
  1149. pagecount: '',
  1150. returntype: 'Map',
  1151. parammaps: {
  1152. user: Cookies.get('name')
  1153. }
  1154. },
  1155. importExcelParm: {
  1156. name: 'getcontract_uploadlist',
  1157. page: 0,
  1158. offset: 0,
  1159. pagecount: '',
  1160. returntype: 'Map',
  1161. parammaps: {
  1162. user: Cookies.get('name')
  1163. }
  1164. }
  1165. },
  1166. // 变更记录
  1167. changeRecord: {
  1168. isContractExamineZG: [],
  1169. // isContractExamineZL: [],
  1170. isContractExamineZX: [],
  1171. isContractDelete: [],
  1172. isStatueReason: false,
  1173. isReason: false,
  1174. radioAll: '全部',
  1175. tableKey: 2,
  1176. listLoading: false,
  1177. total: 0,
  1178. list: [],
  1179. getdataListParm: {
  1180. name: 'providerPactListSH',
  1181. page: 1,
  1182. offset: 1,
  1183. pagecount: 10,
  1184. returntype: 'Map',
  1185. parammaps: {
  1186. loginid: Cookies.get('employeid'),
  1187. contractCode: '',
  1188. tab1InputDatetime3: '',
  1189. startTime: '',
  1190. stopTime: '',
  1191. SHStatus: '',
  1192. SHtype: '',
  1193. pastureId: '',
  1194. providerId: '',
  1195. stopTime1: '',
  1196. flag: '',
  1197. isZeroStock: '',
  1198. statue: '',
  1199. SHnums: 2,
  1200. stuteSH: ''
  1201. }
  1202. },
  1203. see: {
  1204. dialogFormVisible: false,
  1205. activeList: [], active: 3,
  1206. temp: {},
  1207. tableKey: 0,
  1208. listLoading: false,
  1209. total: 0,
  1210. list: [],
  1211. getdataListParm: {
  1212. name: 'getcontratListBybigSH',
  1213. returntype: 'Map',
  1214. page: 0,
  1215. offset: 0,
  1216. pagecount: 10,
  1217. parammaps: {}
  1218. }
  1219. },
  1220. examine: {
  1221. dialogFormVisible: false,
  1222. temp: {
  1223. statueSH: 1
  1224. },
  1225. isReason: false
  1226. }
  1227. }
  1228. },
  1229. postDataPramas: {},
  1230. // 开始日期
  1231. // pickerOptions1: {
  1232. // disabledDate: (time) => {
  1233. // if (this.tab1.contractManagement.create.temp.stopTime !== '') {
  1234. // return parseTime(time.getTime(), '{y}-{m}-{d}') > parseTime(Date.now(), '{y}-{m}-{d}') || parseTime(time.getTime(), '{y}-{m}-{d}') >= this.tab1.contractManagement.create.temp.stopTime
  1235. // } else {
  1236. // return time.getTime() > Date.now()
  1237. // }
  1238. // }
  1239. // },
  1240. // 截止日期
  1241. pickerOptions2: {
  1242. disabledDate: (time) => {
  1243. return parseTime(time.getTime(), '{y}-{m}-{d}') <= this.tab1.contractManagement.create.temp.startTime || parseTime(time.getTime(), '{y}-{m}-{d}') < parseTime(Date.now(), '{y}-{m}-{d}')
  1244. }
  1245. },
  1246. pickerOptions3: {
  1247. disabledDate(time) {
  1248. return time.getTime() > Date.now()// 当天之前的时间可选
  1249. }
  1250. },
  1251. // 合同明细
  1252. tab2: {
  1253. tableKey: 0,
  1254. listLoading: false,
  1255. total: 0,
  1256. getdataListParm: {
  1257. name: 'contractDetailV2',
  1258. page: 1,
  1259. offset: 1,
  1260. pagecount: 10,
  1261. returntype: 'Map',
  1262. parammaps: {
  1263. inputDatetime: '',
  1264. providerName: '',
  1265. contractCode: '',
  1266. stopTime: '',
  1267. startTime: '',
  1268. statue: '',
  1269. partCode: '',
  1270. partName: '',
  1271. isZeroStock: '',
  1272. // pastureName: Cookies.get('pasturename')
  1273. pastureName: ''
  1274. }
  1275. },
  1276. list: []
  1277. },
  1278. UpdateDataParam: {},
  1279. UpdateDataParam2: {},
  1280. pending: {
  1281. total: 0,
  1282. getdataListParm: {
  1283. name: 'providerPactListV2', page: 1, offset: 1, getTotal: 'total3', pagecount: 10, returntype: 'Map',
  1284. parammaps: {}
  1285. }
  1286. },
  1287. myHeight:document.documentElement.clientHeight - 85- 250
  1288. }
  1289. },
  1290. computed: {
  1291. // 设置请求头
  1292. headers() {
  1293. return {
  1294. token: getToken()
  1295. }
  1296. },
  1297. uploadData() {
  1298. return {
  1299. name: 'insertcontract_upload',
  1300. importParams: '备件编号,备件名称,规格型号,计量单位,品牌,计划量,单价,备注',
  1301. sheetname: 'SheetJS'
  1302. }
  1303. },
  1304. // 设置上传地址
  1305. uploadExcelUrl() {
  1306. return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
  1307. }
  1308. },
  1309. created() {
  1310. // this.keyupSubmit()
  1311. console.log(this.$route.query.contractCode)
  1312. this.get_select_list()
  1313. const that = this
  1314. GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
  1315. that.buttons = response.data.list
  1316. that.get_auto_buttons()
  1317. })
  1318. this.getTab1List()
  1319. this.getPendingList()
  1320. if (this.$route.query.contractCode == undefined) {
  1321. this.tab1.contractManagement.getdataListParm.parammaps.contractCode = ''
  1322. } else {
  1323. this.tab1.contractManagement.getdataListParm.parammaps.contractCode = this.$route.query.contractCode
  1324. }
  1325. },
  1326. methods: {
  1327. tableSort1(column) {
  1328. sortChange(column, this.tab1.detailsSpareParts.list)
  1329. },
  1330. tableSort2(column) {
  1331. sortChange(column, this.tab2.list)
  1332. },
  1333. get_auto_buttons() {
  1334. // 新增
  1335. const ContractJinyong = 'customs:contract:jinyong'
  1336. const isContractJinyong = checkButtons(this.$store.state.user.buttons, ContractJinyong)
  1337. this.isContractJinyong = isContractJinyong
  1338. // 新增
  1339. const ContractAdd = 'customs:contract:add'
  1340. const isContractAdd = checkButtons(this.$store.state.user.buttons, ContractAdd)
  1341. this.tab1.contractManagement.isContractAdd = isContractAdd
  1342. // 查看
  1343. const ContractSee = 'customs:contract:see'
  1344. const isContractSee = checkButtons(this.$store.state.user.buttons, ContractSee)
  1345. this.tab1.contractManagement.isContractSee = isContractSee
  1346. // 办公室主任
  1347. const ContractExamineZG = 'customs:contract:examineZG'
  1348. const isContractExamineZG = checkButtons(this.$store.state.user.buttons, ContractExamineZG)
  1349. this.tab1.changeRecord.isContractExamineZG = isContractExamineZG
  1350. // 设备中心审核
  1351. const ContractExamineZX = 'customs:contract:examineZX'
  1352. const isContractExamineZX = checkButtons(this.$store.state.user.buttons, ContractExamineZX)
  1353. this.tab1.changeRecord.isContractExamineZX = isContractExamineZX
  1354. // 审核删除
  1355. const ContractDelete = 'customs:contract:delete'
  1356. const isContractDelete = checkButtons(this.$store.state.user.buttons, ContractDelete)
  1357. this.tab1.changeRecord.isContractDelete = isContractDelete
  1358. // 导出
  1359. const ContractExport = 'customs:contract:export'
  1360. const isContractExport = checkButtons(this.$store.state.user.buttons, ContractExport)
  1361. this.tab1.contractManagement.isContractExport = isContractExport
  1362. // 变更
  1363. const ContractChange = 'customs:contract:change'
  1364. const isContractChange = checkButtons(this.$store.state.user.buttons, ContractChange)
  1365. this.tab1.contractManagement.isContractChange = isContractChange
  1366. },
  1367. get_select_list() {
  1368. GetDataByNames(this.requestParams).then(response => {
  1369. this.findAllProvider = response.data.findAllProvider.list
  1370. this.findAllAssetType = response.data.findAllAssetType.list
  1371. this.findAllPasture = response.data.findAllPasture.list
  1372. this.findAllPastureList2 = response.data.findAllPastureForContract.list
  1373. this.findAllDepart = response.data.findAllDepart.list
  1374. this.findAllEmploye = response.data.findAllEmploye.list
  1375. this.findAllCategory = response.data.findAllCategory.list
  1376. })
  1377. },
  1378. handleClick() {
  1379. if (this.tab1.contractManagement.create.temp.activeName == 'first') {
  1380. console.log('点击了合同管理')
  1381. this.getTab1List()
  1382. } else {
  1383. console.log('点击了合同明细')
  1384. this.getTab2List()
  1385. }
  1386. },
  1387. getPendingList() {
  1388. this.pending.getdataListParm.parammaps.loginid = this.tab1.contractManagement.getdataListParm.parammaps.loginid
  1389. this.pending.getdataListParm.parammaps.pastureName = this.tab1.contractManagement.getdataListParm.parammaps.pastureName
  1390. this.pending.getdataListParm.parammaps.contractCode = this.tab1.contractManagement.getdataListParm.parammaps.contractCode
  1391. this.pending.getdataListParm.parammaps.statue = this.tab1.contractManagement.getdataListParm.parammaps.statue
  1392. this.pending.getdataListParm.parammaps.stuteSH = this.tab1.contractManagement.getdataListParm.parammaps.stuteSH
  1393. this.pending.getdataListParm.parammaps.providerName = this.tab1.contractManagement.getdataListParm.parammaps.providerName
  1394. this.pending.getdataListParm.parammaps.tab1InputDatetime1 = this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1
  1395. this.pending.getdataListParm.parammaps.startTime = this.tab1.contractManagement.getdataListParm.parammaps.startTime
  1396. this.pending.getdataListParm.parammaps.stopTime = this.tab1.contractManagement.getdataListParm.parammaps.stopTime
  1397. this.pending.getdataListParm.parammaps.tab1InputDatetime2 = this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime2
  1398. this.pending.getdataListParm.parammaps.SHdateTimeF = this.tab1.contractManagement.getdataListParm.parammaps.SHdateTimeF
  1399. this.pending.getdataListParm.parammaps.SHdateTimeE = this.tab1.contractManagement.getdataListParm.parammaps.SHdateTimeE
  1400. this.pending.getdataListParm.parammaps.SHnums = 0
  1401. GetDataByName(this.pending.getdataListParm).then(response => {
  1402. this.pending.total = response.data.total3
  1403. })
  1404. },
  1405. getTab1List() {
  1406. this.tab1.contractManagement.listLoading = true
  1407. if (this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1 !== '' && this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1 !== null) {
  1408. this.tab1.contractManagement.getdataListParm.parammaps.startTime = this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1[0]
  1409. this.tab1.contractManagement.getdataListParm.parammaps.stopTime = this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1[1]
  1410. } else {
  1411. this.tab1.contractManagement.getdataListParm.parammaps.startTime = ''
  1412. this.tab1.contractManagement.getdataListParm.parammaps.stopTime = ''
  1413. }
  1414. if (this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime2 !== '' && this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime2 !== null) {
  1415. this.tab1.contractManagement.getdataListParm.parammaps.SHdateTimeF = this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime2[0]
  1416. this.tab1.contractManagement.getdataListParm.parammaps.SHdateTimeE = this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime2[1]
  1417. } else {
  1418. this.tab1.contractManagement.getdataListParm.parammaps.SHdateTimeF = ''
  1419. this.tab1.contractManagement.getdataListParm.parammaps.SHdateTimeE = ''
  1420. }
  1421. GetDataByName(this.tab1.contractManagement.getdataListParm).then(response => {
  1422. if (response.data.list !== null) {
  1423. this.tab1.contractManagement.list = response.data.list
  1424. this.tab1.contractManagement.pageNum = response.data.pageNum
  1425. this.tab1.contractManagement.pageSize = response.data.pageSize
  1426. } else {
  1427. this.tab1.contractManagement.list = []
  1428. }
  1429. this.tab1.contractManagement.total = response.data.total
  1430. setTimeout(() => {
  1431. this.tab1.contractManagement.listLoading = false
  1432. }, 300)
  1433. })
  1434. },
  1435. handleTab1Filter() {
  1436. this.tab1.contractManagement.listLoading = true
  1437. if (this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1 == null) {
  1438. this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1 = ''
  1439. }
  1440. if (this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime2 == null) {
  1441. this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime2 = ''
  1442. }
  1443. this.tab1.contractManagement.getdataListParm.offset = 1
  1444. this.getTab1List()
  1445. this.getPendingList()
  1446. if (this.tab1.contractManagement.radioAll == '全部') {
  1447. this.tab1.contractManagement.getdataListParm.parammaps.SHnums = 2
  1448. this.getTab1List()
  1449. } else if (this.tab1.contractManagement.radioAll == '待处理') {
  1450. this.tab1.contractManagement.getdataListParm.parammaps.SHnums = 0
  1451. this.getTab1List()
  1452. } else if (this.tab1.contractManagement.radioAll == '已处理') {
  1453. this.tab1.contractManagement.getdataListParm.parammaps.SHnums = 1
  1454. this.getTab1List()
  1455. }
  1456. },
  1457. changeContractManagementAll() {
  1458. if (this.tab1.contractManagement.radioAll == '全部') {
  1459. this.tab1.contractManagement.getdataListParm.parammaps.SHnums = 2
  1460. } else if (this.tab1.contractManagement.radioAll == '待处理') {
  1461. this.tab1.contractManagement.getdataListParm.parammaps.SHnums = 0
  1462. } else if (this.tab1.contractManagement.radioAll == '已处理') {
  1463. this.tab1.contractManagement.getdataListParm.parammaps.SHnums = 1
  1464. }
  1465. this.tab1.contractManagement.getdataListParm.offset = 1
  1466. this.getTab1List()
  1467. },
  1468. changeTime(val) {
  1469. if (this.tab1.contractManagement.create.temp.stopTime !== '') {
  1470. if (this.tab1.contractManagement.create.temp.stopTime <= this.tab1.contractManagement.create.temp.startTime) {
  1471. this.tab1.contractManagement.create.temp.stopTime = ''
  1472. this.tab1.contractManagement.create.temp.statue = ''
  1473. this.tab1.contractManagement.create.temp.statueId = ''
  1474. } else {
  1475. if (parseTime(new Date(), '{y}-{m}-{d}') <= this.tab1.contractManagement.create.temp.stopTime) {
  1476. this.tab1.contractManagement.create.temp.statue = '1'
  1477. // this.tab1.contractManagement.create.temp.statueId = 1
  1478. } else {
  1479. this.tab1.contractManagement.create.temp.statue = '0'
  1480. // this.tab1.contractManagement.create.temp.statueId = 2
  1481. }
  1482. }
  1483. } else {
  1484. this.tab1.contractManagement.create.temp.statue = ''
  1485. this.tab1.contractManagement.create.temp.statueId = ''
  1486. }
  1487. },
  1488. changeIsZero(val) {
  1489. console.log(val)
  1490. },
  1491. providerSearch(queryString, cb) {
  1492. var returnList = this.findAllProvider
  1493. var results = queryString ? returnList.filter(this.createFilter(queryString)) : returnList
  1494. // 调用 callback 返回建议列表的数据
  1495. cb(results)
  1496. },
  1497. createFilter(queryString) {
  1498. return returnValue => {
  1499. return (
  1500. returnValue.name.toLowerCase().indexOf(queryString.toLowerCase()) >= 0
  1501. )
  1502. }
  1503. },
  1504. handleSelectProvider(item) {
  1505. this.$set(this.tab1.contractManagement.create.temp, 'providerId', item.id)
  1506. this.$set(this.tab1.contractManagement.create.temp, 'providerName', item.name)
  1507. },
  1508. handleFocusProvider() {
  1509. this.tab1.contractManagement.create.temp.providerId = ''
  1510. this.tab1.contractManagement.create.temp.providerName = ''
  1511. },
  1512. handleBlurProvider() {
  1513. if (this.tab1.contractManagement.create.temp.providerId == '') {
  1514. this.tab1.contractManagement.create.temp.providerId = ''
  1515. this.tab1.contractManagement.create.temp.providerName = ''
  1516. }
  1517. },
  1518. changeCreatorMan(val) {
  1519. this.tab1.contractManagement.create.temp.creatorMan = this.findAllEmploye.find(obj => obj.id == val).name
  1520. },
  1521. resetCreateTemp() {
  1522. this.tab1.contractManagement.create.temp.synchronousPastureList = []
  1523. if (Cookies.get('pastureid') == 18) {
  1524. for (let i = 0; i < this.findAllPasture.length; i++) {
  1525. this.tab1.contractManagement.create.temp.synchronousPastureList.push(this.findAllPasture[i].id)
  1526. }
  1527. } else {
  1528. this.tab1.contractManagement.create.temp.synchronousPastureList.push(parseInt(Cookies.get('pastureid')))
  1529. }
  1530. this.tab1.contractManagement.create.temp = { contractCode: '', pastureId: parseFloat(Cookies.get('pastureid')), providerName: '', startTime: '', stopTime: '', statue: '', isZeroStock: 0, creatorId: parseFloat(Cookies.get('employeid')), creatorMan: Cookies.get('employename'), creatorTime: parseTime(new Date(), '{y}-{m}-{d}'), synchronousPasture: this.tab1.contractManagement.create.temp.synchronousPastureList, synchronousPasture2: [] }
  1531. },
  1532. handleTab1Create() {
  1533. this.resetCreateTemp()
  1534. this.dialogStatus = 'create'
  1535. this.tab1.contractManagement.create.dialogFormVisible = true
  1536. this.getCreateNumber()
  1537. },
  1538. getCreateNumber() {
  1539. GetDataByName(this.tab1.contractManagement.getParmCreateNumber).then(response => {
  1540. this.$nextTick(() => {
  1541. console.log('合同编号', response.data.list[0].orderCode)
  1542. this.tab1.contractManagement.create.temp.contractCode = response.data.list[0].orderCode
  1543. this.$forceUpdate()
  1544. })
  1545. })
  1546. },
  1547. add_dialog_save() {
  1548. console.log('点击了新增保存')
  1549. this.isokDisable = true
  1550. setTimeout(() => {
  1551. this.isokDisable = false
  1552. }, 1000)
  1553. this.$refs['createTemp'].validate(valid => {
  1554. if (valid) {
  1555. if (this.tab1.contractManagement.create.temp.contractCode == '') {
  1556. GetDataByName(this.getParmCreateNumber).then(response => {
  1557. this.$nextTick(() => {
  1558. this.tab1.contractManagement.create.temp.contractCode = response.data.list[0].orderCode
  1559. this.$forceUpdate()
  1560. this.saveCreateData()
  1561. })
  1562. })
  1563. } else {
  1564. this.saveCreateData()
  1565. }
  1566. }
  1567. })
  1568. },
  1569. saveCreateData() {
  1570. this.postDataPramas = {}
  1571. if (Cookies.get('pastureid') == 18) {
  1572. if (this.tab1.contractManagement.create.temp.synchronousPasture.indexOf(18) == -1) {
  1573. this.$message({ type: 'error', message: '当前合同归属于现代牧业,未选中,共享牧场请选中现代牧业!', duration: 2000 })
  1574. return false
  1575. }
  1576. }
  1577. this.postDataPramas.common = { 'returnmap': '0' }
  1578. this.postDataPramas.data = []
  1579. this.postDataPramas.data[0] = { 'name': 'checkbigcontract', 'type': 'v', 'parammaps': {
  1580. pastureId: this.tab1.contractManagement.create.temp.pastureId,
  1581. providerId: this.tab1.contractManagement.create.temp.providerId
  1582. }}
  1583. this.postDataPramas.data[1] = { 'name': 'insertBigContractV2', 'type': 'e', 'parammaps': {
  1584. pastureId: this.tab1.contractManagement.create.temp.pastureId,
  1585. providerId: this.tab1.contractManagement.create.temp.providerId,
  1586. providerName: this.tab1.contractManagement.create.temp.providerName,
  1587. startTime: this.tab1.contractManagement.create.temp.startTime,
  1588. stopTime: this.tab1.contractManagement.create.temp.stopTime,
  1589. contractCode: this.tab1.contractManagement.create.temp.contractCode,
  1590. creatorId: this.tab1.contractManagement.create.temp.creatorId,
  1591. creatorMan: this.tab1.contractManagement.create.temp.creatorMan,
  1592. creatorTime: this.tab1.contractManagement.create.temp.creatorTime,
  1593. isZeroStock: this.tab1.contractManagement.create.temp.isZeroStock,
  1594. statue: 1,
  1595. remark: this.tab1.contractManagement.create.temp.remark,
  1596. SHtype: 0
  1597. }}
  1598. var groupRanchList = []
  1599. for (let i = 0; i < this.tab1.contractManagement.create.temp.synchronousPasture.length; i++) {
  1600. var obj = {}
  1601. obj.pastureId = this.tab1.contractManagement.create.temp.synchronousPasture[i]
  1602. groupRanchList.push(obj)
  1603. }
  1604. if (Cookies.get('pastureid') == 18) {
  1605. this.postDataPramas.data[2] = { 'name': 'insertSpotList', 'resultmaps': { 'list': groupRanchList }}
  1606. this.postDataPramas.data[2].children = []
  1607. this.postDataPramas.data[2].children[0] = { 'name': 'insertPastureBigcontract', 'type': 'e', 'parammaps': {
  1608. bigcontractId: '@insertBigContractV2.LastInsertId',
  1609. pastureId: '@insertSpotList.pastureId'
  1610. }}
  1611. }
  1612. ExecDataByConfig(this.postDataPramas).then(response => {
  1613. console.log('新增保存发送参数', this.postDataPramas)
  1614. if (response.msg == 'fail') {
  1615. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1616. } else {
  1617. this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1 = ''
  1618. this.getTab1List()
  1619. this.getPendingList()
  1620. this.tab1.contractManagement.create.dialogFormVisible = false
  1621. this.tab1.contractManagement.create.temp.providerName = ''
  1622. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  1623. }
  1624. })
  1625. },
  1626. form_see(row) {
  1627. console.log('查看', row)
  1628. row.statue = String(row.statue)
  1629. row.synchronousPasture2 = []
  1630. row.synchronousPastureName2 = []
  1631. row.synchronousPasture = []
  1632. this.tab1.contractManagement.create.temp = Object.assign({}, row)
  1633. this.dialogStatus = 'see'
  1634. this.tab1.contractManagement.create.dialogFormVisible = true
  1635. var reason = '未通过原因:' + this.tab1.contractManagement.create.temp.workflowNote
  1636. if (this.tab1.contractManagement.create.temp.SHStatus == 2) {
  1637. this.tab1.contractManagement.create.temp.activeList = [{ title: '合同录入', date: this.tab1.contractManagement.create.temp.creatorTime, name: this.tab1.contractManagement.create.temp.creatorMan }, { title: '供应主管审核' }, { title: '设备中心审核' }]
  1638. this.tab1.contractManagement.create.temp.active = 1
  1639. } else if (this.tab1.contractManagement.create.temp.SHStatus == 3) {
  1640. this.tab1.contractManagement.create.temp.activeList = [{ title: '合同录入', date: this.tab1.contractManagement.create.temp.creatorTime, name: this.tab1.contractManagement.create.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.contractManagement.create.temp.chargeDate, name: this.tab1.contractManagement.create.temp.chargePerson }, { title: '设备中心审核' }]
  1641. this.tab1.contractManagement.create.temp.active = 2
  1642. } else if (this.tab1.contractManagement.create.temp.SHStatus == 4) {
  1643. this.tab1.contractManagement.create.temp.activeList = [{ title: '合同录入', date: this.tab1.contractManagement.create.temp.creatorTime, name: this.tab1.contractManagement.create.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.contractManagement.create.temp.chargeDate, name: this.tab1.contractManagement.create.temp.chargePerson, status: 'error', reason: reason }, { title: '设备中心审核' }]
  1644. this.tab1.contractManagement.create.temp.active = 2
  1645. } else if (this.tab1.contractManagement.create.temp.SHStatus == 5) {
  1646. this.tab1.contractManagement.create.temp.activeList = [{ title: '合同录入', date: this.tab1.contractManagement.create.temp.creatorTime, name: this.tab1.contractManagement.create.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.contractManagement.create.temp.chargeDate, name: this.tab1.contractManagement.create.temp.chargePerson }, { title: '设备中心审核' }]
  1647. this.tab1.contractManagement.create.temp.active = 2
  1648. } else if (this.tab1.contractManagement.create.temp.SHStatus == 6) {
  1649. this.tab1.contractManagement.create.temp.activeList = [{ title: '合同录入', date: this.tab1.contractManagement.create.temp.creatorTime, name: this.tab1.contractManagement.create.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.contractManagement.create.temp.chargeDate, name: this.tab1.contractManagement.create.temp.chargePerson }, { title: '设备中心审核' }]
  1650. this.tab1.contractManagement.create.temp.active = 3
  1651. } else if (this.tab1.contractManagement.create.temp.SHStatus == 7) {
  1652. this.tab1.contractManagement.create.temp.activeList = [{ title: '合同录入', date: this.tab1.contractManagement.create.temp.creatorTime, name: this.tab1.contractManagement.create.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.contractManagement.create.temp.chargeDate, name: this.tab1.contractManagement.create.temp.chargePerson }, { title: '设备中心审核', date: this.tab1.contractManagement.create.temp.CGChargedate, name: this.tab1.contractManagement.create.temp.CGChargePerson }]
  1653. this.tab1.contractManagement.create.temp.active = 4
  1654. } else if (this.tab1.contractManagement.create.temp.SHStatus == 8) {
  1655. this.tab1.contractManagement.create.temp.activeList = [{ title: '合同录入', date: this.tab1.contractManagement.create.temp.creatorTime, name: this.tab1.contractManagement.create.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.contractManagement.create.temp.chargeDate, name: this.tab1.contractManagement.create.temp.chargePerson }, { title: '设备中心审核', date: this.tab1.contractManagement.create.temp.CGChargedate, name: this.tab1.contractManagement.create.temp.CGChargePerson, status: 'error', reason: reason }]
  1656. this.tab1.contractManagement.create.temp.active = 4
  1657. }
  1658. this.tab1.contractManagement.create.changeEchoParm.parammaps.bigcontract_id = row.id
  1659. GetDataByName(this.tab1.contractManagement.create.changeEchoParm).then(response => {
  1660. if (response.data.list !== null) {
  1661. for (let i = 0; i < response.data.list.length; i++) {
  1662. this.tab1.contractManagement.create.temp.synchronousPasture2.push(response.data.list[i].pasture_id)
  1663. this.tab1.contractManagement.create.temp.synchronousPasture.push(response.data.list[i].pasture_id)
  1664. this.tab1.contractManagement.create.temp.synchronousPastureName2.push(this.findAllPasture.find(obj => obj.id == response.data.list[i].pasture_id).name)
  1665. }
  1666. } else {
  1667. this.tab1.contractManagement.create.temp.synchronousPasture = []
  1668. }
  1669. console.log(this.tab1.contractManagement.create.temp.synchronousPastureName2, 'synchronousPastureName2')
  1670. })
  1671. },
  1672. handleTab1Change(row) {
  1673. console.log('变更', row)
  1674. // row.statue = String(row.statue)
  1675. this.$set(row, 'mystopTime', row.stopTime)
  1676. row.synchronousPasture2 = []
  1677. row.synchronousPastureName2 = []
  1678. row.synchronousPasture = []
  1679. this.tab1.contractManagement.create.temp = Object.assign({}, row)
  1680. this.tab1.contractManagement.create.temp.statue = String(this.tab1.contractManagement.create.temp.statue)
  1681. this.dialogStatus = 'change'
  1682. this.tab1.contractManagement.create.dialogFormVisible = true
  1683. this.tab1.contractManagement.create.changeEchoParm.parammaps.bigcontract_id = row.id
  1684. GetDataByName(this.tab1.contractManagement.create.changeEchoParm).then(response => {
  1685. if (response.data.list !== null) {
  1686. for (let i = 0; i < response.data.list.length; i++) {
  1687. this.tab1.contractManagement.create.temp.synchronousPasture2.push(response.data.list[i].pasture_id)
  1688. this.tab1.contractManagement.create.temp.synchronousPasture.push(response.data.list[i].pasture_id)
  1689. this.tab1.contractManagement.create.temp.synchronousPastureName2.push(this.findAllPasture.find(obj => obj.id == response.data.list[i].pasture_id).name)
  1690. }
  1691. } else {
  1692. this.tab1.contractManagement.create.temp.synchronousPasture = []
  1693. }
  1694. console.log(this.tab1.contractManagement.create.temp.synchronousPastureName2, 'synchronousPastureName2')
  1695. })
  1696. },
  1697. terminationData() {
  1698. var aa = '确认终止合同?'
  1699. if (this.tab1.contractManagement.create.temp.isZeroStock == 1) {
  1700. aa = '若此合同库存中有剩余库存,建议先进行退货操作。'
  1701. } else {
  1702. aa = '确认终止合同?'
  1703. }
  1704. MessageBox.confirm(aa, { confirmButtonText: '确认终止', cancelButtonText: '取消', type: 'warning'
  1705. }).then(() => {
  1706. this.postDataPramas = {}
  1707. this.postDataPramas.name = 'updatecontractstatuV2'
  1708. this.postDataPramas.parammaps = {}
  1709. this.postDataPramas.parammaps = this.tab1.contractManagement.create.temp
  1710. this.postDataPramas.parammaps.creatorId = Cookies.get('employeid')
  1711. this.postDataPramas.parammaps.creatorMan = Cookies.get('employename')
  1712. this.postDataPramas.parammaps.creatorTime = parseTime(new Date(), '{y}-{m}-{d}')
  1713. PostDataByName(this.postDataPramas).then(response => {
  1714. console.log('变更保存发送参数', this.postDataPramas)
  1715. if (response.msg == 'fail') {
  1716. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1717. } else {
  1718. this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1 = ''
  1719. this.getTab1List()
  1720. this.getPendingList()
  1721. this.tab1.contractManagement.create.dialogFormVisible = false
  1722. this.tab1.contractManagement.create.temp.providerName = ''
  1723. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  1724. }
  1725. })
  1726. })
  1727. },
  1728. changeData() {
  1729. if (Cookies.get('pastureid') == 18) {
  1730. this.UpdateDataParam = {}
  1731. this.UpdateDataParam.name = 'pasture_bigcontract'
  1732. this.UpdateDataParam.dataname = 'bigcontract_id'
  1733. this.UpdateDataParam.datavalue = this.tab1.contractManagement.create.temp.id
  1734. this.UpdateDataParam.valuename = 'pasture_id'
  1735. this.UpdateDataParam.values = this.tab1.contractManagement.create.temp.synchronousPasture
  1736. UpdateDataRelation(this.UpdateDataParam).then(response => {
  1737. if (response.msg !== 'fail') {
  1738. this.UpdateDataParam2.name = 'updateBigcontractPId'
  1739. this.UpdateDataParam2.parammaps = {}
  1740. this.UpdateDataParam2.parammaps.bigcontract_id = this.tab1.contractManagement.create.temp.id
  1741. this.UpdateDataParam2.parammaps.enable = 0
  1742. PostDataByName(this.UpdateDataParam2).then(response => {})
  1743. }
  1744. })
  1745. }
  1746. this.postDataPramas = {}
  1747. this.postDataPramas.common = { 'returnmap': '0' }
  1748. this.postDataPramas.data = []
  1749. this.postDataPramas.data[0] = { 'name': 'checkbigcontractSH', 'type': 'v', 'parammaps': {
  1750. pastureId: this.tab1.contractManagement.create.temp.pastureId,
  1751. providerId: this.tab1.contractManagement.create.temp.providerId,
  1752. stopTime: this.tab1.contractManagement.create.temp.mystopTime,
  1753. flag: this.tab1.contractManagement.create.temp.flag,
  1754. isZeroStock: this.tab1.contractManagement.create.temp.isZeroStock,
  1755. statue: this.tab1.contractManagement.create.temp.statue
  1756. }}
  1757. if (Cookies.get('pastureid') == 18) {
  1758. var synchronousPastureName = []
  1759. for (let i = 0; i < this.tab1.contractManagement.create.temp.synchronousPasture.length; i++) {
  1760. synchronousPastureName.push(this.findAllPasture.find(obj => obj.id == this.tab1.contractManagement.create.temp.synchronousPasture[i]).name)
  1761. }
  1762. this.postDataPramas.data[1] = { 'name': 'insertBigContractV2', 'type': 'e', 'parammaps': {
  1763. pastureId: this.tab1.contractManagement.create.temp.pastureId,
  1764. providerId: this.tab1.contractManagement.create.temp.providerId,
  1765. providerName: this.tab1.contractManagement.create.temp.providerName,
  1766. startTime: this.tab1.contractManagement.create.temp.startTime,
  1767. stopTime: this.tab1.contractManagement.create.temp.mystopTime,
  1768. stopTime1: this.tab1.contractManagement.create.temp.stopTime,
  1769. contractCode: '',
  1770. contractCode1: this.tab1.contractManagement.create.temp.contractCode,
  1771. creatorId: this.tab1.contractManagement.create.temp.creatorId,
  1772. creatorMan: this.tab1.contractManagement.create.temp.creatorMan,
  1773. creatorTime: this.tab1.contractManagement.create.temp.creatorTime,
  1774. isZeroStock: this.tab1.contractManagement.create.temp.isZeroStock,
  1775. statue: this.tab1.contractManagement.create.temp.statue,
  1776. remark: this.tab1.contractManagement.create.temp.remark,
  1777. flag: this.tab1.contractManagement.create.temp.flag,
  1778. SHtype: 3,
  1779. pastureNamesOld: this.tab1.contractManagement.create.temp.synchronousPastureName2.toString(),
  1780. pastureNamesNow: synchronousPastureName.toString()
  1781. }}
  1782. } else {
  1783. this.postDataPramas.data[1] = { 'name': 'insertBigContractV2', 'type': 'e', 'parammaps': {
  1784. pastureId: this.tab1.contractManagement.create.temp.pastureId,
  1785. providerId: this.tab1.contractManagement.create.temp.providerId,
  1786. providerName: this.tab1.contractManagement.create.temp.providerName,
  1787. startTime: this.tab1.contractManagement.create.temp.startTime,
  1788. stopTime: this.tab1.contractManagement.create.temp.mystopTime,
  1789. stopTime1: this.tab1.contractManagement.create.temp.stopTime,
  1790. contractCode: '',
  1791. contractCode1: this.tab1.contractManagement.create.temp.contractCode,
  1792. creatorId: this.tab1.contractManagement.create.temp.creatorId,
  1793. creatorMan: this.tab1.contractManagement.create.temp.creatorMan,
  1794. creatorTime: this.tab1.contractManagement.create.temp.creatorTime,
  1795. isZeroStock: this.tab1.contractManagement.create.temp.isZeroStock,
  1796. statue: this.tab1.contractManagement.create.temp.statue,
  1797. remark: this.tab1.contractManagement.create.temp.remark,
  1798. flag: this.tab1.contractManagement.create.temp.flag,
  1799. SHtype: 3
  1800. }}
  1801. }
  1802. ExecDataByConfig(this.postDataPramas).then(response => {
  1803. console.log('变更保存发送参数', this.postDataPramas)
  1804. if (response.msg == 'fail') {
  1805. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1806. } else {
  1807. this.getTab1List()
  1808. this.getPendingList()
  1809. this.tab1.contractManagement.create.dialogFormVisible = false
  1810. this.tab1.contractManagement.create.temp.providerName = ''
  1811. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  1812. }
  1813. })
  1814. },
  1815. // 备件明细
  1816. handleTab1DetailsSpareParts(row) {
  1817. console.log('备件明细', row)
  1818. this.contractCodese = row.contractCode
  1819. this.tab1.detailsSpareParts.updateList = Object.assign({}, row)
  1820. this.tab1.detailsSpareParts.detailsList = Object.assign({}, row)
  1821. this.isContractManagement = false
  1822. this.isDetailsSpareParts = true
  1823. this.tab1.detailsSpareParts.getdataListParm.parammaps.pastureId = row.pastureId
  1824. this.tab1.detailsSpareParts.getdataListParm.parammaps.providerId = row.providerId
  1825. this.tab1.detailsSpareParts.getdataListParm.parammaps.stopTime = row.stopTime
  1826. this.tab1.detailsSpareParts.getdataListParm.parammaps.flag = row.flag
  1827. this.tab1.detailsSpareParts.getdataListParm.parammaps.isZeroStock = row.isZeroStock
  1828. this.tab1.detailsSpareParts.getdataListParm.parammaps.statue = row.statue
  1829. this.tab1.detailsSpareParts.getdataListParm.parammaps.partCode = ''
  1830. this.tab1.detailsSpareParts.getdataListParm.parammaps.partName = ''
  1831. this.tab1.detailsSpareParts.getdataListParm.parammaps.specification = ''
  1832. this.getTab1List2()
  1833. },
  1834. handleTab1goBack() {
  1835. // this.reload()
  1836. this.isContractManagement = true
  1837. this.isDetailsSpareParts = false
  1838. this.tab1.detailsSpareParts.total = 0
  1839. this.getTab1List()
  1840. },
  1841. change_enabled(){
  1842. },
  1843. change_no(){
  1844. console.log("selectList",this.selectList)
  1845. var send_data = {
  1846. "common": {
  1847. "returnmap": "0"
  1848. },
  1849. "data": [
  1850. {
  1851. "name": "insertSpotList",
  1852. "resultmaps": {
  1853. "list": this.selectList
  1854. },
  1855. "children": [
  1856. {
  1857. "name": "updateContractEnableById",
  1858. "type": "e",
  1859. "parammaps": {
  1860. "id": "@insertSpotList.id"
  1861. }
  1862. }
  1863. ]
  1864. },{
  1865. "name": "updateBigcontractIsToSap",
  1866. "type": "e",
  1867. "parammaps": {
  1868. "contractCode": this.contractCodese
  1869. }
  1870. }
  1871. ]
  1872. }
  1873. ExecDataByConfig(send_data).then(response => {
  1874. console.log('发送参数', send_data)
  1875. if (response.msg === 'fail') {
  1876. this.$notify({
  1877. title: '禁用失败',
  1878. message: response.data,
  1879. type: 'warning',
  1880. duration: 2000
  1881. })
  1882. } else {
  1883. this.getTab1List2()
  1884. this.$notify({
  1885. title: '',
  1886. message: '禁用成功',
  1887. type: 'success',
  1888. duration: 2000
  1889. })
  1890. }
  1891. })
  1892. },
  1893. handleSelectionChange(val) {
  1894. // this.create.temp.rowsNumber = []
  1895. // for(let i=0;i<val.length;i++){
  1896. // this.create.temp.rowsNumber.push(val[i].rowNumber)
  1897. // }
  1898. console.log(val)
  1899. this.selectList = val
  1900. },
  1901. getTab1List2() {
  1902. this.tab1.detailsSpareParts.listLoading = true
  1903. GetDataByName(this.tab1.detailsSpareParts.getdataListParm).then(response => {
  1904. if (response.data.list !== null) {
  1905. for (let i = 0; i < response.data.list.length; i++) {
  1906. if (response.data.list[i].srcpath !== null && response.data.list[i].picpath !== null && response.data.list[i].srcpath !== undefined && response.data.list[i].picpath !== undefined) {
  1907. const srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  1908. const picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  1909. response.data.list[i].srcpath = srcpath
  1910. response.data.list[i].picpath = picpath
  1911. } else {
  1912. response.data.list[i].srcpath = ''
  1913. response.data.list[i].picpath = ''
  1914. }
  1915. }
  1916. this.tab1.detailsSpareParts.list = response.data.list
  1917. this.tab1.detailsSpareParts.pageNum = response.data.pageNum
  1918. this.tab1.detailsSpareParts.pageSize = response.data.pageSize
  1919. if (response.data.list !== null) {
  1920. this.tab1.detailsSpareParts.total = response.data.total
  1921. } else {
  1922. this.tab1.detailsSpareParts.total = 0
  1923. }
  1924. } else {
  1925. this.tab1.detailsSpareParts.list = []
  1926. }
  1927. setTimeout(() => {
  1928. this.tab1.detailsSpareParts.listLoading = false
  1929. }, 300)
  1930. })
  1931. },
  1932. handleTab1Filter2() {
  1933. this.tab1.detailsSpareParts.listLoading = true
  1934. this.tab1.detailsSpareParts.getdataListParm.offset = 1
  1935. this.getTab1List2()
  1936. },
  1937. sparePartSearch(queryString, cb) {
  1938. this.tab1.detailsSpareParts.requestSparePart.parammaps['partCode'] = queryString
  1939. GetDataByName(this.tab1.detailsSpareParts.requestSparePart).then(response => {
  1940. if (response.data.list == null) {
  1941. cb([])
  1942. } else {
  1943. cb(response.data.list)
  1944. }
  1945. })
  1946. },
  1947. handleSelectSparePart(item) {
  1948. console.log('备件模糊查询选中值', item)
  1949. if (this.tab1.detailsSpareParts.listAdd.length > 0) {
  1950. if (this.tab1.detailsSpareParts.listAdd.find(obj => obj.partCode == item.partCode)) {
  1951. this.$message({ type: 'warning', message: '此备件已存在,请重新选择备件' })
  1952. } else {
  1953. if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  1954. this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  1955. this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  1956. } else {
  1957. item.srcpath = ''
  1958. item.picpath = ''
  1959. }
  1960. this.$set(item, 'myid', new Date().getTime())
  1961. this.$set(item, 'taxcode', '')
  1962. this.tab1.detailsSpareParts.listAdd.unshift(item)
  1963. }
  1964. } else {
  1965. if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  1966. this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  1967. this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  1968. } else {
  1969. item.srcpath = ''
  1970. item.picpath = ''
  1971. }
  1972. this.$set(item, 'myid', new Date().getTime())
  1973. this.tab1.detailsSpareParts.listAdd.unshift(item)
  1974. }
  1975. },
  1976. brandSearch(queryString, cb) {
  1977. this.tab1.detailsSpareParts.requestBrand.parammaps['brandName'] = queryString
  1978. GetDataByName(this.tab1.detailsSpareParts.requestBrand).then(response => {
  1979. this.tab1.detailsSpareParts.BrandList = response.data.list
  1980. cb(this.tab1.detailsSpareParts.BrandList)
  1981. })
  1982. },
  1983. handleSelectBrand(item, row) {
  1984. this.$set(row, 'brandName', item.brandName)
  1985. this.$set(row, 'brandId', item.brandId)
  1986. this.$forceUpdate()
  1987. },
  1988. handleFocusBrand(row) {
  1989. this.$set(row, 'brandName', '')
  1990. this.$set(row, 'brandId', '')
  1991. },
  1992. handleBlurBrand(row) {
  1993. if (row.brandId == '') {
  1994. this.$set(row, 'brand', '')
  1995. this.$set(row, 'brandName', '')
  1996. this.$set(row, 'brandId', '')
  1997. }
  1998. },
  1999. partDelete(row) {
  2000. console.log('备件明细-备件删除', row)
  2001. MessageBox.confirm('设备名称:' + row.partName, '确认删除?', { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  2002. }).then(() => {
  2003. for (var i = 0; i < this.tab1.detailsSpareParts.listAdd.length; i++) {
  2004. console.log(this.tab1.detailsSpareParts.listAdd[i])
  2005. if (this.tab1.detailsSpareParts.listAdd[i].myid === row.myid) {
  2006. var listAddIndex = this.tab1.detailsSpareParts.listAdd.indexOf(this.tab1.detailsSpareParts.listAdd[i])
  2007. }
  2008. if (listAddIndex > -1) {
  2009. this.tab1.detailsSpareParts.listAdd.splice(listAddIndex, 1)
  2010. return
  2011. }
  2012. }
  2013. })
  2014. },
  2015. handleTab1DownloadTemp2() {
  2016. console.log('备件明细-备件模板')
  2017. import('@/vendor/Export2Excel').then(excel => {
  2018. const list1 = []
  2019. const tHeader = ['备件编号', '备件名称', '规格型号', '计量单位', '品牌', '计划量', '单价', '备注']
  2020. const filterVal = ['备件编号', '备件名称', '规格型号', '计量单位', '品牌', '计划量', '单价', '备注']
  2021. const data1 = this.formatJsonTemp(filterVal, list1)
  2022. excel.export_json_to_excel({ header: tHeader, data: data1, filename: '备件明细模板', autoWidth: true, bookType: 'xlsx' })
  2023. })
  2024. },
  2025. formatJsonTemp(filterVal, jsonData) {
  2026. return jsonData.map(v =>
  2027. filterVal.map(j => {
  2028. if (j === 'timestamp') {
  2029. return parseTime(v[j])
  2030. } else {
  2031. return v[j]
  2032. }
  2033. })
  2034. )
  2035. },
  2036. beforeImportExcel(file) {
  2037. const isLt2M = file.size / 1024 / 1024 < 6
  2038. if (!isLt2M) {
  2039. this.$message.error('上传文件大小不能超过 6MB!')
  2040. }
  2041. return isLt2M
  2042. },
  2043. handleImportExcelSuccess(res, file) {
  2044. console.log(res)
  2045. if (res.msg == 'ok') {
  2046. this.$message({ title: '成功', message: '导入成功:' + res.data.success + '条!', type: 'success', duration: 2000 })
  2047. if (res.data.err_count > 0) {
  2048. this.$notify({ title: '失败', message: '导入失败:' + res.data.err_count + '条!', type: 'danger', duration: 2000 })
  2049. import('@/vendor/Export2Excel').then(excel => {
  2050. const list1 = res.data.result
  2051. const tHeader = ['备件编号', '备件名称', '规格型号', '计量单位', '品牌', '计划量', '单价', '备注', '报错信息']
  2052. const filterVal = ['备件编号', '备件名称', '规格型号', '计量单位', '品牌', '计划量', '单价', '备注', 'error_msg']
  2053. const data1 = this.formatJson(filterVal, list1)
  2054. excel.export_json_to_excel({ header: tHeader, data: data1, filename: '合同报错信息', autoWidth: true, bookType: 'xlsx' })
  2055. })
  2056. }
  2057. this.getImportExcelList()
  2058. } else {
  2059. this.$notify({ title: '失败', message: '上传失败,文件格式错误', type: 'danger', duration: 2000 })
  2060. }
  2061. },
  2062. formatJson(filterVal, jsonData) {
  2063. return jsonData.map(v =>
  2064. filterVal.map(j => {
  2065. if (j == 'timestamp') {
  2066. return parseTime(v[j])
  2067. } else {
  2068. return v[j]
  2069. }
  2070. })
  2071. )
  2072. },
  2073. getClearImportExcelList() {
  2074. PostDataByName(this.tab1.detailsSpareParts.clearImportExcelParm).then(response => {
  2075. console.log(response.msg)
  2076. if (response.msg == 'ok') {
  2077. this.tab1.detailsSpareParts.isDisabledImport = false
  2078. }
  2079. })
  2080. },
  2081. getImportExcelList() {
  2082. GetDataByName(this.tab1.detailsSpareParts.importExcelParm).then(response => {
  2083. if (response.data.list !== null) {
  2084. for (let i = 0; i < response.data.list.length; i++) {
  2085. if (response.data.list[i].picpath == undefined) {
  2086. response.data.list[i].picpath = ''
  2087. response.data.list[i].srcpath = ''
  2088. } else {
  2089. this.$set(response.data.list[i], 'srcpath', process.env.VUE_APP_BASE_API + response.data.list[i].srcpath)
  2090. this.$set(response.data.list[i], 'picpath', process.env.VUE_APP_BASE_API + response.data.list[i].picpath)
  2091. }
  2092. response.data.list[i].myid = new Date().getTime() + i
  2093. }
  2094. this.tab1.detailsSpareParts.listAdd = response.data.list
  2095. } else {
  2096. this.tab1.detailsSpareParts.list = []
  2097. }
  2098. })
  2099. },
  2100. handleTab1Create2() {
  2101. console.log('备件明细-新增/变更')
  2102. this.dialogStatus = 'tab1create2'
  2103. this.tab1.detailsSpareParts.create.dialogFormVisible = true
  2104. this.tab1.detailsSpareParts.listAdd = []
  2105. this.tab1.detailsSpareParts.partCode = ''
  2106. this.tab1.detailsSpareParts.requestSparePart.name = 'getcontratListBybigALLParts'
  2107. this.tab1.detailsSpareParts.requestSparePart.parammaps = {}
  2108. this.getClearImportExcelList()
  2109. },
  2110. add_dialog_save2() {
  2111. console.log('备件明细-新增保存')
  2112. if (this.tab1.detailsSpareParts.listAdd.length !== 0) {
  2113. for (let i = 0; i < this.tab1.detailsSpareParts.listAdd.length; i++) {
  2114. if (this.tab1.detailsSpareParts.listAdd[i].planAmount == null || this.tab1.detailsSpareParts.listAdd[i].brand == null || this.tab1.detailsSpareParts.listAdd[i].price == null || this.tab1.detailsSpareParts.listAdd[i].planAmount == '' || this.tab1.detailsSpareParts.listAdd[i].brand === '' || this.tab1.detailsSpareParts.listAdd[i].brandId === '' || this.tab1.detailsSpareParts.listAdd[i].price == '' || this.tab1.detailsSpareParts.listAdd[i].brand == undefined || this.tab1.detailsSpareParts.listAdd[i].brandId == undefined) {
  2115. this.$message({ type: 'warning', message: '请检查备件品牌或计划量或单价是否为空', duration: 2000 })
  2116. return false
  2117. } else {
  2118. var rulesPlanAmount = /^[1-9]\d*$/
  2119. if (!rulesPlanAmount.test(parseFloat(this.tab1.detailsSpareParts.listAdd[i].planAmount))) {
  2120. this.$message({ type: 'error', message: '计划量请输入正整数', duration: 2000 })
  2121. return false
  2122. }
  2123. var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/
  2124. if (rulesPrice.test(this.tab1.detailsSpareParts.listAdd[i].price) == false) {
  2125. this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后两位', duration: 2000 })
  2126. return false
  2127. }
  2128. }
  2129. }
  2130. this.postDataPramas = {}
  2131. this.postDataPramas.common = { 'returnmap': '0' }
  2132. this.postDataPramas.data = []
  2133. this.postDataPramas.data[0] = { 'name': 'insertBigContractV2', 'type': 'e', 'parammaps': {
  2134. pastureId: this.tab1.detailsSpareParts.detailsList.pastureId,
  2135. flag: this.tab1.detailsSpareParts.detailsList.flag,
  2136. providerId: this.tab1.detailsSpareParts.detailsList.providerId,
  2137. providerName: this.tab1.detailsSpareParts.detailsList.providerName,
  2138. startTime: this.tab1.detailsSpareParts.detailsList.startTime,
  2139. stopTime: this.tab1.detailsSpareParts.detailsList.stopTime,
  2140. contractCode: '',
  2141. contractCode1: this.tab1.detailsSpareParts.detailsList.contractCode,
  2142. creatorId: Cookies.get('employeid'),
  2143. creatorMan: Cookies.get('employename'),
  2144. creatorTime: parseTime(new Date(), '{y}-{m}-{d}'),
  2145. isZeroStock: this.tab1.detailsSpareParts.detailsList.isZeroStock,
  2146. statue: this.tab1.detailsSpareParts.detailsList.statue,
  2147. remark: this.tab1.detailsSpareParts.detailsList.remark,
  2148. SHtype: 1
  2149. }}
  2150. this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.tab1.detailsSpareParts.listAdd }}
  2151. this.postDataPramas.data[1].children = []
  2152. this.postDataPramas.data[1].children[0] = { 'name': 'checkcontracPartCode', 'type': 'v', 'parammaps': {
  2153. pastureId: this.tab1.detailsSpareParts.detailsList.pastureId,
  2154. providerId: this.tab1.detailsSpareParts.detailsList.providerId,
  2155. stopTime: this.tab1.detailsSpareParts.detailsList.stopTime,
  2156. flag: this.tab1.detailsSpareParts.detailsList.flag,
  2157. isZeroStock: this.tab1.detailsSpareParts.detailsList.isZeroStock,
  2158. statue: this.tab1.detailsSpareParts.detailsList.statue,
  2159. partCode: '@insertSpotList.partCode',
  2160. brandId: '@insertSpotList.brandId'
  2161. }}
  2162. this.postDataPramas.data[1].children[1] = { 'name': 'insertContractV2', 'type': 'e', 'parammaps': {
  2163. bigId: '@insertBigContractV2.LastInsertId',
  2164. pastureId: this.tab1.detailsSpareParts.detailsList.pastureId,
  2165. pastureName: this.tab1.detailsSpareParts.detailsList.pastureName,
  2166. partId: '@insertSpotList.id',
  2167. partName: '@insertSpotList.partName',
  2168. partCode: '@insertSpotList.partCode',
  2169. specification: '@insertSpotList.specification',
  2170. price: '@insertSpotList.price',
  2171. brandId: '@insertSpotList.brandId',
  2172. brand: '@insertSpotList.brand',
  2173. planAmount: '@insertSpotList.planAmount',
  2174. remark: '@insertSpotList.remark',
  2175. unit: '@insertSpotList.unit',
  2176. contractId: '@insertSpotList.contractId',
  2177. taxcode: '@insertSpotList.taxcode',
  2178. // lifeCycle: '@insertSpotList.lifeCycle',
  2179. // contractVarianceItem: '@insertSpotList.contractVarianceItem',
  2180. }}
  2181. ExecDataByConfig(this.postDataPramas).then(response => {
  2182. console.log('新增保存发送参数', this.postDataPramas)
  2183. if (response.msg == 'fail') {
  2184. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  2185. } else {
  2186. this.getTab1List2()
  2187. this.getPendingList()
  2188. this.tab1.detailsSpareParts.create.dialogFormVisible = false
  2189. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  2190. }
  2191. })
  2192. } else {
  2193. this.$notify({ title: '', message: '请选择备件', type: 'warning', duration: 2000 })
  2194. return false
  2195. }
  2196. },
  2197. handleTab1Change2() {
  2198. console.log('备件明细-变更')
  2199. this.dialogStatus = 'tab1change2'
  2200. this.tab1.detailsSpareParts.create.dialogFormVisible = true
  2201. this.tab1.detailsSpareParts.listAdd = []
  2202. this.tab1.detailsSpareParts.requestSparePart.parammaps.pastureId = this.tab1.detailsSpareParts.detailsList.pastureId
  2203. this.tab1.detailsSpareParts.requestSparePart.parammaps.providerId = this.tab1.detailsSpareParts.detailsList.providerId
  2204. this.tab1.detailsSpareParts.requestSparePart.parammaps.stopTime = this.tab1.detailsSpareParts.detailsList.stopTime
  2205. this.tab1.detailsSpareParts.requestSparePart.parammaps.flag = this.tab1.detailsSpareParts.detailsList.flag
  2206. this.tab1.detailsSpareParts.requestSparePart.parammaps.isZeroStock = this.tab1.detailsSpareParts.detailsList.isZeroStock
  2207. this.tab1.detailsSpareParts.requestSparePart.parammaps.statue = this.tab1.detailsSpareParts.detailsList.statue
  2208. this.tab1.detailsSpareParts.requestSparePart.name = 'getcontratListBybigParts'
  2209. },
  2210. changeData2() {
  2211. console.log('备件明细-变更保存')
  2212. if (this.tab1.detailsSpareParts.listAdd.length !== 0) {
  2213. for (let i = 0; i < this.tab1.detailsSpareParts.listAdd.length; i++) {
  2214. if (this.tab1.detailsSpareParts.listAdd[i].planAmount == null || this.tab1.detailsSpareParts.listAdd[i].brand == null || this.tab1.detailsSpareParts.listAdd[i].price == null || this.tab1.detailsSpareParts.listAdd[i].planAmount == '' || this.tab1.detailsSpareParts.listAdd[i].brand === '' || this.tab1.detailsSpareParts.listAdd[i].brandId === '' || this.tab1.detailsSpareParts.listAdd[i].price == '' || this.tab1.detailsSpareParts.listAdd[i].brand == undefined || this.tab1.detailsSpareParts.listAdd[i].brandId == undefined) {
  2215. this.$message({ type: 'warning', message: '请检查备件品牌或计划量或单价是否为空', duration: 2000 })
  2216. return false
  2217. } else {
  2218. var rulesPlanAmount = /^[1-9]\d*$/
  2219. if (!rulesPlanAmount.test(parseFloat(this.tab1.detailsSpareParts.listAdd[i].planAmount))) {
  2220. this.$message({ type: 'error', message: '计划量请输入正整数', duration: 2000 })
  2221. return false
  2222. } else {
  2223. var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/
  2224. if (rulesPrice.test(this.tab1.detailsSpareParts.listAdd[i].price) == false) {
  2225. this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后两位', duration: 2000 })
  2226. return false
  2227. }
  2228. }
  2229. }
  2230. }
  2231. this.postDataPramas = {}
  2232. this.postDataPramas.common = { 'returnmap': '0' }
  2233. this.postDataPramas.data = []
  2234. this.postDataPramas.data[0] = { 'name': 'insertBigContractV2', 'type': 'e', 'parammaps': {
  2235. pastureId: this.tab1.detailsSpareParts.detailsList.pastureId,
  2236. flag: this.tab1.detailsSpareParts.detailsList.flag,
  2237. providerId: this.tab1.detailsSpareParts.detailsList.providerId,
  2238. providerName: this.tab1.detailsSpareParts.detailsList.providerName,
  2239. startTime: this.tab1.detailsSpareParts.detailsList.startTime,
  2240. stopTime: this.tab1.detailsSpareParts.detailsList.stopTime,
  2241. contractCode: '',
  2242. contractCode1: this.tab1.detailsSpareParts.detailsList.contractCode,
  2243. creatorId: Cookies.get('employeid'),
  2244. creatorMan: Cookies.get('employename'),
  2245. creatorTime: parseTime(new Date(), '{y}-{m}-{d}'),
  2246. isZeroStock: this.tab1.detailsSpareParts.detailsList.isZeroStock,
  2247. statue: this.tab1.detailsSpareParts.detailsList.statue,
  2248. remark: this.tab1.detailsSpareParts.detailsList.remark,
  2249. SHtype: 2
  2250. }}
  2251. this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.tab1.detailsSpareParts.listAdd }}
  2252. this.postDataPramas.data[1].children = []
  2253. this.postDataPramas.data[1].children[0] = { 'name': 'insertContractV2', 'type': 'e', 'parammaps': {
  2254. bigId: '@insertBigContractV2.LastInsertId',
  2255. pastureId: '@insertSpotList.pastureId',
  2256. pastureName: '@insertSpotList.pastureName',
  2257. partId: '@insertSpotList.partId',
  2258. partName: '@insertSpotList.partName',
  2259. partCode: '@insertSpotList.partCode',
  2260. specification: '@insertSpotList.specification',
  2261. price: '@insertSpotList.price',
  2262. brandId: '@insertSpotList.brandId',
  2263. brand: '@insertSpotList.brand',
  2264. planAmount: '@insertSpotList.planAmount',
  2265. remark: '@insertSpotList.remark',
  2266. unit: '@insertSpotList.unit',
  2267. contractId: '@insertSpotList.contractId',
  2268. taxcode: '@insertSpotList.taxcode',
  2269. // lifeCycle: '@insertSpotList.lifeCycle',
  2270. // contractVarianceItem: '@insertSpotList.contractVarianceItem',
  2271. }}
  2272. ExecDataByConfig(this.postDataPramas).then(response => {
  2273. console.log('新增保存发送参数', this.postDataPramas)
  2274. if (response.msg == 'fail') {
  2275. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  2276. } else {
  2277. this.getTab1List2()
  2278. this.getPendingList()
  2279. this.tab1.detailsSpareParts.create.dialogFormVisible = false
  2280. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  2281. }
  2282. })
  2283. } else {
  2284. this.$notify({ title: '', message: '请选择备件', type: 'warning', duration: 2000 })
  2285. return false
  2286. }
  2287. },
  2288. handleTab1Export2() {
  2289. console.log('备件明细-导出')
  2290. this.$alert('备件明细正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  2291. this.isPercentage = true
  2292. this.percentage = 1
  2293. var timer = setInterval(() => {
  2294. this.percentage += 5
  2295. if (this.percentage > 95) {
  2296. this.percentage = 99
  2297. clearInterval(timer)
  2298. this.tab1.detailsSpareParts.getdataListParm.pagecount = 10
  2299. }
  2300. this.percentage = this.percentage
  2301. }, 1000)
  2302. this.tab1.detailsSpareParts.getdataListParm.pagecount = ''
  2303. GetDataByName(this.tab1.detailsSpareParts.getdataListParm).then(response => {
  2304. if (response.data.list !== '') {
  2305. this.percentage = 99
  2306. setTimeout(() => {
  2307. this.isPercentage = false
  2308. }, 2000)
  2309. }
  2310. if (response.data.list !== null) {
  2311. this.$nextTick(() => {
  2312. const ExcelDatas = [
  2313. {
  2314. tHeader: ['备件编号', '备件名称', '备件规格', '备件品牌', '计量单位', '计划量', '单价', '备注'],
  2315. filterVal: ['partCode', 'partName', 'specification', 'brand', 'unit', 'planAmount', 'price', 'remark'],
  2316. tableDatas: response.data.list,
  2317. sheetName: '合同管理-备件明细'
  2318. }
  2319. ]
  2320. json2excel(ExcelDatas, '合同管理-备件明细', true, 'xlsx')
  2321. })
  2322. }
  2323. })
  2324. },
  2325. // 变更记录
  2326. handleTab1ChangeRecord(row) {
  2327. console.log('变更记录')
  2328. this.tab1.detailsSpareParts.detailsList = Object.assign({}, row)
  2329. this.contractCodese = row.contractCode
  2330. this.isContractManagement = false
  2331. this.isChangeRecord = true
  2332. this.tab1.changeRecord.getdataListParm.parammaps.pastureId = row.pastureId
  2333. this.tab1.changeRecord.getdataListParm.parammaps.providerId = row.providerId
  2334. this.tab1.changeRecord.getdataListParm.parammaps.stopTime1 = row.stopTime
  2335. this.tab1.changeRecord.getdataListParm.parammaps.flag = row.flag
  2336. this.tab1.changeRecord.getdataListParm.parammaps.isZeroStock = row.isZeroStock
  2337. this.tab1.changeRecord.getdataListParm.parammaps.statue = row.statue
  2338. this.tab1.changeRecord.getdataListParm.parammaps.contractCode = ''
  2339. this.tab1.changeRecord.getdataListParm.parammaps.tab1InputDatetime3 = ''
  2340. this.tab1.changeRecord.getdataListParm.parammaps.startTime = ''
  2341. this.tab1.changeRecord.getdataListParm.parammaps.stopTime = ''
  2342. this.tab1.changeRecord.getdataListParm.parammaps.SHtype = ''
  2343. this.tab1.changeRecord.getdataListParm.parammaps.stuteSH = ''
  2344. this.getTab1List3()
  2345. },
  2346. handleTab1goBack2() {
  2347. // this.reload()
  2348. this.isContractManagement = true
  2349. this.isChangeRecord = false
  2350. this.tab1.changeRecord.total = 0
  2351. // this.tab1.contractManagement.getdataListParm.offset = 1
  2352. this.getTab1List()
  2353. },
  2354. getTab1List3() {
  2355. this.tab1.changeRecord.listLoading = true
  2356. if (this.$refs['tab1InputDatetime3'] !== undefined && this.$refs['tab1InputDatetime3'].value !== null) {
  2357. this.tab1.changeRecord.getdataListParm.parammaps.startTime = this.$refs['tab1InputDatetime3'].value[0]
  2358. this.tab1.changeRecord.getdataListParm.parammaps.stopTime = this.$refs['tab1InputDatetime3'].value[1]
  2359. } else {
  2360. this.tab1.changeRecord.getdataListParm.parammaps.startTime = ''
  2361. this.tab1.changeRecord.getdataListParm.parammaps.stopTime = ''
  2362. }
  2363. GetDataByName(this.tab1.changeRecord.getdataListParm).then(response => {
  2364. this.tab1.changeRecord.list = response.data.list
  2365. this.tab1.changeRecord.pageNum = response.data.pageNum
  2366. this.tab1.changeRecord.pageSize = response.data.pageSize
  2367. if (response.data.list !== null) {
  2368. this.tab1.changeRecord.total = response.data.total
  2369. } else {
  2370. this.tab1.changeRecord.total = 0
  2371. }
  2372. setTimeout(() => {
  2373. this.tab1.changeRecord.listLoading = false
  2374. }, 300)
  2375. })
  2376. },
  2377. handleTab1Filter3() {
  2378. this.tab1.changeRecord.listLoading = true
  2379. if (this.tab1.changeRecord.getdataListParm.parammaps.tab1InputDatetime3 == null) {
  2380. this.tab1.changeRecord.getdataListParm.parammaps.tab1InputDatetime3 = ''
  2381. }
  2382. this.tab1.changeRecord.getdataListParm.offset = 1
  2383. if (this.tab1.changeRecord.radioAll == '全部') {
  2384. this.tab1.changeRecord.getdataListParm.parammaps.SHnums = 2
  2385. this.getTab1List3()
  2386. } else if (this.tab1.changeRecord.radioAll == '待处理') {
  2387. this.tab1.changeRecord.getdataListParm.parammaps.SHnums = 0
  2388. this.getTab1List3()
  2389. } else if (this.tab1.changeRecord.radioAll == '已处理') {
  2390. this.tab1.changeRecord.getdataListParm.parammaps.SHnums = 1
  2391. this.getTab1List3()
  2392. }
  2393. },
  2394. changeChangeRecordAll() {
  2395. if (this.tab1.changeRecord.radioAll == '全部') {
  2396. this.tab1.changeRecord.getdataListParm.parammaps.SHnums = 2
  2397. this.getTab1List3()
  2398. } else if (this.tab1.changeRecord.radioAll == '待处理') {
  2399. this.tab1.changeRecord.getdataListParm.parammaps.SHnums = 0
  2400. this.getTab1List3()
  2401. } else if (this.tab1.changeRecord.radioAll == '已处理') {
  2402. this.tab1.changeRecord.getdataListParm.parammaps.SHnums = 1
  2403. this.getTab1List3()
  2404. }
  2405. },
  2406. handleTab1See3(row) {
  2407. console.log('变更记录-查看')
  2408. this.tab1.changeRecord.see.temp = Object.assign({}, row)
  2409. this.dialogStatus = 'tab1See2'
  2410. this.tab1.changeRecord.see.dialogFormVisible = true
  2411. if (row.SHtype == 0 || row.SHtype == 1 || row.SHtype == 2) {
  2412. this.tab1.changeRecord.see.getdataListParm.parammaps.id = row.id
  2413. this.getTab1List3See()
  2414. }
  2415. var reason = '未通过原因:' + this.tab1.changeRecord.see.temp.workflowNote
  2416. if (this.tab1.changeRecord.see.temp.SHStatus == 2) {
  2417. this.tab1.changeRecord.see.activeList = [{ title: '合同录入', date: this.tab1.changeRecord.see.temp.creatorTime, name: this.tab1.changeRecord.see.temp.creatorMan }, { title: '供应主管审核' }, { title: '设备中心审核' }]
  2418. this.tab1.changeRecord.see.active = 1
  2419. } else if (this.tab1.changeRecord.see.temp.SHStatus == 3) {
  2420. this.tab1.changeRecord.see.activeList = [{ title: '合同录入', date: this.tab1.changeRecord.see.temp.creatorTime, name: this.tab1.changeRecord.see.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.changeRecord.see.temp.chargeDate, name: this.tab1.changeRecord.see.temp.chargePerson }, { title: '设备中心审核' }]
  2421. this.tab1.changeRecord.see.active = 2
  2422. } else if (this.tab1.changeRecord.see.temp.SHStatus == 4) {
  2423. this.tab1.changeRecord.see.activeList = [{ title: '合同录入', date: this.tab1.changeRecord.see.temp.creatorTime, name: this.tab1.changeRecord.see.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.changeRecord.see.temp.chargeDate, name: this.tab1.changeRecord.see.temp.chargePerson, status: 'error', reason: reason }, { title: '设备中心审核' }]
  2424. this.tab1.changeRecord.see.active = 2
  2425. } else if (this.tab1.changeRecord.see.temp.SHStatus == 5) {
  2426. this.tab1.changeRecord.see.activeList = [{ title: '合同录入', date: this.tab1.changeRecord.see.temp.creatorTime, name: this.tab1.changeRecord.see.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.changeRecord.see.temp.chargeDate, name: this.tab1.changeRecord.see.temp.chargePerson }, { title: '设备中心审核' }]
  2427. this.tab1.changeRecord.see.active = 2
  2428. } else if (this.tab1.changeRecord.see.temp.SHStatus == 6) {
  2429. this.tab1.changeRecord.see.activeList = [{ title: '合同录入', date: this.tab1.changeRecord.see.temp.creatorTime, name: this.tab1.changeRecord.see.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.changeRecord.see.temp.chargeDate, name: this.tab1.changeRecord.see.temp.chargePerson }, { title: '设备中心审核' }]
  2430. this.tab1.changeRecord.see.active = 3
  2431. } else if (this.tab1.changeRecord.see.temp.SHStatus == 7) {
  2432. this.tab1.changeRecord.see.activeList = [{ title: '合同录入', date: this.tab1.changeRecord.see.temp.creatorTime, name: this.tab1.changeRecord.see.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.changeRecord.see.temp.chargeDate, name: this.tab1.changeRecord.see.temp.chargePerson }, { title: '设备中心审核', date: this.tab1.changeRecord.see.temp.CGChargedate, name: this.tab1.changeRecord.see.temp.CGChargePerson }]
  2433. this.tab1.changeRecord.see.active = 4
  2434. } else if (this.tab1.changeRecord.see.temp.SHStatus == 8) {
  2435. this.tab1.changeRecord.see.activeList = [{ title: '合同录入', date: this.tab1.changeRecord.see.temp.creatorTime, name: this.tab1.changeRecord.see.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.changeRecord.see.temp.chargeDate, name: this.tab1.changeRecord.see.temp.chargePerson }, { title: '设备中心审核', date: this.tab1.changeRecord.see.temp.CGChargedate, name: this.tab1.changeRecord.see.temp.CGChargePerson, status: 'error', reason: reason }]
  2436. this.tab1.changeRecord.see.active = 4
  2437. }
  2438. },
  2439. getTab1List3See() {
  2440. GetDataByName(this.tab1.changeRecord.see.getdataListParm).then(response => {
  2441. if (response.data.list !== null) {
  2442. this.tab1.changeRecord.see.pageNum = response.data.pageNum
  2443. this.tab1.changeRecord.see.pageSize = response.data.pageSize
  2444. if (response.data.total) {
  2445. this.tab1.changeRecord.see.total = response.data.total
  2446. }
  2447. for (let i = 0; i < response.data.list.length; i++) {
  2448. response.data.list[i].myid = new Date().getTime() + i
  2449. if (response.data.list[i].srcpath !== null && response.data.list[i].picpath !== null && response.data.list[i].srcpath !== undefined && response.data.list[i].picpath !== undefined) {
  2450. const srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  2451. const picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  2452. response.data.list[i].srcpath = srcpath
  2453. response.data.list[i].picpath = picpath
  2454. } else {
  2455. response.data.list[i].srcpath = ''
  2456. response.data.list[i].picpath = ''
  2457. }
  2458. }
  2459. this.tab1.changeRecord.see.list = response.data.list
  2460. this.tab1.detailsSpareParts.listAdd = response.data.list
  2461. } else {
  2462. this.tab1.changeRecord.see.list = []
  2463. this.tab1.detailsSpareParts.listAdd = []
  2464. }
  2465. setTimeout(() => {
  2466. this.tab1.changeRecord.see.listLoading = false
  2467. }, 300)
  2468. })
  2469. },
  2470. handleTab1Update3(row) {
  2471. console.log('变更记录-编辑', row)
  2472. this.tab1.detailsSpareParts.updateList = Object.assign({}, row)
  2473. this.tab1.detailsSpareParts.create.temp = Object.assign({}, row)
  2474. this.dialogStatus = 'tab1Update2'
  2475. this.tab1.detailsSpareParts.create.dialogFormVisible = true
  2476. this.tab1.changeRecord.see.getdataListParm.parammaps.id = row.id
  2477. this.getTab1List3See()
  2478. if (row.SHtype == 1) {
  2479. this.tab1.detailsSpareParts.requestSparePart.name = 'getcontratListBybigALLParts'
  2480. this.tab1.detailsSpareParts.requestSparePart.parammaps = {}
  2481. } else {
  2482. this.tab1.detailsSpareParts.requestSparePart.parammaps.pastureId = this.tab1.detailsSpareParts.detailsList.pastureId
  2483. this.tab1.detailsSpareParts.requestSparePart.parammaps.providerId = this.tab1.detailsSpareParts.detailsList.providerId
  2484. this.tab1.detailsSpareParts.requestSparePart.parammaps.stopTime = this.tab1.detailsSpareParts.detailsList.stopTime
  2485. this.tab1.detailsSpareParts.requestSparePart.parammaps.flag = this.tab1.detailsSpareParts.detailsList.flag
  2486. this.tab1.detailsSpareParts.requestSparePart.parammaps.isZeroStock = this.tab1.detailsSpareParts.detailsList.isZeroStock
  2487. this.tab1.detailsSpareParts.requestSparePart.parammaps.statue = this.tab1.detailsSpareParts.detailsList.statue
  2488. this.tab1.detailsSpareParts.requestSparePart.name = 'getcontratListBybigParts'
  2489. }
  2490. },
  2491. edit_dialog_save2() {
  2492. console.log('编辑保存')
  2493. // 新增合同 || 变更日期
  2494. if (this.tab1.detailsSpareParts.updateList.SHtype == 0 || this.tab1.detailsSpareParts.updateList.SHtype == 3) {
  2495. this.postDataPramas = {}
  2496. this.postDataPramas.common = { 'returnmap': '0' }
  2497. this.postDataPramas.data = []
  2498. this.postDataPramas.data[0] = { 'name': 'updateBigcontractV2', 'type': 'e', 'parammaps': {
  2499. id: this.tab1.detailsSpareParts.create.temp.id,
  2500. startTime: this.tab1.detailsSpareParts.create.temp.startTime,
  2501. stopTime: this.tab1.detailsSpareParts.create.temp.stopTime,
  2502. isZeroStock: this.tab1.detailsSpareParts.create.temp.isZeroStock,
  2503. remark: this.tab1.detailsSpareParts.create.temp.remark,
  2504. stopTimeHis: this.tab1.detailsSpareParts.create.temp.stopTimeHis
  2505. }}
  2506. ExecDataByConfig(this.postDataPramas).then(response => {
  2507. console.log('新增保存发送参数', this.postDataPramas)
  2508. if (response.msg == 'fail') {
  2509. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  2510. } else {
  2511. if (this.tab1.detailsSpareParts.updateList.SHtype == 0) {
  2512. this.tab1.changeRecord.getdataListParm.parammaps.stopTime1 = this.tab1.detailsSpareParts.create.temp.stopTime
  2513. }
  2514. this.getTab1List3()
  2515. this.getPendingList()
  2516. this.tab1.detailsSpareParts.create.dialogFormVisible = false
  2517. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  2518. }
  2519. })
  2520. } else {
  2521. if (this.tab1.detailsSpareParts.listAdd.length !== 0) {
  2522. for (let i = 0; i < this.tab1.detailsSpareParts.listAdd.length; i++) {
  2523. if (this.tab1.detailsSpareParts.listAdd[i].planAmount == null || this.tab1.detailsSpareParts.listAdd[i].brand == null || this.tab1.detailsSpareParts.listAdd[i].price == null || this.tab1.detailsSpareParts.listAdd[i].planAmount == '' || this.tab1.detailsSpareParts.listAdd[i].brand == '' || this.tab1.detailsSpareParts.listAdd[i].brandId === '' || this.tab1.detailsSpareParts.listAdd[i].price == '' || this.tab1.detailsSpareParts.listAdd[i].brand == undefined || this.tab1.detailsSpareParts.listAdd[i].brandId == undefined) {
  2524. console.log(this.tab1.detailsSpareParts.listAdd[i])
  2525. this.$message({ type: 'warning', message: '请检查备件品牌或计划量或单价是否为空', duration: 2000 })
  2526. return false
  2527. } else {
  2528. var rulesPlanAmount = /^[1-9]\d*$/
  2529. if (!rulesPlanAmount.test(parseFloat(this.tab1.detailsSpareParts.listAdd[i].planAmount))) {
  2530. this.$message({ type: 'error', message: '计划量请输入正整数', duration: 2000 })
  2531. return false
  2532. } else {
  2533. var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/
  2534. if (rulesPrice.test(this.tab1.detailsSpareParts.listAdd[i].price) == false) {
  2535. this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后两位', duration: 2000 })
  2536. return false
  2537. }
  2538. }
  2539. }
  2540. }
  2541. this.postDataPramas = {}
  2542. this.postDataPramas.common = { 'returnmap': '0' }
  2543. this.postDataPramas.data = []
  2544. this.postDataPramas.data[0] = { 'name': 'deleteContract', 'type': 'e', 'parammaps': {
  2545. bigId: this.tab1.detailsSpareParts.updateList.id
  2546. }}
  2547. this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.tab1.detailsSpareParts.listAdd }}
  2548. this.postDataPramas.data[1].children = []
  2549. if (this.tab1.detailsSpareParts.updateList.SHtype == 2) {
  2550. this.postDataPramas.data[1].children[0] = { 'name': 'insertContractV2', 'type': 'e', 'parammaps': {
  2551. bigId: this.tab1.detailsSpareParts.updateList.id,
  2552. pastureId: this.tab1.detailsSpareParts.detailsList.pastureId,
  2553. pastureName: this.tab1.detailsSpareParts.detailsList.pastureName,
  2554. partId: '@insertSpotList.id',
  2555. partName: '@insertSpotList.partName',
  2556. partCode: '@insertSpotList.partCode',
  2557. specification: '@insertSpotList.specification',
  2558. price: '@insertSpotList.price',
  2559. brandId: '@insertSpotList.brandId',
  2560. brand: '@insertSpotList.brand',
  2561. planAmount: '@insertSpotList.planAmount',
  2562. remark: '@insertSpotList.remark',
  2563. unit: '@insertSpotList.unit',
  2564. contractId: '@insertSpotList.contractId',
  2565. taxcode: '@insertSpotList.taxcode',
  2566. // lifeCycle: '@insertSpotList.lifeCycle',
  2567. // contractVarianceItem: '@insertSpotList.contractVarianceItem',
  2568. }}
  2569. } else {
  2570. this.postDataPramas.data[1].children[0] = { 'name': 'checkcontracPartCode', 'type': 'v', 'parammaps': { pastureId: this.tab1.detailsSpareParts.detailsList.pastureId, providerId: this.tab1.detailsSpareParts.detailsList.providerId, stopTime: this.tab1.detailsSpareParts.detailsList.stopTime, flag: this.tab1.detailsSpareParts.detailsList.flag, isZeroStock: this.tab1.detailsSpareParts.detailsList.isZeroStock, statue: this.tab1.detailsSpareParts.detailsList.statue, partCode: '@insertSpotList.partCode', brandId: '@insertSpotList.brandId' }}
  2571. this.postDataPramas.data[1].children[1] = { 'name': 'insertContractV2', 'type': 'e', 'parammaps': {
  2572. bigId: this.tab1.detailsSpareParts.updateList.id,
  2573. pastureId: this.tab1.detailsSpareParts.detailsList.pastureId,
  2574. pastureName: this.tab1.detailsSpareParts.detailsList.pastureName,
  2575. partId: '@insertSpotList.id',
  2576. partName: '@insertSpotList.partName',
  2577. partCode: '@insertSpotList.partCode',
  2578. specification: '@insertSpotList.specification',
  2579. price: '@insertSpotList.price',
  2580. brandId: '@insertSpotList.brandId',
  2581. brand: '@insertSpotList.brand',
  2582. planAmount: '@insertSpotList.planAmount',
  2583. remark: '@insertSpotList.remark',
  2584. unit: '@insertSpotList.unit',
  2585. contractId: '@insertSpotList.contractId',
  2586. // lifeCycle: '@insertSpotList.lifeCycle',
  2587. // contractVarianceItem: '@insertSpotList.contractVarianceItem',
  2588. // taxcode: '@insertSpotList.taxcode'
  2589. }}
  2590. }
  2591. this.postDataPramas.data[2] = { 'name': 'updateBigcontract', 'type': 'e', 'parammaps': {
  2592. id: this.tab1.detailsSpareParts.updateList.id
  2593. }}
  2594. ExecDataByConfig(this.postDataPramas).then(response => {
  2595. console.log('新增保存发送参数', this.postDataPramas)
  2596. if (response.msg == 'fail') {
  2597. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  2598. } else {
  2599. this.getTab1List3()
  2600. this.getPendingList()
  2601. this.tab1.detailsSpareParts.create.dialogFormVisible = false
  2602. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  2603. }
  2604. })
  2605. } else {
  2606. this.$notify({ title: '', message: '请选择备件', type: 'warning', duration: 2000 })
  2607. return false
  2608. }
  2609. }
  2610. },
  2611. changeExamineStatue(val) {
  2612. if (val == 2) {
  2613. this.tab1.changeRecord.examine.isReason = true
  2614. } else {
  2615. this.tab1.changeRecord.examine.isReason = false
  2616. }
  2617. },
  2618. // 审核1
  2619. handleTab1Examine(row) {
  2620. console.log('变更记录-审核')
  2621. this.dialogStatus = 'tab1examine'
  2622. this.tab1.changeRecord.examine.dialogFormVisible = true
  2623. this.tab1.changeRecord.examine.temp = Object.assign({}, row)
  2624. this.tab1.changeRecord.examine.isReason = false
  2625. if (row == undefined) {
  2626. this.tab1.changeRecord.examine.temp = this.tab1.changeRecord.see.temp
  2627. this.$set(this.tab1.changeRecord.see.temp, 'statueSH', 1)
  2628. this.$set(this.tab1.changeRecord.see.temp, 'workflowNote', '')
  2629. } else {
  2630. this.tab1.changeRecord.examine.temp = Object.assign({}, row)
  2631. this.$set(this.tab1.changeRecord.examine.temp, 'statueSH', 1)
  2632. this.$set(this.tab1.changeRecord.examine.temp, 'workflowNote', '')
  2633. }
  2634. this.keyupSubmit()
  2635. },
  2636. keyupSubmit() {
  2637. if (this.dialogStatus == 'tab1examine' || this.dialogStatus == 'tab1examine2' || this.dialogStatus == 'tab1examine3') {
  2638. document.onkeydown = e => {
  2639. const _key = window.event.keyCode
  2640. if (_key === 13) {
  2641. if (this.dialogStatus == 'tab1examine') {
  2642. this.createExamineData()
  2643. } else {
  2644. this.createExamineData3()
  2645. }
  2646. }
  2647. }
  2648. }
  2649. },
  2650. createExamineData() {
  2651. console.log('点击了设备主管审核确认1')
  2652. this.isokDisable = true
  2653. setTimeout(() => {
  2654. this.isokDisable = false
  2655. }, 1000)
  2656. this.$refs['examineTemp'].validate(valid => {
  2657. if (valid) {
  2658. this.postDataPramas = {}
  2659. this.postDataPramas.name = 'contractCharge'
  2660. this.postDataPramas.parammaps = {}
  2661. this.postDataPramas.parammaps.id = this.tab1.changeRecord.examine.temp.id
  2662. if (this.tab1.changeRecord.examine.temp.statueSH === 1) {
  2663. this.postDataPramas.parammaps.statue = 5
  2664. } else {
  2665. this.postDataPramas.parammaps.statue = 4
  2666. }
  2667. this.postDataPramas.parammaps.empId = Cookies.get('employeid')
  2668. this.postDataPramas.parammaps.workflowNote = this.tab1.changeRecord.examine.temp.workflowNote
  2669. PostDataByName(this.postDataPramas).then(response => {
  2670. console.log('设备主管审核确认发送参数', this.postDataPramas)
  2671. if (response.msg !== 'fail') {
  2672. this.tab1.changeRecord.examine.dialogFormVisible = false
  2673. this.tab1.changeRecord.see.dialogFormVisible = false
  2674. this.tab1.changeRecord.isStatueReason = false
  2675. this.$notify({ title: '成功', message: '审核成功', type: 'success', duration: 2000 })
  2676. this.getTab1List3()
  2677. this.getTab1List()
  2678. this.getPendingList()
  2679. } else {
  2680. failproccess(response, this.$notify)
  2681. }
  2682. })
  2683. }
  2684. })
  2685. },
  2686. // 审核2
  2687. handleTab1Examine3(row) {
  2688. console.log(' 变更记录-审核3')
  2689. if (row == undefined) {
  2690. this.tab1.changeRecord.examine.temp = this.tab1.changeRecord.see.temp
  2691. this.$set(this.tab1.changeRecord.see.temp, 'statueSH', 1)
  2692. this.$set(this.tab1.changeRecord.see.temp, 'workflowNote', '')
  2693. } else {
  2694. this.tab1.changeRecord.examine.temp = Object.assign({}, row)
  2695. this.$set(this.tab1.changeRecord.examine.temp, 'statueSH', 1)
  2696. this.$set(this.tab1.changeRecord.examine.temp, 'workflowNote', '')
  2697. }
  2698. this.dialogStatus = 'tab1examine3'
  2699. this.tab1.changeRecord.examine.dialogFormVisible = true
  2700. this.tab1.changeRecord.examine.isReason = false
  2701. this.keyupSubmit()
  2702. },
  2703. createExamineData3() {
  2704. console.log('点击了设备中心审核确认3')
  2705. this.isokDisable = true
  2706. setTimeout(() => {
  2707. this.isokDisable = false
  2708. }, 1000)
  2709. this.$refs['examineTemp'].validate(valid => {
  2710. if (valid) {
  2711. this.postDataPramas = {}
  2712. this.postDataPramas.common = { 'returnmap': '0' }
  2713. this.postDataPramas.data = []
  2714. if (this.tab1.changeRecord.examine.temp.statueSH == 1) {
  2715. this.postDataPramas.data[0] = { 'name': 'contractCharge1', 'type': 'e', 'parammaps': {
  2716. statue: 7,
  2717. empId: Cookies.get('employeid'),
  2718. workflowNote: this.tab1.changeRecord.examine.temp.workflowNote,
  2719. id: this.tab1.changeRecord.examine.temp.id
  2720. }}
  2721. if (this.tab1.changeRecord.examine.temp.SHtype == 1 || this.tab1.changeRecord.examine.temp.SHtype == 2) {
  2722. this.postDataPramas.data[1] = { 'name': 'updateContractEnable', 'type': 'e', 'parammaps': {
  2723. id: this.tab1.changeRecord.examine.temp.id
  2724. }}
  2725. } else if (this.tab1.changeRecord.examine.temp.SHtype == 3) {
  2726. this.postDataPramas.data[1] = { 'name': 'updatecontractdate', 'type': 'e', 'parammaps': {
  2727. pastureId: this.tab1.changeRecord.examine.temp.pastureId,
  2728. providerId: this.tab1.changeRecord.examine.temp.providerId,
  2729. stopTimeHis: this.tab1.changeRecord.examine.temp.stopTimeHis,
  2730. flag: this.tab1.changeRecord.examine.temp.flag,
  2731. isZeroStock: this.tab1.changeRecord.examine.temp.isZeroStock,
  2732. statue: this.tab1.changeRecord.examine.temp.statue,
  2733. startTime: this.tab1.changeRecord.examine.temp.startTime,
  2734. stopTime: this.tab1.changeRecord.examine.temp.stopTime,
  2735. id: this.tab1.changeRecord.examine.temp.id
  2736. }}
  2737. }
  2738. this.postDataPramas.data[2] = {
  2739. "name": "updateBigcontractIsToSap",
  2740. "type": "e",
  2741. "parammaps": {
  2742. "contractCode": this.contractCodese
  2743. }
  2744. }
  2745. } else {
  2746. this.postDataPramas.data[0] = { 'name': 'contractCharge1', 'type': 'e', 'parammaps': {
  2747. statue: 8,
  2748. empId: Cookies.get('employeid'),
  2749. workflowNote: this.tab1.changeRecord.examine.temp.workflowNote,
  2750. id: this.tab1.changeRecord.examine.temp.id
  2751. }}
  2752. }
  2753. ExecDataByConfig(this.postDataPramas).then(response => {
  2754. console.log('新增保存发送参数', this.postDataPramas)
  2755. if (response.msg === 'fail') {
  2756. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  2757. } else {
  2758. if (this.postDataPramas.data[0].parammaps.statue == 7) {
  2759. if (this.tab1.changeRecord.examine.temp.SHtype == 3) {
  2760. this.tab1.changeRecord.getdataListParm.parammaps.stopTime1 = this.tab1.changeRecord.examine.temp.stopTimeHis
  2761. } else {
  2762. this.tab1.changeRecord.getdataListParm.parammaps.stopTime1 = this.tab1.changeRecord.examine.temp.stopTime
  2763. }
  2764. } else {
  2765. this.tab1.changeRecord.getdataListParm.parammaps.stopTime1 = this.tab1.detailsSpareParts.detailsList.stopTime
  2766. }
  2767. this.tab1.changeRecord.examine.dialogFormVisible = false
  2768. this.tab1.changeRecord.see.dialogFormVisible = false
  2769. this.tab1.changeRecord.examine.isStatueReason = false
  2770. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  2771. this.getTab1List3()
  2772. this.getTab1List()
  2773. this.getPendingList()
  2774. }
  2775. })
  2776. }
  2777. })
  2778. },
  2779. handleTab1Delete3(row) {
  2780. console.log('变更记录-删除')
  2781. console.log('点击了删除')
  2782. MessageBox.confirm('确认删除此条信息?', {
  2783. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  2784. }).then(() => {
  2785. this.postDataPramas = {}
  2786. this.postDataPramas.common = { 'returnmap': '0' }
  2787. this.postDataPramas.data = []
  2788. this.postDataPramas.data[0] = { 'name': 'deleteBigContract', 'type': 'e', 'parammaps': {
  2789. id: row.id
  2790. }}
  2791. this.postDataPramas.data[1] = { 'name': 'deleteContract', 'type': 'e', 'parammaps': {
  2792. bigId: row.id
  2793. }}
  2794. ExecDataByConfig(this.postDataPramas).then(response => {
  2795. this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
  2796. this.getTab1List3()
  2797. this.getPendingList()
  2798. })
  2799. }).catch(() => {
  2800. this.$message({ type: 'info', message: '已取消删除' })
  2801. })
  2802. },
  2803. // 合同明细
  2804. getTab2List() {
  2805. this.tab2.listLoading = true
  2806. if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
  2807. this.tab2.getdataListParm.parammaps.startTime = this.$refs['inputDatetime'].value[0]
  2808. this.tab2.getdataListParm.parammaps.stopTime = this.$refs['inputDatetime'].value[1]
  2809. } else {
  2810. this.tab2.getdataListParm.parammaps.startTime = ''
  2811. this.tab2.getdataListParm.parammaps.stopTime = ''
  2812. }
  2813. GetDataByName(this.tab2.getdataListParm).then(response => {
  2814. if (response.data.list !== null) {
  2815. this.tab2.list = response.data.list
  2816. this.tab2.pageNum = response.data.pageNum
  2817. this.tab2.pageSize = response.data.pageSize
  2818. if (response.data.total) {
  2819. this.tab2.total = response.data.total
  2820. }
  2821. } else {
  2822. this.tab2.list = []
  2823. }
  2824. setTimeout(() => {
  2825. this.tab2.listLoading = false
  2826. }, 300)
  2827. })
  2828. },
  2829. handleTab2Filter() {
  2830. this.listLoading2 = true
  2831. if (this.tab2.getdataListParm.parammaps.inputDatetime === null) {
  2832. this.tab2.getdataListParm.parammaps.inputDatetime = ''
  2833. }
  2834. this.tab2.getdataListParm.offset = 1
  2835. this.getTab2List()
  2836. },
  2837. handleTab2Export() {
  2838. this.$alert('合同明细正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  2839. this.isPercentage = true
  2840. this.percentage = 1
  2841. var timer = setInterval(() => {
  2842. this.percentage += 5
  2843. if (this.percentage > 95) {
  2844. this.percentage = 99
  2845. clearInterval(timer)
  2846. }
  2847. this.percentage = this.percentage
  2848. }, 1000)
  2849. if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
  2850. this.tab2.getdataListParm.parammaps.startTime = this.$refs['inputDatetime'].value[0]
  2851. this.tab2.getdataListParm.parammaps.stopTime = this.$refs['inputDatetime'].value[1]
  2852. } else {
  2853. this.tab2.getdataListParm.parammaps.startTime = ''
  2854. this.tab2.getdataListParm.parammaps.stopTime = ''
  2855. }
  2856. this.tab2.getdataListParm.pagecount = ''
  2857. GetDataByName(this.tab2.getdataListParm).then(response => {
  2858. if (response.data.list !== null) {
  2859. for (let i = 0; i < response.data.list.length; i++) {
  2860. if (response.data.list[i].isZeroStock == 0) {
  2861. response.data.list[i].isZeroStock = '否'
  2862. } else {
  2863. response.data.list[i].isZeroStock = '是'
  2864. }
  2865. }
  2866. this.percentage = 99
  2867. setTimeout(() => {
  2868. this.isPercentage = false
  2869. }, 2000)
  2870. } else {
  2871. this.percentage = 99
  2872. setTimeout(() => {
  2873. this.isPercentage = false
  2874. }, 2000)
  2875. }
  2876. this.tab2.getdataListParm.pagecount = 10
  2877. this.$nextTick(() => {
  2878. const ExcelDatas = [
  2879. {
  2880. tHeader: ['牧场', '合同编号', '合同状态', '供应商', '合同开始日期', '合同截止日期', '零库存', '备件编号', '备件名称', '规格', '备件品牌', '计量单位', '计划量', '单价', '备注', '录入人', '录入日期'],
  2881. filterVal: ['pastureName', 'contractCode', 'statue', 'providerName', 'startTime', 'stopTime', 'isZeroStock', 'partCode', 'partName', 'specification', 'brand', 'unit', 'planAmount', 'price', 'remark', 'creatorMan', 'creatorTime'],
  2882. tableDatas: response.data.list,
  2883. sheetName: '合同明细'
  2884. }
  2885. ]
  2886. json2excel(ExcelDatas, '合同明细', true, 'xlsx')
  2887. })
  2888. })
  2889. }
  2890. }
  2891. }
  2892. </script>
  2893. <style lang="scss" scoped>
  2894. /deep/ .el-badge__content.is-fixed{
  2895. z-index: 1;
  2896. }
  2897. </style>