index.vue 107 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430
  1. <template>
  2. <div class="app-container">
  3. <div class="filter-container">
  4. <el-select v-model="getdataListParm.parammaps.pastureName" placeholder="牧场" class="filter-item" style="width: 120px;" @change="changePastureName">
  5. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
  6. </el-select>
  7. <el-input v-model="getdataListParm.parammaps.upkeepCode" placeholder="保养单号" clearable style="width: 180px;" class="filter-item" />
  8. <el-input v-model="getdataListParm.parammaps.eqName" placeholder="设备名称" clearable style="width: 180px;" class="filter-item" />
  9. <el-input v-model="getdataListParm.parammaps.eqCode" placeholder="设备内部编号" clearable style="width: 180px;" class="filter-item" />
  10. <el-select v-model="getdataListParm.parammaps.departmentId" clearable placeholder="部门" class="filter-item" style="width: 120px;">
  11. <el-option v-for="item in findAllDepart" :key="item.id" :label="item.name" :value="item.id" />
  12. </el-select>
  13. <el-select v-model="getdataListParm.parammaps.statue" clearable placeholder="处理状态" class="filter-item" style="width: 120px;">
  14. <el-option v-for="item in statues" :key="item.id" :label="item.name" :value="item.id" />
  15. </el-select>
  16. <el-select v-model="getdataListParm.parammaps.SHStatue" clearable placeholder="审核状态" class="filter-item" style="width: 120px;">
  17. <el-option v-for="item in SHStatues" :key="item.id" :label="item.name" :value="item.id" />
  18. </el-select>
  19. <el-date-picker ref="inputDatetime" v-model="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="结束日期" />
  20. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
  21. <div>
  22. <el-radio-group v-model="radioAll" style="margin-top:-9px" @change="changeAll()">
  23. <el-radio-button label="全部" />
  24. <el-badge :value="pending.total" class="item">
  25. <el-radio-button label="待处理" />
  26. </el-badge>
  27. <el-radio-button label="已处理" />
  28. </el-radio-group>
  29. </div>
  30. </div>
  31. <el-table
  32. :key="tableKey"
  33. v-loading="listLoading"
  34. element-loading-text="给我一点时间"
  35. :data="list"
  36. border
  37. fit
  38. highlight-current-row
  39. style="width: 100%;"
  40. :row-style="rowStyle"
  41. :cell-style="tableCellStyle"
  42. class="elTable table-fixed"
  43. :max-height="myHeight"
  44. >
  45. <el-table-column label="序号" align="center" type="index" width="50px">
  46. <template slot-scope="scope">
  47. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  48. </template>
  49. </el-table-column>
  50. <el-table-column label="保养单号" min-width="140px" align="center">
  51. <template slot-scope="scope">
  52. <span>{{ scope.row.upkeepCode }}</span>
  53. </template>
  54. </el-table-column>
  55. <el-table-column label="牧场" min-width="140px" align="center">
  56. <template slot-scope="scope">
  57. <span>{{ scope.row.pastureName }}</span>
  58. </template>
  59. </el-table-column>
  60. <el-table-column label="设备内部编号" min-width="80px" align="center">
  61. <template slot-scope="scope">
  62. <span>{{ scope.row.eqCode }}</span>
  63. </template>
  64. </el-table-column>
  65. <el-table-column label="设备名称" min-width="100px" align="center">
  66. <template slot-scope="scope">
  67. <span>{{ scope.row.eqName }}</span>
  68. </template>
  69. </el-table-column>
  70. <el-table-column label="规格型号" min-width="80px" align="center">
  71. <template slot-scope="scope">
  72. <span>{{ scope.row.specification }}</span>
  73. </template>
  74. </el-table-column>
  75. <el-table-column label="部门" min-width="80px" align="center">
  76. <template slot-scope="scope">
  77. <span>{{ scope.row.departmentName }}</span>
  78. </template>
  79. </el-table-column>
  80. <el-table-column label="机修" min-width="100px" align="center">
  81. <template slot-scope="scope">
  82. <span>{{ scope.row.useEmpName }}</span>
  83. </template>
  84. </el-table-column>
  85. <el-table-column label="保养人" min-width="100px" align="center">
  86. <template slot-scope="scope">
  87. <span>{{ scope.row.upkeepPerson}}</span>
  88. </template>
  89. </el-table-column>
  90. <el-table-column label="保养日期" sortable prop="plantime" min-width="80px" align="center" />
  91. <el-table-column label="处理状态" min-width="100px" align="center" :formatter="statue" />
  92. <el-table-column label="领用单状态" min-width="80px" align="center">
  93. <template slot-scope="scope">
  94. <span>{{ scope.row.LYStatue }}</span>
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="旧品录入状态" min-width="110px" align="center">
  98. <template slot-scope="scope">
  99. <span>{{ scope.row.LRStatue }}</span>
  100. </template>
  101. </el-table-column>
  102. <el-table-column label="审核状态" min-width="80px" align="center" :formatter="SHStatue" />
  103. <el-table-column prop="img" label="保养过程" width="180" align="center">
  104. <template slot-scope="scope">
  105. <!-- <el-link @click="preview(scope.row)" v-if="scope.row.videoTxt == '已录制'">{{ scope.row.videoTxt }} </el-link> -->
  106. <a style="border-bottom: 1px solid #333;" @click="preview(scope.row)" v-if="scope.row.videoTxt == '已录制'">{{ scope.row.videoTxt }}</a>
  107. <el-link v-if="scope.row.videoTxt == '未录制'">未录制 </el-link>
  108. <el-link v-if="scope.row.videoTxt == '已录制未上传'">已录制未上传 </el-link>
  109. </template>
  110. </el-table-column>
  111. <el-table-column label="操作" align="center" min-width="300" class-name="small-padding fixed-width" fixed="right">
  112. <template slot-scope="{row}">
  113. <el-button v-if="isSee" type="primary" size="mini" @click="form_see(row)">查看</el-button>
  114. <!-- 保养及领用-->
  115. <el-button v-if="(row.SHStatue == 1 || row.SHStatue== 4 || row.SHStatue== 6 || row.SHStatue== 8 ) && row.LYStatue == '未领用' && row.statue !== 0 && isLingYong && row.upkeepPersonId == getdataListParm.parammaps.loginId" type="success" size="mini" style="width:80px;display:inline-block" @click="handleReceivingSpareParts(row)">保养及领用</el-button>
  116. <el-button v-else type="success" size="mini" style="width:70px;display:none" @click="handleReceivingSpareParts(row)">保养及领用</el-button>
  117. <!-- 完成保养 -->
  118. <el-button v-if="(row.SHStatue == 1 || row.SHStatue== 4 || row.SHStatue== 6 || row.SHStatue== 8) && row.statue !== 0 && isComplete && row.upkeepPersonId == getdataListParm.parammaps.loginId" type="success" size="mini" style="width:70px;display:inline-block" @click="handleCompleteMaintenance(row)">完成保养</el-button>
  119. <el-button v-else type="success" size="mini" style="width:70px;display:none" @click="handleCompleteMaintenance(row)">完成保养</el-button>
  120. <!-- 保养审核 -->
  121. <el-button v-if="(row.SHStatue == 2 ) && isCharge && row.useEmpId == getdataListParm.parammaps.loginId" type="success" size="mini" style="width:70px;display:inline-block" @click="handleExamine(row)">保养审核2</el-button>
  122. <el-button v-else type="success" size="mini" style="width:70px;display:none" @click="handleExamine(row)">保养审核2</el-button>
  123. <!-- 保养审核3 -->
  124. <el-button v-if="(row.SHStatue == 3) && isLeaderCharge" type="success" size="mini" style="width:70px;display:inline-block" @click="handleExamine2(row)">保养审核3</el-button>
  125. <el-button v-else type="success" size="mini" style="width:70px;display:none" @click="handleExamine2(row)">保养审核3</el-button>
  126. <!-- 保养审核2 -->
  127. <!-- <el-button v-if="(row.SHStatue == 3) && isDepartmentCharge && (row.departmentId ==getdataListParm.parammaps.logindeptId)" type="success" size="mini" style="width:70px;display:inline-block" @click="handleExamine3(row)">保养审核2</el-button>
  128. <el-button v-else type="success" size="mini" style="width:70px;display:none" @click="handleExamine3(row)">保养审核2</el-button> -->
  129. </template>
  130. </el-table-column>
  131. </el-table>
  132. <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="get_table_data" />
  133. <!-- 查看 -->
  134. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_See" :close-on-click-modal="false" width="90%" :append-to-body="true" @close="close_diago()" >
  135. <div class="app-see">
  136. <!-- 图片放大 -->
  137. <el-dialog
  138. :visible.sync="dialogVisibleImg"
  139. width="60%"
  140. ref="childDialog"
  141. :modal="false"
  142. custom-class="child-dialog"
  143. >
  144. <img :src="dialogImageUrl" alt="" @load="onLoad" width="80%">
  145. </el-dialog>
  146. <div v-if="statue1" class="see">
  147. <el-form
  148. ref="seeTemp"
  149. :rules="rules"
  150. :model="seeTemp"
  151. label-position="right"
  152. label-width="120px"
  153. style="width: 90%;margin:0 auto;"
  154. >
  155. <el-row>
  156. <el-col :span="8">
  157. <el-form-item label="保养单号:" prop="upkeepCode">
  158. <el-input ref="upkeepCode" v-model="seeTemp.upkeepCode" disabled />
  159. </el-form-item>
  160. </el-col>
  161. <el-col :span="8">
  162. <el-form-item label="设备名称:" prop="eqName">
  163. <el-input ref="eqName" v-model="seeTemp.eqName" disabled />
  164. </el-form-item>
  165. </el-col>
  166. <el-col :span="8">
  167. <el-form-item label="设备内部编号:" prop="eqCode">
  168. <el-input ref="eqCode" v-model="seeTemp.eqCode" disabled />
  169. </el-form-item>
  170. </el-col>
  171. </el-row>
  172. <el-row>
  173. <el-col :span="8">
  174. <el-form-item label="牧场:" prop="pastureName">
  175. <el-input ref="pastureName" v-model="seeTemp.pastureName" disabled />
  176. </el-form-item>
  177. </el-col>
  178. <el-col :span="8">
  179. <el-form-item label="部门:" prop="departmentName">
  180. <el-input ref="departmentName" v-model="seeTemp.departmentName" disabled />
  181. </el-form-item>
  182. </el-col>
  183. <el-col :span="8">
  184. <el-form-item label="责任人:" prop="employeName">
  185. <el-input ref="employeName" v-model="seeTemp.employeName" disabled />
  186. </el-form-item>
  187. </el-col>
  188. </el-row>
  189. <el-row>
  190. <el-col :span="8">
  191. <!-- <el-form-item label="保养人:" prop="upkeepPerson">
  192. <el-input ref="upkeepPerson" v-model="seeTemp.upkeepPerson" disabled />
  193. </el-form-item> -->
  194. <el-form-item label="机修 :" prop="useEmpName">
  195. <el-input ref="useEmpName" v-model="seeTemp.useEmpName" disabled />
  196. </el-form-item>
  197. </el-col>
  198. <el-col :span="8">
  199. <el-form-item label="保养日期:" prop="plantime">
  200. <el-input ref="plantime" v-model="seeTemp.plantime" disabled />
  201. </el-form-item>
  202. </el-col>
  203. <el-col :span="8">
  204. <!-- <el-form-item label="使用人:" prop="useEmpName">
  205. <el-input ref="useEmpName" v-model="seeTemp.useEmpName" disabled />
  206. </el-form-item> -->
  207. <el-form-item label="保养人:" prop="upkeepPerson">
  208. <el-input ref="upkeepPerson" v-model="seeTemp.upkeepPerson" disabled />
  209. </el-form-item>
  210. </el-col>
  211. </el-row>
  212. <el-row>
  213. <el-col :span="12">
  214. <el-form-item label="保养内容:" prop="upNameLevel">
  215. <el-input ref="upNameLevel" v-model="seeTemp.upNameLevel" disabled />
  216. </el-form-item>
  217. </el-col>
  218. </el-row>
  219. </el-form>
  220. <el-table
  221. :key="tableKey"
  222. v-loading="listLoadingMaintenanceContent"
  223. element-loading-text="给我一点时间"
  224. :data="listMaintenanceContent"
  225. border
  226. fit
  227. highlight-current-row
  228. style="width: 90%;margin:0 auto;"
  229. :row-style="rowStyle"
  230. :cell-style="cellStyle"
  231. class="elTable table-fixed"
  232. >
  233. <el-table-column label="序号" align="center" type="index" width="50px">
  234. <template slot-scope="scope">
  235. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  236. </template>
  237. </el-table-column>
  238. <el-table-column label="部位" min-width="140px" align="center">
  239. <template slot-scope="scope">
  240. <span>{{ scope.row.positionName }}</span>
  241. </template>
  242. </el-table-column>
  243. <el-table-column label="项目" min-width="140px" align="center">
  244. <template slot-scope="scope">
  245. <span>{{ scope.row.program }}</span>
  246. </template>
  247. </el-table-column>
  248. <el-table-column label="标准" min-width="80px" align="center">
  249. <template slot-scope="scope">
  250. <span>{{ scope.row.standard }}</span>
  251. </template>
  252. </el-table-column>
  253. <el-table-column label="执行动作" min-width="80px" align="center">
  254. <template slot-scope="scope">
  255. <span>{{ scope.row.active }}</span>
  256. </template>
  257. </el-table-column>
  258. </el-table>
  259. <el-form
  260. ref="seeTemp"
  261. :rules="rules"
  262. :model="seeTemp"
  263. label-position="right"
  264. label-width="120px"
  265. style="width: 90%;margin:0 auto;"
  266. >
  267. <el-row>
  268. <el-col>
  269. <el-form-item label="流程进度" />
  270. <el-steps :active="active" align-center finish-status="success">
  271. <el-step
  272. v-for="(item,index) in activeList"
  273. :key="index"
  274. :title="item.title"
  275. :status="item.status"
  276. >
  277. <template slot="description">
  278. <div class="step-row">
  279. <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
  280. <div>{{ item.reason }}</div>
  281. <div>{{ item.scores }}</div>
  282. </div>
  283. </template>
  284. </el-step>
  285. </el-steps>
  286. </el-col>
  287. </el-row>
  288. <el-row>
  289. <el-col>
  290. <el-form-item label="操作:">
  291. <el-button v-if="(seeTemp.SHStatue == 1 || seeTemp.SHStatue== 4 || seeTemp.SHStatue== 6 || seeTemp.SHStatue== 8) && seeTemp.LYStatue == '未领用' && seeTemp.statue !== 0 && isLingYong && seeTemp.upkeepPersonId == getdataListParm.parammaps.loginId" type="success" style="display:inline-block" @click="handleReceivingSpareParts()">保养及领用</el-button>
  292. <el-button v-else type="success" style="display:none" @click="handleReceivingSpareParts()">保养及领用</el-button>
  293. <!-- 完成保养 -->
  294. <el-button v-if="(seeTemp.SHStatue == 1 || seeTemp.SHStatue== 4 || seeTemp.SHStatue== 6 || seeTemp.SHStatue== 8) && seeTemp.statue !== 0 && isComplete && seeTemp.upkeepPersonId == getdataListParm.parammaps.loginId" type="success" style="display:inline-block" @click="handleCompleteMaintenance()">完成保养</el-button>
  295. <el-button v-else type="success" style="display:none" @click="handleCompleteMaintenance()">完成保养</el-button>
  296. <!-- 保养审核 -->
  297. <el-button v-if="seeTemp.SHStatue == 2 && isCharge && seeTemp.useEmpId == getdataListParm.parammaps.loginId" type="success" style="display:inline-block" @click="handleExamine()">保养审核</el-button>
  298. <el-button v-else type="success" style="display:none" @click="handleExamine()">保养审核</el-button>
  299. <!-- 保养审核3 -->
  300. <el-button v-if="(seeTemp.SHStatue == 3) && isLeaderCharge" type="success" style="display:inline-block" @click="handleExamine2()">保养审核3</el-button>
  301. <el-button v-else type="success" style="display:none" @click="handleExamine2()">保养审核3</el-button>
  302. <!-- 保养审核2 -->
  303. <!-- <el-button v-if="(seeTemp.SHStatue == 3) && isDepartmentCharge && (seeTemp.departmentId ==getdataListParm.parammaps.logindeptId)" type="success" style="width:70px;display:inline-block" @click="handleExamine3()">保养审核2</el-button>
  304. <el-button v-else type="success" style="width:70px;display:none" @click="handleExamine3()">保养审核2</el-button> -->
  305. </el-form-item>
  306. </el-col>
  307. </el-row>
  308. </el-form>
  309. </div>
  310. <div v-if="statue2" class="see">
  311. <el-tabs v-model="activeName">
  312. <el-tab-pane label="保养信息" name="first">
  313. <el-form
  314. ref="seeTemp"
  315. :rules="rules"
  316. :model="seeTemp"
  317. label-position="right"
  318. label-width="120px"
  319. style="width: 90%;margin:0 auto;"
  320. >
  321. <el-row>
  322. <el-col :span="8">
  323. <el-form-item label="保养单号:" prop="upkeepCode">
  324. <el-input ref="upkeepCode" v-model="seeTemp.upkeepCode" disabled />
  325. </el-form-item>
  326. </el-col>
  327. <el-col :span="8">
  328. <el-form-item label="设备名称:" prop="eqName">
  329. <el-input ref="eqName" v-model="seeTemp.eqName" disabled />
  330. </el-form-item>
  331. </el-col>
  332. <el-col :span="8">
  333. <el-form-item label="设备内部编号:" prop="eqCode">
  334. <el-input ref="eqCode" v-model="seeTemp.eqCode" disabled />
  335. </el-form-item>
  336. </el-col>
  337. </el-row>
  338. <el-row>
  339. <el-col :span="8">
  340. <el-form-item label="牧场:" prop="pastureName">
  341. <el-input ref="pastureName" v-model="seeTemp.pastureName" disabled />
  342. </el-form-item>
  343. </el-col>
  344. <el-col :span="8">
  345. <el-form-item label="部门:" prop="departmentName">
  346. <el-input ref="departmentName" v-model="seeTemp.departmentName" disabled />
  347. </el-form-item>
  348. </el-col>
  349. <el-col :span="8">
  350. <el-form-item label="责任人:" prop="employeName">
  351. <el-input ref="employeName" v-model="seeTemp.employeName" disabled />
  352. </el-form-item>
  353. </el-col>
  354. </el-row>
  355. <el-row>
  356. <el-col :span="8">
  357. <!-- <el-form-item label="保养人:" prop="upkeepPerson">
  358. <el-input ref="upkeepPerson" v-model="seeTemp.upkeepPerson" disabled />
  359. </el-form-item> -->
  360. <el-form-item label="机修:" prop="useEmpName">
  361. <el-input ref="useEmpName" v-model="seeTemp.useEmpName" disabled />
  362. </el-form-item>
  363. </el-col>
  364. <el-col :span="8">
  365. <el-form-item label="保养日期:" prop="plantime">
  366. <el-input ref="plantime" v-model="seeTemp.plantime" disabled />
  367. </el-form-item>
  368. </el-col>
  369. <el-col :span="8">
  370. <!-- <el-form-item label="使用人:" prop="useEmpName">
  371. <el-input ref="useEmpName" v-model="seeTemp.useEmpName" disabled />
  372. </el-form-item> -->
  373. <el-form-item label="保养人:" prop="upkeepPerson">
  374. <el-input ref="upkeepPerson" v-model="seeTemp.upkeepPerson" disabled />
  375. </el-form-item>
  376. </el-col>
  377. </el-row>
  378. <el-row>
  379. <el-col :span="12">
  380. <el-form-item label="保养内容:" prop="upNameLevel">
  381. <el-input ref="upNameLevel" v-model="seeTemp.upNameLevel" disabled />
  382. </el-form-item>
  383. </el-col>
  384. </el-row>
  385. </el-form>
  386. <el-table
  387. :key="tableKey"
  388. v-loading="listLoadingMaintenanceContent"
  389. element-loading-text="给我一点时间"
  390. :data="listMaintenanceContent"
  391. border
  392. fit
  393. highlight-current-row
  394. style="width: 90%;margin:0 auto;"
  395. :row-style="rowStyle"
  396. :cell-style="cellStyle"
  397. class="elTable table-fixed"
  398. >
  399. <el-table-column label="序号" align="center" type="index" width="50px">
  400. <template slot-scope="scope">
  401. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  402. </template>
  403. </el-table-column>
  404. <el-table-column label="部位" min-width="140px" align="center">
  405. <template slot-scope="scope">
  406. <span>{{ scope.row.positionName }}</span>
  407. </template>
  408. </el-table-column>
  409. <el-table-column label="项目" min-width="140px" align="center">
  410. <template slot-scope="scope">
  411. <span>{{ scope.row.program }}</span>
  412. </template>
  413. </el-table-column>
  414. <el-table-column label="标准" min-width="80px" align="center">
  415. <template slot-scope="scope">
  416. <span>{{ scope.row.standard }}</span>
  417. </template>
  418. </el-table-column>
  419. <el-table-column label="执行动作" min-width="80px" align="center">
  420. <template slot-scope="scope">
  421. <span>{{ scope.row.active }}</span>
  422. </template>
  423. </el-table-column>
  424. </el-table>
  425. <el-form
  426. ref="seeTemp"
  427. :rules="rules"
  428. :model="seeTemp"
  429. label-position="right"
  430. label-width="120px"
  431. style="width: 90%;margin:0 auto;"
  432. >
  433. <!-- 图片上传todo: v-if="(seeTemp.SHStatue == 3) && isLeaderCharge" -->
  434. <div style="margin-top:20px;" >
  435. <el-row>
  436. <el-col :span="24">
  437. <el-form-item label="保养图片:" required>
  438. <el-upload
  439. id="uploadPic"
  440. ref="upload"
  441. :limit="3"
  442. list-type="picture-card"
  443. :file-list="fileList"
  444. :headers="headers"
  445. :action="uploadImageUrl"
  446. :auto-upload="true"
  447. :on-preview="handlePicPreview"
  448. :class="{ hide: showUpload }"
  449. :disabled="seeTemp.SHStatue != 2"
  450. :on-change="
  451. (file, fileList) => {
  452. return handlePicChange(file, fileList)
  453. }
  454. "
  455. :on-success="
  456. (response, file, fileList) => {
  457. return handlePicSuccess(response, file, fileList)
  458. }
  459. "
  460. :on-remove="
  461. (file, fileList) => {
  462. return handlePicRemove(file, fileList)
  463. }
  464. "
  465. >
  466. <i class="el-icon-plus" />
  467. </el-upload>
  468. </el-form-item>
  469. </el-col>
  470. <!-- <el-col :span="24" style="margin-left:120px;">
  471. <el-button type="primary" plain @click="handleSaveImg">确认上传图片</el-button>
  472. </el-col> -->
  473. </el-row>
  474. </div>
  475. <el-row>
  476. <el-col>
  477. <el-form-item label="流程进度" />
  478. <el-steps :active="active" align-center finish-status="success">
  479. <el-step
  480. v-for="(item,index) in activeList"
  481. :key="index"
  482. :title="item.title"
  483. :status="item.status"
  484. >
  485. <template slot="description">
  486. <div class="step-row">
  487. <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
  488. <div>{{ item.reason }}</div>
  489. <div>{{ item.scores }}</div>
  490. </div>
  491. </template>
  492. </el-step>
  493. </el-steps>
  494. </el-col>
  495. </el-row>
  496. <el-row>
  497. <el-col>
  498. <el-form-item label="操作:">
  499. <el-button v-if="(seeTemp.SHStatue == 1 || seeTemp.SHStatue== 4 || seeTemp.SHStatue== 6 || seeTemp.SHStatue== 8) && seeTemp.LYStatue == '未领用' && seeTemp.statue !== 0 && isLingYong && seeTemp.upkeepPersonId == getdataListParm.parammaps.loginId" type="success" style="display:inline-block" @click="handleReceivingSpareParts()">保养及领用</el-button>
  500. <el-button v-else type="success" style="width:70px;display:none" @click="handleReceivingSpareParts()">保养及领用</el-button>
  501. <!-- 完成保养 -->
  502. <el-button v-if="(seeTemp.SHStatue == 1 || seeTemp.SHStatue== 4 || seeTemp.SHStatue== 6 || seeTemp.SHStatue== 8) && seeTemp.statue !== 0 && isComplete && seeTemp.upkeepPersonId == getdataListParm.parammaps.loginId" type="success" style="display:inline-block" @click="handleCompleteMaintenance()">完成保养</el-button>
  503. <el-button v-else type="success" style="width:70px;display:none" @click="handleCompleteMaintenance()">完成保养</el-button>
  504. <!-- 保养审核 -->
  505. <el-button v-if="seeTemp.SHStatue == 2 && isCharge && seeTemp.useEmpId == getdataListParm.parammaps.loginId" type="success" style="display:inline-block" @click="handleExamine()">保养审核</el-button>
  506. <el-button v-else type="success" style="width:70px;display:none" @click="handleExamine()">保养审核</el-button>
  507. <!-- 保养审核3 -->
  508. <el-button v-if="(seeTemp.SHStatue == 3) && isLeaderCharge" type="success" style="display:inline-block" @click="handleExamine2()">保养审核3</el-button>
  509. <el-button v-else type="success" style="width:70px;display:none" @click="handleExamine2()">保养审核3</el-button>
  510. <!-- 保养审核2 -->
  511. <!-- <el-button v-if="(seeTemp.SHStatue == 3) && isDepartmentCharge && (seeTemp.departmentId ==getdataListParm.parammaps.logindeptId)" type="success" style="display:inline-block" @click="handleExamine3()">保养审核2</el-button>
  512. <el-button v-else type="success" style="width:70px;display:none" @click="handleExamine3()">保养审核2</el-button> -->
  513. </el-form-item>
  514. </el-col>
  515. </el-row>
  516. </el-form>
  517. </el-tab-pane>
  518. <el-tab-pane label="领用记录" name="second">
  519. <el-form ref="collarUseTemp" :rules="rules" :model="collarUseTemp" label-position="right" label-width="120px" style="width: 90%;margin:0 auto;">
  520. <el-row>
  521. <el-col :span="6">
  522. <el-form-item label="领用单号:" prop="applyCode" >
  523. <span>{{ (collarUseTemp && collarUseTemp.applyCode) || ''}}</span>
  524. </el-form-item>
  525. </el-col>
  526. <el-col :span="6">
  527. <el-form-item label="领用部门:" prop="departmentName">
  528. <span>{{ (collarUseTemp && collarUseTemp.departmentName) || '' }}</span>
  529. </el-form-item>
  530. </el-col>
  531. <el-col :span="6">
  532. <el-form-item label="领用日期:" prop="createDate">
  533. <span>{{ (collarUseTemp && collarUseTemp.createDate) || '' }}</span>
  534. </el-form-item>
  535. </el-col>
  536. <el-col :span="6">
  537. <el-form-item label="领用状态:" prop="statueName">
  538. <span>{{ (collarUseTemp && collarUseTemp.statueName) || '' }}</span>
  539. </el-form-item>
  540. </el-col>
  541. </el-row>
  542. </el-form>
  543. <el-table
  544. :key="tableKey"
  545. v-loading="listLoadingCollarUse"
  546. element-loading-text="给我一点时间"
  547. :data="listCollarUse"
  548. border
  549. fit
  550. highlight-current-row
  551. style="width: 100%;"
  552. :row-style="rowStyle"
  553. :cell-style="cellStyle"
  554. class="elTable"
  555. @cell-click="openDetails"
  556. @sort-change="tableSort"
  557. >
  558. <el-table-column label="序号" align="center" type="index" width="50px">
  559. <template slot-scope="scope">
  560. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  561. </template>
  562. </el-table-column>
  563. <el-table-column label="备件编号" min-width="110px" align="center">
  564. <template slot-scope="scope">
  565. <span>{{ scope.row.partCode }}</span>
  566. </template>
  567. </el-table-column>
  568. <el-table-column label="备件名称" min-width="110px" align="center">
  569. <template slot-scope="scope">
  570. <span>{{ scope.row.partName }}</span>
  571. </template>
  572. </el-table-column>
  573. <el-table-column label="备件规格" min-width="110px" align="center">
  574. <template slot-scope="scope">
  575. <span>{{ scope.row.specification }}</span>
  576. </template>
  577. </el-table-column>
  578. <el-table-column sortable prop="reportery" label="库存数" min-width="110px" align="center">
  579. <template slot-scope="scope">
  580. <span>{{ scope.row.reportery }}</span>
  581. </template>
  582. </el-table-column>
  583. <el-table-column sortable prop="amount" label="领用数量" min-width="110px" align="center">
  584. <template slot-scope="scope">
  585. <span>{{ scope.row.amount }}</span>
  586. </template>
  587. </el-table-column>
  588. <el-table-column label="用途" min-width="110px" align="center">
  589. <template slot-scope="scope">
  590. <span>{{ scope.row.note }}</span>
  591. </template>
  592. </el-table-column>
  593. </el-table>
  594. </el-tab-pane>
  595. <el-tab-pane label="旧品录入记录" name="third">
  596. <el-table
  597. :key="tableKey"
  598. v-loading="listLoadingOldProducts"
  599. element-loading-text="给我一点时间"
  600. :data="listOldProducts"
  601. border
  602. fit
  603. highlight-current-row
  604. style="width: 100%;"
  605. :row-style="rowStyle"
  606. :cell-style="cellStyle"
  607. class="elTable"
  608. @sort-change="tableSort"
  609. >
  610. <el-table-column label="序号" align="center" type="index" width="50px">
  611. <template slot-scope="scope">
  612. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  613. </template>
  614. </el-table-column>
  615. <el-table-column label="备件编号" min-width="110px" align="center">
  616. <template slot-scope="scope">
  617. <span>{{ scope.row.partCode }}</span>
  618. </template>
  619. </el-table-column>
  620. <el-table-column label="备件名称" prop="id" align="center">
  621. <template slot-scope="scope">
  622. <span>{{ scope.row.partName }}</span>
  623. </template>
  624. </el-table-column>
  625. <el-table-column label="备件规格" min-width="110px" align="center">
  626. <template slot-scope="scope">
  627. <span>{{ scope.row.specification }}</span>
  628. </template>
  629. </el-table-column>
  630. <el-table-column sortable prop="acturalAmount" label="录入数量" min-width="110px" align="center">
  631. <template slot-scope="scope">
  632. <span>{{ scope.row.acturalAmount }}</span>
  633. </template>
  634. </el-table-column>
  635. </el-table>
  636. </el-tab-pane>
  637. </el-tabs>
  638. </div>
  639. </div>
  640. <div slot="footer" class="dialog-footer" style="bottom:5px;">
  641. <el-button @click="close_diago()">关闭</el-button>
  642. </div>
  643. </el-dialog>
  644. <!-- 保养及领用 -->
  645. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_ReceivingSpareParts" :close-on-click-modal="false" width="90%">
  646. <el-tabs v-model="activeName2">
  647. <el-tab-pane label="保养" name="first">
  648. <el-form
  649. ref="maintainTemp"
  650. :rules="rules"
  651. :model="maintainTemp"
  652. label-position="right"
  653. label-width="120px"
  654. style="width: 90%;margin:0 auto;"
  655. >
  656. <el-row>
  657. <el-col :span="8">
  658. <el-form-item label="使用人:" prop="employeeId">
  659. <el-select v-model="maintainTemp.employeeId" placeholder="使用人" class="filter-item" style="width: 120px;">
  660. <el-option v-for="item in empdeptList" :key="item.id" :label="item.empname" :value="item.id" />
  661. </el-select>
  662. </el-form-item>
  663. </el-col>
  664. </el-row>
  665. <el-row>
  666. <el-col :span="12">
  667. <el-form-item label="保养内容:" prop="upNameLevel">
  668. <el-input ref="upNameLevel" v-model="maintainTemp.upNameLevel" disabled />
  669. </el-form-item>
  670. </el-col>
  671. </el-row>
  672. </el-form>
  673. <el-table
  674. :key="tableKey"
  675. v-loading="listLoadingMaintenanceContent"
  676. element-loading-text="给我一点时间"
  677. :data="listMaintenanceContent"
  678. border
  679. fit
  680. highlight-current-row
  681. style="width: 90%;margin:0 auto;"
  682. :row-style="rowStyle"
  683. :cell-style="cellStyle"
  684. class="elTable table-fixed"
  685. >
  686. <el-table-column label="序号" align="center" type="index" width="50px">
  687. <template slot-scope="scope">
  688. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  689. </template>
  690. </el-table-column>
  691. <el-table-column label="部位" min-width="140px" align="center">
  692. <template slot-scope="scope">
  693. <span>{{ scope.row.positionName }}</span>
  694. </template>
  695. </el-table-column>
  696. <el-table-column label="项目" min-width="140px" align="center">
  697. <template slot-scope="scope">
  698. <span>{{ scope.row.program }}</span>
  699. </template>
  700. </el-table-column>
  701. <el-table-column label="标准" min-width="80px" align="center">
  702. <template slot-scope="scope">
  703. <span>{{ scope.row.standard }}</span>
  704. </template>
  705. </el-table-column>
  706. <el-table-column label="执行动作" min-width="80px" align="center">
  707. <template slot-scope="scope">
  708. <el-select v-model="scope.row.active" class="filter-item" style="width: 80%;">
  709. <el-option v-for="item in getDictByName" :key="item.id" :label="item. label" :value="item.value" />
  710. </el-select>
  711. </template>
  712. </el-table-column>
  713. </el-table>
  714. </el-tab-pane>
  715. <el-tab-pane label="备件领用" name="second">
  716. <div class="app-receivingSpareParts">
  717. <el-form
  718. ref="receivingTemp"
  719. :rules="rules"
  720. :model="receivingTemp"
  721. label-position="right"
  722. label-width="120px"
  723. style="width: 90%;margin:0 auto;"
  724. >
  725. <el-row>
  726. <el-col :span="8">
  727. <el-form-item label="领用单号:" prop="applyCode" >
  728. <span>{{(receivingTemp && receivingTemp.applyCode) || '' }}</span>
  729. </el-form-item>
  730. </el-col>
  731. <el-col :span="8">
  732. <el-form-item label="领用部门:" prop="departmentName">
  733. <span>{{ (receivingTemp && receivingTemp.departmentName) || '' }}</span>
  734. </el-form-item>
  735. </el-col>
  736. <el-col :span="8">
  737. <el-form-item label="领用日期:" prop="createDate">
  738. <span>{{ receivingTemp.createDate }}</span>
  739. </el-form-item>
  740. </el-col>
  741. </el-row>
  742. <el-row>
  743. <el-form-item label="所需备件:" prop="partCode">
  744. <el-autocomplete
  745. v-model="receivingTemp.partCode"
  746. value-key="name"
  747. class="inline-input"
  748. :fetch-suggestions="sparePartSearch"
  749. placeholder="请输入备件编号或备件名称或备件规格"
  750. style="width:100%"
  751. @select="handleSelectSparePart"
  752. >
  753. <template slot-scope="{ item }">
  754. <b>备件编号:</b><span class="name">{{ item.partCode }}</span>
  755. |<b>备件名称:</b><span class="addr">{{ item.partName }}</span>
  756. |<b style="padding-left:3em;">备件规格:</b><span class="addr">{{ item.specification }}</span>
  757. </template>
  758. </el-autocomplete>
  759. </el-form-item>
  760. </el-row>
  761. </el-form>
  762. <el-table
  763. :key="tableKey"
  764. v-loading="listLoadingCollarUse"
  765. element-loading-text="给我一点时间"
  766. :data="listCollarUse"
  767. border
  768. fit
  769. highlight-current-row
  770. style="width: 100%;"
  771. :row-style="rowStyle"
  772. :cell-style="cellStyle"
  773. class="elTable"
  774. >
  775. <!-- table表格 -->
  776. <el-table-column label="序号" align="center" type="index" width="50px">
  777. <template slot-scope="scope">
  778. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  779. </template>
  780. </el-table-column>
  781. <el-table-column label="备件编号" min-width="110px" align="center">
  782. <template slot-scope="scope">
  783. <span>{{ scope.row.partCode }}</span>
  784. </template>
  785. </el-table-column>
  786. <el-table-column label="备件名称" min-width="110px" align="center">
  787. <template slot-scope="scope">
  788. <span>{{ scope.row.partName }}</span>
  789. </template>
  790. </el-table-column>
  791. <el-table-column label="备件规格" min-width="110px" align="center">
  792. <template slot-scope="scope">
  793. <span>{{ scope.row.specification }}</span>
  794. </template>
  795. </el-table-column>
  796. <el-table-column label="库存数" min-width="110px" align="center">
  797. <template slot-scope="scope">
  798. <span>{{ scope.row.reportery }}</span>
  799. </template>
  800. </el-table-column>
  801. <el-table-column label="领用数量" min-width="110px" align="center">
  802. <template slot-scope="scope">
  803. <el-form :model="scope.row">
  804. <el-form-item prop="amount">
  805. <el-input ref="amount" v-model="scope.row.amount" style="margin-top:15px" />
  806. </el-form-item>
  807. </el-form>
  808. </template>
  809. </el-table-column>
  810. <el-table-column label="用途" prop="note" align="center" min-width="60">
  811. <template slot-scope="scope">
  812. <el-form :model="scope.row">
  813. <el-form-item prop="note">
  814. <el-input ref="note" v-model="scope.row.note" style="margin-top:15px" />
  815. </el-form-item>
  816. </el-form>
  817. </template>
  818. </el-table-column>
  819. <el-table-column label="操作" align="center" width="60" class-name="small-padding fixed-width" fixed="right">
  820. <template slot-scope="{row}">
  821. <a class="del" @click="sparePartsDelete(row)">删除</a>
  822. </template>
  823. </el-table-column>
  824. </el-table>
  825. </div>
  826. </el-tab-pane>
  827. </el-tabs>
  828. <div slot="footer" class="dialog-footer" style="bottom: 5px">
  829. <el-button v-if="activeName2=='first'" type="primary" :disabled="isokDisable" @click="createReceivingSparePartseData1()">确认</el-button>
  830. <el-button v-if="activeName2=='second'" type="primary" :disabled="isokDisable" @click="createReceivingSparePartseData2()">确认</el-button>
  831. <el-button @click="dialogFormVisible_ReceivingSpareParts = false;">关闭</el-button>
  832. </div>
  833. </el-dialog>
  834. <!-- 完成保养 -->
  835. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_maintainComplete" :close-on-click-modal="false" width="50%">
  836. <div class="maintainComplete">
  837. <el-form ref="maintainCompleteTemp" :rules="rules" :model="maintainCompleteTemp" label-position="right" label-width="120px" style="width: 90%;margin:0 auto;">
  838. <el-row>
  839. <el-col :span="20">
  840. <el-form-item label="是否录入旧品:" prop="isOldProducts">
  841. <el-radio-group v-model="maintainCompleteTemp.isOldProducts" @change="changeIsOldProducts">
  842. <el-radio :label="0" checked>否</el-radio>
  843. <el-radio :label="1">是</el-radio>
  844. </el-radio-group>
  845. </el-form-item>
  846. </el-col>
  847. </el-row>
  848. <el-row v-if="No2">
  849. <el-col :span="24">
  850. <el-form-item label="旧品录入:" prop="partCode">
  851. <el-autocomplete
  852. v-model="maintainCompleteTemp.partCode"
  853. value-key="name"
  854. class="inline-input"
  855. :fetch-suggestions="oldProductsSearch"
  856. placeholder="请输入备件编号或备件名称或备件规格 "
  857. style="width:100%"
  858. @select="handleSelectOldProducts"
  859. >
  860. <template slot-scope="{ item }">
  861. <b>备件编号:</b><span class="name">{{ item.partCode }}</span>
  862. |<b>备件名称:</b><span class="addr">{{ item.partName }}</span>
  863. |<b style="padding-left:3em;">备件规格:</b><span class="addr">{{ item.specification }}</span>
  864. </template>
  865. </el-autocomplete>
  866. </el-form-item>
  867. </el-col>
  868. </el-row>
  869. </el-form>
  870. <el-table
  871. v-if="No2"
  872. :key="tableKey"
  873. v-loading="listLoading"
  874. element-loading-text="给我一点时间"
  875. :data="listAdd"
  876. border
  877. fit
  878. highlight-current-row
  879. style="width: 100%;margin-bottom:30px"
  880. :cell-style="cellStyle"
  881. class="elTable"
  882. :row-style="rowStyle"
  883. >
  884. <!-- table表格 -->
  885. <el-table-column type="index" label="序号" align="center" width="50px" />
  886. <el-table-column label="备件编号" min-width="90px" prop="partCode" align="center">
  887. <template slot-scope="scope">
  888. <span>{{ scope.row.partCode }}</span>
  889. </template>
  890. </el-table-column>
  891. <el-table-column label="备件名称" min-width="60px" align="center">
  892. <template slot-scope="scope">
  893. <span>{{ scope.row.partName }}</span><br>
  894. </template>
  895. </el-table-column>
  896. <el-table-column label="备件规格" prop="specification" align="center" min-width="90">
  897. <template slot-scope="scope">
  898. <span>{{ scope.row.specification }}</span>
  899. </template>
  900. </el-table-column>
  901. <el-table-column label="录入数量" prop="brand" align="center" min-width="60">
  902. <template slot-scope="scope">
  903. <el-form :model="scope.row" :rules="rules">
  904. <el-form-item prop="acturalAmount">
  905. <el-input ref="acturalAmount" v-model="scope.row.acturalAmount" style="margin-top:15px" />
  906. </el-form-item>
  907. </el-form>
  908. </template>
  909. </el-table-column>
  910. <el-table-column label="用途" prop="note" align="center" min-width="60">
  911. <template slot-scope="scope">
  912. <el-form :model="scope.row">
  913. <el-form-item prop="note">
  914. <el-input ref="note" v-model="scope.row.note" style="margin-top:15px" />
  915. </el-form-item>
  916. </el-form>
  917. </template>
  918. </el-table-column>
  919. <el-table-column label="操作" align="center" width="60" class-name="small-padding fixed-width" fixed="right">
  920. <template slot-scope="{row}">
  921. <a class="del" @click="partDelete(row)">删除</a>
  922. </template>
  923. </el-table-column>
  924. </el-table>
  925. </div>
  926. <div slot="footer" class="dialog-footer">
  927. <el-button type="primary" :disabled="isokDisable" @click="dialogStatus==='maintainComplete'?createMaintainCompleteData():createMaintainCompleteData()">确认</el-button>
  928. <el-button @click="dialogFormVisible_maintainComplete = false;">关闭</el-button>
  929. </div>
  930. </el-dialog>
  931. <!-- 保养审核 -->
  932. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_examine" :close-on-click-modal="false" width="30%">
  933. <div class="app-examine">
  934. <h3 style="width: 100%;margin:0 auto;line-height:50px">请确认保养审核结果:</h3>
  935. <el-form ref="examineTemp" :rules="rules" :model="examineTemp" label-position="right" style="width: 60%;height:150px;margin:0 auto;">
  936. <el-row style="width:88%;margin:0 auto;">
  937. <el-col :span="20">
  938. <el-form-item>
  939. <el-radio-group v-model="examineTemp.isStatue" @change="changeIsStatue">
  940. <el-radio :label="3">通过</el-radio>
  941. <el-radio :label="4">不通过</el-radio>
  942. </el-radio-group>
  943. </el-form-item>
  944. </el-col>
  945. <el-col v-if="isStatueReason" :span="20">
  946. <el-input v-model="examineTemp.workflowNote" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入保养不通过的原因" />
  947. </el-col>
  948. </el-row>
  949. <el-row v-if="examineTemp.SHStatue == 2 && examineTemp.isStatue == 3" style="width:90%;margin:0 auto;">
  950. <el-col :span="24">
  951. <el-form-item label="评分:" prop="scores">
  952. <el-rate v-model="examineTemp.scores" show-text :texts="['1分','2分', '3分', '4分', '5分']" style="width:100%;margin-top:10px;" />
  953. </el-form-item>
  954. </el-col>
  955. </el-row>
  956. </el-form>
  957. </div>
  958. <div slot="footer" class="dialog-footer">
  959. <el-button v-if="dialogStatus==='examine'" type="primary" :disabled="isokDisable" @click="createExamineData()">确认</el-button>
  960. <el-button v-if="dialogStatus==='examine2'" type="primary" :disabled="isokDisable" @click="createExamineData2()">确认</el-button>
  961. <el-button v-if="dialogStatus==='examine3'" type="primary" :disabled="isokDisable" @click="createExamineData3()">确认</el-button>
  962. <el-button @click="dialogFormVisible_examine = false;">关闭</el-button>
  963. </div>
  964. </el-dialog>
  965. <!-- 视频 -->
  966. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_video" :close-on-click-modal="false" width="60%">
  967. <div class="app-video">
  968. <el-form ref="videoTemp" :rules="rules" :model="videoTemp" label-position="right" style="width: 80%;min-height:150px;margin:0 auto;">
  969. <el-row>
  970. <el-col :span="24">
  971. <el-form-item label="" prop="scores">
  972. <video :src="videoTemp.videoPath" controls="controls" style="width:90%;height:450px;margin:0 auto;" />
  973. </el-form-item>
  974. </el-col>
  975. </el-row>
  976. </el-form>
  977. </div>
  978. </el-dialog>
  979. </div>
  980. </template>
  981. <script>
  982. // 引入
  983. import { GetDataByName, GetDataByNames, PostDataByName, failproccess, ExecDataByConfig, checkButtons ,saveImgIds} from '@/api/common'
  984. // import { mapGetters } from 'vuex'
  985. import waves from '@/directive/waves' // waves directive
  986. import { parseTime, sortChange } from '@/utils/index.js'
  987. // eslint-disable-next-line no-unused-vars
  988. import Pagination from '@/components/Pagination' // secondary package based on el-pagination
  989. import Cookies from 'js-cookie'
  990. import { MessageBox } from 'element-ui'
  991. import { getToken } from '@/utils/auth'
  992. export default {
  993. name: 'Maintain',
  994. components: { Pagination },
  995. directives: { waves },
  996. data() {
  997. return {
  998. showUpload: false,
  999. fileList: [],
  1000. headers: { optname: 'insertcustompic', id: 1, token: getToken(), host: "192.168.1.250:8082" },
  1001. uploadImageUrl: process.env.VUE_APP_BASE_API + 'authdata/uploaderimage',
  1002. dialogImageUrl: '',
  1003. dialogVisibleImg: false,
  1004. // width:'40%',
  1005. myHeight: document.documentElement.clientHeight - 85- 250,
  1006. active: 0,
  1007. activeList: [],
  1008. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  1009. cellStyle: { padding: 0 + 'px' },
  1010. isokDisable: false,
  1011. rules: {
  1012. employeeId: [{ required: true, message: '必填', trigger: 'blur' }]
  1013. },
  1014. findAllPasture: [],
  1015. findAllDepart: [],
  1016. findAllEmploye: [],
  1017. requestParams: [
  1018. { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
  1019. { name: 'findAllDepart1', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }},
  1020. { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
  1021. { name: 'getDictByName', offset: 0, pagecount: 0, params: ['保养模板执行动作'] }
  1022. ],
  1023. getDepartParam: {
  1024. name: 'findAllDepart1', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }
  1025. },
  1026. statues: [{ id: '0', name: '已逾期' }, { id: '1', name: '保养中' }, { id: '2', name: '保养完成' }],
  1027. SHStatues: [{ id: '0', name: '审核中' }, { id: '1', name: '已通过' }, { id: '2', name: '未通过' }],
  1028. empdeptList: [],
  1029. getDictByName: [],
  1030. radio2: '全部',
  1031. textMap: {
  1032. see: '查看详情',
  1033. receivingSpareParts: '保养及领用',
  1034. maintainComplete: '完成保养',
  1035. examine: '保养审核',
  1036. examine2: '保养审核2',
  1037. examine3: '保养审核3',
  1038. video: '视频'
  1039. },
  1040. dialogStatus: '',
  1041. radioAll: '全部',
  1042. getdataListParm: {
  1043. name: 'getBigupkeepList',
  1044. page: 1,
  1045. offset: 1,
  1046. pagecount: 10,
  1047. returntype: 'Map',
  1048. parammaps: {
  1049. inputDatetime: '',
  1050. upkeepCode: '',
  1051. eqName: '',
  1052. eqCode: '',
  1053. departmentId: '',
  1054. statue: '',
  1055. pastureName: Cookies.get('pasturename'),
  1056. loginId: Cookies.get('employeid'),
  1057. menu: 'Maintain',
  1058. SHStatue: '',
  1059. logindeptId: Cookies.get('departmentid'),
  1060. loginpastureId: Cookies.get('pastureid')
  1061. }
  1062. },
  1063. total: 0,
  1064. tableKey: 0,
  1065. listLoading: false,
  1066. list: [],
  1067. // 查看
  1068. dialogFormVisible_See: false,
  1069. seeTemp: {
  1070. id:'',
  1071. scenePhoto1: -1,
  1072. scenePhoto2: -1,
  1073. scenePhoto3: -1
  1074. },
  1075. statue1: false,
  1076. statue2: false,
  1077. activeName: 'first',
  1078. listLoadingMaintenanceContent: false,
  1079. listMaintenanceContent: [],
  1080. getMaintenanceContentParm: {
  1081. name: 'getUpkeepTemplateListbyeqV2',
  1082. returntype: 'Map',
  1083. parammaps: {}
  1084. },
  1085. Reason: false,
  1086. // 查看-领用记录
  1087. getCollarUseParm: {
  1088. name: 'getPartsapplybyMt',
  1089. returntype: 'Map',
  1090. parammaps: {}
  1091. },
  1092. collarUseTemp: {
  1093. },
  1094. // 查看-领用记录table
  1095. getCollarUseListParm: {
  1096. name: 'getpartapplyListBybig',
  1097. returntype: 'Map',
  1098. parammaps: {}
  1099. },
  1100. listLoadingCollarUse: false,
  1101. listCollarUse: [],
  1102. // 查看-旧品录入记录table
  1103. getOldProductsParm: {
  1104. name: 'getMaintainRefuse',
  1105. returntype: 'Map',
  1106. parammaps: {}
  1107. },
  1108. listLoadingOldProducts: false,
  1109. listOldProducts: [],
  1110. // 保养及领用
  1111. dialogFormVisible_ReceivingSpareParts: false,
  1112. activeName2: 'first',
  1113. maintainTemp: {},
  1114. receivingTemp: {},
  1115. getEmpdeptParm: {
  1116. name: 'getEmpdept',
  1117. returntype: 'Map',
  1118. parammaps: {
  1119. deptId: ''
  1120. }
  1121. },
  1122. getAutoCreatCodeParm: {
  1123. name: 'autoCreatCode',
  1124. returntype: 'Map',
  1125. parammaps: {
  1126. pastureId: Cookies.get('pastureid'),
  1127. codeType: 'LY'
  1128. }
  1129. },
  1130. requestSparePart: {
  1131. name: 'getPartsListLY',
  1132. page: 1,
  1133. offset: 1,
  1134. pagecount: 20,
  1135. returntype: 'Map',
  1136. parammaps: {
  1137. pastureId: Cookies.get('pastureid')
  1138. }
  1139. },
  1140. postDataPramas: {},
  1141. // 完成保养
  1142. dialogFormVisible_maintainComplete: false,
  1143. maintainCompleteTemp: {},
  1144. requestOldProducts: {
  1145. name: 'getAllPartsListWB',
  1146. page: 1,
  1147. offset: 1,
  1148. pagecount: 10,
  1149. returntype: 'Map',
  1150. parammaps: {}
  1151. },
  1152. No2: false,
  1153. listAdd: [],
  1154. // 保养审核
  1155. dialogFormVisible_examine: false,
  1156. requestParam: {},
  1157. examineTemp: {
  1158. isStatue: 3
  1159. },
  1160. isStatueReason: false,
  1161. // 权限按钮
  1162. isSee: [],
  1163. isLingYong: [],
  1164. isComplete: [],
  1165. isCharge: [],
  1166. isLeaderCharge: [],
  1167. isDepartmentCharge: [],
  1168. buttons: [],
  1169. pending: {
  1170. total: 0,
  1171. getdataListParm: {
  1172. name: 'getBigupkeepWebListNO', page: 1, offset: 1, getTotal: 'total3', pagecount: 10, returntype: 'Map',
  1173. parammaps: {}
  1174. }
  1175. },
  1176. dialogFormVisible_video: false,
  1177. videoTemp: {},
  1178. requestParam2: {}
  1179. }
  1180. },
  1181. // computed: {
  1182. // ...mapGetters([
  1183. // 'sidebar',
  1184. // 'avatar',
  1185. // 'employeid',
  1186. // 'pastureid'
  1187. // ])
  1188. // },
  1189. computed: {
  1190. space() {
  1191. const { isSimple, $parent: { space }} = this
  1192. return isSimple ? '' : space
  1193. },
  1194. style: function() {
  1195. const style = {}
  1196. const parent = this.$parent
  1197. const len = parent.steps.length
  1198. const space =
  1199. typeof this.space === 'number'
  1200. ? this.space + 'px'
  1201. : this.space
  1202. ? this.space
  1203. : 100 / (len - (this.isCenter ? 0 : 1)) + '%'
  1204. style.flexBasis = space
  1205. if (this.isVertical) return style
  1206. if (this.isLast) {
  1207. style.maxWidth = 100 / this.stepsCount + '%'
  1208. } else {
  1209. style.marginRight = -this.$parent.stepOffset + 'px'
  1210. }
  1211. return style
  1212. }
  1213. },
  1214. created() {
  1215. console.log(process.env.VUE_APP_BASE_API,'00000-hss')
  1216. const that = this
  1217. GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
  1218. that.buttons = response.data.list
  1219. that.get_auto_buttons()
  1220. })
  1221. if (this.$route.query.myPath !== undefined && this.$route.query.myPath == 'MaintenancePlan') {
  1222. this.getdataListParm.parammaps.eqCode = this.$route.query.eqCode
  1223. this.getdataListParm.parammaps.inputDatetime = [this.$route.query.time, this.$route.query.time]
  1224. this.getdataListParm.parammaps.startTime = this.$route.query.time
  1225. this.getdataListParm.parammaps.stopTime = this.$route.query.time
  1226. }
  1227. this.get_select_list()
  1228. this.get_table_data()
  1229. this.getPendingList()
  1230. },
  1231. methods: {
  1232. onLoad(e) {
  1233. const img = e.target
  1234. let width = 0
  1235. if (img.fileSize > 0 || (img.width > 1 && img.height > 1)) {
  1236. width = img.width + 40
  1237. }
  1238. this.width = width + 'px'
  1239. },
  1240. // 图片保存
  1241. async handleSaveImg(type) {
  1242. console.log('====hss',this.seeTemp)
  1243. const obj = { name: "upkeepImage", parammaps: { id: this.seeTemp.id, picId1: this.seeTemp.scenePhoto1 , picId2: this.seeTemp.scenePhoto2, picId3: this.seeTemp.scenePhoto3 }}
  1244. const { data, code } = await saveImgIds(obj)
  1245. if(code == 200){
  1246. type == 1? this.$notify({ title: '提示', message: '保养图片上传成功', type: 'success', duration: 3000 }) : this.$notify({ title: '提示', message: '保养图片删除成功', type: 'success', duration: 3000 })
  1247. this.get_table_data()
  1248. }
  1249. console.log(data, '图片确认发布到保养中')
  1250. },
  1251. handlePicChange(file, fileList) {
  1252. // this.handlePicSuccess()
  1253. // console.log(this.seeTemp)
  1254. },
  1255. handlePicSuccess(response, file, fileList) {
  1256. console.log('文件上传成功时的钩子response', response, )
  1257. console.log('文件上传成功时的钩子file', file)
  1258. console.log('fileList', fileList)
  1259. //3张图片时,关闭新增的按钮
  1260. if (fileList.length == 3) {
  1261. document.getElementById('uploadPic').lastChild.style.display = "none"
  1262. } else {
  1263. document.getElementById('uploadPic').lastChild.style.display = "inline-block"
  1264. }
  1265. if (this.seeTemp.scenePhoto1 === undefined || this.seeTemp.scenePhoto1 == '-1') {
  1266. console.log("111")
  1267. this.seeTemp.scenePhoto1 = response.execresult.LastInsertId.toString()
  1268. } else if (this.seeTemp.scenePhoto2 === undefined || this.seeTemp.scenePhoto2 == '-1') {
  1269. console.log("222")
  1270. this.seeTemp.scenePhoto2 = response.execresult.LastInsertId.toString()
  1271. } else if (this.seeTemp.scenePhoto3 === undefined || this.seeTemp.scenePhoto3 == '-1') {
  1272. console.log("333")
  1273. this.seeTemp.scenePhoto3 = response.execresult.LastInsertId.toString()
  1274. }
  1275. this.fileList = fileList;
  1276. console.log(this.fileList, '上传成功后的数组')
  1277. // 上传成功后 在调用图片保定合同的接口
  1278. this.handleSaveImg(1)
  1279. },
  1280. handlePicRemove(file, fileList) {
  1281. console.log(file, '文件列表移除文件时的钩子file---')
  1282. console.log(fileList, '文件列表移除文件时的钩子fileList--')
  1283. this.seeTemp.scenePhoto1 = '-1';
  1284. this.seeTemp.scenePhoto2 = '-1';
  1285. this.seeTemp.scenePhoto3 = '-1';
  1286. if (fileList.length == 3) {
  1287. this.seeTemp.scenePhoto1 = (fileList[0].response && fileList[0].response.execresult.LastInsertId.toString()) || fileList[0].imgId
  1288. this.seeTemp.scenePhoto2 = (fileList[1].response && fileList[1].response.execresult.LastInsertId.toString()) || fileList[1].imgId
  1289. this.seeTemp.scenePhoto3 = (fileList[2].response && fileList[2].response.execresult.LastInsertId.toString()) || fileList[2].imgId
  1290. } else if (fileList.length == 2) {
  1291. this.seeTemp.scenePhoto1 = (fileList[0].response && fileList[0].response.execresult.LastInsertId.toString()) || fileList[0].imgId
  1292. this.seeTemp.scenePhoto2 = (fileList[1].response && fileList[1].response.execresult.LastInsertId.toString()) || fileList[1].imgId
  1293. } else if (fileList.length == 1) {
  1294. this.seeTemp.scenePhoto1 = (fileList[0].response && fileList[0].response.execresult.LastInsertId.toString()) || fileList[0].imgId
  1295. }
  1296. //3张图片时,关闭新增的按钮
  1297. if (fileList.length == 3) {
  1298. document.getElementById('uploadPic').lastChild.style.display = "none"
  1299. } else {
  1300. document.getElementById('uploadPic').lastChild.style.display = "inline-block"
  1301. }
  1302. this.fileList = fileList
  1303. console.log(this.fileList,'图片删除----88')
  1304. // 删除后更新图数量
  1305. this.handleSaveImg(2)
  1306. },
  1307. handlePicPreview(file) {
  1308. console.log(file,'放大查看')
  1309. this.dialogImageUrl = file.url
  1310. this.dialogVisibleImg = true
  1311. },
  1312. // handleCheck(row) {
  1313. // this.playvideo = row.hotVideoPath // 存储用户点击的视频播放链接
  1314. // this.playvideoName = row.hotVideoPath // 存储用户点击的视频播放链接
  1315. // },
  1316. tableSort(column) {
  1317. if (this.activeName == 'second') {
  1318. sortChange(column, this.listCollarUse)
  1319. } else if (this.activeName == 'third') {
  1320. sortChange(column, this.listOldProducts)
  1321. }
  1322. },
  1323. get_auto_buttons() {
  1324. // 查看
  1325. const See = 'maintenance:maintain:see'
  1326. const isSee = checkButtons(JSON.parse(sessionStorage.buttons), See)
  1327. this.isSee = isSee
  1328. // 保养及领用
  1329. const LingYong = 'maintenance:maintain:lingyong'
  1330. const isLingYong = checkButtons(JSON.parse(sessionStorage.buttons), LingYong)
  1331. this.isLingYong = isLingYong
  1332. // 完成保养
  1333. const Complete = 'maintenance:maintain:complete'
  1334. const isComplete = checkButtons(JSON.parse(sessionStorage.buttons), Complete)
  1335. this.isComplete = isComplete
  1336. // 使用人保养审核
  1337. const Charge = 'maintenance:maintain:charge'
  1338. const isCharge = checkButtons(JSON.parse(sessionStorage.buttons), Charge)
  1339. this.isCharge = isCharge
  1340. // 主管审核
  1341. const LeaderCharge = 'maintenance:maintain:leaderCharge'
  1342. const isLeaderCharge = checkButtons(JSON.parse(sessionStorage.buttons), LeaderCharge)
  1343. this.isLeaderCharge = isLeaderCharge
  1344. // 部门审核
  1345. const DeptCharge = 'maintenance:maintain:deptcharge'
  1346. const isDepartmentCharge = checkButtons(JSON.parse(sessionStorage.buttons), DeptCharge)
  1347. this.isDepartmentCharge = isDepartmentCharge
  1348. },
  1349. // next() {
  1350. // if (this.active++ > 2) this.active = 0
  1351. // this.finishStatus = 'error'
  1352. // },
  1353. get_select_list() {
  1354. GetDataByNames(this.requestParams).then(response => {
  1355. this.findAllPasture = response.data.findAllPasture.list
  1356. this.findAllEmploye = response.data.findAllEmploye.list
  1357. this.getDictByName = response.data.getDictByName.list
  1358. this.getDepartDownList()
  1359. })
  1360. },
  1361. getDepartDownList() {
  1362. GetDataByName(this.getDepartParam).then(response => {
  1363. this.findAllDepart = response.data.list
  1364. })
  1365. },
  1366. changePastureName(item) {
  1367. this.getDepartParam.parammaps.pastureId = this.findAllPasture.find(obj => obj.name == item).id
  1368. this.getdataListParm.parammaps.departmentId = ''
  1369. this.getDepartDownList()
  1370. },
  1371. close_diago(){
  1372. this.get_table_data()
  1373. this.dialogFormVisible_See = false
  1374. this.dialogVisibleImg = false
  1375. },
  1376. getPendingList() {
  1377. this.pending.getdataListParm.parammaps = {
  1378. inputDatetime: this.getdataListParm.parammaps.inputDatetime,
  1379. pastureName: this.getdataListParm.parammaps.pastureName,
  1380. SHStatue: this.getdataListParm.parammaps.SHStatue,
  1381. upkeepCode: this.getdataListParm.parammaps.upkeepCode,
  1382. eqName: this.getdataListParm.parammaps.eqName,
  1383. eqCode: this.getdataListParm.parammaps.eqCode,
  1384. departmentId: this.getdataListParm.parammaps.departmentId,
  1385. statue: this.getdataListParm.parammaps.statue,
  1386. loginId: Cookies.get('employeid'),
  1387. menu: 'Maintain',
  1388. logindeptId: Cookies.get('departmentid'),
  1389. loginpastureId: Cookies.get('pastureid'),
  1390. empId: Cookies.get('employeid'),
  1391. pastureId: Cookies.get('pastureid'),
  1392. deptId: Cookies.get('departmentid')
  1393. }
  1394. GetDataByName(this.pending.getdataListParm).then(response => {
  1395. this.pending.total = response.data.total3
  1396. })
  1397. },
  1398. get_table_data() {
  1399. if (this.getdataListParm.parammaps.inputDatetime !== undefined && this.getdataListParm.parammaps.inputDatetime !== '') {
  1400. this.getdataListParm.parammaps.startTime = this.getdataListParm.parammaps.inputDatetime[0]
  1401. this.getdataListParm.parammaps.stopTime = this.getdataListParm.parammaps.inputDatetime[1]
  1402. } else {
  1403. this.getdataListParm.parammaps.startTime = ''
  1404. this.getdataListParm.parammaps.stopTime = ''
  1405. }
  1406. this.listLoading = true
  1407. GetDataByName(this.getdataListParm).then(response => {
  1408. if (response.data.list !== null) {
  1409. console.log('table数据', response.data.list)
  1410. for (let i = 0; i < response.data.list.length; i++) {
  1411. this.$set(response.data.list[i], 'img', '视频')
  1412. }
  1413. this.list = response.data.list
  1414. this.pageNum = response.data.pageNum
  1415. this.pageSize = response.data.pageSize
  1416. } else {
  1417. this.list = []
  1418. }
  1419. this.total = response.data.total
  1420. // Just to simulate the time of the request
  1421. setTimeout(() => {
  1422. this.listLoading = false
  1423. }, 100)
  1424. })
  1425. },
  1426. tableCellStyle({ row, column, rowIndex, columnIndex }) {
  1427. if (row.statue == 0 && columnIndex === 10) {
  1428. return {
  1429. background: 'red',
  1430. color: '#fff'
  1431. }
  1432. }
  1433. return {
  1434. background: ''
  1435. }
  1436. },
  1437. changeAll() {
  1438. console.log(this.radioAll)
  1439. if (this.radioAll === '全部') {
  1440. this.getdataListParm.name = 'getBigupkeepList'
  1441. this.getdataListParm.offset = 1
  1442. this.getdataListParm.parammaps = {
  1443. inputDatetime: '',
  1444. upkeepCode: '',
  1445. eqName: '',
  1446. eqCode: '',
  1447. departmentId: '',
  1448. statue: '',
  1449. pastureName: Cookies.get('pasturename'),
  1450. loginId: Cookies.get('employeid'),
  1451. menu: 'Maintain',
  1452. SHStatue: '',
  1453. logindeptId: Cookies.get('departmentid'),
  1454. loginpastureId: Cookies.get('pastureid')
  1455. }
  1456. this.get_table_data()
  1457. } else if (this.radioAll === '待处理') {
  1458. this.getdataListParm.name = 'getBigupkeepWebListNO'
  1459. this.getdataListParm.offset = 1
  1460. this.getdataListParm.parammaps = {
  1461. inputDatetime: this.getdataListParm.parammaps.inputDatetime,
  1462. pastureName: this.getdataListParm.parammaps.pastureName,
  1463. SHStatue: this.getdataListParm.parammaps.SHStatue,
  1464. upkeepCode: this.getdataListParm.parammaps.upkeepCode,
  1465. eqName: this.getdataListParm.parammaps.eqName,
  1466. eqCode: this.getdataListParm.parammaps.eqCode,
  1467. departmentId: this.getdataListParm.parammaps.departmentId,
  1468. statue: this.getdataListParm.parammaps.statue,
  1469. loginId: Cookies.get('employeid'),
  1470. menu: 'Maintain',
  1471. logindeptId: Cookies.get('departmentid'),
  1472. loginpastureId: Cookies.get('pastureid'),
  1473. empId: Cookies.get('employeid'),
  1474. pastureId: Cookies.get('pastureid'),
  1475. deptId: Cookies.get('departmentid')
  1476. }
  1477. this.get_table_data()
  1478. } else if (this.radioAll === '已处理') {
  1479. this.getdataListParm.name = 'getBigupkeepWebList'
  1480. this.getdataListParm.offset = 1
  1481. this.getdataListParm.parammaps = {
  1482. inputDatetime: this.getdataListParm.parammaps.inputDatetime,
  1483. pastureName: this.getdataListParm.parammaps.pastureName,
  1484. SHStatue: this.getdataListParm.parammaps.SHStatue,
  1485. upkeepCode: this.getdataListParm.parammaps.upkeepCode,
  1486. eqName: this.getdataListParm.parammaps.eqName,
  1487. eqCode: this.getdataListParm.parammaps.eqCode,
  1488. departmentId: this.getdataListParm.parammaps.departmentId,
  1489. statue: this.getdataListParm.parammaps.statue,
  1490. loginId: Cookies.get('employeid'),
  1491. menu: 'Maintain',
  1492. logindeptId: Cookies.get('departmentid'),
  1493. loginpastureId: Cookies.get('pastureid'),
  1494. empId: Cookies.get('employeid'),
  1495. pastureId: Cookies.get('pastureid'),
  1496. deptId: Cookies.get('departmentid')
  1497. }
  1498. this.get_table_data()
  1499. }
  1500. },
  1501. statue: function(cellValue) {
  1502. // console.log(cellValue.isZeroStock)
  1503. if (cellValue.statue == 0) {
  1504. return '已逾期'
  1505. } else if (cellValue.statue == 1) {
  1506. return '保养中'
  1507. } else if (cellValue.statue == 2) {
  1508. return '已完成'
  1509. }
  1510. },
  1511. SHStatue: function(cellValue) {
  1512. // console.log(cellValue.isZeroStock)
  1513. if (cellValue.SHStatue == 1) {
  1514. return ''
  1515. } else if (cellValue.SHStatue == 2) {
  1516. return '审核中'
  1517. } else if (cellValue.SHStatue == 3) {
  1518. return '审核中'
  1519. } else if (cellValue.SHStatue == 4) {
  1520. return '未通过'
  1521. } else if (cellValue.SHStatue == 8) {
  1522. return '未通过'
  1523. } else if (cellValue.SHStatue == 7) {
  1524. return '已通过'
  1525. }
  1526. },
  1527. form_search() {
  1528. console.log('点击了table搜索')
  1529. this.listLoading = true
  1530. if (this.getdataListParm.parammaps.inputDatetime === null) {
  1531. this.getdataListParm.parammaps.inputDatetime = ''
  1532. }
  1533. this.getdataListParm.offset = 1
  1534. this.get_table_data()
  1535. this.getPendingList()
  1536. },
  1537. form_see(row) {
  1538. this.seeTemp = Object.assign({}, row)
  1539. console.log('查看----图片1', row)
  1540. // 只要有图片就全部展示出来
  1541. this.seeTemp.scenePhoto1 = '-1'
  1542. this.seeTemp.scenePhoto2 = '-1'
  1543. this.seeTemp.scenePhoto3 = '-1'
  1544. this.fileList =[]
  1545. if( row.picId1 !== '-1' && row.picId1 !== '') {
  1546. this.seeTemp.scenePhoto1 = row.picId1
  1547. this.$set(this.fileList, 0, { name: "picImg1", url: process.env.VUE_APP_BASE_API + row.picpath1 , imgId : row.picId1 }
  1548. )
  1549. }
  1550. if( row.picId2 !== '-1' && row.picId2 !== '') {
  1551. this.seeTemp.scenePhoto2 = row.picId2
  1552. this.$set(this.fileList, 1, { name: "picImg2", url: process.env.VUE_APP_BASE_API + row.picpath2, imgId : row.picId2 }
  1553. )
  1554. }
  1555. if( row.picId3 !== '-1' && row.picId3 !== '') {
  1556. this.seeTemp.scenePhoto3 = row.picId3
  1557. this.$set(this.fileList, 2, { name: "picImg3", url: process.env.VUE_APP_BASE_API + row.picpath3, imgId : row.picId3 }
  1558. )
  1559. }
  1560. console.log('查看-------图片2', this.fileList)
  1561. // 流程图
  1562. var reason = '未通过原因:' + this.seeTemp.workflowNote
  1563. var scores = '评分:' + this.seeTemp.scores + '分'
  1564. if (this.seeTemp.SHStatue === 1) {
  1565. this.activeList = [{ title: '保养人提交' }, { title: '机修审核' }, { title: '设备主管审核' }]
  1566. this.active = 0
  1567. } else if (this.seeTemp.SHStatue === 2) {
  1568. this.activeList = [{ title: '保养人提交', name: this.seeTemp.upkeepPerson, date: this.seeTemp.finishedTime, status: '', reason: '' }, { title: '机修审核' }, { title: '设备主管审核' }]
  1569. this.active = 1
  1570. } else if (this.seeTemp.SHStatue === 3) {
  1571. this.active = 2
  1572. this.activeList = [{ title: '保养人提交', name: this.seeTemp.upkeepPerson, date: this.seeTemp.finishedTime, status: '', reason: '' }, { title: '机修审核', date: this.seeTemp.useChargeDate, name: this.seeTemp.useChargePerson, status: '', reason: '', scores: scores }, { title: '设备主管审核' }]
  1573. } else if (this.seeTemp.SHStatue === 4) {
  1574. this.active = 2
  1575. this.activeList = [{ title: '保养人提交', name: this.seeTemp.upkeepPerson, date: this.seeTemp.finishedTime, status: '', reason: '' }, { title: '机修审核', date: this.seeTemp.useChargeDate, name: this.seeTemp.useChargePerson, status: 'error', reason: reason }, { title: '设备主管审核' }]
  1576. } else if (this.seeTemp.SHStatue === 7) {
  1577. this.activeList = [{ title: '保养人提交', name: this.seeTemp.upkeepPerson, date: this.seeTemp.finishedTime, status: '', reason: '' }, { title: '机修审核', date: this.seeTemp.useChargeDate, name: this.seeTemp.useChargePerson, status: '', reason: '', scores: scores }, { title: '设备主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }]
  1578. this.active = 3
  1579. } else if (this.seeTemp.SHStatue === 8) {
  1580. this.activeList = [{ title: '保养人提交', name: this.seeTemp.upkeepPerson, date: this.seeTemp.finishedTime, status: '', reason: '' }, { title: '机修审核', date: this.seeTemp.useChargeDate, name: this.seeTemp.useChargePerson, status: '', reason: '', scores: scores }, { title: '设备主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson, status: 'error', reason: reason }]
  1581. this.active = 3
  1582. }
  1583. this.dialogStatus = 'see'
  1584. this.dialogFormVisible_See = true
  1585. if (this.seeTemp.SHStatue !== 1) {
  1586. // 查看显示类型2
  1587. this.statue1 = false
  1588. this.statue2 = true
  1589. this.getMaintenanceContentList()
  1590. } else {
  1591. if (this.seeTemp.SHStatue == 1 && this.seeTemp.LYStatue == '未领用' && this.seeTemp.LRStatue == '未录入') {
  1592. // 查看显示类型1
  1593. this.statue1 = true
  1594. this.statue2 = false
  1595. this.getMaintenanceContentList()
  1596. } else {
  1597. // 查看显示类型2
  1598. this.statue1 = false
  1599. this.statue2 = true
  1600. this.getMaintenanceContentList()
  1601. }
  1602. }
  1603. this.collarUseTemp = {}
  1604. this.listCollarUse = []
  1605. this.getCollarUse()
  1606. this.getOldProductsList()
  1607. this.$nextTick(()=>{
  1608. if(this.seeTemp.SHStatue !== 2 || this.fileList.length >= 3){
  1609. document.getElementById('uploadPic').lastChild.style.display = "none"
  1610. }else{
  1611. document.getElementById('uploadPic').lastChild.style.display = "inline-block"
  1612. }
  1613. })
  1614. },
  1615. getMaintenanceContentList() {
  1616. this.getMaintenanceContentParm.parammaps.id = this.seeTemp.id
  1617. this.listLoadingMaintenanceContent = false
  1618. GetDataByName(this.getMaintenanceContentParm).then(response => {
  1619. console.log('保养内容table数据', response.data.list)
  1620. this.listMaintenanceContent = response.data.list
  1621. this.$forceUpdate()
  1622. setTimeout(() => {
  1623. this.listLoadingMaintenanceContent = false
  1624. }, 100)
  1625. })
  1626. },
  1627. openDetails(row, column, cell, event) {
  1628. if (column.label !== '操作') {
  1629. this.$router.push({ path: '/customs/Receive', query: { applyCode: this.collarUseTemp && this.collarUseTemp.applyCode || '' }})
  1630. }
  1631. },
  1632. getCollarUse() {
  1633. this.getCollarUseParm.parammaps.RUCode = this.seeTemp.upkeepCode
  1634. GetDataByName(this.getCollarUseParm).then(response => {
  1635. this.collarUseTemp = response.data.list[0]
  1636. if (response.data.list.length > 0) {
  1637. console.log('领用记录数据', response.data.list[0])
  1638. if (response.data.list[0].statue == 0) {
  1639. this.$set(this.collarUseTemp, 'statueName', '未领用')
  1640. } else {
  1641. this.$set(this.collarUseTemp, 'statueName', '已领用')
  1642. }
  1643. }
  1644. this.getCollarUseList()
  1645. })
  1646. },
  1647. getCollarUseList() {
  1648. this.getCollarUseListParm.parammaps.id = this.collarUseTemp ? this.collarUseTemp.id : ''
  1649. this.listLoadingCollarUse = true
  1650. if( this.getCollarUseListParm.parammaps.id == ''){
  1651. return
  1652. } else {
  1653. GetDataByName(this.getCollarUseListParm).then(response => {
  1654. console.log('领用table数据', response.data.list)
  1655. this.listCollarUse = response.data.list
  1656. setTimeout(() => {
  1657. this.listLoadingCollarUse = false
  1658. }, 100)
  1659. })
  1660. }
  1661. },
  1662. getOldProductsList() {
  1663. this.getOldProductsParm.parammaps.repairCode = this.seeTemp.upkeepCode
  1664. this.listLoadingOldProducts = true
  1665. GetDataByName(this.getOldProductsParm).then(response => {
  1666. console.log('旧品录入记录table数据', response.data.list)
  1667. this.listOldProducts = response.data.list
  1668. setTimeout(() => {
  1669. this.listLoadingOldProducts = false
  1670. }, 100)
  1671. })
  1672. },
  1673. // 保养及领用
  1674. handleReceivingSpareParts(row) {
  1675. console.log('点击了保养及领用')
  1676. if (row == undefined) {
  1677. this.receivingTemp = this.seeTemp
  1678. } else {
  1679. this.receivingTemp = Object.assign({}, row)
  1680. }
  1681. this.maintainTemp = this.receivingTemp
  1682. this.maintainTemp.employeeId = String(this.maintainTemp.useEmpId)
  1683. this.seeTemp = this.maintainTemp
  1684. this.listCollarUse = []
  1685. this.getAutoCreatCode()
  1686. this.receivingTemp.createDate = parseTime(new Date(), '{y}-{m}-{d}')
  1687. this.getEmpdeptList()
  1688. this.getCollarUse()
  1689. this.getMaintenanceContentList()
  1690. this.dialogStatus = 'receivingSpareParts'
  1691. this.dialogFormVisible_ReceivingSpareParts = true
  1692. },
  1693. getEmpdeptList() {
  1694. this.getEmpdeptParm.parammaps.deptId = this.maintainTemp.departmentId
  1695. GetDataByName(this.getEmpdeptParm).then(response => {
  1696. console.log('保养使用人', response.data.list)
  1697. if (response.data.list !== null) {
  1698. this.empdeptList = response.data.list
  1699. } else {
  1700. this.empdeptList = []
  1701. }
  1702. })
  1703. },
  1704. getAutoCreatCode() {
  1705. GetDataByName(this.getAutoCreatCodeParm).then(response => {
  1706. console.log('领用领用单号', response.data.list[0])
  1707. this.receivingTemp.applyCode = response.data.list[0].orderCode
  1708. this.$forceUpdate()
  1709. })
  1710. },
  1711. sparePartSearch(queryString, cb) {
  1712. console.log('备件模糊查询输入值', queryString)
  1713. this.requestSparePart.parammaps['partCode'] = queryString
  1714. GetDataByName(this.requestSparePart).then(response => {
  1715. console.log('备件模糊查询搜索data', response.data.list)
  1716. if (response.data.list == null) {
  1717. cb([])
  1718. } else {
  1719. cb(response.data.list)
  1720. }
  1721. })
  1722. },
  1723. handleSelectSparePart(item) {
  1724. console.log('备件模糊查询选中值', item)
  1725. if (this.listCollarUse.length > 0) {
  1726. // eslint-disable-next-line no-redeclare
  1727. if (this.listCollarUse.find(obj => obj.id === item.id)) {
  1728. this.$message({
  1729. type: 'warning',
  1730. message: '此备件已存在,请重新选择备件'
  1731. })
  1732. } else {
  1733. this.listCollarUse.unshift(item)
  1734. }
  1735. } else {
  1736. this.listCollarUse = []
  1737. this.listCollarUse.unshift(item)
  1738. }
  1739. },
  1740. createReceivingSparePartseData1() {
  1741. this.isokDisable = true
  1742. setTimeout(() => {
  1743. this.isokDisable = false
  1744. }, 1000)
  1745. this.$refs['maintainTemp'].validate(valid => {
  1746. if (valid) {
  1747. this.postDataPramas.common = { 'returnmap': '0' }
  1748. this.postDataPramas.data = []
  1749. this.postDataPramas.data[0] = { 'name': 'updateEquseEmpId', 'type': 'e', 'parammaps': {
  1750. employeeId: this.maintainTemp.employeeId,
  1751. id: this.maintainTemp.id
  1752. }}
  1753. this.postDataPramas.data[1] = { 'name': 'deleteutupbyBigid', 'type': 'e', 'parammaps': {
  1754. id: this.maintainTemp.id
  1755. }}
  1756. this.postDataPramas.data[2] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listMaintenanceContent }}
  1757. this.postDataPramas.data[2].children = []
  1758. this.postDataPramas.data[2].children[0] = { 'name': 'insertutup', 'type': 'e', 'parammaps': {
  1759. id: this.maintainTemp.id,
  1760. positionName: '@insertSpotList.positionName',
  1761. program: '@insertSpotList.program',
  1762. standard: '@insertSpotList.standard',
  1763. active: '@insertSpotList.active'
  1764. }}
  1765. ExecDataByConfig(this.postDataPramas).then(response => {
  1766. console.log('添加领用保存发送参数', this.postDataPramas)
  1767. if (response.msg === 'fail') {
  1768. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1769. } else {
  1770. this.dialogFormVisible_ReceivingSpareParts = false
  1771. this.dialogFormVisible_See = false
  1772. this.get_table_data()
  1773. this.getPendingList()
  1774. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  1775. }
  1776. })
  1777. }
  1778. })
  1779. },
  1780. createReceivingSparePartseData2() {
  1781. console.log('点击了保养及领用保存')
  1782. this.isokDisable = true
  1783. setTimeout(() => {
  1784. this.isokDisable = false
  1785. }, 1000)
  1786. this.$refs['receivingTemp'].validate(valid => {
  1787. if (valid) {
  1788. if (this.listCollarUse.length !== 0) {
  1789. for (var i = 0; i < this.listCollarUse.length; i++) {
  1790. console.log(this.listCollarUse[i].amount)
  1791. if (this.listCollarUse[i].amount !== undefined) {
  1792. var rulesAmount = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
  1793. if (!rulesAmount.test(this.listCollarUse[i].amount)) {
  1794. this.$message({ type: 'error', message: '领用数量请输入正数,最多保留两位小数', duration: 2000 })
  1795. return false
  1796. } else if (parseFloat(this.listCollarUse[i].amount) > parseFloat(this.listCollarUse[i].reportery)) {
  1797. this.$message({ type: 'error', message: '领用数量不可大于库存数', duration: 2000 })
  1798. return false
  1799. }
  1800. } else {
  1801. this.$message({ type: 'error', message: '请检查领用数量是否未填写', duration: 2000 })
  1802. return false
  1803. }
  1804. }
  1805. let mySumPrice = 0
  1806. for (let i = 0; i < this.listCollarUse.length; i++) {
  1807. mySumPrice += parseFloat(this.listCollarUse[i].price) * parseFloat(this.listCollarUse[i].amount)
  1808. }
  1809. if (mySumPrice > 500) {
  1810. this.receivingTemp.SHStatus = 2
  1811. } else {
  1812. this.receivingTemp.SHStatus = 9
  1813. }
  1814. this.postDataPramas.common = { 'returnmap': '0' }
  1815. this.postDataPramas.data = []
  1816. this.postDataPramas.data[0] = { 'name': 'insertBigpartapply', 'type': 'e', 'parammaps': {
  1817. pastureId: this.$store.state.user.pastureid,
  1818. applyCode: this.receivingTemp.applyCode,
  1819. applyType: 2,
  1820. departmentId: this.receivingTemp.departmentId,
  1821. empId: this.receivingTemp.upkeepPersonId,
  1822. applyDate: this.receivingTemp.createDate,
  1823. RUCode: this.receivingTemp.upkeepCode,
  1824. SHStatus: this.receivingTemp.SHStatus
  1825. }}
  1826. this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listCollarUse }}
  1827. this.postDataPramas.data[1].children = []
  1828. this.postDataPramas.data[1].children[0] = { 'name': 'insertpartapply', 'type': 'e', 'parammaps': {
  1829. bigId: '@insertBigpartapply.LastInsertId',
  1830. pastureId: '@insertSpotList.pastureId',
  1831. partId: '@insertSpotList.partId',
  1832. partCode: '@insertSpotList.partCode',
  1833. partName: '@insertSpotList.partName',
  1834. specification: '@insertSpotList.specification',
  1835. brandId: '@insertSpotList.brandId',
  1836. price: '@insertSpotList.price',
  1837. amount: '@insertSpotList.amount',
  1838. eqName: this.receivingTemp.eqName,
  1839. eqCode: this.receivingTemp.eqCode,
  1840. providerId: '@insertSpotList.providerId',
  1841. note: '@insertSpotList.note',
  1842. reportery: '@insertSpotList.reportery',
  1843. contractId: '@insertSpotList.contractId',
  1844. locationId: '@insertSpotList.locationId'
  1845. }}
  1846. ExecDataByConfig(this.postDataPramas).then(response => {
  1847. console.log('添加领用保存发送参数', this.postDataPramas)
  1848. if (response.msg === 'fail') {
  1849. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1850. } else {
  1851. this.dialogFormVisible_ReceivingSpareParts = false
  1852. this.dialogFormVisible_See = false
  1853. this.get_table_data()
  1854. this.getPendingList()
  1855. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  1856. }
  1857. })
  1858. // return true
  1859. } else {
  1860. this.$notify({ title: '', message: '请选择备件', type: 'warning', duration: 2000 })
  1861. return false
  1862. }
  1863. }
  1864. })
  1865. },
  1866. // 完成保养
  1867. handleCompleteMaintenance(row) {
  1868. console.log('点击了完成保养', row)
  1869. if (row == undefined) {
  1870. this.$set(this.seeTemp, 'isOldProducts', 0)
  1871. this.maintainCompleteTemp = this.seeTemp
  1872. } else {
  1873. this.maintainCompleteTemp = Object.assign({}, row)
  1874. this.$set(this.maintainCompleteTemp, 'isOldProducts', 0)
  1875. }
  1876. this.dialogStatus = 'maintainComplete'
  1877. this.No2 = false
  1878. this.dialogFormVisible_maintainComplete = true
  1879. this.listAdd = []
  1880. },
  1881. // 如果有历史记录则删除所图图片
  1882. async handleDelALlImg(){
  1883. console.log('完成保养确认---删除图片',this.maintainCompleteTemp)
  1884. if((this.maintainCompleteTemp.picId1 != '' || this.maintainCompleteTemp.picId1 != '-1' ) ){
  1885. const obj = { name: "upkeepImage", parammaps: { id: this.maintainCompleteTemp.id, picId1: '-1' , picId2: '-1', picId3: '-1' }}
  1886. const { data, code } = await saveImgIds(obj)
  1887. console.log(data,code,'删除历史了')
  1888. }
  1889. },
  1890. changeIsOldProducts(val) {
  1891. console.log(val)
  1892. if (val == 1) {
  1893. this.No2 = true
  1894. } else {
  1895. this.No2 = false
  1896. }
  1897. },
  1898. oldProductsSearch(queryString, cb) {
  1899. console.log('旧品录入模糊查询输入值', queryString)
  1900. this.requestOldProducts.parammaps.partCode = queryString
  1901. this.requestOldProducts.parammaps.RUCode = this.maintainCompleteTemp.upkeepCode
  1902. GetDataByName(this.requestOldProducts).then(response => {
  1903. console.log('旧品录入模糊查询搜索data', response.data.list)
  1904. cb(response.data.list)
  1905. })
  1906. },
  1907. handleSelectOldProducts(item) {
  1908. this.maintainCompleteTemp.partCode = ''
  1909. console.log('旧品录入模糊查询选中值', item)
  1910. if (this.listAdd.length > 0) {
  1911. // eslint-disable-next-line no-redeclare
  1912. if (this.listAdd.find(obj => obj.id === item.id)) {
  1913. this.$message({
  1914. type: 'warning',
  1915. message: '此旧品已存在,请重新选择旧品'
  1916. })
  1917. } else {
  1918. if (item.checkoutNumber == null) {
  1919. this.$set(item, 'checkoutNumber', item.reportery)
  1920. }
  1921. this.listAdd.unshift(item)
  1922. }
  1923. } else {
  1924. if (item.checkoutNumber == null) {
  1925. this.$set(item, 'checkoutNumber', item.reportery)
  1926. }
  1927. this.listAdd.unshift(item)
  1928. }
  1929. },
  1930. sparePartsDelete(row) {
  1931. MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
  1932. confirmButtonText: '确认',
  1933. cancelButtonText: '取消',
  1934. type: 'warning'
  1935. }).then(() => {
  1936. // console.log(this.list2)
  1937. for (var i = 0; i < this.listCollarUse.length; i++) {
  1938. console.log(this.listCollarUse[i])
  1939. if (this.listCollarUse[i].id === row.id) {
  1940. var listCollarUseIndex = this.listCollarUse.indexOf(this.listCollarUse[i])
  1941. }
  1942. if (listCollarUseIndex > -1) {
  1943. this.listCollarUse.splice(listCollarUseIndex, 1)
  1944. return
  1945. }
  1946. }
  1947. })
  1948. },
  1949. partDelete(row) {
  1950. console.log(this.listAdd)
  1951. MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
  1952. confirmButtonText: '确认',
  1953. cancelButtonText: '取消',
  1954. type: 'warning'
  1955. }).then(() => {
  1956. // console.log(this.list2)
  1957. for (var i = 0; i < this.listAdd.length; i++) {
  1958. console.log(this.listAdd[i])
  1959. if (this.listAdd[i].id === row.id) {
  1960. var listAddIndex = this.listAdd.indexOf(this.listAdd[i])
  1961. }
  1962. if (listAddIndex > -1) {
  1963. this.listAdd.splice(listAddIndex, 1)
  1964. return
  1965. }
  1966. }
  1967. })
  1968. },
  1969. // 完成保养-保存
  1970. createMaintainCompleteData() {
  1971. console.log('点击了完成保养确认', this.maintainCompleteTemp)
  1972. console.log('点击了完成保养确认', this.maintainCompleteTemp.laidcou)
  1973. if (this.maintainCompleteTemp.laidcou == 0) {
  1974. if (this.maintainCompleteTemp.isOldProducts == 0) {
  1975. console.log('否')
  1976. this.handleDelALlImg()
  1977. this.requestParam.name = 'completeUpkeep'
  1978. this.requestParam.parammaps = {}
  1979. this.requestParam.parammaps.id = this.maintainCompleteTemp.id
  1980. PostDataByName(this.requestParam).then((response) => {
  1981. if (response.msg !== 'fail') {
  1982. //如果有设备记录仪的权限
  1983. if(this.maintainCompleteTemp.isVideoBtnShow == '1'){
  1984. // 临时注释
  1985. if (this.maintainCompleteTemp.videoTxt == '已录制') {
  1986. this.requestParam2.name = 'upkeepChargDone'
  1987. this.requestParam2.parammaps = {}
  1988. this.requestParam2.parammaps.id = this.maintainCompleteTemp.id
  1989. this.requestParam2.parammaps.statue = 7
  1990. this.requestParam2.parammaps.orderStatue = 2
  1991. this.requestParam2.parammaps.empId = Cookies.get('employeid')
  1992. PostDataByName(this.requestParam2).then(response => {
  1993. if (response.msg !== 'fail') {
  1994. if (this.getdataListParm.parammaps.inputDatetime === null) {
  1995. this.getdataListParm.parammaps.inputDatetime = ''
  1996. }
  1997. this.get_table_data()
  1998. this.dialogFormVisible_maintainComplete = false
  1999. this.dialogFormVisible_See = false
  2000. this.getPendingList()
  2001. this.$notify({ title: '成功', message: '成功', type: 'success', duration: 2000 })
  2002. } else {
  2003. failproccess(response, this.$notify)
  2004. }
  2005. })
  2006. }
  2007. // 临时注释
  2008. }else{
  2009. //正常流程。没有记录仪权限
  2010. if (this.getdataListParm.parammaps.inputDatetime === null) {
  2011. this.getdataListParm.parammaps.inputDatetime = ''
  2012. }
  2013. this.dialogFormVisible_maintainComplete = false
  2014. this.dialogFormVisible_See = false
  2015. this.$notify({ title: '成功', message: '成功', type: 'success', duration: 2000 })
  2016. this.get_table_data()
  2017. this.getPendingList()
  2018. }
  2019. } else {
  2020. failproccess(response, this.$notify)
  2021. }
  2022. })
  2023. } else {
  2024. console.log('是')
  2025. this.isokDisable = true
  2026. setTimeout(() => {
  2027. this.isokDisable = false
  2028. }, 1000)
  2029. this.$refs['maintainCompleteTemp'].validate(valid => {
  2030. if (valid) {
  2031. if (this.listAdd.length !== 0) {
  2032. for (var i = 0; i < this.listAdd.length; i++) {
  2033. if (this.listAdd[i].acturalAmount == null || this.listAdd[i].acturalAmount == '') {
  2034. this.$message({
  2035. type: 'warning',
  2036. message: '请录入数量是否未填写',
  2037. duration: 2000
  2038. })
  2039. return false
  2040. } else {
  2041. var rulesActuralAmount = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
  2042. if (!rulesActuralAmount.test(parseFloat(this.listAdd[i].acturalAmount))) {
  2043. this.$message({
  2044. type: 'error',
  2045. message: '录入数量请输入正数,最多保留两位小数点',
  2046. duration: 2000
  2047. })
  2048. return false
  2049. }
  2050. }
  2051. }
  2052. this.postDataPramas.common = { 'returnmap': '0' }
  2053. this.postDataPramas.data = []
  2054. this.postDataPramas.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
  2055. this.postDataPramas.data[0].children = []
  2056. this.postDataPramas.data[0].children[0] = { 'name': 'insertRepirsRefuse', 'type': 'e', 'parammaps': {
  2057. pastureId: Cookies.get('pastureid'),
  2058. deptId: this.maintainCompleteTemp.departmentId,
  2059. partCode: '@insertSpotList.partCode',
  2060. partName: '@insertSpotList.partName',
  2061. partId: '@insertSpotList.id',
  2062. specification: '@insertSpotList.specification',
  2063. unit: '@insertSpotList.unit',
  2064. acturalAmount: '@insertSpotList.acturalAmount',
  2065. eqId: this.maintainCompleteTemp.eqId,
  2066. eqCode: this.maintainCompleteTemp.eqCode,
  2067. eqName: this.maintainCompleteTemp.eqName,
  2068. repairCode: this.maintainCompleteTemp.upkeepCode,
  2069. listType: 1
  2070. }}
  2071. this.postDataPramas.data[1] = { 'name': 'completeUpkeep', 'type': 'e', 'parammaps': {
  2072. id: this.maintainCompleteTemp.id
  2073. }}
  2074. ExecDataByConfig(this.postDataPramas).then(response => {
  2075. console.log('完成维修-是-保存发送参数', this.postDataPramas)
  2076. if (response.msg === 'fail') {
  2077. this.$notify({
  2078. title: '保存失败',
  2079. message: response.data,
  2080. type: 'warning',
  2081. duration: 2000
  2082. })
  2083. } else {
  2084. this.handleDelALlImg()
  2085. this.dialogFormVisible_maintainComplete = false
  2086. this.dialogFormVisible_See = false
  2087. this.get_table_data()
  2088. this.getPendingList()
  2089. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  2090. }
  2091. })
  2092. return true
  2093. } else {
  2094. this.$notify({
  2095. title: '',
  2096. message: '请完善旧品信息',
  2097. type: 'warning',
  2098. duration: 2000
  2099. })
  2100. return false
  2101. }
  2102. }
  2103. })
  2104. }
  2105. } else {
  2106. this.$notify({ message: '备件未领用不可完成保养', type: 'warning', duration: 2000 })
  2107. }
  2108. },
  2109. // 保养审核
  2110. handleExamine(row) {
  2111. console.log('点击了保养审核', row, this.seeTemp, this.fileList)
  2112. if (row == undefined) {
  2113. console.log('里面审核')
  2114. this.examineTemp = this.seeTemp
  2115. this.$set(this.seeTemp, 'isStatue', 3)
  2116. this.$set(this.seeTemp, 'workflowNote', '')
  2117. this.$set(this.examineTemp, 'scores', '')
  2118. if(( this.seeTemp.scenePhoto1 == '-1' || this.seeTemp.scenePhoto1 == '' ) || !this.fileList.length ){
  2119. this.$notify({ title: '提示', message: '请上传保养图片', type: 'warning', duration: 3000 })
  2120. return
  2121. }
  2122. } else {
  2123. console.log('外面审核')
  2124. if((row.picId1 == '' || row.picId1 == '-1' )){
  2125. this.$notify({ title: '提示', message: '请上传保养图片', type: 'warning', duration: 3000 })
  2126. return
  2127. }
  2128. this.examineTemp = Object.assign({}, row)
  2129. this.$set(this.examineTemp, 'isStatue', 3)
  2130. this.$set(this.examineTemp, 'workflowNote', '')
  2131. this.$set(this.examineTemp, 'scores', '')
  2132. }
  2133. this.dialogStatus = 'examine'
  2134. this.dialogFormVisible_examine = true
  2135. },
  2136. changeIsStatue(val) {
  2137. console.log(val)
  2138. if (val == 4) {
  2139. this.isStatueReason = true
  2140. } else {
  2141. this.isStatueReason = false
  2142. }
  2143. },
  2144. // 保养审核1
  2145. createExamineData() {
  2146. console.log('点击了保养审核确认-hss')
  2147. this.isokDisable = true
  2148. setTimeout(() => {
  2149. this.isokDisable = false
  2150. }, 1000)
  2151. this.$refs['examineTemp'].validate(valid => {
  2152. if (valid) {
  2153. this.requestParam.name = 'upkeepCharge'
  2154. this.requestParam.parammaps = {}
  2155. this.requestParam.parammaps.id = this.examineTemp.id
  2156. this.requestParam.parammaps.statue = this.examineTemp.isStatue
  2157. this.requestParam.parammaps.empId = Cookies.get('employeid')
  2158. this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
  2159. if (this.requestParam.parammaps.statue == 4) {
  2160. this.requestParam.parammaps.scores = 5
  2161. } else {
  2162. this.requestParam.parammaps.scores = this.examineTemp.scores
  2163. }
  2164. if (this.requestParam.parammaps.scores == '' || !this.requestParam.parammaps.scores ) {
  2165. this.$notify({ title: '提示', message: '请给保养结果评分', type: 'warning', duration: 2000 })
  2166. return
  2167. }
  2168. PostDataByName(this.requestParam).then(response => {
  2169. console.log('保养审核确认发送参数', this.requestParam)
  2170. if (response.msg !== 'fail') {
  2171. if (this.getdataListParm.parammaps.inputDatetime === null) {
  2172. this.getdataListParm.parammaps.inputDatetime = ''
  2173. }
  2174. this.get_table_data()
  2175. this.dialogFormVisible_examine = false
  2176. this.dialogFormVisible_See = false
  2177. this.isStatueReason = false
  2178. this.getPendingList()
  2179. this.$notify({ title: '成功', message: '审核成功', type: 'success', duration: 2000 })
  2180. } else {
  2181. failproccess(response, this.$notify)
  2182. }
  2183. })
  2184. }
  2185. })
  2186. },
  2187. // 保养审核2
  2188. handleExamine2(row) {
  2189. console.log('点击了保养审核------99')
  2190. if (row == undefined) {
  2191. this.examineTemp = this.seeTemp
  2192. this.$set(this.seeTemp, 'isStatue', 3)
  2193. this.$set(this.seeTemp, 'workflowNote', '')
  2194. } else {
  2195. this.examineTemp = Object.assign({}, row)
  2196. this.$set(this.examineTemp, 'isStatue', 3)
  2197. this.$set(this.examineTemp, 'workflowNote', '')
  2198. }
  2199. this.dialogStatus = 'examine2'
  2200. this.dialogFormVisible_examine = true
  2201. },
  2202. // 保养审核2-保存
  2203. createExamineData2() {
  2204. if (this.examineTemp.isStatue == 3) {
  2205. console.log('点击了保养审核2确认-通过')
  2206. this.isokDisable = true
  2207. setTimeout(() => {
  2208. this.isokDisable = false
  2209. }, 1000)
  2210. this.$refs['examineTemp'].validate(valid => {
  2211. if (valid) {
  2212. this.requestParam.name = 'upkeepChargDone'
  2213. this.requestParam.parammaps = {}
  2214. this.requestParam.parammaps.id = this.examineTemp.id
  2215. this.requestParam.parammaps.statue = 7
  2216. this.requestParam.parammaps.orderStatue = 2
  2217. this.requestParam.parammaps.empId = Cookies.get('employeid')
  2218. this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
  2219. PostDataByName(this.requestParam).then(response => {
  2220. console.log('保养审核确认发送参数', this.requestParam)
  2221. if (response.msg !== 'fail') {
  2222. if (this.getdataListParm.parammaps.inputDatetime === null) {
  2223. this.getdataListParm.parammaps.inputDatetime = ''
  2224. }
  2225. this.get_table_data()
  2226. this.dialogFormVisible_examine = false
  2227. this.dialogFormVisible_See = false
  2228. this.isStatueReason = false
  2229. this.getPendingList()
  2230. this.$notify({ title: '成功', message: '审核成功', type: 'success', duration: 2000 })
  2231. } else {
  2232. failproccess(response, this.$notify)
  2233. }
  2234. })
  2235. }
  2236. })
  2237. } else {
  2238. console.log('点击了保养审核2确认-不通过')
  2239. this.isokDisable = true
  2240. setTimeout(() => {
  2241. this.isokDisable = false
  2242. }, 1000)
  2243. this.$refs['examineTemp'].validate(valid => {
  2244. if (valid) {
  2245. this.requestParam.name = 'upkeepCharge1'
  2246. this.requestParam.parammaps = {}
  2247. this.requestParam.parammaps.id = this.examineTemp.id
  2248. this.requestParam.parammaps.statue = 8
  2249. this.requestParam.parammaps.empId = Cookies.get('employeid')
  2250. this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
  2251. PostDataByName(this.requestParam).then(response => {
  2252. console.log('保养审核确认发送参数', this.requestParam)
  2253. if (response.msg !== 'fail') {
  2254. if (this.getdataListParm.parammaps.inputDatetime === null) {
  2255. this.getdataListParm.parammaps.inputDatetime = ''
  2256. }
  2257. this.get_table_data()
  2258. this.dialogFormVisible_examine = false
  2259. this.dialogFormVisible_See = false
  2260. this.isStatueReason = false
  2261. this.getPendingList()
  2262. this.$notify({ title: '成功', message: '审核成功', type: 'success', duration: 2000 })
  2263. } else {
  2264. failproccess(response, this.$notify)
  2265. }
  2266. })
  2267. }
  2268. })
  2269. }
  2270. },
  2271. // 保养审核2
  2272. handleExamine3(row) {
  2273. console.log('点击了保养审核------', row)
  2274. if (row == undefined) {
  2275. this.examineTemp = this.seeTemp
  2276. this.$set(this.seeTemp, 'isStatue', 3)
  2277. this.$set(this.seeTemp, 'workflowNote', '')
  2278. } else {
  2279. this.examineTemp = Object.assign({}, row)
  2280. this.$set(this.examineTemp, 'isStatue', 3)
  2281. this.$set(this.examineTemp, 'workflowNote', '')
  2282. }
  2283. this.dialogStatus = 'examine3'
  2284. this.dialogFormVisible_examine = true
  2285. },
  2286. // 保养审核3-保存
  2287. createExamineData3() {
  2288. if (this.examineTemp.isStatue == 3) {
  2289. console.log('点击了保养审核3确认-通过')
  2290. this.isokDisable = true
  2291. setTimeout(() => {
  2292. this.isokDisable = false
  2293. }, 1000)
  2294. this.$refs['examineTemp'].validate(valid => {
  2295. if (valid) {
  2296. this.requestParam.name = 'upkeepCharge3'
  2297. this.requestParam.parammaps = {}
  2298. this.requestParam.parammaps.id = this.examineTemp.id
  2299. this.requestParam.parammaps.statue = 5
  2300. this.requestParam.parammaps.empId = Cookies.get('employeid')
  2301. this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
  2302. PostDataByName(this.requestParam).then(response => {
  2303. console.log('保养审核确认发送参数', this.requestParam)
  2304. if (response.msg !== 'fail') {
  2305. if (this.getdataListParm.parammaps.inputDatetime === null) {
  2306. this.getdataListParm.parammaps.inputDatetime = ''
  2307. }
  2308. this.get_table_data()
  2309. this.dialogFormVisible_examine = false
  2310. this.dialogFormVisible_See = false
  2311. this.isStatueReason = false
  2312. this.getPendingList()
  2313. this.$notify({ title: '成功', message: '审核成功', type: 'success', duration: 2000 })
  2314. } else {
  2315. failproccess(response, this.$notify)
  2316. }
  2317. })
  2318. }
  2319. })
  2320. } else {
  2321. console.log('点击了保养审核3确认-不通过')
  2322. this.isokDisable = true
  2323. setTimeout(() => {
  2324. this.isokDisable = false
  2325. }, 1000)
  2326. this.$refs['examineTemp'].validate(valid => {
  2327. if (valid) {
  2328. this.requestParam.name = 'upkeepCharge3'
  2329. this.requestParam.parammaps = {}
  2330. this.requestParam.parammaps.id = this.examineTemp.id
  2331. this.requestParam.parammaps.statue = 6
  2332. this.requestParam.parammaps.empId = Cookies.get('employeid')
  2333. this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
  2334. PostDataByName(this.requestParam).then(response => {
  2335. console.log('保养审核确认发送参数', this.requestParam)
  2336. if (response.msg !== 'fail') {
  2337. if (this.getdataListParm.parammaps.inputDatetime === null) {
  2338. this.getdataListParm.parammaps.inputDatetime = ''
  2339. }
  2340. this.get_table_data()
  2341. this.getPendingList()
  2342. this.dialogFormVisible_examine = false
  2343. this.dialogFormVisible_See = false
  2344. this.isStatueReason = false
  2345. this.$notify({ title: '成功', message: '审核成功', type: 'success', duration: 2000 })
  2346. } else {
  2347. failproccess(response, this.$notify)
  2348. }
  2349. })
  2350. }
  2351. })
  2352. }
  2353. },
  2354. preview(row) {
  2355. console.log(row, '=====666')
  2356. this.dialogStatus = 'video'
  2357. this.dialogFormVisible_video = true
  2358. // row.videoPath = 'https://sys.mcs8.net:7706' + row.videoPath
  2359. this.videoTemp = Object.assign({}, row)
  2360. }
  2361. }
  2362. }
  2363. </script>
  2364. <style lang="scss" scoped>
  2365. /deep/ .el-badge__content.is-fixed{
  2366. z-index: 1;
  2367. }
  2368. </style>
  2369. <style lang="scss" scoped>
  2370. ::v-deep .child-dialog{
  2371. z-index: 3000 !important; /* 手动提升 z-index 层级 */
  2372. }
  2373. .el-step__head.is-success {
  2374. color: #409EFF;
  2375. border-color: #409EFF;
  2376. }
  2377. .el-step__title.is-success{
  2378. color: #409EFF;
  2379. }
  2380. .el-step__head.is-process{
  2381. color: #409EFF;
  2382. border-color: #409EFF;
  2383. .el-step__icon.is-text{
  2384. background: #409EFF;
  2385. color: #fff;
  2386. }
  2387. }
  2388. .step-row{
  2389. color: #000;
  2390. }
  2391. </style>