tab2.vue 90 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333
  1. <template>
  2. <div class="app-container">
  3. <div class="filter-container">
  4. <el-select v-model="tableObj1.getdataListParm.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item" @change="change_pasture1">
  5. <el-option v-for="item in pastureNameList" :key="item.id" :label="item.name" :value="item.name" />
  6. </el-select>
  7. <el-select v-model="tableObj1.getdataListParm.parammaps.departmentId" clearable style="width: 140px;" placeholder="部门" class="filter-item">
  8. <el-option v-for="item in departNameList1" :key="item.id" :label="item.name" :value="item.id" />
  9. </el-select>
  10. <el-input v-model="tableObj1.getdataListParm.parammaps.acceptanceCode" placeholder="委外验收单号" style="width: 200px;" class="filter-item" />
  11. <el-select v-model="tableObj1.getdataListParm.parammaps.status" style="width: 140px;" clearable placeholder="审核状态" class="filter-item">
  12. <el-option v-for="item in statuesNameList" :key="item.id" :label="item.name" :value="item.id" />
  13. </el-select>
  14. <el-input v-model="tableObj1.getdataListParm.parammaps.outsourcingCode" placeholder="委外申请单号" style="width: 200px;" class="filter-item" />
  15. <el-select v-model="tableObj1.getdataListParm.parammaps.iscontract" style="width: 140px;" clearable placeholder="有无合同" class="filter-item">
  16. <el-option v-for="item in iscontractList" :key="item.id" :label="item.name" :value="item.id" />
  17. </el-select>
  18. <el-date-picker ref="inputDatetime" v-model="tableObj1.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="结束日期" />
  19. <el-button class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
  20. <!-- <el-button v-if="istab2Add" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button> -->
  21. </div>
  22. <div class="elTable">
  23. <el-table :max-height="myHeight" :key="tableObj1.tableKey" v-loading="tableObj1.listLoading" element-loading-text="给我一点时间" :data="tableObj1.list" border fit highlight-current-row style="width: 100%;" :row-style="rowStyle" :cell-style="cellStyle" class="elTable table-fixed" >
  24. <el-table-column label="序号" align="center" type="index" width="50px">
  25. <template slot-scope="scope">
  26. <span>{{ scope.$index + (tableObj1.pageNum-1) * tableObj1.pageSize + 1 }}</span>
  27. </template>
  28. </el-table-column>
  29. <el-table-column label="委外验收单号" min-width="120px" align="center" prop="acceptanceCode" />
  30. <el-table-column label="牧场" min-width="120px" align="center" prop="pastureName" />
  31. <el-table-column label="部门 " min-width="120px" align="center" prop="departmentName" />
  32. <el-table-column label="申请人" min-width="120px" align="center" prop="applicantName" />
  33. <el-table-column label="合同" min-width="120px" align="center" prop="contract">
  34. <template slot-scope="scope">
  35. <span v-if="scope.row.iscontract == 0 ">有</span>
  36. <span v-else>无</span>
  37. </template>
  38. </el-table-column>
  39. <el-table-column label="日期" min-width="120px" align="center" prop="date" />
  40. <el-table-column label="审核状态" min-width="150px" align="center">
  41. <template slot-scope="scope">
  42. <span v-if="scope.row.status == 0 ">未离厂</span>
  43. <span v-else-if="scope.row.status == 1 ">未回厂</span>
  44. <span v-else-if="scope.row.status == 2 ">已回厂</span>
  45. <span v-else>已验收</span>
  46. </template>
  47. </el-table-column>
  48. <el-table-column label="操作" align="center" width="320" class-name="small-padding fixed-width" fixed="right">
  49. <template slot-scope="{row}">
  50. <el-button type="primary" size="mini" @click="form_see(row)">查看</el-button>
  51. <el-button v-if="istab2Edit && row.isAcceptance == 0" type="success" size="mini" @click="form_edit(row)">编辑</el-button>
  52. <el-button v-if="istab2Del && row.isAcceptance == 0" type="danger" size="mini" @click="form_delete(row)">删除</el-button>
  53. <el-button v-if="row.isAcceptance == 0" style="display:inline-block" type="success" size="mini" @click="form_submit(row)">提交</el-button>
  54. <el-button v-if="istab2Shenhe1 && row.isAcceptance == 1 && (row.flowCompeleted == 1) " style="display:inline-block" type="success" size="mini" @click="form_examine(row)">审核1</el-button>
  55. <el-button v-if="istab2Shenhe2 && row.isAcceptance == 1 && (row.flowCompeleted == 2) " style="display:inline-block" type="success" size="mini" @click="form_examine2(row)">审核2</el-button>
  56. <el-button v-if="istab2Shenhe3 && row.isAcceptance == 1 && (row.flowCompeleted == 4) " style="display:inline-block" type="success" size="mini" @click="form_examine3(row)">审核3</el-button>
  57. </template>
  58. </el-table-column>
  59. </el-table>
  60. <pagination v-show="tableObj1.total>0" :total="tableObj1.total" :page.sync="tableObj1.getdataListParm.offset" :limit.sync="tableObj1.getdataListParm.pagecount" @pagination="get_table_data1()" />
  61. </div>
  62. <!-- 弹出层新增or修改 -->
  63. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="90%">
  64. <div class="app-container">
  65. <el-form ref="createTemp" :rules="rules" :model="createTemp" label-position="right" label-width="100px" style="width: 100%;">
  66. <el-row :gutter="20">
  67. <el-col :span="8">
  68. <el-form-item label="委外验收单号:" prop="acceptanceCode">
  69. <el-input ref="acceptanceCode" v-model="createTemp.acceptanceCode" disabled />
  70. </el-form-item>
  71. </el-col>
  72. <el-col :span="8">
  73. <el-form-item label="牧场:" prop="pastureId" >
  74. <el-select v-model="createTemp.pastureId" placeholder="牧场" class="filter-item" style="width:100%" :disabled="dialogStatus==='update' || dialogStatus==='see'" @change="change_pasture2" >
  75. <el-option v-for="item in pastureNameList" :key="item.id" :label="item.name" :value="item.id" />
  76. </el-select>
  77. </el-form-item>
  78. </el-col>
  79. <el-col :span="8">
  80. <el-form-item label="责任部门:" prop="departmentId">
  81. <el-select v-model="createTemp.departmentId" placeholder="责任部门" class="filter-item" style="width:100%" :disabled="dialogStatus==='update' || dialogStatus==='see'" @change="change_depart2">
  82. <el-option v-for="item in departNameList2" :key="item.id" :label="item.name" :value="item.id" />
  83. </el-select>
  84. </el-form-item>
  85. </el-col>
  86. </el-row>
  87. <el-row :gutter="20">
  88. <el-col :span="8">
  89. <el-form-item label="委外申请单号:" prop="outsourcingCode">
  90. <el-autocomplete :disabled="dialogStatus==='update' || dialogStatus==='see'"
  91. v-model="createTemp.outsourcingCode"
  92. value-key="name"
  93. class="inline-input"
  94. :fetch-suggestions="getOutNumber"
  95. placeholder=""
  96. style="width:100%"
  97. @select="changeOutNumber"
  98. >
  99. <template slot-scope="{ item }">
  100. <div class="name" style="display: inline;">{{ item.outsourcingCode }}</div>
  101. <!-- <div class="name" style="display: inline;">{{ item.departmentName }}</div> -->
  102. </template>
  103. </el-autocomplete>
  104. </el-form-item>
  105. </el-col>
  106. <el-col :span="8">
  107. <el-form-item label="录入人:" prop="applicant">
  108. <el-select v-model="createTemp.applicant" placeholder="录入人" class="filter-item" style="width:100%" :disabled="dialogStatus==='update' || dialogStatus==='see'" >
  109. <el-option v-for="item in employeNameList" :key="item.id" :label="item.name" :value="item.id" />
  110. </el-select>
  111. </el-form-item>
  112. </el-col>
  113. <el-col :span="8">
  114. <el-form-item label="日期:" prop="date">
  115. <el-date-picker v-model="createTemp.date" :picker-options="pickerOptions" type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'" />
  116. </el-form-item>
  117. </el-col>
  118. </el-row>
  119. <el-row :gutter="20">
  120. <el-col :span="8">
  121. <el-form-item label="有无合同:" prop="iscontract">
  122. <span v-if="createTemp.iscontract == 0">有合同</span>
  123. <span v-else>无合同</span>
  124. </el-form-item>
  125. </el-col>
  126. <el-col :span="8">
  127. <el-form-item label="离厂日期:" prop="lcdate">
  128. <el-date-picker v-model="createTemp.lcdate" :picker-options="pickerOptions" type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'" />
  129. </el-form-item>
  130. </el-col>
  131. <el-col :span="8">
  132. <el-form-item label="回厂日期:" prop="hcdate">
  133. <el-date-picker v-model="createTemp.hcdate" :picker-options="pickerOptions" type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'" />
  134. </el-form-item>
  135. </el-col>
  136. </el-row>
  137. <el-divider></el-divider>
  138. <el-table
  139. key="tableKey"
  140. v-loading="listLoading"
  141. element-loading-text="给我一点时间"
  142. :data="listAddCont"
  143. border
  144. fit
  145. highlight-current-row
  146. style="width: 100%;margin-bottom:30px"
  147. :row-style="rowStyle"
  148. :cell-style="cellStyle"
  149. class="elTable"
  150. >
  151. <!-- table表格 -->
  152. <el-table-column label="序号" align="center" type="index" width="50px" />
  153. <el-table-column label="供应商" prop="providerName" align="center" min-width="80px">
  154. <template slot-scope="scope">
  155. <span>{{ scope.row.providerName }}</span>
  156. </template>
  157. </el-table-column>
  158. <!-- <el-table-column label="金额" prop="amount" align="center" min-width="80px">
  159. <template slot-scope="scope">
  160. <span>{{ scope.row.amount }}</span>
  161. </template>
  162. </el-table-column> -->
  163. <el-table-column label="金额" v-if="createTemp.iscontract !== 0" prop="amount" align="center" min-width="80px">
  164. <template slot-scope="scope">
  165. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  166. <el-input v-model="scope.row.amount" style="margin-top:10px" />
  167. </span>
  168. <span v-if="dialogStatus ==='see'">{{ scope.row.amount }}</span>
  169. </template>
  170. </el-table-column>
  171. <el-table-column label="设备名称" prop="eqName" min-width="80px" align="center">
  172. <template slot-scope="scope">
  173. <span>{{ scope.row.eqName }}</span>
  174. </template>
  175. </el-table-column>
  176. <el-table-column label="设备内部编号" prop="eqCode" align="center" min-width="80px">
  177. <template slot-scope="scope">
  178. <span>{{ scope.row.eqCode }}</span>
  179. </template>
  180. </el-table-column>
  181. <el-table-column label="费用类型" prop="typea" align="center" min-width="80px">
  182. <template slot-scope="scope">
  183. <span>{{ scope.row.typea }}</span>
  184. </template>
  185. </el-table-column>
  186. <el-table-column label="铅封号" prop="sealNumber" align="center" min-width="80px">
  187. <template slot-scope="scope">
  188. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  189. <el-input v-model="scope.row.sealNumber" style="margin-top:10px" />
  190. </span>
  191. <span v-if="dialogStatus ==='see'">{{ scope.row.sealNumber }}</span>
  192. </template>
  193. </el-table-column>
  194. <el-table-column label="质保日期" prop="warrantydate" align="center" min-width="80px">
  195. <template slot-scope="scope">
  196. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  197. <!-- <el-date-picker v-model="scope.row.warrantydate" :picker-options="pickerOptions" type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="margin-top:10px" /> -->
  198. <el-date-picker v-model="scope.row.warrantydate" type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="margin-top:10px" />
  199. </span>
  200. <span v-if="dialogStatus ==='see'">{{ scope.row.warrantydate }}</span>
  201. </template>
  202. </el-table-column>
  203. <!-- <el-table-column label="交付日期" prop="date" align="center" min-width="80px">
  204. <template slot-scope="scope">
  205. <span>{{ scope.row.date }}</span>
  206. </template>
  207. </el-table-column> -->
  208. <!-- <el-table-column label="合同编号" prop="contractCode" align="center" min-width="80px">
  209. <template slot-scope="scope">
  210. <span>{{ scope.row.contractCode }}</span>
  211. </template>
  212. </el-table-column> -->
  213. <el-table-column label="备注" prop="remark" align="center" min-width="80px">
  214. <template slot-scope="scope">
  215. <span >{{ scope.row.remark }}</span>
  216. </template>
  217. </el-table-column>
  218. </el-table>
  219. <el-divider></el-divider>
  220. <el-row :gutter="20">
  221. <el-col :span="8">
  222. <el-form-item label="备件类型:" prop="applyType">
  223. <el-radio-group v-model="createTemp.applyType" :disabled="dialogStatus==='see'" @change="change_applyType" >
  224. <el-radio :label="0" :checked="createTemp.applyType == 0">牧场</el-radio>
  225. <el-radio :label="1" :checked="createTemp.applyType == 1">供应商</el-radio>
  226. </el-radio-group>
  227. </el-form-item>
  228. </el-col>
  229. </el-row>
  230. <el-row :gutter="20" v-if = "createTemp.applyType == 0">
  231. <el-button v-if = "dialogStatus !=='see' " class="filter-item" type="primary" size="mini" style="margin-bottom:10px" @click="handleCollectionSparePartsCreate">添加领用单</el-button>
  232. <!-- <el-col :span="8">
  233. <el-form-item label="领用单号:" prop="applyCode">
  234. <el-input ref="applyCode" v-model="createTemp.applyCode" disabled />
  235. </el-form-item>
  236. </el-col>
  237. <el-col :span="16">
  238. <el-form-item label="备件:" prop="partCode">
  239. <el-autocomplete v-model="orderPart.partCode" value-key="name" class="inline-input" :fetch-suggestions="sparePartSearch" placeholder="请输入备件编号或备件名称或备件规格" style="width:100%" @select="handleSelectSparePart" :disabled="dialogStatus==='update' || dialogStatus==='see'" >
  240. <template slot-scope="{ item }">
  241. <b>备件编号:</b><div class="name" style="display: inline;">{{ item.partCode }}</div>&nbsp;
  242. | &nbsp;<b>备件名称:</b><span class="addr">{{ item.partName }}</span>&nbsp;
  243. | &nbsp;<b>备件规格:</b><span class="addr">{{ item.specification }}</span>
  244. | &nbsp;<b>品牌:</b><span class="addr">{{ item.brand }}</span>
  245. | &nbsp;<b>库存:</b><span class="addr">{{ item.reportery }}</span>
  246. </template>
  247. </el-autocomplete>
  248. </el-form-item>
  249. </el-col> -->
  250. </el-row>
  251. <el-table v-if = "createTemp.applyType == 0"
  252. :key="tableKey"
  253. v-loading="listLoading"
  254. element-loading-text="给我一点时间"
  255. :data="listCollectionSpareParts"
  256. border
  257. fit
  258. highlight-current-row
  259. style="width: 100%;"
  260. :row-style="rowStyle"
  261. :cell-style="cellStyle"
  262. class="elTable table-fixed"
  263. >
  264. <el-table-column label="序号" align="center" type="index" width="50px">
  265. <template slot-scope="scope">
  266. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  267. </template>
  268. </el-table-column>
  269. <el-table-column label="领用单号" align="center">
  270. <template slot-scope="scope">
  271. <span>{{ scope.row.applyCode }}</span>
  272. </template>
  273. </el-table-column>
  274. <el-table-column label="领用部门" width="140px" align="center">
  275. <template slot-scope="scope">
  276. <span>{{ scope.row.departmentName }}</span>
  277. </template>
  278. </el-table-column>
  279. <el-table-column label="领用日期" sortable prop="createDate" min-width="80px" align="center" />
  280. <el-table-column label="领用备件" prop="details" align="center">
  281. <template slot-scope="scope">
  282. <span>{{ scope.row.details }}</span>
  283. </template>
  284. </el-table-column>
  285. <el-table-column label="领用状态" min-width="100px" align="center" :formatter="statue" />
  286. <el-table-column label="操作" min-width="80px" align="center">
  287. <template slot-scope="{row}">
  288. <el-button type="primary" size="mini" @click="handleCollarUseSee(row)">查看</el-button>
  289. </template>
  290. </el-table-column>
  291. </el-table>
  292. <el-divider></el-divider>
  293. <el-button v-if = "createTemp.applyType == 1 && dialogStatus !=='see' " class="filter-item" type="primary" icon="el-icon-edit" @click="form_add_list2">新增</el-button>
  294. <el-table v-if = "createTemp.applyType == 1"
  295. key="2" v-loading="listLoading" element-loading-text="给我一点时间"
  296. :data="listAdd2" border fit highlight-current-row style="width: 100%;margin-bottom:30px"
  297. :row-style="rowStyle" :cell-style="cellStyle" class="elTable" >
  298. <!-- table表格 -->
  299. <el-table-column type="index" label="序号" align="center" width="50px" />
  300. <el-table-column label="备件编号" min-width="90px" prop="partCode" align="center">
  301. <template slot-scope="scope">
  302. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  303. <el-input v-model="scope.row.partCode" style="margin-top:10px" />
  304. </span>
  305. <span v-if="dialogStatus ==='see'">{{ scope.row.partCode }}</span>
  306. </template>
  307. </el-table-column>
  308. <el-table-column label="备件名称" min-width="60px" align="center">
  309. <template slot-scope="scope">
  310. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  311. <el-input v-model="scope.row.partName" style="margin-top:10px" />
  312. </span>
  313. <span v-if="dialogStatus ==='see'">{{ scope.row.partName }}</span>
  314. </template>
  315. </el-table-column>
  316. <el-table-column label="备件规格" prop="specification" align="center" min-width="90">
  317. <template slot-scope="scope">
  318. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  319. <el-input v-model="scope.row.specification" style="margin-top:10px" />
  320. </span>
  321. <span v-if="dialogStatus ==='see'">{{ scope.row.specification }}</span>
  322. </template>
  323. </el-table-column>
  324. <el-table-column label="备件品牌" prop="brand" align="center" min-width="60">
  325. <template slot-scope="scope">
  326. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  327. <el-input v-model="scope.row.brand" style="margin-top:10px" />
  328. </span>
  329. <span v-if="dialogStatus ==='see'">{{ scope.row.brand }}</span>
  330. </template>
  331. </el-table-column>
  332. <el-table-column label="供应商" prop="providerName" align="center" min-width="60">
  333. <template slot-scope="scope">
  334. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  335. <el-input v-model="scope.row.providerName" style="margin-top:10px" />
  336. </span>
  337. <span v-if="dialogStatus ==='see'">{{ scope.row.providerName }}</span>
  338. </template>
  339. </el-table-column>
  340. <el-table-column label="计量单位" prop="unit" align="center" min-width="60">
  341. <template slot-scope="scope">
  342. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  343. <el-input v-model="scope.row.unit" style="margin-top:10px" />
  344. </span>
  345. <span v-if="dialogStatus ==='see'">{{ scope.row.unit }}</span>
  346. </template>
  347. </el-table-column>
  348. <el-table-column label="数量" prop="amount" align="center" min-width="60">
  349. <template slot-scope="scope">
  350. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  351. <el-input v-model="scope.row.amount" style="margin-top:10px" />
  352. </span>
  353. <span v-if="dialogStatus ==='see'">{{ scope.row.amount }}</span>
  354. </template>
  355. </el-table-column>
  356. <el-table-column label="单价" prop="price" align="center" min-width="70">
  357. <template slot-scope="scope">
  358. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  359. <el-input v-model="scope.row.price" style="margin-top:10px" />
  360. </span>
  361. <span v-if="dialogStatus ==='see'">{{ scope.row.price }}</span>
  362. </template>
  363. </el-table-column>
  364. <el-table-column label="总价" prop="totalPrice" align="center" min-width="70">
  365. <template slot-scope="scope">
  366. <span>{{ scope.row.price * parseFloat(scope.row.amount) }}</span>
  367. </template>
  368. </el-table-column>
  369. <el-table-column label="备注" prop="remark" align="center" min-width="60">
  370. <template slot-scope="scope">
  371. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  372. <el-input v-model="scope.row.remark" style="margin-top:10px" />
  373. </span>
  374. <span v-if="dialogStatus ==='see'">{{ scope.row.remark }}</span>
  375. </template>
  376. </el-table-column>
  377. <el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right" v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  378. <template slot-scope="{row}">
  379. <a class="del" @click="partDelete2(row)">删除</a>
  380. </template>
  381. </el-table-column>
  382. </el-table>
  383. </el-form>
  384. <el-row v-if="dialogStatus ==='see' ">
  385. <el-col>
  386. <h3 >流程进度</h3>
  387. <el-steps :active="active" align-center finish-status="success">
  388. <el-step
  389. v-for="(item,index) in activeList"
  390. :key="index"
  391. :title="item.title"
  392. :status="item.status"
  393. >
  394. <template slot="description">
  395. <div class="step-row">
  396. <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
  397. <div>{{ item.reason }}</div>
  398. </div>
  399. </template>
  400. </el-step>
  401. </el-steps>
  402. </el-col>
  403. </el-row>
  404. <div slot="footer" class="dialog-footer" style="bottom:10px">
  405. <el-button type="primary" v-if="dialogStatus !=='see'" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()">保存并关闭</el-button>
  406. <!-- <el-button type="primary" v-show ="dialogStatus==='create'" :disabled="isokDisable" @click="add_dialog_save()">保存并关闭1</el-button>
  407. <el-button type="primary" v-show ="dialogStatus==='update'" :disabled="isokDisable" @click="edit_dialog_save()">保存并关闭2</el-button> -->
  408. <el-button @click="dialogFormVisible = false;get_table_data1()">取消并关闭</el-button>
  409. </div>
  410. </div>
  411. </el-dialog>
  412. <!-- 审核 -->
  413. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_Examine" :close-on-click-modal="false" width="30%">
  414. <div class="app-examine">
  415. <h3 style="width: 100%;margin:0 0 0 5%;line-height:50px;">请确认审核结果:</h3>
  416. <el-form ref="examineTemp" :model="examineTemp" label-position="right" style="width: 50%;margin:0 auto;">
  417. <el-row style="width:88%;height:150px;margin:0 auto;">
  418. <el-col :span="20">
  419. <el-form-item>
  420. <el-radio-group v-model="examineTemp.status" @change="change_statue">
  421. <el-radio :label="1" checked>通过</el-radio>
  422. <el-radio :label="2">不通过</el-radio>
  423. </el-radio-group>
  424. </el-form-item>
  425. </el-col>
  426. <el-col v-if="statueReason" :span="20">
  427. <el-input v-model="examineTemp.workflowNote" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入不通过原因" />
  428. </el-col>
  429. </el-row>
  430. </el-form>
  431. </div>
  432. <div slot="footer" class="dialog-footer">
  433. <el-button v-if="istab2Shenhe1 && (examineTemp.flowCompeleted == 1) " type="primary" :disabled="isokDisable" @click="form_examine_save()">确认</el-button>
  434. <el-button v-if="istab2Shenhe2 && (examineTemp.flowCompeleted == 2) " type="primary" :disabled="isokDisable" @click="form_examine_save2()">确认</el-button>
  435. <el-button v-if="istab2Shenhe3 && (examineTemp.flowCompeleted == 4) " type="primary" :disabled="isokDisable" @click="form_examine_save3()">确认</el-button>
  436. <!-- <el-button v-if="dialogStatus==='examine22'" type="primary" :disabled="isokDisable" @click="form_examine_save22()">确认</el-button>
  437. <el-button v-if="dialogStatus==='examine2'" type="primary" :disabled="isokDisable" @click="form_examine_save2()">确认</el-button>
  438. <el-button v-if="dialogStatus==='examine33'" type="primary" :disabled="isokDisable" @click="form_examine_save33()">确认</el-button>
  439. <el-button v-if="dialogStatus==='examine3'" type="primary" :disabled="isokDisable" @click="form_examine_save3()">确认</el-button> -->
  440. <el-button @click="dialogFormVisible_Examine = false;">关闭</el-button>
  441. </div>
  442. </el-dialog>
  443. <el-dialog title="领用单" :visible.sync="dialogFormVisible_CollectionSparePartsSee" :close-on-click-modal="false" width="90%">
  444. <div class="collectionSparePartsSee">
  445. <el-form
  446. ref="collectionSparePartsSeeTemp"
  447. :rules="rules"
  448. :model="collectionSparePartsSeeTemp"
  449. label-position="right"
  450. label-width="120px"
  451. style="width: 90%;margin:0 auto;"
  452. >
  453. <el-row>
  454. <el-col :span="8">
  455. <el-form-item label="领用单号:" prop="applyCode">
  456. <el-input ref="applyCode" v-model="collectionSparePartsSeeTemp.applyCode" disabled />
  457. </el-form-item>
  458. </el-col>
  459. <el-col :span="8">
  460. <el-form-item label="领用部门:" prop="departmentName">
  461. <el-input ref="departmentName" v-model="collectionSparePartsSeeTemp.departmentName" disabled />
  462. </el-form-item>
  463. </el-col>
  464. <el-col :span="8">
  465. <el-form-item label="领用日期:" prop="applyDate">
  466. <el-input ref="applyDate" v-model="collectionSparePartsSeeTemp.applyDate" disabled />
  467. </el-form-item>
  468. </el-col>
  469. </el-row>
  470. <el-row v-if="isPartCode">
  471. <el-col :span="16">
  472. <el-form-item label="所需备件:" prop="partCode">
  473. <el-autocomplete
  474. v-model="collectionSparePartsSeeTemp.partCode"
  475. value-key="name"
  476. class="inline-input"
  477. :fetch-suggestions="sparePartSearch"
  478. placeholder="请输入备件编号或备件名称或备件规格"
  479. style="width:98%"
  480. @select="handleSelectSparePart"
  481. >
  482. <template slot-scope="{ item }">
  483. <b>备件编号:</b><div class="name" style="display: inline;">{{ item.partCode }}</div>&nbsp;
  484. | &nbsp;<b>备件名称:</b><span class="addr">{{ item.partName }}</span>&nbsp;
  485. | &nbsp;<b>备件规格:</b><span class="addr">{{ item.specification }}</span>
  486. | &nbsp;<b>库存:</b><span class="addr">{{ item.reportery }}</span>
  487. | &nbsp;<b>是否零库存:</b><span class="addr" v-if="item.isZeroStock==1">是</span>
  488. <span class="addr" v-else>否</span>
  489. </template>
  490. </el-autocomplete>
  491. </el-form-item>
  492. </el-col>
  493. </el-row>
  494. </el-form>
  495. <el-table
  496. :key="tableKey"
  497. v-loading="listLoading"
  498. element-loading-text="给我一点时间"
  499. :data="listCreateCollectionSpareParts"
  500. border
  501. fit
  502. highlight-current-row
  503. style="width: 100%;margin-bottom:30px"
  504. :row-style="rowStyle"
  505. :cell-style="cellStyle"
  506. class="elTable table-fixed"
  507. >
  508. <!-- table表格 -->
  509. <el-table-column type="index" label="序号" align="center" width="50px" />
  510. <el-table-column label="备件编号" min-width="90px" prop="partCode" align="center">
  511. <template slot-scope="scope">
  512. <span>{{ scope.row.partCode }}</span>
  513. </template>
  514. </el-table-column>
  515. <el-table-column label="备件名称" min-width="80px" align="center">
  516. <template slot-scope="scope">
  517. <span>{{ scope.row.partName }}</span><br>
  518. </template>
  519. </el-table-column>
  520. <el-table-column label="备件规格" prop="specification" align="center" min-width="100">
  521. <template slot-scope="scope">
  522. <span>{{ scope.row.specification }}</span>
  523. </template>
  524. </el-table-column>
  525. <el-table-column label="库存数" prop="reportery" align="center" min-width="100">
  526. <template slot-scope="scope">
  527. <span>{{ scope.row.reportery }}</span>
  528. </template>
  529. </el-table-column>
  530. <el-table-column label="领用数量" prop="amount" align="center" min-width="80">
  531. <template slot-scope="scope">
  532. <el-form :model="scope.row">
  533. <el-form-item prop="amount">
  534. <el-input ref="amount" v-model="scope.row.amount" :disabled="dialogStatus==='collectionSparePartsSee'" style="margin-top:15px" />
  535. </el-form-item>
  536. </el-form>
  537. </template>
  538. </el-table-column>
  539. <!-- <el-table-column label="领用时间" prop="date" align="center" min-width="100">
  540. <template slot-scope="scope">
  541. <span>{{ scope.row.date }}</span>
  542. </template>
  543. </el-table-column> -->
  544. <el-table-column label="用途" prop="note" align="center" min-width="60">
  545. <template slot-scope="scope">
  546. <el-form :model="scope.row">
  547. <el-form-item prop="note">
  548. <el-input ref="note" v-model="scope.row.note" :disabled="dialogStatus==='collectionSparePartsSee'" style="margin-top:15px" />
  549. </el-form-item>
  550. </el-form>
  551. </template>
  552. </el-table-column>
  553. <el-table-column label="设备名称" prop="eqName" align="center" min-width="250">
  554. <template slot-scope="scope">
  555. <el-autocomplete v-if="isCreatePartDelete"
  556. v-model="scope.row.eqName"
  557. class="inline-input"
  558. :fetch-suggestions="querySearchEqName"
  559. value-key="eqName"
  560. placeholder="设备名称"
  561. @select="(value)=>
  562. {handleSelectEqName(value, scope.row)}"
  563. @blur="(value)=>
  564. {blurSelectEqName(value, scope.row)}"
  565. >
  566. <template slot-scope="{ item }">
  567. <span class="addr">{{ item.eqName }}</span>
  568. |<span class="addr">{{ item.eqCode }}</span>
  569. </template>
  570. </el-autocomplete>
  571. <span v-else class="addr">{{ scope.row.eqName }}</span>
  572. </template>
  573. </el-table-column>
  574. <el-table-column label="设备内部编号" prop="eqCode" align="center" min-width="150">
  575. <template slot-scope="scope">
  576. <el-autocomplete v-if="isCreatePartDelete"
  577. v-model="scope.row.eqCode"
  578. class="inline-input"
  579. :fetch-suggestions="querySearchCode"
  580. value-key="eqCode"
  581. placeholder="设备内部编号"
  582. @select="(value)=>
  583. {handleSelectEqCode(value, scope.row)}"
  584. @blur="(value)=>
  585. {blurSelectEqCode(value, scope.row)}"
  586. />
  587. <span v-else class="addr">{{ scope.row.eqCode }}</span>
  588. </template>
  589. </el-table-column>
  590. <el-table-column v-if="isCreatePartDelete" label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right">
  591. <template slot-scope="{row}">
  592. <a class="del" @click="createPartDelete(row)">删除</a>
  593. </template>
  594. </el-table-column>
  595. </el-table>
  596. </div>
  597. <div slot="footer" class="dialog-footer" style="bottom:5px">
  598. <el-button v-if="isPartCode" type="primary" :disabled="isokDisable" @click="createCollectionSparePartsData()">确认</el-button>
  599. <el-button @click="dialogFormVisible_CollectionSparePartsSee = false;">关闭</el-button>
  600. </div>
  601. </el-dialog>
  602. </div>
  603. </template>
  604. <script>
  605. import echarts from 'echarts'
  606. require('echarts/theme/macarons')
  607. import { GetDataByNames, GetReportform, GetDataByName, PostDataByName, checkButtons, ExecDataByConfig} from '@/api/common'
  608. import Cookies from 'js-cookie'
  609. import { parseTime, json2excel } from '@/utils/index.js'
  610. import { MessageBox } from 'element-ui'
  611. import Pagination from '@/components/Pagination'
  612. export default {
  613. name: 'Tab2',
  614. components: { Pagination },
  615. inject: ['reload'],
  616. data() {
  617. return {
  618. myHeight:document.documentElement.clientHeight - 85- 200,
  619. //多个下拉框 - 请求内容
  620. send_select_list: [
  621. { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
  622. { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
  623. ],
  624. // 下拉框 - 牧场
  625. pastureNameList: [
  626. // {id: "犊牛1", name: "犊牛1"},
  627. // {id: "犊牛2", name: "犊牛2"},
  628. // {id: "犊牛3", name: "犊牛3"}
  629. ],
  630. getDepartParam1: {
  631. name: 'findAllDepart', offset: 0, pagecount: 0,
  632. parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }
  633. },
  634. employeNameList: [],
  635. departNameList1: [],
  636. getDepartParam2: {
  637. name: 'findAllDepart', offset: 0, pagecount: 0,
  638. parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }
  639. },
  640. departNameList2: [],
  641. // statuesNameList: [{ id: '0', name: '审核中' }, { id: '1', name: '已通过' }, { id: '2', name: '未通过' }],
  642. statuesNameList: [{ id: '0', name: '未离厂' }, { id: '1', name: '未回厂' }, { id: '2', name: '已回厂' }, { id: '3', name: '已验收' }],
  643. iscontractList:[{id: '0', name: '有合同'},{id: '1', name: '无合同'}],
  644. isokDisable: false,
  645. tableObj1: {
  646. getdataListParm: {
  647. name: 'getBigacceptanceList',
  648. //请求的 page 无用参数 offset 第几页 pagecount 每页多少条
  649. page: 1, offset: 1,pagecount: 10,returntype: 'Map',
  650. parammaps: { pastureName:Cookies.get('pasturename'), acceptanceCode: '',departmentName: '',status: "",outsourcingCode: "", inputDatetime:"",startdate: "",enddate: "",iscontract:''}
  651. },
  652. tableKey: 0,listLoading: false,
  653. //返回的 pageNum 第几页 pageSize 每页多少条 total 总条数
  654. pageNum:'',pageSize:'',total: 0,
  655. list: [
  656. ]
  657. },
  658. pageNum:'',pageSize:'',total: 0,
  659. getAddContListParam: {
  660. name: "getOutsourcingList",
  661. page: 1,offset: 1,pagecount: 20,returntype: "Map",
  662. parammaps: {"bigId": ""}
  663. },
  664. pickerOptions: {
  665. disabledDate(time) {
  666. return time.getTime() > Date.now()// 当天之前的时间可选
  667. }
  668. },
  669. dialogFormVisible_CollectionSparePartsSee: false,
  670. listCreateCollectionSpareParts: [],
  671. isCreatePartDelete: false,
  672. isPartCode: true,
  673. getCollarUseSeeParm: {
  674. name: 'getpartapplyListBybig',
  675. parammaps: {}
  676. },
  677. orderPart: {},
  678. getOutCodetParm: {
  679. name: 'getBigoutsourcingCode',
  680. returntype: 'Map',
  681. parammaps: {
  682. pastureId: Cookies.get('pastureid'),
  683. outsourcingCode:"",
  684. }
  685. },
  686. useForms: [],
  687. getParmCreateAdd: {
  688. name: 'getPartApplyByBig',
  689. returntype: 'Map',
  690. parammaps: {}
  691. },
  692. rules: {
  693. equipmentName: [{ required: true, message: '必填', trigger: 'blur' }],
  694. lcdate: [{ required: true, message: '必填', trigger: 'blur' }],
  695. hcdate: [{ required: true, message: '必填', trigger: 'blur' }],
  696. },
  697. getPramPartApplyListBybig: {
  698. name:"getpartapplyListBybig",
  699. returntype:"Map",
  700. parammaps:{"id":""}
  701. },
  702. getPramAcceptanceList: {
  703. name:"getAcceptanceList",
  704. returntype:"Map",
  705. parammaps:{"bigId ":""}
  706. },
  707. getCollarUseListParm: {
  708. name: 'getPartsapplybyMt',
  709. page: 1,
  710. offset: 1,
  711. returntype: 'Map',
  712. parammaps: {
  713. "RUCode":"",
  714. }
  715. },
  716. collectionSparePartsSeeTemp: {
  717. applyCode:"",departmentName:"",applyDate:"",
  718. isStock: 0,
  719. applyDate:"",
  720. },
  721. listCollectionSpareParts: [],
  722. tableKey: 0,
  723. listLoading: true,
  724. total: 0,
  725. list: [],
  726. dialogStatus: '',
  727. dialogFormVisible: false,
  728. dialogFormVisibleSee: false,
  729. listLoadingSee: true,
  730. listSee: [],
  731. totalSee: 0,
  732. seeTemp: {},
  733. getdataListSee: {
  734. name: 'getpartpurchaseBybig',
  735. returntype: 'Map',
  736. parammaps: {}
  737. },
  738. createTemp: {
  739. pastureId: this.$store.state.user.pastureid,
  740. departmentId: this.$store.state.user.departmentid,
  741. employeId: this.$store.state.user.employeid,
  742. date: parseTime(new Date(), '{y}-{m}-{d}'),
  743. providerId: '',
  744. contract:1,
  745. acceptanceCode:"",
  746. outsourcingCode:"",
  747. applyType:0,
  748. applicant: '',
  749. departmentName: '',
  750. contract:1,
  751. },
  752. getParmCreateNumber: {
  753. name: 'autoCreatCode',
  754. page: 0, offset: 0, pagecount: 0, returntype: 'Map',
  755. parammaps: {
  756. pastureId: Cookies.get('pastureid'),
  757. codeType: 'WY'
  758. }
  759. },
  760. getParmCreateNumber2: {
  761. name: 'autoCreatCode',
  762. page: 0, offset: 0, pagecount: 0, returntype: 'Map',
  763. parammaps: {
  764. pastureId: Cookies.get('pastureid'),
  765. codeType: 'LY'
  766. }
  767. },
  768. requestSparePart: {
  769. name: 'getPartsListLY', page: 1, offset: 1, pagecount: 20, returntype: 'Map',
  770. parammaps: { pastureId: Cookies.get('pastureid') }
  771. },
  772. EqNameList: [],
  773. requestEqName: {
  774. name: 'geteqbyNameCode', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
  775. parammaps: { pastureId: Cookies.get('pastureid') }
  776. },
  777. EqCodeList: [],
  778. listAdd:[],
  779. listAdd2:[],
  780. isData:false,
  781. listAddCont:[
  782. // {providerName:"",providerId: "0",eqId: "0",contractId: "0",}
  783. ],
  784. activeList: [],
  785. active: 1,
  786. dialogFormVisible_Examine: false,
  787. examineTemp: {
  788. "status": 1,
  789. "empid": "",
  790. "flowCompeleted":"",
  791. "workflowNote": "",
  792. "id": ""
  793. },
  794. statueReason: false,
  795. rowStyle: { maxHeight: 50 + 'px', height: 35 + 'px' },
  796. cellStyle: { padding: 0 + 'px' },
  797. textMap: {
  798. update: '编辑',
  799. create: '新增',
  800. see: '查看',
  801. examine: '审核1',
  802. examine22: '审核2',
  803. examine2: '审核3',
  804. examine33: '审核4',
  805. examine3: '审核5',
  806. collectionSparePartsSee: '查看领用',
  807. collectionSparePartsCreate: '添加领用',
  808. },
  809. istab2Add:[],
  810. istab2Edit:[],
  811. istab2Del:[],
  812. istab2Shenhe1:[],
  813. istab2Shenhe2:[],
  814. istab2Shenhe3:[],
  815. }
  816. },
  817. created() {
  818. this.get_select_list()
  819. this.get_table_data1()
  820. },
  821. methods: {
  822. //获取按钮权限
  823. get_auto_buttons() {
  824. const istab2Add = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:add')
  825. this.istab2Add = istab2Add
  826. const istab2Edit = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:edit')
  827. this.istab2Edit = istab2Edit
  828. const istab2Del = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:del')
  829. this.istab2Del = istab2Del
  830. const istab2Shenhe1 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:shenhe1')
  831. this.istab2Shenhe1 = istab2Shenhe1
  832. const istab2Shenhe2 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:shenhe2')
  833. this.istab2Shenhe2 = istab2Shenhe2
  834. const istab2Shenhe3 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:shenhe3')
  835. this.istab2Shenhe3 = istab2Shenhe3
  836. },
  837. get_select_list() {
  838. GetDataByNames(this.send_select_list).then(response => {
  839. this.pastureNameList = response.data.findAllPasture.list
  840. console.log("牧场下拉框", this.pastureNameList)
  841. this.employeNameList = response.data.findAllEmploye.list
  842. console.log("申请人下拉框", this.employeNameList)
  843. this.get_depart_list1()
  844. })
  845. },
  846. change_pasture1(item) {
  847. this.getDepartParam1.parammaps.pastureId = this.pastureNameList.find(obj => obj.name == item).id
  848. this.tableObj1.getdataListParm.parammaps.departmentId = ''
  849. this.get_depart_list1()
  850. },
  851. //部门List
  852. get_depart_list1() {
  853. GetDataByName(this.getDepartParam1).then(response => {
  854. this.departNameList1 = response.data.list
  855. })
  856. },
  857. change_pasture2(item) {
  858. this.getDepartParam2.parammaps.pastureId = item
  859. this.get_depart_list2()
  860. },
  861. get_depart_list2() {
  862. GetDataByName(this.getDepartParam2).then(response => {
  863. this.departNameList2 = response.data.list
  864. })
  865. },
  866. change_depart2(item) {
  867. this.createTemp.departmentName = this.departNameList2.find(obj => obj.id == item).name
  868. },
  869. get_table_data1() {
  870. this.tableObj1.listLoading = false
  871. if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
  872. this.tableObj1.getdataListParm.parammaps.startdate = this.$refs['inputDatetime'].value[0]
  873. this.tableObj1.getdataListParm.parammaps.enddate = this.$refs['inputDatetime'].value[1]
  874. } else {
  875. this.tableObj1.getdataListParm.parammaps.inputDatetime = ''
  876. this.tableObj1.getdataListParm.parammaps.startdate = ''
  877. this.tableObj1.getdataListParm.parammaps.enddate = ''
  878. }
  879. GetDataByName(this.tableObj1.getdataListParm).then(response => {
  880. if (response.data.list !== null) {
  881. this.tableObj1.list = response.data.list
  882. this.tableObj1.pageNum = response.data.pageNum
  883. this.tableObj1.pageSize = response.data.pageSize
  884. this.tableObj1.total = response.data.total
  885. } else {
  886. this.tableObj1.list = [ ]
  887. }
  888. setTimeout(() => {
  889. this.tableObj1.listLoading = false
  890. }, 100)
  891. })
  892. },
  893. form_search() {
  894. console.log('查询')
  895. this.get_table_data1()
  896. },
  897. change_applyType(val) {
  898. console.log(val)
  899. if(val ==1){
  900. this.createTemp.applyType = 1
  901. } else {
  902. this.createTemp.applyType = 0
  903. }
  904. },
  905. form_add() {
  906. this.reset_create()
  907. this.getDepartParam2.parammaps.pastureId = this.createTemp.pastureId
  908. this.get_depart_list2()
  909. this.dialogStatus = 'create'
  910. this.dialogFormVisible = true
  911. this.listLoading = false
  912. this.$nextTick(() => {
  913. this.$refs['createTemp'].clearValidate()
  914. })
  915. //新增生成单号
  916. this.getCreateNumber()
  917. },
  918. statue: function(cellValue) {
  919. // console.log(cellValue.isZeroStock)
  920. if (cellValue.statue == 0) {
  921. return '未领用'
  922. } else if (cellValue.statue == 1) {
  923. return '已领用'
  924. }
  925. },
  926. reset_create() {
  927. this.createTemp.pastureId = parseInt(Cookies.get('pastureid'))
  928. this.createTemp.departmentId = parseInt(Cookies.get('departmentid'))
  929. this.createTemp.departmentName = Cookies.get('departmentname')
  930. this.createTemp.employeId = parseInt(Cookies.get('employeid'))
  931. this.createTemp.date = parseTime(new Date(), '{y}-{m}-{d}')
  932. this.createTemp.outsourcingCode = ''
  933. this.createTemp.applicant = parseInt(Cookies.get('employeid'))
  934. this.createTemp.providerId = ''
  935. this.createTemp.contract = 1
  936. this.createTemp.description = ''
  937. if(parseInt(Cookies.get('pastureid')) == 18){
  938. this.createTemp.departmentId = ""
  939. }
  940. this.createTemp.outsourcingCode = ''
  941. console.log( this.createTemp.departmentName )
  942. this.listAddCont = [
  943. // {providerName:"",providerId: "0",eqId: "0",contractId: "0",amount:"",contractCode:"",date:"",eqCode:"",eqName:"",remark:"",typea:"",}
  944. ]
  945. this.listAdd = []
  946. this.listAdd2 = []
  947. this.listCreateCollectionSpareParts = []
  948. this.listCollectionSpareParts = []
  949. },
  950. handleCollarUseSee(row, isStock) {
  951. console.log(row)
  952. this.collectionSparePartsSeeTemp = Object.assign({}, row)
  953. // this.dialogStatus = 'collectionSparePartsSee'
  954. this.collectionSparePartsSeeTemp.applyDate = row.createDate
  955. this.dialogFormVisible_CollectionSparePartsSee = true
  956. this.isCreatePartDelete = false
  957. this.isPartCode = false
  958. this.getCollarUseSeeList()
  959. },
  960. getCollarUseSeeList() {
  961. this.getCollarUseSeeParm.parammaps.id = this.collectionSparePartsSeeTemp.id
  962. GetDataByName(this.getCollarUseSeeParm).then(response => {
  963. this.listCreateCollectionSpareParts = response.data.list
  964. })
  965. },
  966. form_add_list2() {
  967. var idDel = "id" + Math.round(Math.random()*100) + Math.round(Math.random()*100)
  968. this.listAdd2.unshift({partCode:"",providerId: "0",eqId: "0",contractId: "0",idDel:idDel,partId: "",partCode: "",partName: "",brandId: "",brand: "",providerId: "",providerName: "",price: "",sumPrice: "",remark: "",amount: ""})
  969. },
  970. getCreateNumber() {
  971. GetDataByName(this.getParmCreateNumber).then(response => {
  972. this.$nextTick(() => {
  973. console.log('新增委外维修单单号', response.data.list[0].orderCode)
  974. this.createTemp.acceptanceCode = response.data.list[0].orderCode
  975. this.$forceUpdate()
  976. })
  977. })
  978. },
  979. getCreateLYNumber() {
  980. GetDataByName(this.getParmCreateNumber2).then(response => {
  981. this.$nextTick(() => {
  982. console.log('新增领用单号', response.data.list[0].orderCode)
  983. this.collectionSparePartsSeeTemp.applyCode = response.data.list[0].orderCode
  984. this.$forceUpdate()
  985. })
  986. })
  987. },
  988. add_dialog_save() {
  989. this.isokDisable = true
  990. setTimeout(() => {
  991. this.isokDisable = false
  992. }, 1000)
  993. this.$refs['createTemp'].validate(valid => {
  994. if (valid) {
  995. console.log(this.listAddCont)
  996. if (this.createTemp.acceptanceCode == '' || this.createTemp.acceptanceCode == null || this.createTemp.acceptanceCode == undefined) {
  997. GetDataByName(this.getParmCreateNumber).then(response => {
  998. this.$nextTick(() => {
  999. console.log('新增单号', response.data.list[0].orderCode)
  1000. this.createTemp.acceptanceCode = response.data.list[0].orderCode
  1001. this.$forceUpdate()
  1002. this.add_dialog_saveSave()
  1003. })
  1004. })
  1005. } else {
  1006. this.add_dialog_saveSave()
  1007. }
  1008. }
  1009. })
  1010. },
  1011. add_dialog_saveSave() {
  1012. for (var j = 0; j < this.listAddCont.length; j++) {
  1013. console.log(this.listAddCont[j].amount)
  1014. if (this.listAddCont[j].amount == null || this.listAddCont[j].amount === '') {
  1015. this.$message({ type: 'warning', message: '请检查金额是否未填写', duration: 2000 })
  1016. return false
  1017. } else {
  1018. // var rulesAmount = /^[1-9]\d*$/
  1019. // if (!rulesAmount.test(this.listAddCont[j].amount)) {
  1020. // this.$message({ type: 'error', message: '申购数量请输入正整数', duration: 2000 })
  1021. // return false
  1022. // }
  1023. }
  1024. }
  1025. //牧场
  1026. if(this.createTemp.applyType == 0){
  1027. let mySumPrice = 0
  1028. for (let i = 0; i < this.listAdd.length; i++) {
  1029. mySumPrice += parseFloat(this.listAdd[i].price) * parseFloat(this.listAdd[i].amount)
  1030. }
  1031. if (mySumPrice > 500) {
  1032. this.createTemp.SHStatus = 2
  1033. } else {
  1034. this.createTemp.SHStatus = 9
  1035. }
  1036. var send_data = {
  1037. "common": { "returnmap": "0" },
  1038. "data": [
  1039. {
  1040. "name": "insertBigacceptance",
  1041. "type": "e",
  1042. "parammaps": this.createTemp
  1043. }
  1044. ]
  1045. }
  1046. }
  1047. //供应商
  1048. if(this.createTemp.applyType == 1){
  1049. if(this.listAdd2.length == 0){
  1050. this.$notify({
  1051. title: '失败', message: "备件必选!",
  1052. type: 'warning',
  1053. duration: 2000
  1054. })
  1055. return false
  1056. }
  1057. this.listAdd2.map((item, index) => {
  1058. return item.partId = "0"
  1059. })
  1060. this.listAdd2.map((item, index) => {
  1061. return item.brandId = "0"
  1062. })
  1063. this.listAdd2.map((item, index) => {
  1064. return item.providerId = "0"
  1065. })
  1066. var send_data = {
  1067. "common": {
  1068. "returnmap": "0"
  1069. },
  1070. "data": [
  1071. {
  1072. "name": "insertBigacceptance",
  1073. "type": "e",
  1074. "parammaps": this.createTemp
  1075. },
  1076. {
  1077. "name": "insertSpotList",
  1078. "resultmaps": {
  1079. "list": this.listAdd2
  1080. },
  1081. "children": [
  1082. {
  1083. "name": "insertAcceptance",
  1084. "type": "e",
  1085. "parammaps": {
  1086. "bigId":"@insertBigacceptance.LastInsertId",
  1087. "partId":"@insertSpotList.partId",
  1088. "partCode":"@insertSpotList.partCode",
  1089. "partName":"@insertSpotList.partName",
  1090. "brandId":"@insertSpotList.brandId",
  1091. "brand":"@insertSpotList.brand",
  1092. "providerId":"@insertSpotList.providerId",
  1093. "providerName":"@insertSpotList.providerName",
  1094. "unit":"@insertSpotList.unit",
  1095. "price":"@insertSpotList.price",
  1096. "remark":"@insertSpotList.remark",
  1097.    "specification": "@insertSpotList.specification",
  1098. "amount":"@insertSpotList.amount"
  1099. }
  1100. }
  1101. ]
  1102. }
  1103. ]
  1104. }
  1105. }
  1106. ExecDataByConfig(send_data).then(response => {
  1107. console.log('新增保存发送参数', send_data)
  1108. if (response.msg === 'fail') {
  1109. this.$notify({
  1110. title: '保存失败',
  1111. message: response.data,
  1112. type: 'warning',
  1113. duration: 2000
  1114. })
  1115. } else {
  1116. this.dialogFormVisible = false
  1117. this.get_table_data1()
  1118. this.$notify({
  1119. title: '',
  1120. message: '保存成功',
  1121. type: 'success',
  1122. duration: 2000
  1123. })
  1124. }
  1125. })
  1126. },
  1127. getOutNumber(queryString, cb) {
  1128. console.log('委外申请单号模糊查询输入值', queryString)
  1129. this.getOutCodetParm.parammaps['outsourcingCode'] = queryString
  1130. GetDataByName(this.getOutCodetParm).then(response => {
  1131. console.log('委外申请单号模糊查询搜索data', response.data.list)
  1132. // this.useForms = response.data.list
  1133. cb(response.data.list)
  1134. })
  1135. },
  1136. changeOutNumber(item) {
  1137. console.log('委外申请单号模糊查询选中值', item)
  1138. this.createTemp.outsourcingCode = item.outsourcingCode
  1139. this.$set(this.createTemp, "outsourcingCode", item.outsourcingCode)
  1140. this.getAddContListParam.parammaps.bigId = item.id
  1141. this.getAddContList()
  1142. // this.createTemp.bid = item.id
  1143. // this.createTemp.applicatId = item.empId
  1144. // this.orderPart.applyCode = item.applyCode
  1145. // this.TotalAmount = 0
  1146. // this.get_table_dataAdd()
  1147. },
  1148. querySearchEqName(queryString, cb) {
  1149. console.log('备件名称/设备内部编号模糊查询输入值', queryString)
  1150. this.requestEqName.parammaps['eqName'] = queryString
  1151. GetDataByName(this.requestEqName).then(response => {
  1152. console.log('备件名称模糊查询搜索data', response.data.list)
  1153. this.EqNameList = response.data.list
  1154. cb(this.EqNameList)
  1155. })
  1156. },
  1157. handleSelectEqName(item, row) {
  1158. console.log('备件名称/设备内部编号模糊查询选中值', item.eqName)
  1159. console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
  1160. this.$set(row, 'eqCode', item.eqCode)
  1161. this.$forceUpdate()
  1162. },
  1163. querySearchCode(queryString, cb) {
  1164. console.log('备件名称/设备内部编号模糊查询输入值', queryString)
  1165. this.requestEqName.parammaps['eqCode'] = queryString
  1166. GetDataByName(this.requestEqName).then(response => {
  1167. console.log('备件名称模糊查询搜索data', response.data.list)
  1168. this.EqNameList = response.data.list
  1169. cb(this.EqNameList)
  1170. })
  1171. },
  1172. handleSelectEqCode(item, row) {
  1173. console.log('备件名称/设备内部编号模糊查询选中值', item)
  1174. console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
  1175. this.$set(row, 'eqName', item.eqName)
  1176. this.$forceUpdate()
  1177. },
  1178. blurSelectEqName(item, row) {
  1179. this.$set(row, 'eqName', '')
  1180. this.$set(row, 'eqCode', '')
  1181. },
  1182. blurSelectEqCode(item, row) {
  1183. this.$set(row, 'eqName', '')
  1184. this.$set(row, 'eqCode', '')
  1185. },
  1186. sparePartSearch(queryString, cb) {
  1187. console.log('备件模糊查询输入值', queryString)
  1188. this.requestSparePart.parammaps.pastureId = this.createTemp.pastureId
  1189. this.requestSparePart.parammaps['partCode'] = queryString
  1190. GetDataByName(this.requestSparePart).then(response => {
  1191. console.log('备件模糊查询搜索data', response.data.list)
  1192. if (response.data.list == null) {
  1193. cb([])
  1194. } else {
  1195. cb(response.data.list)
  1196. }
  1197. })
  1198. },
  1199. // handleSelectSparePart(item) {
  1200. // console.log('备件模糊查询选中值', item)
  1201. // if (this.listAdd.length > 0) {
  1202. // // eslint-disable-next-line no-redeclare
  1203. // if (this.listAdd.find(obj => obj.id === item.id)) {
  1204. // this.$message({
  1205. // type: 'warning',
  1206. // message: '此备件已存在,请重新选择备件'
  1207. // })
  1208. // } else {
  1209. // if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  1210. // this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  1211. // this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  1212. // } else {
  1213. // item.srcpath = ''
  1214. // item.picpath = ''
  1215. // }
  1216. // this.listAdd.push(item)
  1217. // }
  1218. // } else {
  1219. // if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  1220. // this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  1221. // this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  1222. // } else {
  1223. // item.srcpath = ''
  1224. // item.picpath = ''
  1225. // }
  1226. // this.listAdd.push(item)
  1227. // }
  1228. // // this.getEqNameList()
  1229. // },
  1230. handleSelectSparePart(item) {
  1231. console.log('备件模糊查询选中值', item)
  1232. if (this.listCreateCollectionSpareParts.length > 0) {
  1233. // eslint-disable-next-line no-redeclare
  1234. if (this.listCreateCollectionSpareParts.find(obj => obj.partId === item.partId)) {
  1235. this.$message({ type: 'warning', message: '此备件已存在,请重新选择备件' })
  1236. } else {
  1237. item.date = this.collectionSparePartsSeeTemp.applyDate
  1238. this.listCreateCollectionSpareParts.unshift(item)
  1239. }
  1240. } else {
  1241. item.date = this.collectionSparePartsSeeTemp.applyDate
  1242. this.listCreateCollectionSpareParts.unshift(item)
  1243. }
  1244. },
  1245. createPartDelete(row) {
  1246. console.log(this.listAdd)
  1247. MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
  1248. confirmButtonText: '确认',
  1249. cancelButtonText: '取消',
  1250. type: 'warning'
  1251. }).then(() => {
  1252. // console.log(this.list2)
  1253. for (var i = 0; i < this.listCreateCollectionSpareParts.length; i++) {
  1254. console.log(this.listCreateCollectionSpareParts[i])
  1255. if (this.listCreateCollectionSpareParts[i].id === row.id) {
  1256. var listCreateCollectionSparePartsIndex = this.listCreateCollectionSpareParts.indexOf(this.listCreateCollectionSpareParts[i])
  1257. }
  1258. if (listCreateCollectionSparePartsIndex > -1) {
  1259. this.listCreateCollectionSpareParts.splice(listCreateCollectionSparePartsIndex, 1)
  1260. return
  1261. }
  1262. }
  1263. })
  1264. },
  1265. // 添加领用保存
  1266. createCollectionSparePartsData() {
  1267. this.isokDisable = true
  1268. if (this.listCreateCollectionSpareParts.length !== 0) {
  1269. for (var i = 0; i < this.listCreateCollectionSpareParts.length; i++) {
  1270. console.log(this.listCreateCollectionSpareParts[i].amount)
  1271. if (this.listCreateCollectionSpareParts[i].amount !== undefined && this.listCreateCollectionSpareParts[i].amount !== '') {
  1272. var rulesAmount = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
  1273. if (!rulesAmount.test(this.listCreateCollectionSpareParts[i].amount)) {
  1274. this.$message({
  1275. type: 'error',
  1276. message: '领用数量请输入正数,最多保留两位小数',
  1277. duration: 2000
  1278. })
  1279. return false
  1280. } else {
  1281. var listCreateCollectionSpareParts1 = [] // >库存
  1282. var listCreateCollectionSpareParts2 = [] // <=库存
  1283. var amountList = []
  1284. var amount2List = []
  1285. let mySumPrice = 0
  1286. for (let i = 0; i < listCreateCollectionSpareParts2.length; i++) {
  1287. mySumPrice += parseFloat(listCreateCollectionSpareParts2[i].price) * parseFloat(listCreateCollectionSpareParts2[i].amount)
  1288. }
  1289. if (mySumPrice > 500) {
  1290. this.collectionSparePartsSeeTemp.SHStatus = 2
  1291. } else {
  1292. this.collectionSparePartsSeeTemp.SHStatus = 9
  1293. }
  1294. var send_data ={
  1295. "common": { "returnmap": "0" },
  1296. "data": [
  1297. {
  1298. "name": "insertBigpartapply",
  1299. "type": "e",
  1300. "parammaps": {
  1301. "pastureId": this.collectionSparePartsSeeTemp.pastureId,
  1302. "applyCode": this.collectionSparePartsSeeTemp.applyCode,
  1303. "applyType": 1,
  1304. "departmentId": this.collectionSparePartsSeeTemp.departmentId,
  1305. "empId": this.collectionSparePartsSeeTemp.empId,
  1306. "applyDate": this.collectionSparePartsSeeTemp.applyDate,
  1307. "RUCode": this.createTemp.acceptanceCode,
  1308. "SHStatus": 9
  1309. }
  1310. },
  1311. {
  1312. "name": "insertSpotList",
  1313. "resultmaps": {
  1314. "list":this.listCreateCollectionSpareParts
  1315. },
  1316. "children": [
  1317. {
  1318. "name": "insertpartapply",
  1319. "type": "e",
  1320. "parammaps": {
  1321. "bigId": "@insertBigpartapply.LastInsertId",
  1322. "pastureId": "@insertSpotList.pastureId",
  1323. "partId": "@insertSpotList.partId",
  1324. "partCode": "@insertSpotList.partCode",
  1325. "partName": "@insertSpotList.partName",
  1326. "specification": "@insertSpotList.specification",
  1327. "brandId": "@insertSpotList.brandId",
  1328. "price": "@insertSpotList.price",
  1329. "amount": "@insertSpotList.amount",
  1330. "eqName": "@insertSpotList.eqName",
  1331.                          "eqCode": "@insertSpotList.eqCode",
  1332. "providerId": "@insertSpotList.providerId",
  1333. "note": "@insertSpotList.note",
  1334. "reportery": "@insertSpotList.reportery",
  1335. "contractId": "@insertSpotList.contractId",
  1336. "locationId": "@insertSpotList.locationId"
  1337. }
  1338. }
  1339. ]
  1340. }
  1341. ]
  1342. }
  1343. ExecDataByConfig(send_data).then(response => {
  1344. console.log('添加领用保存发送参数',send_data)
  1345. if (response.msg === 'fail') {
  1346. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1347. } else {
  1348. this.dialogFormVisible_CollectionSparePartsSee = false
  1349. this.getCollectionSpareParts()
  1350. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  1351. }
  1352. })
  1353. return true
  1354. }
  1355. } else {
  1356. this.$message({ type: 'error', message: '请检查领用数量是否未填写', duration: 2000 })
  1357. return false
  1358. }
  1359. }
  1360. } else {
  1361. this.$notify({ title: '', type: 'warning', message: '请选择备件', duration: 2000 })
  1362. return false
  1363. }
  1364.  setTimeout(() => {
  1365.         this.isokDisable = false
  1366.       }, 2000)
  1367. },
  1368. //看领用单
  1369. getCollectionSpareParts() {
  1370. this.getCollarUseListParm.parammaps.RUCode = this.createTemp.acceptanceCode
  1371. GetDataByName(this.getCollarUseListParm).then(response => {
  1372. console.log('领用table数据', response.data.list)
  1373. this.listCollectionSpareParts = response.data.list
  1374. })
  1375. },
  1376. // 新增删除
  1377. partDelete(row) {
  1378. console.log(this.listAdd)
  1379. MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
  1380. confirmButtonText: '确认',
  1381. cancelButtonText: '取消',
  1382. type: 'warning'
  1383. }).then(() => {
  1384. for (var i = 0; i < this.listAdd.length; i++) {
  1385. console.log(this.listAdd[i])
  1386. if (this.listAdd[i].id === row.id) {
  1387. var listAddIndex = this.listAdd.indexOf(this.listAdd[i])
  1388. }
  1389. if (listAddIndex > -1) {
  1390. this.listAdd.splice(listAddIndex, 1)
  1391. return
  1392. }
  1393. }
  1394. })
  1395. },
  1396. partDelete2(row) {
  1397. console.log(this.listAdd2)
  1398. MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
  1399. confirmButtonText: '确认',
  1400. cancelButtonText: '取消',
  1401. type: 'warning'
  1402. }).then(() => {
  1403. for (var i = 0; i < this.listAdd2.length; i++) {
  1404. console.log(this.listAdd2[i])
  1405. if (this.listAdd2[i].idDel === row.idDel) {
  1406. var listAddIndex = this.listAdd2.indexOf(this.listAdd2[i])
  1407. }
  1408. if (listAddIndex > -1) {
  1409. this.listAdd2.splice(listAddIndex, 1)
  1410. return
  1411. }
  1412. }
  1413. })
  1414. },
  1415. handleCollectionSparePartsCreate() {
  1416. if(this.createTemp.departmentId == "" || this.createTemp.departmentId == undefined){
  1417. this.$message({ type: 'warning', message: '请选择责任部门', duration: 2000 })
  1418. return false
  1419. }
  1420. if(this.createTemp.applicant == "" || this.createTemp.applicant == undefined){
  1421. this.$message({ type: 'warning', message: '请选择录入人', duration: 2000 })
  1422. return false
  1423. }
  1424. console.log( "createTemp)============",this.createTemp)
  1425. this.collectionSparePartsSeeTemp = Object.assign({}, this.createTemp)
  1426. this.collectionSparePartsSeeTemp.empId = this.collectionSparePartsSeeTemp.applicant
  1427. this.collectionSparePartsSeeTemp.applyDate = parseTime(new Date(), '{y}-{m}-{d}')
  1428. // this.dialogStatus = 'collectionSparePartsCreate'
  1429. this.dialogFormVisible_CollectionSparePartsSee = true
  1430. this.isCreatePartDelete = true
  1431. this.listCreateCollectionSpareParts = []
  1432. this.isPartCode = true
  1433. this.getCreateLYNumber()
  1434. console.log( "console.log( this.collectionSparePartsSeeTemp)============",this.collectionSparePartsSeeTemp)
  1435. },
  1436. // getCreateNumber() {
  1437. // // GetDataByName(this.getParmCreateNumber).then(response => {
  1438. // // this.$nextTick(() => {
  1439. // // console.log('新增领用单号', response.data.list[0].orderCode)
  1440. // // this.collectionSparePartsSeeTemp.applyCode = response.data.list[0].orderCode
  1441. // // this.$forceUpdate()
  1442. // // })
  1443. // // })
  1444. // },
  1445. form_see(row){
  1446. console.log('查看======》',row)
  1447. this.reset_create()
  1448. this.getDepartParam2.parammaps.pastureId = row.pastureId
  1449. this.get_depart_list2()
  1450. if (row.providerId == undefined) {
  1451. row.providerId = ''
  1452. row.providerName = ''
  1453. }
  1454. this.createTemp = Object.assign({}, row) // copy obj
  1455. this.dialogStatus = 'see'
  1456. this.dialogFormVisible = true
  1457. this.$nextTick(() => {
  1458. this.$refs['createTemp'].clearValidate()
  1459. })
  1460. //委外申请单号获取合同
  1461. this.getAddContListParam.parammaps.bigId = row.outsourcingId
  1462. this.getAddContList()
  1463. //牧场
  1464. if(row.applyType == 0){
  1465. this.getPramPartApplyListBybig.parammaps.id = row.partapplyId
  1466. this.getCollectionSpareParts()
  1467. this.isCreatePartDelete = false
  1468. }
  1469. //供应商
  1470. if(row.applyType == 1){
  1471. this.getPramAcceptanceList.parammaps.bigId = row.id
  1472. this.getListAdd2()
  1473. }
  1474. if (row.flowCompeleted == 1) {
  1475. this.activeList = [{ title: '委外验收', date: row.createTime, name: row.empname }, { title: '供应处长' }, { title: '部门负责人' },{ title: '场长' }]
  1476. this.active = 1
  1477. } else if (row.flowCompeleted == 2) {
  1478. this.activeList = [{ title: '委外验收', date: row.createTime, name: row.applicantName }, { title: '供应处长', date: row.equipmentdate, name: row.equipmentName },{ title: '部门负责人' },{ title: '场长' }]
  1479. this.active = 2
  1480. } else if (row.flowCompeleted === 3) {
  1481. this.activeList = [{ title: '委外验收', date: row.createTime, name: row.applicantName }, { title: '供应处长', date: row.equipmentdate, name: row.equipmentName, status: 'error', reason: row.workflowNote },{ title: '部门负责人' },{ title: '场长' }]
  1482. this.active = 2
  1483. } else if (row.flowCompeleted === 4) {
  1484. this.activeList = [{ title: '委外验收', date: row.createTime, name: row.applicantName }, { title: '供应处长', date: row.equipmentdate, name: row.equipmentName },{ title: '部门负责人', date: row.departmentdate, name: row.departmentUser },{ title: '场长' }]
  1485. this.active = 3
  1486. } else if (row.flowCompeleted === 5) {
  1487. this.activeList = [{ title: '委外验收', date: row.createTime, name:row.applicantName }, { title: '供应处长', date: row.equipmentdate, name: row.equipmentName },{ title: '部门负责人', date: row.departmentdate, name: row.departmentUser, status: 'error', reason: row.workflowNote },{ title: '场长' }]
  1488. this.active = 3
  1489. } else if (row.flowCompeleted === 6) {
  1490. this.activeList = [{ title: '委外验收', date: row.createTime, name: row.applicantName }, { title: '供应处长', date:row.equipmentdate, name: row.equipmentName },{ title: '部门负责人', date: row.departmentdate, name: row.departmentUser },{ title: '场长', date:row.fielddate, name:row.fieldName }]
  1491. this.active = 4
  1492. } else if (row.flowCompeleted === 7) {
  1493. this.activeList = [{ title: '委外验收', date: row.createTime, name: row.applicantName }, { title: '供应处长', date: row.equipmentdate, name: row.equipmentName },{ title: '部门负责人', date: row.departmentdate, name: row.departmentUser },{ title: '场长', date: row.fielddate, name: row.fieldName, status: 'error', reason: row.workflowNote }]
  1494. this.active = 4
  1495. }
  1496. },
  1497. getAddContList() {
  1498. GetDataByName(this.getAddContListParam).then(response => {
  1499. this.listAddCont = response.data.list
  1500. this.listLoading = false
  1501. })
  1502. },
  1503. form_edit(row) {
  1504. this.reset_create()
  1505. console.log('编辑',row)
  1506. this.getDepartParam2.parammaps.pastureId = row.pastureId
  1507. this.get_depart_list2()
  1508. if (row.providerId == undefined) {
  1509. row.providerId = ''
  1510. row.providerName = ''
  1511. }
  1512. this.createTemp = Object.assign({}, row) // copy obj
  1513. this.dialogStatus = 'update'
  1514. this.dialogFormVisible = true
  1515. this.$nextTick(() => {
  1516. this.$refs['createTemp'].clearValidate()
  1517. })
  1518. //委外申请单号获取合同
  1519. this.getAddContListParam.parammaps.bigId = row.outsourcingId
  1520. this.getAddContList()
  1521. this.isData = false
  1522. //牧场
  1523. if(row.applyType == 0){
  1524. this.getCollectionSpareParts()
  1525. }
  1526. //供应商
  1527. if(row.applyType == 1){
  1528. this.getPramAcceptanceList.parammaps.bigId = row.id
  1529. this.getListAdd2()
  1530. }
  1531. },
  1532. getListAdd() {
  1533. GetDataByName(this.getPramPartApplyListBybig).then(response => {
  1534. this.listAdd = response.data.list
  1535. this.listLoading = false
  1536. })
  1537. },
  1538. getListAdd2() {
  1539. GetDataByName(this.getPramAcceptanceList).then(response => {
  1540. this.listAdd2 = response.data.list
  1541. if(this.listAdd2.length>0){
  1542. this.isData = true
  1543. }else{
  1544. this.isData = false
  1545. }
  1546. this.listLoading = false
  1547. })
  1548. },
  1549. edit_dialog_save() {
  1550. this.isokDisable = true
  1551. setTimeout(() => {
  1552. this.isokDisable = false
  1553. }, 1000)
  1554. this.$refs['createTemp'].validate(valid => {
  1555. if (valid) {
  1556. this.edit_dialog_saveSave()
  1557. }
  1558. })
  1559. },
  1560. edit_dialog_saveSave() {
  1561. //牧场
  1562. if(this.createTemp.applyType == 0){
  1563. for(let i=0;i<this.listAddCont.length;i++){
  1564. if(this.listAddCont[i].sealNumber == ''){
  1565. this.$message({ type: 'warning', message: '请检查铅封号是否未填写', duration: 2000 })
  1566. return false
  1567. }
  1568. if(this.listAddCont[i].warrantydate == ''){
  1569. this.$message({ type: 'warning', message: '请检查质保日期是否未填写', duration: 2000 })
  1570. return false
  1571. }
  1572. }
  1573. var send_data = {
  1574. "common": { "returnmap": "0" },
  1575. "data": [
  1576. {
  1577. "name": "editBigacceptanceDate",
  1578. "type": "e",
  1579. "parammaps": {
  1580. "id":this.createTemp.id,
  1581. "date":this.createTemp.date,
  1582. "applyType":this.createTemp.applyType
  1583. }
  1584. },
  1585. {
  1586. "name": "updateBigacceptanceFlowCompeleted", "type": "e",
  1587. "parammaps":{
  1588. id:this.createTemp.id
  1589. }
  1590. },
  1591. {
  1592. "name": "editBigacceptance", "type": "e",
  1593. "parammaps":{
  1594. id:this.createTemp.id,
  1595. lcdate:this.createTemp.lcdate,
  1596. hcdate:this.createTemp.hcdate
  1597. }
  1598. },
  1599. {
  1600. "name": "insertSpotList",
  1601. "resultmaps": { "list": this.listAddCont },
  1602. "children": [
  1603. {
  1604. "name": "editOutsourcingData", "type": "e",
  1605. "parammaps": {
  1606. "id": "@insertSpotList.id",
  1607. "amount": "@insertSpotList.amount",
  1608. "sealNumber": "@insertSpotList.sealNumber",
  1609. "warrantydate": "@insertSpotList.warrantydate"
  1610. }
  1611. }
  1612. ],
  1613. }
  1614. ]
  1615. }
  1616. }
  1617. //供应商
  1618. if(this.createTemp.applyType == 1){
  1619. if(this.listAdd2.length == 0){
  1620. this.$notify({
  1621. title: '失败', message: "备件必选!",
  1622. type: 'warning',
  1623. duration: 2000
  1624. })
  1625. return false
  1626. }
  1627. this.listAdd2.map((item, index) => {
  1628. return item.partId = "0"
  1629. })
  1630. this.listAdd2.map((item, index) => {
  1631. return item.brandId = "0"
  1632. })
  1633. this.listAdd2.map((item, index) => {
  1634. return item.providerId = "0"
  1635. })
  1636. var myname = ''
  1637. // var bigId = ''
  1638. if(this.isData == true){
  1639. myname = 'editAcceptance'
  1640. // bigId = "@insertBigacceptance.LastInsertId"
  1641. // bigId = "@insertSpotList.bigId"
  1642. }else{
  1643. myname = 'insertAcceptance'
  1644. for(let i=0;i<this.listAdd2.length;i++){
  1645. this.$set(this.listAdd2[i],'bigId',this.createTemp.id)
  1646. }
  1647. // bigId = "@insertSpotList.bigId"
  1648. }
  1649. var send_data = {
  1650. "common": { "returnmap": "0" },
  1651. "data": [
  1652. {
  1653. "name": "editBigacceptanceDate",
  1654. "type": "e",
  1655. "parammaps": {
  1656. "id":this.createTemp.id,"date":this.createTemp.date,"applyType":this.createTemp.applyType
  1657. }
  1658. },
  1659. {
  1660. "name": "insertSpotList",
  1661. "type": "e",
  1662. "resultmaps": {
  1663. "list": this.listAdd2
  1664. },
  1665. "children": [
  1666. {
  1667. "name": myname,
  1668. "type": "e",
  1669. "parammaps": {
  1670. "id":"@insertSpotList.id",
  1671. "bigId":"@insertSpotList.bigId",
  1672. "partId":"@insertSpotList.partId",
  1673. "partCode":"@insertSpotList.partCode",
  1674. "partName":"@insertSpotList.partName",
  1675. "brandId":"@insertSpotList.brandId",
  1676. "brand":"@insertSpotList.brand",
  1677. "providerId":"@insertSpotList.providerId",
  1678. "providerName":"@insertSpotList.providerName",
  1679. "unit":"@insertSpotList.unit",
  1680. "price":"@insertSpotList.price",
  1681. "remark":"@insertSpotList.remark",
  1682. "specification":"@insertSpotList.specification",
  1683. "amount":"@insertSpotList.amount"
  1684. }
  1685. }
  1686. ]
  1687. },
  1688. {
  1689. "name": "updateBigacceptanceFlowCompeleted", "type": "e",
  1690. "parammaps":{
  1691. id:this.createTemp.id
  1692. }
  1693. },
  1694. {
  1695. "name": "editBigacceptance", "type": "e",
  1696. "parammaps":{
  1697. id:this.createTemp.id,
  1698. lcdate:this.createTemp.lcdate,
  1699. hcdate:this.createTemp.hcdate
  1700. }
  1701. },
  1702. {
  1703. "name": "insertSpotList",
  1704. "resultmaps": { "list": this.listAddCont },
  1705. "children": [
  1706. {
  1707. "name": "editOutsourcingData", "type": "e",
  1708. "parammaps": {
  1709. "id": "@insertSpotList.id",
  1710. "amount": "@insertSpotList.amount",
  1711. "sealNumber": "@insertSpotList.sealNumber",
  1712. "warrantydate": "@insertSpotList.warrantydate"
  1713. }
  1714. }
  1715. ],
  1716. }
  1717. ]
  1718. }
  1719. }
  1720. ExecDataByConfig(send_data).then(response => {
  1721. console.log('编辑保存发送参数', send_data)
  1722. if (response.msg === 'fail') {
  1723. this.$notify({
  1724. title: '保存失败',
  1725. message: response.data,
  1726. type: 'warning',
  1727. duration: 2000
  1728. })
  1729. } else {
  1730. this.dialogFormVisible = false
  1731. this.get_table_data1()
  1732. this.$notify({
  1733. title: '',
  1734. message: '保存成功',
  1735. type: 'success',
  1736. duration: 2000
  1737. })
  1738. }
  1739. })
  1740. },
  1741. form_delete(row) {
  1742. console.log('点击了删除',row)
  1743. MessageBox.confirm('确认删除此条信息?', {
  1744. confirmButtonText: '确认',
  1745. cancelButtonText: '取消',
  1746. type: 'warning'
  1747. }).then(() => {
  1748. var send_data = {
  1749. "common": { "returnmap": "0" },
  1750. "data": [
  1751. {
  1752. "name": "deleteBigacceptance", "type": "e",
  1753. "parammaps": { "id":row.id }
  1754. }
  1755. ]
  1756. }
  1757. ExecDataByConfig(send_data).then(response => {
  1758. this.get_table_data1()
  1759. this.$notify({
  1760. title: '成功',
  1761. message: '删除成功',
  1762. type: 'success',
  1763. duration: 2000
  1764. })
  1765. })
  1766. }).catch(() => {
  1767. this.$message({
  1768. type: 'info',
  1769. message: '已取消删除'
  1770. })
  1771. })
  1772. },
  1773. change_statue(val) {
  1774. if (val == 2) {
  1775. this.statueReason = true
  1776. } else {
  1777. this.statueReason = false
  1778. }
  1779. },
  1780. form_examine(row) {
  1781. console.log('点击了供应处长审核',row)
  1782. if (row == undefined) {
  1783. this.examineTemp = this.createTemp
  1784. this.$set(this.createTemp, 'status', 1)
  1785. this.$set(this.createTemp, 'workflowNote', '')
  1786. } else {
  1787. this.examineTemp = Object.assign({}, row)
  1788. this.$set(this.examineTemp, 'status', 1)
  1789. this.$set(this.examineTemp, 'workflowNote', '')
  1790. }
  1791. this.dialogStatus = 'examine'
  1792. this.dialogFormVisible_Examine = true
  1793. this.statueReason = false
  1794. },
  1795. form_examine_save() {
  1796. console.log('点击了供应处长审核', )
  1797. this.isokDisable = true
  1798. setTimeout(() => {
  1799. this.isokDisable = false
  1800. }, 1000)
  1801. this.$refs['examineTemp'].validate(valid => {
  1802. if (valid) {
  1803. //不通过
  1804. if(this.statueReason){
  1805. this.examineTemp.status = 2
  1806. //审核角色
  1807. this.examineTemp.flowCompeleted = "3"
  1808. } else {
  1809. this.examineTemp.status = 0
  1810. this.examineTemp.flowCompeleted = "2"
  1811. }
  1812. this.examineTemp.empid = Cookies.get('employeid')
  1813. var send_data = {
  1814. "common": { "returnmap": "0" },
  1815. "data": [
  1816. {
  1817. "name": "EditBigacceptanceEquipment", "type": "e",
  1818. "parammaps": this.examineTemp
  1819. }
  1820. ]
  1821. }
  1822. ExecDataByConfig(send_data).then(response => {
  1823. console.log('审核确认发送参数', send_data)
  1824. if (response.msg !== 'fail') {
  1825. this.get_table_data1()
  1826. this.dialogFormVisible_Examine = false
  1827. this.statueReason = false
  1828. this.$notify({
  1829. title: '成功',
  1830. message: '审核成功',
  1831. type: 'success',
  1832. duration: 2000
  1833. })
  1834. } else {
  1835. failproccess(response, this.$notify)
  1836. }
  1837. })
  1838. }
  1839. })
  1840. },
  1841. form_examine2(row) {
  1842. console.log('点击了部门负责人审核',row)
  1843. if (row == undefined) {
  1844. this.examineTemp = this.createTemp
  1845. this.$set(this.createTemp, 'status', 1)
  1846. this.$set(this.createTemp, 'workflowNote', '')
  1847. } else {
  1848. this.examineTemp = Object.assign({}, row)
  1849. this.$set(this.examineTemp, 'status', 1)
  1850. this.$set(this.examineTemp, 'workflowNote', '')
  1851. }
  1852. this.dialogStatus = 'examine'
  1853. this.dialogFormVisible_Examine = true
  1854. this.statueReason = false
  1855. },
  1856. form_examine_save2() {
  1857. console.log('点击了部门负责人审核', )
  1858. this.isokDisable = true
  1859. setTimeout(() => {
  1860. this.isokDisable = false
  1861. }, 1000)
  1862. this.$refs['examineTemp'].validate(valid => {
  1863. if (valid) {
  1864. //不通过
  1865. if(this.statueReason){
  1866. this.examineTemp.status = 2
  1867. //审核角色
  1868. this.examineTemp.flowCompeleted = "5"
  1869. } else {
  1870. this.examineTemp.status = 0
  1871. this.examineTemp.flowCompeleted = "4"
  1872. }
  1873. this.examineTemp.empid = Cookies.get('employeid')
  1874. var send_data = {
  1875. "common": { "returnmap": "0" },
  1876. "data": [
  1877. {
  1878. "name": "EditBigacceptanceDepartment", "type": "e",
  1879. "parammaps": this.examineTemp
  1880. }
  1881. ]
  1882. }
  1883. ExecDataByConfig(send_data).then(response => {
  1884. console.log('审核确认发送参数', send_data)
  1885. if (response.msg !== 'fail') {
  1886. this.get_table_data1()
  1887. this.dialogFormVisible_Examine = false
  1888. this.statueReason = false
  1889. this.$notify({
  1890. title: '成功',
  1891. message: '审核成功',
  1892. type: 'success',
  1893. duration: 2000
  1894. })
  1895. } else {
  1896. failproccess(response, this.$notify)
  1897. }
  1898. })
  1899. }
  1900. })
  1901. },
  1902. form_examine3(row) {
  1903. console.log('点击了场长 审核',row)
  1904. if (row == undefined) {
  1905. this.examineTemp = this.createTemp
  1906. this.$set(this.createTemp, 'status', 1)
  1907. this.$set(this.createTemp, 'workflowNote', '')
  1908. } else {
  1909. this.examineTemp = Object.assign({}, row)
  1910. this.$set(this.examineTemp, 'status', 1)
  1911. this.$set(this.examineTemp, 'workflowNote', '')
  1912. }
  1913. this.dialogStatus = 'examine'
  1914. this.dialogFormVisible_Examine = true
  1915. this.statueReason = false
  1916. },
  1917. form_examine_save3() {
  1918. console.log('点击了场长审核', )
  1919. this.isokDisable = true
  1920. setTimeout(() => {
  1921. this.isokDisable = false
  1922. }, 1000)
  1923. this.$refs['examineTemp'].validate(valid => {
  1924. if (valid) {
  1925. //不通过
  1926. if(this.statueReason){
  1927. this.examineTemp.status = 2
  1928. //审核角色
  1929. this.examineTemp.flowCompeleted = "7"
  1930. } else {
  1931. this.examineTemp.status = 1
  1932. this.examineTemp.flowCompeleted = "6"
  1933. }
  1934. this.examineTemp.empid = Cookies.get('employeid')
  1935. var send_data = {
  1936. "common": { "returnmap": "0" },
  1937. "data": [
  1938. {
  1939. "name": "EditBigacceptanceField", "type": "e",
  1940. "parammaps": this.examineTemp
  1941. }
  1942. ]
  1943. }
  1944. ExecDataByConfig(send_data).then(response => {
  1945. console.log('审核确认发送参数', send_data)
  1946. if (response.msg !== 'fail') {
  1947. this.get_table_data1()
  1948. this.dialogFormVisible_Examine = false
  1949. this.statueReason = false
  1950. this.$notify({
  1951. title: '成功',
  1952. message: '审核成功',
  1953. type: 'success',
  1954. duration: 2000
  1955. })
  1956. } else {
  1957. failproccess(response, this.$notify)
  1958. }
  1959. })
  1960. }
  1961. })
  1962. },
  1963. form_submit(row){
  1964. MessageBox.confirm('确认提交此条信息?', {
  1965. confirmButtonText: '确认',
  1966. cancelButtonText: '取消',
  1967. type: 'warning'
  1968. }).then(() => {
  1969. if(row.isPartapply == 1){
  1970. var send_data1 = {
  1971. "name": "checkOutsourcingAmount",
  1972. "parammaps": { "outsourcingCode":row.outsourcingCode }
  1973. }
  1974. var send_data2 = {
  1975. "common": { "returnmap": "0" },
  1976. "data": [
  1977. {
  1978. "name": "editBigacceptanceIsAcceptance", "type": "e",
  1979. "parammaps": { "id":row.id }
  1980. }
  1981. ]
  1982. }
  1983. GetDataByName(send_data1).then(response => {
  1984. if(parseFloat(response.data.list[0].amount) !== 0){
  1985. this.save_submit(send_data2)
  1986. }else{
  1987. this.$message({
  1988. type: 'error',
  1989. message: '数据未填写,请完善相关信息'
  1990. })
  1991. }
  1992. })
  1993. }else{
  1994. this.$message({ type: 'warning', message: '备件未领用,暂时不能提交。', duration: 2000 })
  1995. }
  1996. }).catch(() => {
  1997. this.$message({
  1998. type: 'info',
  1999. message: '已取消提交'
  2000. })
  2001. })
  2002. },
  2003. save_submit(send_data){
  2004. ExecDataByConfig(send_data).then(response => {
  2005. if (response.msg !== 'fail') {
  2006. this.$notify({ title: '成功', message: '提交成功', type: 'success', duration: 2000 })
  2007. this.get_table_data1()
  2008. }
  2009. })
  2010. }
  2011. }
  2012. }
  2013. </script>
  2014. <style lang="scss" scoped>
  2015. .content{
  2016. padding: 20px 20px;
  2017. .title{
  2018. text-align: center;
  2019. font-weight: 700;
  2020. }
  2021. .title2{
  2022. float: left;
  2023. font-weight: 700;
  2024. padding: 10px 0;
  2025. }
  2026. }
  2027. </style>