index.vue 154 KB

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