index1.vue 154 KB

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