index.vue 159 KB

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