tab2.vue 91 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344
  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" style="height: 500px;">
  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==='collectionSparePartsSee1'" 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==='collectionSparePartsSee1'" 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. <el-button @click="closeCollectionSparePartsSee">关闭</el-button>
  601. </div>
  602. </el-dialog>
  603. </div>
  604. </template>
  605. <script>
  606. import echarts from 'echarts'
  607. require('echarts/theme/macarons')
  608. import { GetDataByNames, GetReportform, GetDataByName, PostDataByName, checkButtons, ExecDataByConfig} from '@/api/common'
  609. import Cookies from 'js-cookie'
  610. import { parseTime, json2excel } from '@/utils/index.js'
  611. import { MessageBox } from 'element-ui'
  612. import Pagination from '@/components/Pagination'
  613. export default {
  614. name: 'Tab2',
  615. components: { Pagination },
  616. inject: ['reload'],
  617. data() {
  618. return {
  619. myHeight:document.documentElement.clientHeight - 85- 200,
  620. //多个下拉框 - 请求内容
  621. send_select_list: [
  622. { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
  623. { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
  624. ],
  625. // 下拉框 - 牧场
  626. pastureNameList: [
  627. // {id: "犊牛1", name: "犊牛1"},
  628. // {id: "犊牛2", name: "犊牛2"},
  629. // {id: "犊牛3", name: "犊牛3"}
  630. ],
  631. getDepartParam1: {
  632. name: 'findAllDepart', offset: 0, pagecount: 0,
  633. parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }
  634. },
  635. employeNameList: [],
  636. departNameList1: [],
  637. getDepartParam2: {
  638. name: 'findAllDepart', offset: 0, pagecount: 0,
  639. parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }
  640. },
  641. departNameList2: [],
  642. // statuesNameList: [{ id: '0', name: '审核中' }, { id: '1', name: '已通过' }, { id: '2', name: '未通过' }],
  643. statuesNameList: [{ id: '0', name: '未离厂' }, { id: '1', name: '未回厂' }, { id: '2', name: '已回厂' }, { id: '3', name: '已验收' }],
  644. iscontractList:[{id: '0', name: '有合同'},{id: '1', name: '无合同'}],
  645. isokDisable: false,
  646. tableObj1: {
  647. getdataListParm: {
  648. name: 'getBigacceptanceList',
  649. //请求的 page 无用参数 offset 第几页 pagecount 每页多少条
  650. page: 1, offset: 1,pagecount: 10,returntype: 'Map',
  651. parammaps: { pastureName:Cookies.get('pasturename'), acceptanceCode: '',departmentName: '',status: "",outsourcingCode: "", inputDatetime:"",startdate: "",enddate: "",iscontract:''}
  652. },
  653. tableKey: 0,listLoading: false,
  654. //返回的 pageNum 第几页 pageSize 每页多少条 total 总条数
  655. pageNum:'',pageSize:'',total: 0,
  656. list: [
  657. ]
  658. },
  659. pageNum:'',pageSize:'',total: 0,
  660. getAddContListParam: {
  661. name: "getOutsourcingList",
  662. page: 1,offset: 1,pagecount: 20,returntype: "Map",
  663. parammaps: {"bigId": ""}
  664. },
  665. pickerOptions: {
  666. disabledDate(time) {
  667. return time.getTime() > Date.now()// 当天之前的时间可选
  668. }
  669. },
  670. dialogFormVisible_CollectionSparePartsSee: false,
  671. beforedialog:'',
  672. listCreateCollectionSpareParts: [],
  673. isCreatePartDelete: false,
  674. isPartCode: true,
  675. getCollarUseSeeParm: {
  676. name: 'getpartapplyListBybig',
  677. parammaps: {}
  678. },
  679. orderPart: {},
  680. getOutCodetParm: {
  681. name: 'getBigoutsourcingCode',
  682. returntype: 'Map',
  683. parammaps: {
  684. pastureId: Cookies.get('pastureid'),
  685. outsourcingCode:"",
  686. }
  687. },
  688. useForms: [],
  689. getParmCreateAdd: {
  690. name: 'getPartApplyByBig',
  691. returntype: 'Map',
  692. parammaps: {}
  693. },
  694. rules: {
  695. equipmentName: [{ required: true, message: '必填', trigger: 'blur' }],
  696. // lcdate: [{ required: true, message: '必填', trigger: 'blur' }],
  697. // hcdate: [{ required: true, message: '必填', trigger: 'blur' }],
  698. },
  699. getPramPartApplyListBybig: {
  700. name:"getpartapplyListBybig",
  701. returntype:"Map",
  702. parammaps:{"id":""}
  703. },
  704. getPramAcceptanceList: {
  705. name:"getAcceptanceList",
  706. returntype:"Map",
  707. parammaps:{"bigId ":""}
  708. },
  709. getCollarUseListParm: {
  710. name: 'getPartsapplybyMt',
  711. page: 1,
  712. offset: 1,
  713. returntype: 'Map',
  714. parammaps: {
  715. "RUCode":"",
  716. }
  717. },
  718. collectionSparePartsSeeTemp: {
  719. applyCode:"",departmentName:"",applyDate:"",
  720. isStock: 0,
  721. applyDate:"",
  722. },
  723. listCollectionSpareParts: [],
  724. tableKey: 0,
  725. listLoading: true,
  726. total: 0,
  727. list: [],
  728. dialogStatus: '',
  729. dialogFormVisible: false,
  730. dialogFormVisibleSee: false,
  731. listLoadingSee: true,
  732. listSee: [],
  733. totalSee: 0,
  734. seeTemp: {},
  735. getdataListSee: {
  736. name: 'getpartpurchaseBybig',
  737. returntype: 'Map',
  738. parammaps: {}
  739. },
  740. createTemp: {
  741. pastureId: this.$store.state.user.pastureid,
  742. departmentId: this.$store.state.user.departmentid,
  743. employeId: this.$store.state.user.employeid,
  744. date: parseTime(new Date(), '{y}-{m}-{d}'),
  745. providerId: '',
  746. contract:1,
  747. acceptanceCode:"",
  748. outsourcingCode:"",
  749. applyType:0,
  750. applicant: '',
  751. departmentName: '',
  752. contract:1,
  753. },
  754. getParmCreateNumber: {
  755. name: 'autoCreatCode',
  756. page: 0, offset: 0, pagecount: 0, returntype: 'Map',
  757. parammaps: {
  758. pastureId: Cookies.get('pastureid'),
  759. codeType: 'WY'
  760. }
  761. },
  762. getParmCreateNumber2: {
  763. name: 'autoCreatCode',
  764. page: 0, offset: 0, pagecount: 0, returntype: 'Map',
  765. parammaps: {
  766. pastureId: Cookies.get('pastureid'),
  767. codeType: 'LY'
  768. }
  769. },
  770. requestSparePart: {
  771. name: 'getPartsListLY', page: 1, offset: 1, pagecount: 20, returntype: 'Map',
  772. parammaps: { pastureId: Cookies.get('pastureid') }
  773. },
  774. EqNameList: [],
  775. requestEqName: {
  776. name: 'geteqbyNameCode', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
  777. parammaps: { pastureId: Cookies.get('pastureid') }
  778. },
  779. EqCodeList: [],
  780. listAdd:[],
  781. listAdd2:[],
  782. isData:false,
  783. listAddCont:[
  784. // {providerName:"",providerId: "0",eqId: "0",contractId: "0",}
  785. ],
  786. activeList: [],
  787. active: 1,
  788. dialogFormVisible_Examine: false,
  789. examineTemp: {
  790. "status": 1,
  791. "empid": "",
  792. "flowCompeleted":"",
  793. "workflowNote": "",
  794. "id": ""
  795. },
  796. statueReason: false,
  797. rowStyle: { maxHeight: 50 + 'px', height: 35 + 'px' },
  798. cellStyle: { padding: 0 + 'px' },
  799. textMap: {
  800. update: '编辑',
  801. create: '新增',
  802. see: '查看',
  803. examine: '审核1',
  804. examine22: '审核2',
  805. examine2: '审核3',
  806. examine33: '审核4',
  807. examine3: '审核5',
  808. collectionSparePartsSee: '查看领用',
  809. collectionSparePartsSee1:'查看领用',
  810. collectionSparePartsCreate: '添加领用',
  811. },
  812. istab2Add:[],
  813. istab2Edit:[],
  814. istab2Del:[],
  815. istab2Shenhe1:[],
  816. istab2Shenhe2:[],
  817. istab2Shenhe3:[],
  818. }
  819. },
  820. created() {
  821. this.get_select_list()
  822. this.get_table_data1()
  823. },
  824. methods: {
  825. //获取按钮权限
  826. get_auto_buttons() {
  827. const istab2Add = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:add')
  828. this.istab2Add = istab2Add
  829. const istab2Edit = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:edit')
  830. this.istab2Edit = istab2Edit
  831. const istab2Del = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:del')
  832. this.istab2Del = istab2Del
  833. const istab2Shenhe1 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:shenhe1')
  834. this.istab2Shenhe1 = istab2Shenhe1
  835. const istab2Shenhe2 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:shenhe2')
  836. this.istab2Shenhe2 = istab2Shenhe2
  837. const istab2Shenhe3 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:shenhe3')
  838. this.istab2Shenhe3 = istab2Shenhe3
  839. },
  840. get_select_list() {
  841. GetDataByNames(this.send_select_list).then(response => {
  842. this.pastureNameList = response.data.findAllPasture.list
  843. console.log("牧场下拉框", this.pastureNameList)
  844. this.employeNameList = response.data.findAllEmploye.list
  845. console.log("申请人下拉框", this.employeNameList)
  846. this.get_depart_list1()
  847. })
  848. },
  849. change_pasture1(item) {
  850. this.getDepartParam1.parammaps.pastureId = this.pastureNameList.find(obj => obj.name == item).id
  851. this.tableObj1.getdataListParm.parammaps.departmentId = ''
  852. this.get_depart_list1()
  853. },
  854. //部门List
  855. get_depart_list1() {
  856. GetDataByName(this.getDepartParam1).then(response => {
  857. this.departNameList1 = response.data.list
  858. })
  859. },
  860. change_pasture2(item) {
  861. this.getDepartParam2.parammaps.pastureId = item
  862. this.get_depart_list2()
  863. },
  864. get_depart_list2() {
  865. GetDataByName(this.getDepartParam2).then(response => {
  866. this.departNameList2 = response.data.list
  867. })
  868. },
  869. change_depart2(item) {
  870. this.createTemp.departmentName = this.departNameList2.find(obj => obj.id == item).name
  871. },
  872. get_table_data1() {
  873. this.tableObj1.listLoading = false
  874. if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
  875. this.tableObj1.getdataListParm.parammaps.startdate = this.$refs['inputDatetime'].value[0]
  876. this.tableObj1.getdataListParm.parammaps.enddate = this.$refs['inputDatetime'].value[1]
  877. } else {
  878. this.tableObj1.getdataListParm.parammaps.inputDatetime = ''
  879. this.tableObj1.getdataListParm.parammaps.startdate = ''
  880. this.tableObj1.getdataListParm.parammaps.enddate = ''
  881. }
  882. GetDataByName(this.tableObj1.getdataListParm).then(response => {
  883. if (response.data.list !== null) {
  884. this.tableObj1.list = response.data.list
  885. this.tableObj1.pageNum = response.data.pageNum
  886. this.tableObj1.pageSize = response.data.pageSize
  887. this.tableObj1.total = response.data.total
  888. } else {
  889. this.tableObj1.list = [ ]
  890. }
  891. setTimeout(() => {
  892. this.tableObj1.listLoading = false
  893. }, 100)
  894. })
  895. },
  896. form_search() {
  897. console.log('查询')
  898. this.get_table_data1()
  899. },
  900. change_applyType(val) {
  901. console.log(val)
  902. if(val ==1){
  903. this.createTemp.applyType = 1
  904. } else {
  905. this.createTemp.applyType = 0
  906. }
  907. },
  908. form_add() {
  909. this.reset_create()
  910. this.getDepartParam2.parammaps.pastureId = this.createTemp.pastureId
  911. this.get_depart_list2()
  912. this.dialogStatus = 'create'
  913. this.dialogFormVisible = true
  914. this.listLoading = false
  915. this.$nextTick(() => {
  916. this.$refs['createTemp'].clearValidate()
  917. })
  918. //新增生成单号
  919. this.getCreateNumber()
  920. },
  921. statue: function(cellValue) {
  922. // console.log(cellValue.isZeroStock)
  923. if (cellValue.statue == 0) {
  924. return '未领用'
  925. } else if (cellValue.statue == 1) {
  926. return '已领用'
  927. }
  928. },
  929. reset_create() {
  930. this.createTemp.pastureId = parseInt(Cookies.get('pastureid'))
  931. this.createTemp.departmentId = parseInt(Cookies.get('departmentid'))
  932. this.createTemp.departmentName = Cookies.get('departmentname')
  933. this.createTemp.employeId = parseInt(Cookies.get('employeid'))
  934. this.createTemp.date = parseTime(new Date(), '{y}-{m}-{d}')
  935. this.createTemp.outsourcingCode = ''
  936. this.createTemp.applicant = parseInt(Cookies.get('employeid'))
  937. this.createTemp.providerId = ''
  938. this.createTemp.contract = 1
  939. this.createTemp.description = ''
  940. if(parseInt(Cookies.get('pastureid')) == 18){
  941. this.createTemp.departmentId = ""
  942. }
  943. this.createTemp.outsourcingCode = ''
  944. console.log( this.createTemp.departmentName )
  945. this.listAddCont = [
  946. // {providerName:"",providerId: "0",eqId: "0",contractId: "0",amount:"",contractCode:"",date:"",eqCode:"",eqName:"",remark:"",typea:"",}
  947. ]
  948. this.listAdd = []
  949. this.listAdd2 = []
  950. this.listCreateCollectionSpareParts = []
  951. this.listCollectionSpareParts = []
  952. },
  953. handleCollarUseSee(row, isStock) {
  954. console.log(row)
  955. let beforedialog = ''
  956. this.beforedialog = this.dialogStatus
  957. this.collectionSparePartsSeeTemp = Object.assign({}, row)
  958. this.dialogStatus = 'collectionSparePartsSee1'
  959. this.collectionSparePartsSeeTemp.applyDate = row.createDate
  960. this.dialogFormVisible_CollectionSparePartsSee = true
  961. this.isCreatePartDelete = false
  962. this.isPartCode = false
  963. this.getCollarUseSeeList()
  964. },
  965. getCollarUseSeeList() {
  966. this.getCollarUseSeeParm.parammaps.id = this.collectionSparePartsSeeTemp.id
  967. GetDataByName(this.getCollarUseSeeParm).then(response => {
  968. this.listCreateCollectionSpareParts = response.data.list
  969. })
  970. },
  971. form_add_list2() {
  972. var idDel = "id" + Math.round(Math.random()*100) + Math.round(Math.random()*100)
  973. this.listAdd2.unshift({partCode:"",providerId: "0",eqId: "0",contractId: "0",idDel:idDel,partId: "",partCode: "",partName: "",brandId: "",brand: "",providerId: "",providerName: "",price: "",sumPrice: "",remark: "",amount: ""})
  974. },
  975. getCreateNumber() {
  976. GetDataByName(this.getParmCreateNumber).then(response => {
  977. this.$nextTick(() => {
  978. console.log('新增委外维修单单号', response.data.list[0].orderCode)
  979. this.createTemp.acceptanceCode = response.data.list[0].orderCode
  980. this.$forceUpdate()
  981. })
  982. })
  983. },
  984. getCreateLYNumber() {
  985. GetDataByName(this.getParmCreateNumber2).then(response => {
  986. this.$nextTick(() => {
  987. console.log('新增领用单号', response.data.list[0].orderCode)
  988. this.collectionSparePartsSeeTemp.applyCode = response.data.list[0].orderCode
  989. this.$forceUpdate()
  990. })
  991. })
  992. },
  993. add_dialog_save() {
  994. this.isokDisable = true
  995. setTimeout(() => {
  996. this.isokDisable = false
  997. }, 1000)
  998. this.$refs['createTemp'].validate(valid => {
  999. if (valid) {
  1000. console.log(this.listAddCont)
  1001. if (this.createTemp.acceptanceCode == '' || this.createTemp.acceptanceCode == null || this.createTemp.acceptanceCode == undefined) {
  1002. GetDataByName(this.getParmCreateNumber).then(response => {
  1003. this.$nextTick(() => {
  1004. console.log('新增单号', response.data.list[0].orderCode)
  1005. this.createTemp.acceptanceCode = response.data.list[0].orderCode
  1006. this.$forceUpdate()
  1007. this.add_dialog_saveSave()
  1008. })
  1009. })
  1010. } else {
  1011. this.add_dialog_saveSave()
  1012. }
  1013. }
  1014. })
  1015. },
  1016. add_dialog_saveSave() {
  1017. for (var j = 0; j < this.listAddCont.length; j++) {
  1018. console.log(this.listAddCont[j].amount)
  1019. if (this.listAddCont[j].amount == null || this.listAddCont[j].amount === '') {
  1020. this.$message({ type: 'warning', message: '请检查金额是否未填写', duration: 2000 })
  1021. return false
  1022. } else {
  1023. // var rulesAmount = /^[1-9]\d*$/
  1024. // if (!rulesAmount.test(this.listAddCont[j].amount)) {
  1025. // this.$message({ type: 'error', message: '申购数量请输入正整数', duration: 2000 })
  1026. // return false
  1027. // }
  1028. }
  1029. }
  1030. //牧场
  1031. if(this.createTemp.applyType == 0){
  1032. let mySumPrice = 0
  1033. for (let i = 0; i < this.listAdd.length; i++) {
  1034. mySumPrice += parseFloat(this.listAdd[i].price) * parseFloat(this.listAdd[i].amount)
  1035. }
  1036. if (mySumPrice > 500) {
  1037. this.createTemp.SHStatus = 2
  1038. } else {
  1039. this.createTemp.SHStatus = 9
  1040. }
  1041. var send_data = {
  1042. "common": { "returnmap": "0" },
  1043. "data": [
  1044. {
  1045. "name": "insertBigacceptance",
  1046. "type": "e",
  1047. "parammaps": this.createTemp
  1048. }
  1049. ]
  1050. }
  1051. }
  1052. //供应商
  1053. if(this.createTemp.applyType == 1){
  1054. if(this.listAdd2.length == 0){
  1055. this.$notify({
  1056. title: '失败', message: "备件必选!",
  1057. type: 'warning',
  1058. duration: 2000
  1059. })
  1060. return false
  1061. }
  1062. this.listAdd2.map((item, index) => {
  1063. return item.partId = "0"
  1064. })
  1065. this.listAdd2.map((item, index) => {
  1066. return item.brandId = "0"
  1067. })
  1068. this.listAdd2.map((item, index) => {
  1069. return item.providerId = "0"
  1070. })
  1071. var send_data = {
  1072. "common": {
  1073. "returnmap": "0"
  1074. },
  1075. "data": [
  1076. {
  1077. "name": "insertBigacceptance",
  1078. "type": "e",
  1079. "parammaps": this.createTemp
  1080. },
  1081. {
  1082. "name": "insertSpotList",
  1083. "resultmaps": {
  1084. "list": this.listAdd2
  1085. },
  1086. "children": [
  1087. {
  1088. "name": "insertAcceptance",
  1089. "type": "e",
  1090. "parammaps": {
  1091. "bigId":"@insertBigacceptance.LastInsertId",
  1092. "partId":"@insertSpotList.partId",
  1093. "partCode":"@insertSpotList.partCode",
  1094. "partName":"@insertSpotList.partName",
  1095. "brandId":"@insertSpotList.brandId",
  1096. "brand":"@insertSpotList.brand",
  1097. "providerId":"@insertSpotList.providerId",
  1098. "providerName":"@insertSpotList.providerName",
  1099. "unit":"@insertSpotList.unit",
  1100. "price":"@insertSpotList.price",
  1101. "remark":"@insertSpotList.remark",
  1102.    "specification": "@insertSpotList.specification",
  1103. "amount":"@insertSpotList.amount"
  1104. }
  1105. }
  1106. ]
  1107. }
  1108. ]
  1109. }
  1110. }
  1111. ExecDataByConfig(send_data).then(response => {
  1112. console.log('新增保存发送参数', send_data)
  1113. if (response.msg === 'fail') {
  1114. this.$notify({
  1115. title: '保存失败',
  1116. message: response.data,
  1117. type: 'warning',
  1118. duration: 2000
  1119. })
  1120. } else {
  1121. this.dialogFormVisible = false
  1122. this.get_table_data1()
  1123. this.$notify({
  1124. title: '',
  1125. message: '保存成功',
  1126. type: 'success',
  1127. duration: 2000
  1128. })
  1129. }
  1130. })
  1131. },
  1132. getOutNumber(queryString, cb) {
  1133. console.log('委外申请单号模糊查询输入值', queryString)
  1134. this.getOutCodetParm.parammaps['outsourcingCode'] = queryString
  1135. GetDataByName(this.getOutCodetParm).then(response => {
  1136. console.log('委外申请单号模糊查询搜索data', response.data.list)
  1137. // this.useForms = response.data.list
  1138. cb(response.data.list)
  1139. })
  1140. },
  1141. changeOutNumber(item) {
  1142. console.log('委外申请单号模糊查询选中值', item)
  1143. this.createTemp.outsourcingCode = item.outsourcingCode
  1144. this.$set(this.createTemp, "outsourcingCode", item.outsourcingCode)
  1145. this.getAddContListParam.parammaps.bigId = item.id
  1146. this.getAddContList()
  1147. // this.createTemp.bid = item.id
  1148. // this.createTemp.applicatId = item.empId
  1149. // this.orderPart.applyCode = item.applyCode
  1150. // this.TotalAmount = 0
  1151. // this.get_table_dataAdd()
  1152. },
  1153. querySearchEqName(queryString, cb) {
  1154. console.log('备件名称/设备内部编号模糊查询输入值', queryString)
  1155. this.requestEqName.parammaps['eqName'] = queryString
  1156. GetDataByName(this.requestEqName).then(response => {
  1157. console.log('备件名称模糊查询搜索data', response.data.list)
  1158. this.EqNameList = response.data.list
  1159. cb(this.EqNameList)
  1160. })
  1161. },
  1162. handleSelectEqName(item, row) {
  1163. console.log('备件名称/设备内部编号模糊查询选中值', item.eqName)
  1164. console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
  1165. this.$set(row, 'eqCode', item.eqCode)
  1166. this.$forceUpdate()
  1167. },
  1168. querySearchCode(queryString, cb) {
  1169. console.log('备件名称/设备内部编号模糊查询输入值', queryString)
  1170. this.requestEqName.parammaps['eqCode'] = queryString
  1171. GetDataByName(this.requestEqName).then(response => {
  1172. console.log('备件名称模糊查询搜索data', response.data.list)
  1173. this.EqNameList = response.data.list
  1174. cb(this.EqNameList)
  1175. })
  1176. },
  1177. handleSelectEqCode(item, row) {
  1178. console.log('备件名称/设备内部编号模糊查询选中值', item)
  1179. console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
  1180. this.$set(row, 'eqName', item.eqName)
  1181. this.$forceUpdate()
  1182. },
  1183. blurSelectEqName(item, row) {
  1184. this.$set(row, 'eqName', '')
  1185. this.$set(row, 'eqCode', '')
  1186. },
  1187. blurSelectEqCode(item, row) {
  1188. this.$set(row, 'eqName', '')
  1189. this.$set(row, 'eqCode', '')
  1190. },
  1191. sparePartSearch(queryString, cb) {
  1192. console.log('备件模糊查询输入值', queryString)
  1193. this.requestSparePart.parammaps.pastureId = this.createTemp.pastureId
  1194. this.requestSparePart.parammaps['partCode'] = queryString
  1195. GetDataByName(this.requestSparePart).then(response => {
  1196. console.log('备件模糊查询搜索data', response.data.list)
  1197. if (response.data.list == null) {
  1198. cb([])
  1199. } else {
  1200. cb(response.data.list)
  1201. }
  1202. })
  1203. },
  1204. // handleSelectSparePart(item) {
  1205. // console.log('备件模糊查询选中值', item)
  1206. // if (this.listAdd.length > 0) {
  1207. // // eslint-disable-next-line no-redeclare
  1208. // if (this.listAdd.find(obj => obj.id === item.id)) {
  1209. // this.$message({
  1210. // type: 'warning',
  1211. // message: '此备件已存在,请重新选择备件'
  1212. // })
  1213. // } else {
  1214. // if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  1215. // this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  1216. // this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  1217. // } else {
  1218. // item.srcpath = ''
  1219. // item.picpath = ''
  1220. // }
  1221. // this.listAdd.push(item)
  1222. // }
  1223. // } else {
  1224. // if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  1225. // this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  1226. // this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  1227. // } else {
  1228. // item.srcpath = ''
  1229. // item.picpath = ''
  1230. // }
  1231. // this.listAdd.push(item)
  1232. // }
  1233. // // this.getEqNameList()
  1234. // },
  1235. handleSelectSparePart(item) {
  1236. console.log('备件模糊查询选中值', item)
  1237. if (this.listCreateCollectionSpareParts.length > 0) {
  1238. // eslint-disable-next-line no-redeclare
  1239. if (this.listCreateCollectionSpareParts.find(obj => obj.partId === item.partId)) {
  1240. this.$message({ type: 'warning', message: '此备件已存在,请重新选择备件' })
  1241. } else {
  1242. item.date = this.collectionSparePartsSeeTemp.applyDate
  1243. this.listCreateCollectionSpareParts.unshift(item)
  1244. }
  1245. } else {
  1246. item.date = this.collectionSparePartsSeeTemp.applyDate
  1247. this.listCreateCollectionSpareParts.unshift(item)
  1248. }
  1249. },
  1250. createPartDelete(row) {
  1251. console.log(this.listAdd)
  1252. MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
  1253. confirmButtonText: '确认',
  1254. cancelButtonText: '取消',
  1255. type: 'warning'
  1256. }).then(() => {
  1257. // console.log(this.list2)
  1258. for (var i = 0; i < this.listCreateCollectionSpareParts.length; i++) {
  1259. console.log(this.listCreateCollectionSpareParts[i])
  1260. if (this.listCreateCollectionSpareParts[i].id === row.id) {
  1261. var listCreateCollectionSparePartsIndex = this.listCreateCollectionSpareParts.indexOf(this.listCreateCollectionSpareParts[i])
  1262. }
  1263. if (listCreateCollectionSparePartsIndex > -1) {
  1264. this.listCreateCollectionSpareParts.splice(listCreateCollectionSparePartsIndex, 1)
  1265. return
  1266. }
  1267. }
  1268. })
  1269. },
  1270. closeCollectionSparePartsSee(){
  1271. this.dialogFormVisible_CollectionSparePartsSee = false
  1272. this.dialogStatus = this.beforedialog
  1273. },
  1274. // 添加领用保存
  1275. createCollectionSparePartsData() {
  1276. this.isokDisable = true
  1277. if (this.listCreateCollectionSpareParts.length !== 0) {
  1278. for (var i = 0; i < this.listCreateCollectionSpareParts.length; i++) {
  1279. console.log(this.listCreateCollectionSpareParts[i].amount)
  1280. if (this.listCreateCollectionSpareParts[i].amount !== undefined && this.listCreateCollectionSpareParts[i].amount !== '') {
  1281. var rulesAmount = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
  1282. if (!rulesAmount.test(this.listCreateCollectionSpareParts[i].amount)) {
  1283. this.$message({
  1284. type: 'error',
  1285. message: '领用数量请输入正数,最多保留两位小数',
  1286. duration: 2000
  1287. })
  1288. return false
  1289. } else {
  1290. var listCreateCollectionSpareParts1 = [] // >库存
  1291. var listCreateCollectionSpareParts2 = [] // <=库存
  1292. var amountList = []
  1293. var amount2List = []
  1294. let mySumPrice = 0
  1295. for (let i = 0; i < listCreateCollectionSpareParts2.length; i++) {
  1296. mySumPrice += parseFloat(listCreateCollectionSpareParts2[i].price) * parseFloat(listCreateCollectionSpareParts2[i].amount)
  1297. }
  1298. if (mySumPrice > 500) {
  1299. this.collectionSparePartsSeeTemp.SHStatus = 2
  1300. } else {
  1301. this.collectionSparePartsSeeTemp.SHStatus = 9
  1302. }
  1303. var send_data ={
  1304. "common": { "returnmap": "0" },
  1305. "data": [
  1306. {
  1307. "name": "insertBigpartapply",
  1308. "type": "e",
  1309. "parammaps": {
  1310. "pastureId": this.collectionSparePartsSeeTemp.pastureId,
  1311. "applyCode": this.collectionSparePartsSeeTemp.applyCode,
  1312. "applyType": 1,
  1313. "departmentId": this.collectionSparePartsSeeTemp.departmentId,
  1314. "empId": this.collectionSparePartsSeeTemp.empId,
  1315. "applyDate": this.collectionSparePartsSeeTemp.applyDate,
  1316. "RUCode": this.createTemp.acceptanceCode,
  1317. "SHStatus": 9
  1318. }
  1319. },
  1320. {
  1321. "name": "insertSpotList",
  1322. "resultmaps": {
  1323. "list":this.listCreateCollectionSpareParts
  1324. },
  1325. "children": [
  1326. {
  1327. "name": "insertpartapply",
  1328. "type": "e",
  1329. "parammaps": {
  1330. "bigId": "@insertBigpartapply.LastInsertId",
  1331. "pastureId": "@insertSpotList.pastureId",
  1332. "partId": "@insertSpotList.partId",
  1333. "partCode": "@insertSpotList.partCode",
  1334. "partName": "@insertSpotList.partName",
  1335. "specification": "@insertSpotList.specification",
  1336. "brandId": "@insertSpotList.brandId",
  1337. "price": "@insertSpotList.price",
  1338. "amount": "@insertSpotList.amount",
  1339. "eqName": "@insertSpotList.eqName",
  1340.                          "eqCode": "@insertSpotList.eqCode",
  1341. "providerId": "@insertSpotList.providerId",
  1342. "note": "@insertSpotList.note",
  1343. "reportery": "@insertSpotList.reportery",
  1344. "contractId": "@insertSpotList.contractId",
  1345. "locationId": "@insertSpotList.locationId"
  1346. }
  1347. }
  1348. ]
  1349. }
  1350. ]
  1351. }
  1352. ExecDataByConfig(send_data).then(response => {
  1353. console.log('添加领用保存发送参数',send_data)
  1354. if (response.msg === 'fail') {
  1355. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1356. } else {
  1357. this.dialogFormVisible_CollectionSparePartsSee = false
  1358. this.getCollectionSpareParts()
  1359. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  1360. }
  1361. })
  1362. setTimeout(() => {
  1363.         this.isokDisable = false
  1364.       }, 2000)
  1365. return true
  1366. }
  1367. } else {
  1368. this.$message({ type: 'error', message: '请检查领用数量是否未填写', duration: 2000 })
  1369. return false
  1370. }
  1371. }
  1372. } else {
  1373. this.$notify({ title: '', type: 'warning', message: '请选择备件', duration: 2000 })
  1374. return false
  1375. }
  1376.  setTimeout(() => {
  1377.         this.isokDisable = false
  1378.       }, 2000)
  1379. },
  1380. //看领用单
  1381. getCollectionSpareParts() {
  1382. this.getCollarUseListParm.parammaps.RUCode = this.createTemp.acceptanceCode
  1383. GetDataByName(this.getCollarUseListParm).then(response => {
  1384. console.log('领用table数据', response.data.list)
  1385. this.listCollectionSpareParts = response.data.list
  1386. })
  1387. },
  1388. // 新增删除
  1389. partDelete(row) {
  1390. console.log(this.listAdd)
  1391. MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
  1392. confirmButtonText: '确认',
  1393. cancelButtonText: '取消',
  1394. type: 'warning'
  1395. }).then(() => {
  1396. for (var i = 0; i < this.listAdd.length; i++) {
  1397. console.log(this.listAdd[i])
  1398. if (this.listAdd[i].id === row.id) {
  1399. var listAddIndex = this.listAdd.indexOf(this.listAdd[i])
  1400. }
  1401. if (listAddIndex > -1) {
  1402. this.listAdd.splice(listAddIndex, 1)
  1403. return
  1404. }
  1405. }
  1406. })
  1407. },
  1408. partDelete2(row) {
  1409. console.log(this.listAdd2)
  1410. MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
  1411. confirmButtonText: '确认',
  1412. cancelButtonText: '取消',
  1413. type: 'warning'
  1414. }).then(() => {
  1415. for (var i = 0; i < this.listAdd2.length; i++) {
  1416. console.log(this.listAdd2[i])
  1417. if (this.listAdd2[i].idDel === row.idDel) {
  1418. var listAddIndex = this.listAdd2.indexOf(this.listAdd2[i])
  1419. }
  1420. if (listAddIndex > -1) {
  1421. this.listAdd2.splice(listAddIndex, 1)
  1422. return
  1423. }
  1424. }
  1425. })
  1426. },
  1427. handleCollectionSparePartsCreate() {
  1428. if(this.createTemp.departmentId == "" || this.createTemp.departmentId == undefined){
  1429. this.$message({ type: 'warning', message: '请选择责任部门', duration: 2000 })
  1430. return false
  1431. }
  1432. if(this.createTemp.applicant == "" || this.createTemp.applicant == undefined){
  1433. this.$message({ type: 'warning', message: '请选择录入人', duration: 2000 })
  1434. return false
  1435. }
  1436. console.log( "createTemp)============",this.createTemp)
  1437. this.collectionSparePartsSeeTemp = Object.assign({}, this.createTemp)
  1438. this.collectionSparePartsSeeTemp.empId = this.collectionSparePartsSeeTemp.applicant
  1439. this.collectionSparePartsSeeTemp.applyDate = parseTime(new Date(), '{y}-{m}-{d}')
  1440. this.dialogStatus = 'collectionSparePartsSee'
  1441. this.dialogFormVisible_CollectionSparePartsSee = true
  1442. this.isCreatePartDelete = true
  1443. this.listCreateCollectionSpareParts = []
  1444. this.isPartCode = true
  1445. this.getCreateLYNumber()
  1446. console.log( "console.log( this.collectionSparePartsSeeTemp)============",this.collectionSparePartsSeeTemp)
  1447. },
  1448. // getCreateNumber() {
  1449. // // GetDataByName(this.getParmCreateNumber).then(response => {
  1450. // // this.$nextTick(() => {
  1451. // // console.log('新增领用单号', response.data.list[0].orderCode)
  1452. // // this.collectionSparePartsSeeTemp.applyCode = response.data.list[0].orderCode
  1453. // // this.$forceUpdate()
  1454. // // })
  1455. // // })
  1456. // },
  1457. form_see(row){
  1458. console.log('查看======》',row)
  1459. this.reset_create()
  1460. this.getDepartParam2.parammaps.pastureId = row.pastureId
  1461. this.get_depart_list2()
  1462. if (row.providerId == undefined) {
  1463. row.providerId = ''
  1464. row.providerName = ''
  1465. }
  1466. this.createTemp = Object.assign({}, row) // copy obj
  1467. this.dialogStatus = 'see'
  1468. this.dialogFormVisible = true
  1469. this.$nextTick(() => {
  1470. this.$refs['createTemp'].clearValidate()
  1471. })
  1472. //委外申请单号获取合同
  1473. this.getAddContListParam.parammaps.bigId = row.outsourcingId
  1474. this.getAddContList()
  1475. //牧场
  1476. if(row.applyType == 0){
  1477. this.getPramPartApplyListBybig.parammaps.id = row.partapplyId
  1478. this.getCollectionSpareParts()
  1479. this.isCreatePartDelete = false
  1480. }
  1481. //供应商
  1482. if(row.applyType == 1){
  1483. this.getPramAcceptanceList.parammaps.bigId = row.id
  1484. this.getListAdd2()
  1485. }
  1486. if (row.flowCompeleted == 1) {
  1487. this.activeList = [{ title: '委外验收', date: row.createTime, name: row.empname }, { title: '供应处长' }, { title: '部门负责人' },{ title: '场长' }]
  1488. this.active = 1
  1489. } else if (row.flowCompeleted == 2) {
  1490. this.activeList = [{ title: '委外验收', date: row.createTime, name: row.applicantName }, { title: '供应处长', date: row.equipmentdate, name: row.equipmentName },{ title: '部门负责人' },{ title: '场长' }]
  1491. this.active = 2
  1492. } else if (row.flowCompeleted === 3) {
  1493. this.activeList = [{ title: '委外验收', date: row.createTime, name: row.applicantName }, { title: '供应处长', date: row.equipmentdate, name: row.equipmentName, status: 'error', reason: row.workflowNote },{ title: '部门负责人' },{ title: '场长' }]
  1494. this.active = 2
  1495. } else if (row.flowCompeleted === 4) {
  1496. this.activeList = [{ title: '委外验收', date: row.createTime, name: row.applicantName }, { title: '供应处长', date: row.equipmentdate, name: row.equipmentName },{ title: '部门负责人', date: row.departmentdate, name: row.departmentUser },{ title: '场长' }]
  1497. this.active = 3
  1498. } else if (row.flowCompeleted === 5) {
  1499. 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: '场长' }]
  1500. this.active = 3
  1501. } else if (row.flowCompeleted === 6) {
  1502. 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 }]
  1503. this.active = 4
  1504. } else if (row.flowCompeleted === 7) {
  1505. 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 }]
  1506. this.active = 4
  1507. }
  1508. },
  1509. getAddContList() {
  1510. GetDataByName(this.getAddContListParam).then(response => {
  1511. this.listAddCont = response.data.list
  1512. this.listLoading = false
  1513. })
  1514. },
  1515. form_edit(row) {
  1516. this.reset_create()
  1517. console.log('编辑',row)
  1518. this.getDepartParam2.parammaps.pastureId = row.pastureId
  1519. this.get_depart_list2()
  1520. if (row.providerId == undefined) {
  1521. row.providerId = ''
  1522. row.providerName = ''
  1523. }
  1524. this.createTemp = Object.assign({}, row) // copy obj
  1525. this.dialogStatus = 'update'
  1526. this.dialogFormVisible = true
  1527. this.$nextTick(() => {
  1528. this.$refs['createTemp'].clearValidate()
  1529. })
  1530. //委外申请单号获取合同
  1531. this.getAddContListParam.parammaps.bigId = row.outsourcingId
  1532. this.getAddContList()
  1533. this.isData = false
  1534. //牧场
  1535. if(row.applyType == 0){
  1536. this.getCollectionSpareParts()
  1537. }
  1538. //供应商
  1539. if(row.applyType == 1){
  1540. this.getPramAcceptanceList.parammaps.bigId = row.id
  1541. this.getListAdd2()
  1542. }
  1543. },
  1544. getListAdd() {
  1545. GetDataByName(this.getPramPartApplyListBybig).then(response => {
  1546. this.listAdd = response.data.list
  1547. this.listLoading = false
  1548. })
  1549. },
  1550. getListAdd2() {
  1551. GetDataByName(this.getPramAcceptanceList).then(response => {
  1552. this.listAdd2 = response.data.list
  1553. if(this.listAdd2.length>0){
  1554. this.isData = true
  1555. }else{
  1556. this.isData = false
  1557. }
  1558. this.listLoading = false
  1559. })
  1560. },
  1561. edit_dialog_save() {
  1562. this.isokDisable = true
  1563. setTimeout(() => {
  1564. this.isokDisable = false
  1565. }, 1000)
  1566. this.$refs['createTemp'].validate(valid => {
  1567. if (valid) {
  1568. this.edit_dialog_saveSave()
  1569. }
  1570. })
  1571. },
  1572. edit_dialog_saveSave() {
  1573. //牧场
  1574. if(this.createTemp.applyType == 0){
  1575. for(let i=0;i<this.listAddCont.length;i++){
  1576. // if(this.listAddCont[i].sealNumber == ''){
  1577. // this.$message({ type: 'warning', message: '请检查铅封号是否未填写', duration: 2000 })
  1578. // return false
  1579. // }
  1580. // if(this.listAddCont[i].warrantydate == ''){
  1581. // this.$message({ type: 'warning', message: '请检查质保日期是否未填写', duration: 2000 })
  1582. // return false
  1583. // }
  1584. }
  1585. var send_data = {
  1586. "common": { "returnmap": "0" },
  1587. "data": [
  1588. {
  1589. "name": "editBigacceptanceDate",
  1590. "type": "e",
  1591. "parammaps": {
  1592. "id":this.createTemp.id,
  1593. "date":this.createTemp.date,
  1594. "applyType":this.createTemp.applyType
  1595. }
  1596. },
  1597. {
  1598. "name": "updateBigacceptanceFlowCompeleted", "type": "e",
  1599. "parammaps":{
  1600. id:this.createTemp.id
  1601. }
  1602. },
  1603. {
  1604. "name": "editBigacceptance", "type": "e",
  1605. "parammaps":{
  1606. id:this.createTemp.id,
  1607. lcdate:this.createTemp.lcdate,
  1608. hcdate:this.createTemp.hcdate
  1609. }
  1610. },
  1611. {
  1612. "name": "insertSpotList",
  1613. "resultmaps": { "list": this.listAddCont },
  1614. "children": [
  1615. {
  1616. "name": "editOutsourcingData", "type": "e",
  1617. "parammaps": {
  1618. "id": "@insertSpotList.id",
  1619. "amount": "@insertSpotList.amount",
  1620. "sealNumber": "@insertSpotList.sealNumber",
  1621. "warrantydate": "@insertSpotList.warrantydate"
  1622. }
  1623. }
  1624. ],
  1625. }
  1626. ]
  1627. }
  1628. }
  1629. //供应商
  1630. if(this.createTemp.applyType == 1){
  1631. if(this.listAdd2.length == 0){
  1632. this.$notify({
  1633. title: '失败', message: "备件必选!",
  1634. type: 'warning',
  1635. duration: 2000
  1636. })
  1637. return false
  1638. }
  1639. this.listAdd2.map((item, index) => {
  1640. return item.partId = "0"
  1641. })
  1642. this.listAdd2.map((item, index) => {
  1643. return item.brandId = "0"
  1644. })
  1645. this.listAdd2.map((item, index) => {
  1646. return item.providerId = "0"
  1647. })
  1648. var myname = ''
  1649. // var bigId = ''
  1650. if(this.isData == true){
  1651. myname = 'editAcceptance'
  1652. // bigId = "@insertBigacceptance.LastInsertId"
  1653. // bigId = "@insertSpotList.bigId"
  1654. }else{
  1655. myname = 'insertAcceptance'
  1656. for(let i=0;i<this.listAdd2.length;i++){
  1657. this.$set(this.listAdd2[i],'bigId',this.createTemp.id)
  1658. }
  1659. // bigId = "@insertSpotList.bigId"
  1660. }
  1661. var send_data = {
  1662. "common": { "returnmap": "0" },
  1663. "data": [
  1664. {
  1665. "name": "editBigacceptanceDate",
  1666. "type": "e",
  1667. "parammaps": {
  1668. "id":this.createTemp.id,"date":this.createTemp.date,"applyType":this.createTemp.applyType
  1669. }
  1670. },
  1671. {
  1672. "name": "insertSpotList",
  1673. "type": "e",
  1674. "resultmaps": {
  1675. "list": this.listAdd2
  1676. },
  1677. "children": [
  1678. {
  1679. "name": myname,
  1680. "type": "e",
  1681. "parammaps": {
  1682. "id":"@insertSpotList.id",
  1683. "bigId":"@insertSpotList.bigId",
  1684. "partId":"@insertSpotList.partId",
  1685. "partCode":"@insertSpotList.partCode",
  1686. "partName":"@insertSpotList.partName",
  1687. "brandId":"@insertSpotList.brandId",
  1688. "brand":"@insertSpotList.brand",
  1689. "providerId":"@insertSpotList.providerId",
  1690. "providerName":"@insertSpotList.providerName",
  1691. "unit":"@insertSpotList.unit",
  1692. "price":"@insertSpotList.price",
  1693. "remark":"@insertSpotList.remark",
  1694. "specification":"@insertSpotList.specification",
  1695. "amount":"@insertSpotList.amount"
  1696. }
  1697. }
  1698. ]
  1699. },
  1700. {
  1701. "name": "updateBigacceptanceFlowCompeleted", "type": "e",
  1702. "parammaps":{
  1703. id:this.createTemp.id
  1704. }
  1705. },
  1706. {
  1707. "name": "editBigacceptance", "type": "e",
  1708. "parammaps":{
  1709. id:this.createTemp.id,
  1710. lcdate:this.createTemp.lcdate,
  1711. hcdate:this.createTemp.hcdate
  1712. }
  1713. },
  1714. {
  1715. "name": "insertSpotList",
  1716. "resultmaps": { "list": this.listAddCont },
  1717. "children": [
  1718. {
  1719. "name": "editOutsourcingData", "type": "e",
  1720. "parammaps": {
  1721. "id": "@insertSpotList.id",
  1722. "amount": "@insertSpotList.amount",
  1723. "sealNumber": "@insertSpotList.sealNumber",
  1724. "warrantydate": "@insertSpotList.warrantydate"
  1725. }
  1726. }
  1727. ],
  1728. }
  1729. ]
  1730. }
  1731. }
  1732. ExecDataByConfig(send_data).then(response => {
  1733. console.log('编辑保存发送参数', send_data)
  1734. if (response.msg === 'fail') {
  1735. this.$notify({
  1736. title: '保存失败',
  1737. message: response.data,
  1738. type: 'warning',
  1739. duration: 2000
  1740. })
  1741. } else {
  1742. this.dialogFormVisible = false
  1743. this.get_table_data1()
  1744. this.$notify({
  1745. title: '',
  1746. message: '保存成功',
  1747. type: 'success',
  1748. duration: 2000
  1749. })
  1750. }
  1751. })
  1752. },
  1753. form_delete(row) {
  1754. console.log('点击了删除',row)
  1755. MessageBox.confirm('确认删除此条信息?', {
  1756. confirmButtonText: '确认',
  1757. cancelButtonText: '取消',
  1758. type: 'warning'
  1759. }).then(() => {
  1760. var send_data = {
  1761. "common": { "returnmap": "0" },
  1762. "data": [
  1763. {
  1764. "name": "deleteBigacceptance", "type": "e",
  1765. "parammaps": { "id":row.id }
  1766. }
  1767. ]
  1768. }
  1769. ExecDataByConfig(send_data).then(response => {
  1770. this.get_table_data1()
  1771. this.$notify({
  1772. title: '成功',
  1773. message: '删除成功',
  1774. type: 'success',
  1775. duration: 2000
  1776. })
  1777. })
  1778. }).catch(() => {
  1779. this.$message({
  1780. type: 'info',
  1781. message: '已取消删除'
  1782. })
  1783. })
  1784. },
  1785. change_statue(val) {
  1786. if (val == 2) {
  1787. this.statueReason = true
  1788. } else {
  1789. this.statueReason = false
  1790. }
  1791. },
  1792. form_examine(row) {
  1793. console.log('点击了供应处长审核',row)
  1794. if (row == undefined) {
  1795. this.examineTemp = this.createTemp
  1796. this.$set(this.createTemp, 'status', 1)
  1797. this.$set(this.createTemp, 'workflowNote', '')
  1798. } else {
  1799. this.examineTemp = Object.assign({}, row)
  1800. this.$set(this.examineTemp, 'status', 1)
  1801. this.$set(this.examineTemp, 'workflowNote', '')
  1802. }
  1803. this.dialogStatus = 'examine'
  1804. this.dialogFormVisible_Examine = true
  1805. this.statueReason = false
  1806. },
  1807. form_examine_save() {
  1808. console.log('点击了供应处长审核', )
  1809. this.isokDisable = true
  1810. setTimeout(() => {
  1811. this.isokDisable = false
  1812. }, 1000)
  1813. this.$refs['examineTemp'].validate(valid => {
  1814. if (valid) {
  1815. //不通过
  1816. if(this.statueReason){
  1817. this.examineTemp.status = 2
  1818. //审核角色
  1819. this.examineTemp.flowCompeleted = "3"
  1820. } else {
  1821. this.examineTemp.status = 0
  1822. this.examineTemp.flowCompeleted = "2"
  1823. }
  1824. this.examineTemp.empid = Cookies.get('employeid')
  1825. var send_data = {
  1826. "common": { "returnmap": "0" },
  1827. "data": [
  1828. {
  1829. "name": "EditBigacceptanceEquipment", "type": "e",
  1830. "parammaps": this.examineTemp
  1831. }
  1832. ]
  1833. }
  1834. ExecDataByConfig(send_data).then(response => {
  1835. console.log('审核确认发送参数', send_data)
  1836. if (response.msg !== 'fail') {
  1837. this.get_table_data1()
  1838. this.dialogFormVisible_Examine = false
  1839. this.statueReason = false
  1840. this.$notify({
  1841. title: '成功',
  1842. message: '审核成功',
  1843. type: 'success',
  1844. duration: 2000
  1845. })
  1846. } else {
  1847. failproccess(response, this.$notify)
  1848. }
  1849. })
  1850. }
  1851. })
  1852. },
  1853. form_examine2(row) {
  1854. console.log('点击了部门负责人审核',row)
  1855. if (row == undefined) {
  1856. this.examineTemp = this.createTemp
  1857. this.$set(this.createTemp, 'status', 1)
  1858. this.$set(this.createTemp, 'workflowNote', '')
  1859. } else {
  1860. this.examineTemp = Object.assign({}, row)
  1861. this.$set(this.examineTemp, 'status', 1)
  1862. this.$set(this.examineTemp, 'workflowNote', '')
  1863. }
  1864. this.dialogStatus = 'examine'
  1865. this.dialogFormVisible_Examine = true
  1866. this.statueReason = false
  1867. },
  1868. form_examine_save2() {
  1869. console.log('点击了部门负责人审核', )
  1870. this.isokDisable = true
  1871. setTimeout(() => {
  1872. this.isokDisable = false
  1873. }, 1000)
  1874. this.$refs['examineTemp'].validate(valid => {
  1875. if (valid) {
  1876. //不通过
  1877. if(this.statueReason){
  1878. this.examineTemp.status = 2
  1879. //审核角色
  1880. this.examineTemp.flowCompeleted = "5"
  1881. } else {
  1882. this.examineTemp.status = 0
  1883. this.examineTemp.flowCompeleted = "4"
  1884. }
  1885. this.examineTemp.empid = Cookies.get('employeid')
  1886. var send_data = {
  1887. "common": { "returnmap": "0" },
  1888. "data": [
  1889. {
  1890. "name": "EditBigacceptanceDepartment", "type": "e",
  1891. "parammaps": this.examineTemp
  1892. }
  1893. ]
  1894. }
  1895. ExecDataByConfig(send_data).then(response => {
  1896. console.log('审核确认发送参数', send_data)
  1897. if (response.msg !== 'fail') {
  1898. this.get_table_data1()
  1899. this.dialogFormVisible_Examine = false
  1900. this.statueReason = false
  1901. this.$notify({
  1902. title: '成功',
  1903. message: '审核成功',
  1904. type: 'success',
  1905. duration: 2000
  1906. })
  1907. } else {
  1908. failproccess(response, this.$notify)
  1909. }
  1910. })
  1911. }
  1912. })
  1913. },
  1914. form_examine3(row) {
  1915. console.log('点击了场长 审核',row)
  1916. if (row == undefined) {
  1917. this.examineTemp = this.createTemp
  1918. this.$set(this.createTemp, 'status', 1)
  1919. this.$set(this.createTemp, 'workflowNote', '')
  1920. } else {
  1921. this.examineTemp = Object.assign({}, row)
  1922. this.$set(this.examineTemp, 'status', 1)
  1923. this.$set(this.examineTemp, 'workflowNote', '')
  1924. }
  1925. this.dialogStatus = 'examine'
  1926. this.dialogFormVisible_Examine = true
  1927. this.statueReason = false
  1928. },
  1929. form_examine_save3() {
  1930. console.log('点击了场长审核', )
  1931. this.isokDisable = true
  1932. setTimeout(() => {
  1933. this.isokDisable = false
  1934. }, 1000)
  1935. this.$refs['examineTemp'].validate(valid => {
  1936. if (valid) {
  1937. //不通过
  1938. if(this.statueReason){
  1939. this.examineTemp.status = 2
  1940. //审核角色
  1941. this.examineTemp.flowCompeleted = "7"
  1942. } else {
  1943. this.examineTemp.status = 1
  1944. this.examineTemp.flowCompeleted = "6"
  1945. }
  1946. this.examineTemp.empid = Cookies.get('employeid')
  1947. var send_data = {
  1948. "common": { "returnmap": "0" },
  1949. "data": [
  1950. {
  1951. "name": "EditBigacceptanceField", "type": "e",
  1952. "parammaps": this.examineTemp
  1953. }
  1954. ]
  1955. }
  1956. ExecDataByConfig(send_data).then(response => {
  1957. console.log('审核确认发送参数', send_data)
  1958. if (response.msg !== 'fail') {
  1959. this.get_table_data1()
  1960. this.dialogFormVisible_Examine = false
  1961. this.statueReason = false
  1962. this.$notify({
  1963. title: '成功',
  1964. message: '审核成功',
  1965. type: 'success',
  1966. duration: 2000
  1967. })
  1968. } else {
  1969. failproccess(response, this.$notify)
  1970. }
  1971. })
  1972. }
  1973. })
  1974. },
  1975. form_submit(row){
  1976. MessageBox.confirm('确认提交此条信息?', {
  1977. confirmButtonText: '确认',
  1978. cancelButtonText: '取消',
  1979. type: 'warning'
  1980. }).then(() => {
  1981. if(row.isPartapply == 1){
  1982. var send_data1 = {
  1983. "name": "checkOutsourcingAmount",
  1984. "parammaps": { "outsourcingCode":row.outsourcingCode }
  1985. }
  1986. var send_data2 = {
  1987. "common": { "returnmap": "0" },
  1988. "data": [
  1989. {
  1990. "name": "editBigacceptanceIsAcceptance", "type": "e",
  1991. "parammaps": { "id":row.id }
  1992. }
  1993. ]
  1994. }
  1995. GetDataByName(send_data1).then(response => {
  1996. if(parseFloat(response.data.list[0].amount) !== 0){
  1997. this.save_submit(send_data2)
  1998. }else{
  1999. this.$message({
  2000. type: 'error',
  2001. message: '数据未填写,请完善相关信息'
  2002. })
  2003. }
  2004. })
  2005. }else{
  2006. this.$message({ type: 'warning', message: '备件未领用,暂时不能提交。', duration: 2000 })
  2007. }
  2008. }).catch(() => {
  2009. this.$message({
  2010. type: 'info',
  2011. message: '已取消提交'
  2012. })
  2013. })
  2014. },
  2015. save_submit(send_data){
  2016. ExecDataByConfig(send_data).then(response => {
  2017. if (response.msg !== 'fail') {
  2018. this.$notify({ title: '成功', message: '提交成功', type: 'success', duration: 2000 })
  2019. this.get_table_data1()
  2020. }
  2021. })
  2022. }
  2023. }
  2024. }
  2025. </script>
  2026. <style lang="scss" scoped>
  2027. .content{
  2028. padding: 20px 20px;
  2029. .title{
  2030. text-align: center;
  2031. font-weight: 700;
  2032. }
  2033. .title2{
  2034. float: left;
  2035. font-weight: 700;
  2036. padding: 10px 0;
  2037. }
  2038. }
  2039. </style>