index.vue 157 KB

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