index.vue 154 KB

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