tab1.vue 62 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622
  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.outsourcingCode" 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.eqName" placeholder="设备名称" style="width: 200px;" class="filter-item" />
  15. <el-input v-model="tableObj1.getdataListParm.parammaps.eqCode" placeholder="设备内部编号" style="width: 200px;" class="filter-item" />
  16. <el-input v-model="tableObj1.getdataListParm.parammaps.contractCode" placeholder="合同编号" style="width: 200px;" class="filter-item" />
  17. <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="结束日期" />
  18. <el-button class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
  19. <el-button v-if="istab1Add" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
  20. </div>
  21. <div class="elTable">
  22. <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" >
  23. <el-table-column label="序号" align="center" type="index" width="50px">
  24. <template slot-scope="scope">
  25. <span>{{ scope.$index + (tableObj1.pageNum-1) * tableObj1.pageSize + 1 }}</span>
  26. </template>
  27. </el-table-column>
  28. <el-table-column label="委外单号" min-width="120px" align="center" prop="outsourcingCode" />
  29. <el-table-column label="牧场" min-width="120px" align="center" prop="pastureName" />
  30. <el-table-column label="责任部门 " min-width="120px" align="center" prop="departmentName" />
  31. <el-table-column label="合同" min-width="150px" align="center">
  32. <template slot-scope="scope">
  33. <span v-if="scope.row.contract ==1 ">有</span>
  34. <span v-else>无</span>
  35. </template>
  36. </el-table-column>
  37. <el-table-column label="申请人" min-width="120px" align="center" prop="applicantName" />
  38. <el-table-column label="日期" min-width="120px" align="center" prop="date" />
  39. <el-table-column label="审核状态" min-width="150px" align="center">
  40. <template slot-scope="scope">
  41. <span v-if="scope.row.status == 0 ">审核中</span>
  42. <span v-else-if="scope.row.status == 1 ">审核通过</span>
  43. <span v-else>审核未通过</span>
  44. </template>
  45. </el-table-column>
  46. <el-table-column label="操作" align="center" width="260" class-name="small-padding fixed-width" fixed="right">
  47. <template slot-scope="{row}">
  48. <el-button type="primary" size="mini" @click="form_see(row)">查看</el-button>
  49. <el-button v-if="istab1Edit && (row.status !== 0) && (row.status !== 1) " type="success" size="mini" @click="form_edit(row)">编辑</el-button>
  50. <el-button v-if="istab1Del && (row.status !== 1) " type="danger" size="mini" @click="form_delete(row)">删除</el-button>
  51. <el-button v-if="istab1Shenhe1 && (row.status== 0) && (row.flowCompeleted == 1) " style="display:inline-block" type="success" size="mini" @click="form_examine(row)">审核1</el-button>
  52. <el-button v-else style="display:none" type="success" size="mini" @click="form_examine(row)">审核1</el-button>
  53. <el-button v-if="istab1Shenhe2 && (row.status== 0) && (row.flowCompeleted == 2 )" style="display:inline-block" type="success" size="mini" @click="form_examine2(row)">审核2</el-button>
  54. <el-button v-else style="display:none" type="success" size="mini" @click="form_examine2(row)">审核2</el-button>
  55. <el-button v-if="istab1Shenhe3 && (row.status== 0) && (row.flowCompeleted == 4)" style="display:inline-block" type="success" size="mini" @click="form_examine3(row)">审核3</el-button>
  56. <el-button v-else style="display:none" type="success" size="mini" @click="form_examine3(row)">审核3</el-button>
  57. <el-button v-if="istab1Shenhe4 && (row.status== 0) && (row.flowCompeleted == 6) && (row.isAudit == 1)" style="display:inline-block" type="success" size="mini" @click="form_examine4(row)">审核4</el-button>
  58. <el-button v-else style="display:none" type="success" size="mini" @click="form_examine4(row)">审核4</el-button>
  59. </template>
  60. </el-table-column>
  61. </el-table>
  62. <pagination v-show="tableObj1.total>0" :total="tableObj1.total" :page.sync="tableObj1.getdataListParm.offset" :limit.sync="tableObj1.getdataListParm.pagecount" @pagination="get_table_data1()" />
  63. </div>
  64. <!-- 弹出层新增or修改 -->
  65. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="90%">
  66. <div >
  67. <el-form ref="createTemp" :rules="rules" :model="createTemp" label-position="right" label-width="100px" style="width: 100%;">
  68. <el-row :gutter="20">
  69. <el-col :span="8">
  70. <el-form-item label="委外维修单号:" prop="outsourcingCode">
  71. <el-input ref="outsourcingCode" v-model="createTemp.outsourcingCode" disabled />
  72. </el-form-item>
  73. </el-col>
  74. <el-col :span="8">
  75. <el-form-item label="牧场:" prop="pastureId" >
  76. <el-select v-model="createTemp.pastureId" placeholder="牧场" class="filter-item" style="width:100%" :disabled=" dialogStatus==='see'" @change="change_pasture2" >
  77. <el-option v-for="item in pastureNameList" :key="item.id" :label="item.name" :value="item.id" />
  78. </el-select>
  79. </el-form-item>
  80. </el-col>
  81. <el-col :span="8">
  82. <el-form-item label="责任部门:" prop="departmentId">
  83. <el-select v-model="createTemp.departmentId" placeholder="责任部门" class="filter-item" style="width:100%" :disabled=" dialogStatus==='see'" @change="change_depart2">
  84. <el-option v-for="item in departNameList2" :key="item.id" :label="item.name" :value="item.id" />
  85. </el-select>
  86. </el-form-item>
  87. </el-col>
  88. </el-row>
  89. <el-row :gutter="20">
  90. <el-col :span="8">
  91. <el-form-item label="合同:" prop="contract">
  92. <el-radio-group v-model="createTemp.contract" :disabled="dialogStatus==='see'" @change="change_contract" >
  93. <el-radio :label="0" :checked="createTemp.contract == 0">无合同</el-radio>
  94. <el-radio :label="1" :checked="createTemp.contract == 1">有合同</el-radio>
  95. </el-radio-group>
  96. </el-form-item>
  97. </el-col>
  98. <el-col :span="8">
  99. <el-form-item label="申请人:" prop="applicant">
  100. <el-select v-model="createTemp.applicant" placeholder="申请人" class="filter-item" style="width:100%" :disabled="dialogStatus==='see'" >
  101. <el-option v-for="item in employeNameList" :key="item.id" :label="item.name" :value="item.id" />
  102. </el-select>
  103. </el-form-item>
  104. </el-col>
  105. <el-col :span="8">
  106. <el-form-item label="日期:" prop="date">
  107. <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'" />
  108. </el-form-item>
  109. </el-col>
  110. </el-row>
  111. <el-row :gutter="20">
  112. <el-col :span="16">
  113. <el-form-item label="故障描述:" prop="description">
  114. <el-input v-model="createTemp.description" type="textarea" autosize :disabled="dialogStatus==='see'" />
  115. </el-form-item>
  116. </el-col>
  117. <el-col :span="8">
  118. <el-form-item label="报修单号:" prop="RUCode">
  119. <el-input ref="RUCode" v-model="createTemp.RUCode" disabled />
  120. </el-form-item>
  121. </el-col>
  122. </el-row>
  123. </el-form>
  124. <el-table
  125. :key="tableKey"
  126. v-loading="listLoading"
  127. element-loading-text="给我一点时间"
  128. :data="listAddCont"
  129. border
  130. fit
  131. highlight-current-row
  132. style="width: 100%;margin-bottom:30px"
  133. :row-style="rowStyle"
  134. :cell-style="cellStyle"
  135. class="elTable"
  136. >
  137. <!-- table表格 -->
  138. <el-table-column :key="1" label="序号" align="center" type="index" width="50px" />
  139. <el-table-column :key="2" label="供应商" prop="providerName" align="center" min-width="80px">
  140. <template slot-scope="scope">
  141. <el-select v-model="scope.row.providerName" placeholder="供应商" class="filter-item" style="width: 120px; margin-top:10px" v-if="dialogStatus ==='create'||dialogStatus ==='update'" >
  142. <el-option v-for="item in providerNameList" :key="item.name" :label="item.name" :value="item.name" />
  143. </el-select>
  144. <span v-if="dialogStatus ==='see'">{{ scope.row.providerName }}</span>
  145. </template>
  146. </el-table-column>
  147. <el-table-column :key="3" v-if="createTemp.contract==0" label="金额" prop="amount" align="center" min-width="80px">
  148. <template slot-scope="scope">
  149. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  150. <el-input v-model="scope.row.amount" style="margin-top:10px" />
  151. </span>
  152. <span v-if="dialogStatus ==='see'">{{ scope.row.amount }}</span>
  153. </template>
  154. </el-table-column>
  155. <el-table-column :key="4" label="设备名称" prop="eqName" align="center" min-width="250">
  156. <template slot-scope="scope">
  157. <el-autocomplete style="margin-top:10px" :disabled="dialogStatus ==='see'"
  158. v-model="scope.row.eqName"
  159. class="inline-input"
  160. :fetch-suggestions="querySearchEqNameCont"
  161. value-key="eqName"
  162. placeholder="设备名称"
  163. @select="(value)=>
  164. {handleSelectEqNameCont(value, scope.row)}"
  165. @blur="(value)=>
  166. {blurSelectEqNameCont(value, scope.row)}"
  167. >
  168. <template slot-scope="{ item }">
  169. <span class="addr">{{ item.eqName }}</span>
  170. |<span class="addr">{{ item.eqCode }}</span>
  171. </template>
  172. </el-autocomplete>
  173. </template>
  174. </el-table-column>
  175. <el-table-column :key="5" label="设备内部编号" prop="eqCode" align="center" min-width="150">
  176. <template slot-scope="scope">
  177. <el-autocomplete style="margin-top:10px"
  178. v-model="scope.row.eqCode" :disabled="dialogStatus ==='see'"
  179. class="inline-input"
  180. :fetch-suggestions="querySearchCodeCont"
  181. value-key="eqCode"
  182. placeholder="设备内部编号"
  183. @select="(value)=>
  184. {handleSelectEqCodeCont(value, scope.row)}"
  185. @blur="(value)=>
  186. {blurSelectEqCodeCont(value, scope.row)}"
  187. />
  188. </template>
  189. </el-table-column>
  190. <!-- <el-table-column label="设备名称" prop="eqName" min-width="80px" align="center">
  191. <template slot-scope="scope">
  192. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  193. <el-input v-model="scope.row.eqName" style="margin-top:10px" />
  194. </span>
  195. <span v-if="dialogStatus ==='see'">{{ scope.row.eqName }}</span>
  196. </template>
  197. </el-table-column>
  198. <el-table-column label="设备内部编号" prop="eqCode" align="center" min-width="80px">
  199. <template slot-scope="scope">
  200. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  201. <el-input v-model="scope.row.eqCode" style="margin-top:10px" />
  202. </span>
  203. <span v-if="dialogStatus ==='see'">{{ scope.row.eqCode }}</span>
  204. </template>
  205. </el-table-column> -->
  206. <el-table-column :key="6" label="费用类型" prop="typea" align="center" min-width="80px">
  207. <template slot-scope="scope">
  208. <el-select v-model="scope.row.typea" placeholder="费用类型" class="filter-item" style="width: 120px; margin-top:10px " v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  209. <el-option v-for="item in costTypeList" :key="item.id" :label="item.name" :value="item.name" />
  210. </el-select>
  211. <span v-if="dialogStatus ==='see'">{{ scope.row.typea }}</span>
  212. </template>
  213. </el-table-column>
  214. <!-- <el-table-column label="交付日期" prop="date" align="center" min-width="80px">
  215. <template slot-scope="scope">
  216. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  217. <el-date-picker v-model="scope.row.date" style="margin-top:10px" type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
  218. </span>
  219. <span v-if="dialogStatus ==='see'">{{ scope.row.date }}</span>
  220. </template>
  221. </el-table-column> -->
  222. <el-table-column :key="7" v-if="createTemp.contract == 1" label="合同编号" prop="contractCode" align="center" min-width="80px">
  223. <template slot-scope="scope">
  224. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  225. <el-input v-model="scope.row.contractCode" style="margin-top:10px" />
  226. </span>
  227. <span v-if="dialogStatus ==='see'">{{ scope.row.contractCode }}</span>
  228. </template>
  229. </el-table-column>
  230. <el-table-column :key="8" label="备注" prop="remark" align="center" min-width="180px">
  231. <template slot-scope="scope">
  232. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  233. <el-input v-model="scope.row.remark" style="margin-top:10px" />
  234. </span>
  235. <span v-if="dialogStatus ==='see'">{{ scope.row.remark }}</span>
  236. </template>
  237. </el-table-column>
  238. </el-table>
  239. <el-row :gutter="10" v-if="dialogStatus ==='see' ">
  240. <el-col>
  241. <h3>流程进度</h3>
  242. <el-steps :active="active" align-center finish-status="success">
  243. <el-step
  244. v-for="(item,index) in activeList"
  245. :key="index"
  246. :title="item.title"
  247. :status="item.status"
  248. >
  249. <template slot="description">
  250. <div class="step-row">
  251. <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
  252. <div>{{ item.reason }}</div>
  253. </div>
  254. </template>
  255. </el-step>
  256. </el-steps>
  257. </el-col>
  258. </el-row>
  259. <div slot="footer" class="dialog-footer" style="bottom:10px">
  260. <el-button type="primary" :disabled="isokDisable" v-if="dialogStatus !=='see'" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()">保存并关闭</el-button>
  261. <el-button @click="dialogFormVisible = false;get_table_data1()">取消并关闭</el-button>
  262. </div>
  263. </div>
  264. </el-dialog>
  265. <!-- 审核 -->
  266. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_Examine" :close-on-click-modal="false" width="30%">
  267. <div class="app-examine">
  268. <h3 style="width: 100%;margin:0 0 0 5%;line-height:50px;">请确认审核结果:</h3>
  269. <el-form ref="examineTemp" :model="examineTemp" label-position="right" style="width: 50%;margin:0 auto;">
  270. <el-row style="width:88%;height:150px;margin:0 auto;">
  271. <el-col :span="20">
  272. <el-form-item>
  273. <el-radio-group v-model="examineTemp.status" @change="change_statue">
  274. <el-radio :label="1" checked>通过</el-radio>
  275. <el-radio :label="2">不通过</el-radio>
  276. </el-radio-group>
  277. </el-form-item>
  278. </el-col>
  279. <el-col v-if="statueReason" :span="20">
  280. <el-input v-model="examineTemp.workflowNote" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入不通过原因" />
  281. </el-col>
  282. </el-row>
  283. </el-form>
  284. </div>
  285. <div slot="footer" class="dialog-footer">
  286. <el-button v-if="istab1Shenhe1 && (examineTemp.flowCompeleted == 1) " type="primary" :disabled="isokDisable" @click="form_examine_save()">确认1</el-button>
  287. <el-button v-if="istab1Shenhe2 && (examineTemp.flowCompeleted == 2)" type="primary" :disabled="isokDisable" @click="form_examine_save2()">确认2</el-button>
  288. <el-button v-if="istab1Shenhe3 && (examineTemp.flowCompeleted == 4)" type="primary" :disabled="isokDisable" @click="form_examine_save3()">确认3</el-button>
  289. <el-button v-if="istab1Shenhe4 && (examineTemp.flowCompeleted == 6)" type="primary" :disabled="isokDisable" @click="form_examine_save4()">确认4</el-button>
  290. <!-- <el-button v-if="dialogStatus==='examine22'" type="primary" :disabled="isokDisable" @click="form_examine_save22()">确认</el-button>
  291. <el-button v-if="dialogStatus==='examine2'" type="primary" :disabled="isokDisable" @click="form_examine_save2()">确认</el-button>
  292. <el-button v-if="dialogStatus==='examine33'" type="primary" :disabled="isokDisable" @click="form_examine_save33()">确认</el-button>
  293. <el-button v-if="dialogStatus==='examine3'" type="primary" :disabled="isokDisable" @click="form_examine_save3()">确认</el-button> -->
  294. <el-button @click="dialogFormVisible_Examine = false;">关闭</el-button>
  295. </div>
  296. </el-dialog>
  297. </div>
  298. </template>
  299. <script>
  300. import echarts from 'echarts'
  301. require('echarts/theme/macarons')
  302. import { GetDataByNames, GetReportform, GetDataByName, PostDataByName, checkButtons, ExecDataByConfig} from '@/api/common'
  303. import Cookies from 'js-cookie'
  304. import { parseTime, json2excel } from '@/utils/index.js'
  305. import { MessageBox } from 'element-ui'
  306. import Pagination from '@/components/Pagination'
  307. export default {
  308. name: 'Tab1',
  309. components: { Pagination },
  310. inject: ['reload'],
  311. data() {
  312. return {
  313. myHeight:document.documentElement.clientHeight - 85- 200,
  314. //多个下拉框 - 请求内容
  315. send_select_list: [
  316. { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
  317. { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
  318. { name: 'findAllProviderByCt', offset: 0, pagecount: 0, parammaps: { 'id': Cookies.get('pastureid') }},
  319. ],
  320. // 下拉框 - 牧场
  321. pastureNameList: [
  322. // {id: "犊牛1", name: "犊牛1"},
  323. // {id: "犊牛2", name: "犊牛2"},
  324. // {id: "犊牛3", name: "犊牛3"}
  325. ],
  326. getDepartParam1: {
  327. name: 'findAllDepart', offset: 0, pagecount: 0,
  328. parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }
  329. },
  330. employeNameList: [],
  331. departNameList1: [],
  332. getDepartParam2: {
  333. name: 'findAllDepart', offset: 0, pagecount: 0,
  334. parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }
  335. },
  336. departNameList2: [],
  337. statuesNameList: [{ id: '0', name: '审核中' }, { id: '1', name: '已通过' }, { id: '2', name: '未通过' }],
  338. isokDisable: false,
  339. tableObj1: {
  340. getdataListParm: {
  341. name: 'getBigoutsourcingList',
  342. //请求的 page 无用参数 offset 第几页 pagecount 每页多少条
  343. page: 1, offset: 1,pagecount: 10,returntype: 'Map',
  344. parammaps: { pastureName: Cookies.get('pasturename'), outsourcingCode: '',departmentName: '',status: "",eqName: "",eqCode: "",contractCode: "",inputDatetime:"",startdate: "",enddate: ""}
  345. },
  346. tableKey: 0,listLoading: false,
  347. //返回的 pageNum 第几页 pageSize 每页多少条 total 总条数
  348. pageNum:'',pageSize:'',total: 0,
  349. list: [
  350. ]
  351. },
  352. getAddContListParam: {
  353. name: "getOutsourcingList",
  354. page: 1,offset: 1,pagecount: 20,returntype: "Map",
  355. parammaps: {"bigId": ""}
  356. },
  357. pickerOptions: {
  358. disabledDate(time) {
  359. return time.getTime() > Date.now()// 当天之前的时间可选
  360. }
  361. },
  362. rules: {
  363. outsourcingCode: [{ required: true, message: '必填', trigger: 'blur' }],
  364. equipmentName: [{ required: true, message: '必填', trigger: 'blur' }],
  365. departmentId: [{ required: true, message: '必填', trigger: 'blur' }],
  366. contract: [{ required: true, message: '必填', trigger: 'blur' }],
  367. description: [{ required: true, message: '必填', trigger: 'blur' }],
  368. // equipmentName: [{ required: true, message: '必填', trigger: 'blur' }]
  369. },
  370. tableKey: 0,
  371. listLoading: true,
  372. total: 0,
  373. list: [],
  374. dialogStatus: '',
  375. dialogFormVisible: false,
  376. dialogFormVisibleSee: false,
  377. listLoadingSee: true,
  378. listSee: [],
  379. totalSee: 0,
  380. seeTemp: {},
  381. getdataListSee: {
  382. name: 'getpartpurchaseBybig',
  383. returntype: 'Map',
  384. parammaps: {}
  385. },
  386. createTemp: {
  387. pastureId: this.$store.state.user.pastureid,
  388. departmentId: this.$store.state.user.departmentid,
  389. employeId: this.$store.state.user.employeid,
  390. date: parseTime(new Date(), '{y}-{m}-{d}'),
  391. outsourcingCode: '',
  392. applicant: '',
  393. RUCode: '',
  394. providerId: '',
  395. departmentName: '',
  396. description: '',
  397. contract:1,
  398. },
  399. costTypeList:[
  400. {id:'保养',name:'保养'},
  401. {id:'维修',name:'维修'},
  402. {id:'物耗',name:'物耗'},
  403. {id:'土建',name:'土建'},
  404. {id:'安全',name:'安全'},
  405. ],
  406. providerNameList:[
  407. ],
  408. getParmCreateNumber: {
  409. name: 'autoCreatCode',
  410. page: 0,
  411. offset: 0,
  412. pagecount: 0,
  413. returntype: 'Map',
  414. parammaps: {
  415. pastureId: Cookies.get('pastureid'),
  416. codeType: 'WW'
  417. }
  418. },
  419. listAddCont:[
  420. {providerName:"",providerId: "0",eqId: "0",contractId: "0",}
  421. ],
  422. activeList: [],
  423. active: 1,
  424. EqNameList: [],
  425. requestEqName: {
  426. name: 'geteqbyNameCode', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
  427. parammaps: { pastureId: Cookies.get('pastureid') }
  428. },
  429. EqCodeList: [],
  430. dialogFormVisible_Examine: false,
  431. examineTemp: {
  432. "status": 1,
  433. "empid": "",
  434. "flowCompeleted":"",
  435. "workflowNote": "",
  436. "id": ""
  437. },
  438. statueReason: false,
  439. rowStyle: { maxHeight: 50 + 'px', height: 35 + 'px' },
  440. cellStyle: { padding: 0 + 'px' },
  441. textMap: {
  442. update: '编辑',
  443. create: '新增',
  444. see: '查看',
  445. examine: '审核1',
  446. examine22: '审核2',
  447. examine2: '审核3',
  448. examine33: '审核4',
  449. examine3: '审核5'
  450. },
  451. istab1Add:[],
  452. istab1Edit:[],
  453. istab1Del:[],
  454. istab1Shenhe1:[],
  455. istab1Shenhe2:[],
  456. istab1Shenhe4:[],
  457. getParmCreateNumber2: {
  458. name: 'autoCreatCode',
  459. page: 0, offset: 0, pagecount: 0, returntype: 'Map',
  460. parammaps: {
  461. pastureId: Cookies.get('pastureid'),
  462. codeType: 'WY'
  463. }
  464. },
  465. }
  466. },
  467. created() {
  468. this.get_select_list()
  469. this.get_table_data1()
  470. this.get_auto_buttons()
  471. },
  472. methods: {
  473. //获取按钮权限
  474. get_auto_buttons() {
  475. const istab1Add = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten:add')
  476. this.istab1Add = istab1Add
  477. const istab1Edit = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten:edit')
  478. this.istab1Edit = istab1Edit
  479. const istab1Del = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten:del')
  480. this.istab1Del = istab1Del
  481. const istab1Shenhe1 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten:shenhe1')
  482. this.istab1Shenhe1 = istab1Shenhe1
  483. const istab1Shenhe2 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten:shenhe2')
  484. this.istab1Shenhe2 = istab1Shenhe2
  485. const istab1Shenhe3 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten:shenhe3')
  486. this.istab1Shenhe3 = istab1Shenhe3
  487. const istab1Shenhe4 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten:shenhe4')
  488. this.istab1Shenhe4 = istab1Shenhe4
  489. },
  490. querySearchEqNameCont(queryString, cb) {
  491. console.log('备件名称/设备内部编号模糊查询输入值', queryString)
  492. this.requestEqName.parammaps['eqName'] = queryString
  493. GetDataByName(this.requestEqName).then(response => {
  494. console.log('备件名称模糊查询搜索data', response.data.list)
  495. this.EqNameList = response.data.list
  496. cb(this.EqNameList)
  497. })
  498. },
  499. handleSelectEqNameCont(item, row) {
  500. console.log('备件名称/设备内部编号模糊查询选中值', item.eqName)
  501. console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
  502. this.$set(row, 'eqCode', item.eqCode)
  503. this.$forceUpdate()
  504. },
  505. querySearchCodeCont(queryString, cb) {
  506. console.log('备件名称/设备内部编号模糊查询输入值', queryString)
  507. this.requestEqName.parammaps['eqCode'] = queryString
  508. GetDataByName(this.requestEqName).then(response => {
  509. console.log('备件名称模糊查询搜索data', response.data.list)
  510. this.EqNameList = response.data.list
  511. cb(this.EqNameList)
  512. })
  513. },
  514. handleSelectEqCodeCont(item, row) {
  515. console.log('备件名称/设备内部编号模糊查询选中值', item)
  516. console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
  517. this.$set(row, 'eqName', item.eqName)
  518. this.$forceUpdate()
  519. },
  520. blurSelectEqNameCont(item, row) {
  521. this.$set(row, 'eqName', '')
  522. this.$set(row, 'eqCode', '')
  523. },
  524. blurSelectEqCodeCont(item, row) {
  525. this.$set(row, 'eqName', '')
  526. this.$set(row, 'eqCode', '')
  527. },
  528. get_select_list() {
  529. GetDataByNames(this.send_select_list).then(response => {
  530. this.pastureNameList = response.data.findAllPasture.list
  531. console.log("牧场下拉框", this.pastureNameList)
  532. this.employeNameList = response.data.findAllEmploye.list
  533. console.log("申请人下拉框", this.employeNameList)
  534. this.providerNameList = response.data.findAllProviderByCt.list
  535. this.get_depart_list1()
  536. })
  537. },
  538. change_pasture1(item) {
  539. this.getDepartParam1.parammaps.pastureId = this.pastureNameList.find(obj => obj.name == item).id
  540. this.tableObj1.getdataListParm.parammaps.departmentId = ''
  541. this.get_depart_list1()
  542. },
  543. //部门List
  544. get_depart_list1() {
  545. GetDataByName(this.getDepartParam1).then(response => {
  546. this.departNameList1 = response.data.list
  547. })
  548. },
  549. change_pasture2(item) {
  550. this.getDepartParam2.parammaps.pastureId = item
  551. this.get_depart_list2()
  552. },
  553. get_depart_list2() {
  554. GetDataByName(this.getDepartParam2).then(response => {
  555. this.departNameList2 = response.data.list
  556. })
  557. },
  558. change_depart2(item) {
  559. this.createTemp.departmentName = this.departNameList2.find(obj => obj.id == item).name
  560. },
  561. get_table_data1() {
  562. this.tableObj1.listLoading = false
  563. if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
  564. this.tableObj1.getdataListParm.parammaps.startdate = this.$refs['inputDatetime'].value[0]
  565. this.tableObj1.getdataListParm.parammaps.enddate = this.$refs['inputDatetime'].value[1]
  566. } else {
  567. this.tableObj1.getdataListParm.parammaps.inputDatetime = ''
  568. this.tableObj1.getdataListParm.parammaps.startdate = ''
  569. this.tableObj1.getdataListParm.parammaps.enddate = ''
  570. }
  571. GetDataByName(this.tableObj1.getdataListParm).then(response => {
  572. if (response.data.list !== null) {
  573. this.tableObj1.list = response.data.list
  574. this.tableObj1.pageNum = response.data.pageNum
  575. this.tableObj1.pageSize = response.data.pageSize
  576. this.tableObj1.total = response.data.total
  577. } else {
  578. this.tableObj1.list = [ ]
  579. }
  580. setTimeout(() => {
  581. this.tableObj1.listLoading = false
  582. }, 100)
  583. })
  584. },
  585. form_search() {
  586. console.log('查询')
  587. this.get_table_data1()
  588. },
  589. change_contract(val) {
  590. console.log(val)
  591. if(val ==1){
  592. this.createTemp.contract = 1
  593. } else {
  594. this.createTemp.contract = 0
  595. }
  596. },
  597. form_add() {
  598. this.reset_create()
  599. this.getDepartParam2.parammaps.pastureId = this.createTemp.pastureId
  600. this.get_depart_list2()
  601. this.dialogStatus = 'create'
  602. this.dialogFormVisible = true
  603. this.listLoading = false
  604. this.$nextTick(() => {
  605. this.$refs['createTemp'].clearValidate()
  606. })
  607. //新增生成单号
  608. this.get_create_num()
  609. },
  610. reset_create() {
  611. this.createTemp.pastureId = parseInt(Cookies.get('pastureid'))
  612. this.createTemp.departmentId = parseInt(Cookies.get('departmentid'))
  613. if(parseInt(Cookies.get('pastureid')) == 18){
  614. this.createTemp.departmentId = ""
  615. }
  616. this.createTemp.departmentName = Cookies.get('departmentname')
  617. this.createTemp.employeId = parseInt(Cookies.get('employeid'))
  618. this.createTemp.date = parseTime(new Date(), '{y}-{m}-{d}')
  619. this.createTemp.outsourcingCode = ''
  620. this.createTemp.applicant = parseInt(Cookies.get('employeid'))
  621. this.createTemp.providerId = ''
  622. this.createTemp.contract = 1
  623. this.createTemp.description = ''
  624. this.listAddCont = [{providerName:"",providerId: "0",eqId: "0",contractId: "0",amount:"",contractCode:"",date:"",eqCode:"",eqName:"",remark:"",typea:"",}]
  625. },
  626. get_create_num() {
  627. GetDataByName(this.getParmCreateNumber).then(response => {
  628. this.$nextTick(() => {
  629. console.log('新增单号', response.data.list[0].orderCode)
  630. this.createTemp.outsourcingCode = response.data.list[0].orderCode
  631. this.$forceUpdate()
  632. })
  633. })
  634. },
  635. add_dialog_save() {
  636. this.isokDisable = true
  637. setTimeout(() => {
  638. this.isokDisable = false
  639. }, 1000)
  640. this.$refs['createTemp'].validate(valid => {
  641. if (valid) {
  642. console.log(this.listAddCont)
  643. if (this.createTemp.outsourcingCode == '' || this.createTemp.outsourcingCode == null || this.createTemp.outsourcingCode == undefined) {
  644. GetDataByName(this.getParmCreateNumber2).then(response => {
  645. this.$nextTick(() => {
  646. console.log('新增单号', response.data.list[0].orderCode)
  647. this.createTemp.outsourcingCode = response.data.list[0].orderCode
  648. this.$forceUpdate()
  649. this.add_dialog_saveSave()
  650. })
  651. })
  652. } else {
  653. this.add_dialog_saveSave()
  654. }
  655. }
  656. })
  657. },
  658. add_dialog_saveSave() {
  659. for (var j = 0; j < this.listAddCont.length; j++) {
  660. console.log(this.listAddCont[j].amount)
  661. if(this.listAddCont[j].providerName == ''){
  662. this.$message({ type: 'warning', message: '请检查供应商是否未填写', duration: 2000 })
  663. return false
  664. }
  665. if(this.listAddCont[j].eqName == ''){
  666. this.$message({ type: 'warning', message: '请检查设备名称是否未填写', duration: 2000 })
  667. return false
  668. }
  669. if(this.listAddCont[j].eqCode == ''){
  670. this.$message({ type: 'warning', message: '请检查设备内部编号是否未填写', duration: 2000 })
  671. return false
  672. }
  673. if (this.listAddCont[j].amount == null || this.listAddCont[j].amount === '') {
  674. // this.$message({ type: 'warning', message: '请检查金额是否未填写', duration: 2000 })
  675. // return false
  676. } else {
  677. // var rulesAmount = /^[1-9]\d*$/
  678. // if (!rulesAmount.test(this.listAddCont[j].amount)) {
  679. // this.$message({ type: 'error', message: '申购数量请输入正整数', duration: 2000 })
  680. // return false
  681. // }
  682. }
  683. if (this.createTemp.contract == 1){
  684. if (this.listAddCont[j].contractCode == null || this.listAddCont[j].contractCode === '') {
  685. this.$message({ type: 'warning', message: '请检查合同编号是否未填写', duration: 2000 })
  686. return false
  687. }
  688. }
  689. }
  690. var amount = 0
  691. if(this.createTemp.contract==0){
  692. amount = "@insertSpotList.amount"
  693. }else{
  694. amount = 0
  695. }
  696. if(this.createTemp.contract == 0){
  697. // 无合同
  698. this.$set(this.createTemp,'status',0)
  699. }else{
  700. // 有合同
  701. this.$set(this.createTemp,'status',1)
  702. }
  703. var send_data = {
  704. "common": { "returnmap": "0" },
  705. "data": [
  706. {
  707. "name": "addBigoutsourcing", "type": "e",
  708. "parammaps": this.createTemp
  709. },
  710. {
  711. "name": "insertSpotList",
  712. "resultmaps": { "list": this.listAddCont },
  713. "children": [
  714. {
  715. "name": "addOutsourcing", "type": "e",
  716. "parammaps": {
  717. "bigId": "@addBigoutsourcing.LastInsertId",
  718. "providerId": "@insertSpotList.providerId",
  719. "amount": amount,
  720. "eqId": "@insertSpotList.eqId",
  721. "eqCode": "@insertSpotList.eqCode",
  722. "eqName": "@insertSpotList.eqName",
  723. "typea": "@insertSpotList.typea",
  724. "date": "@insertSpotList.date",
  725. "contractId": "@insertSpotList.contractId",
  726. "providerName": "@insertSpotList.providerName",
  727. "contractCode": "@insertSpotList.contractCode",
  728. "status":this.createTemp.status
  729. }
  730. }
  731. ]
  732. }
  733. ]
  734. }
  735. ExecDataByConfig(send_data).then(response => {
  736. console.log('新增保存发送参数', send_data)
  737. if (response.msg === 'fail') {
  738. this.$notify({
  739. title: '保存失败',
  740. message: response.data,
  741. type: 'warning',
  742. duration: 2000
  743. })
  744. } else {
  745. if(this.createTemp.contract==1){
  746. this.add_dialog_saveSave2()
  747. }
  748. this.dialogFormVisible = false
  749. this.get_table_data1()
  750. this.$notify({
  751. title: '',
  752. message: '保存成功',
  753. type: 'success',
  754. duration: 2000
  755. })
  756. }
  757. })
  758. return true
  759. },
  760. form_see(row){
  761. console.log('查看======》',row)
  762. this.getDepartParam2.parammaps.pastureId = row.pastureId
  763. this.get_depart_list2()
  764. this.createTemp = Object.assign({}, row)
  765. this.dialogStatus = 'see'
  766. this.dialogFormVisible = true
  767. this.$nextTick(() => {
  768. this.$refs['createTemp'].clearValidate()
  769. })
  770. //总价大于等于10000,有高级设备工程师
  771. if(row.isAudit == 1) {
  772. if (row.flowCompeleted == 1) {
  773. this.activeList = [
  774. { title: '设备处长', date: row.createTime, name: row.applicantName },
  775. { title: '部门负责人' },
  776. { title: '财务负责人' },
  777. { title: '场长' },
  778. { title: '运营支持部高级工程师' },
  779. ]
  780. this.active = 1
  781. } else if (row.flowCompeleted == 2) {
  782. this.activeList = [
  783. { title: '设备处长', date: row.createTime, name: row.applicantName },
  784. { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
  785. { title: '财务负责人' },
  786. { title: '场长' },
  787. { title: '运营支持部高级工程师' },
  788. ]
  789. this.active = 2
  790. } else if (row.flowCompeleted === 3) {
  791. this.activeList = [
  792. { title: '设备处长', date: row.createTime, name: row.applicantName },
  793. { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName,status: 'error', reason: row.workflowNote },
  794. { title: '财务负责人' },
  795. { title: '场长' },
  796. { title: '运营支持部高级工程师' }
  797. ]
  798. this.active = 2
  799. } else if (row.flowCompeleted === 4) {
  800. this.activeList = [
  801. { title: '设备处长', date: row.createTime, name: row.applicantName },
  802. { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
  803. { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName },
  804. { title: '场长' },
  805. { title: '运营支持部高级工程师' }
  806. ]
  807. this.active = 3
  808. } else if (row.flowCompeleted === 5) {
  809. this.activeList = [
  810. { title: '设备处长', date: row.createTime, name: row.applicantName },
  811. { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
  812. { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName,status: 'error', reason: row.workflowNote },
  813. { title: '场长' },
  814. { title: '运营支持部高级工程师' }
  815. ]
  816. this.active = 3
  817. } else if (row.flowCompeleted === 6) {
  818. this.activeList = [
  819. { title: '设备处长', date: row.createTime, name: row.applicantName },
  820. { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
  821. { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName },
  822. { title: '场长',date: row.fielddate, name: row.fieldName },
  823. { title: '运营支持部高级工程师' }
  824. ]
  825. this.active = 4
  826. } else if (row.flowCompeleted === 7) {
  827. this.activeList = [
  828. { title: '设备处长', date: row.createTime, name: row.applicantName },
  829. { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
  830. { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName },
  831. { title: '场长',date: row.fielddate, name: row.fieldName,status: 'error', reason: row.workflowNote },
  832. { title: '运营支持部高级工程师' }
  833. ]
  834. this.active = 4
  835. }else if (row.flowCompeleted === 8) {
  836. this.activeList = [
  837. { title: '设备处长', date: row.createTime, name: row.applicantName },
  838. { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
  839. { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName },
  840. { title: '场长',date: row.fielddate, name: row.fieldName },
  841. { title: '运营支持部高级工程师',date: row.advanceddate, name: row.advancedName }
  842. ]
  843. this.active = 5
  844. }else if (row.flowCompeleted === 9) {
  845. this.activeList = [
  846. { title: '设备处长', date: row.createTime, name: row.applicantName },
  847. { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
  848. { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName },
  849. { title: '场长',date: row.fielddate, name: row.fieldName},
  850. { title: '运营支持部高级工程师',date: row.advanceddate, name: row.advancedName,status: 'error', reason: row.workflowNote }
  851. ]
  852. this.active = 5
  853. }
  854. //总价小于10000 没有高级设备工程师,直接场长审核
  855. } else {
  856. if (row.flowCompeleted == 1) {
  857. this.activeList = [
  858. { title: '设备处长', date: row.createTime, name: row.applicantName },
  859. { title: '部门负责人' },
  860. { title: '财务负责人' },
  861. { title: '场长' }
  862. ]
  863. this.active = 1
  864. } else if (row.flowCompeleted == 2) {
  865. this.activeList = [
  866. { title: '设备处长', date: row.createTime, name: row.applicantName },
  867. { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
  868. { title: '财务负责人' },
  869. { title: '场长' }
  870. ]
  871. this.active = 2
  872. } else if (row.flowCompeleted === 3) {
  873. this.activeList = [
  874. { title: '设备处长', date: row.createTime, name: row.applicantName },
  875. { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName,status: 'error', reason: row.workflowNote },
  876. { title: '财务负责人' },
  877. { title: '场长' }
  878. ]
  879. this.active = 2
  880. } else if (row.flowCompeleted === 4) {
  881. this.activeList = [
  882. { title: '设备处长', date: row.createTime, name: row.applicantName },
  883. { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
  884. { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName },
  885. { title: '场长' },
  886. ]
  887. this.active = 3
  888. } else if (row.flowCompeleted === 5) {
  889. this.activeList = [
  890. { title: '设备处长', date: row.createTime, name: row.applicantName },
  891. { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
  892. { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName,status: 'error', reason: row.workflowNote },
  893. { title: '场长' }
  894. ]
  895. this.active = 3
  896. } else if (row.flowCompeleted === 6) {
  897. this.activeList = [
  898. { title: '设备处长', date: row.createTime, name: row.applicantName },
  899. { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
  900. { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName },
  901. { title: '场长',date: row.fielddate, name: row.fieldName },
  902. ]
  903. this.active = 4
  904. } else if (row.flowCompeleted === 7) {
  905. this.activeList = [
  906. { title: '设备处长', date: row.createTime, name: row.applicantName },
  907. { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
  908. { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName },
  909. { title: '场长',date: row.fielddate, name: row.fieldName,status: 'error', reason: row.workflowNote }
  910. ]
  911. this.active = 4
  912. }
  913. }
  914. if(row.contract == 1){
  915. this.activeList = [
  916. { title: '设备处长', date: row.createTime, name: row.applicantName }
  917. ]
  918. this.active = 1
  919. }
  920. this.getAddContListParam.parammaps.bigId = row.id
  921. this.getAddContList()
  922. },
  923. getAddContList() {
  924. GetDataByName(this.getAddContListParam).then(response => {
  925. this.listAddCont = response.data.list
  926. this.listLoading = false
  927. })
  928. },
  929. form_edit(row) {
  930. this.reset_create()
  931. console.log('编辑',row)
  932. this.getDepartParam2.parammaps.pastureId = row.pastureId
  933. this.get_depart_list2()
  934. if (row.providerId == undefined) {
  935. row.providerId = ''
  936. row.providerName = ''
  937. }
  938. this.createTemp = Object.assign({}, row) // copy obj
  939. this.dialogStatus = 'update'
  940. this.dialogFormVisible = true
  941. this.$nextTick(() => {
  942. this.$refs['createTemp'].clearValidate()
  943. })
  944. this.getAddContListParam.parammaps.bigId = row.id
  945. this.getAddContList()
  946. },
  947. edit_dialog_save() {
  948. this.isokDisable = true
  949. setTimeout(() => {
  950. this.isokDisable = false
  951. }, 1000)
  952. this.$refs['createTemp'].validate(valid => {
  953. if (valid) {
  954. this.edit_dialog_saveSave()
  955. }
  956. })
  957. },
  958. edit_dialog_saveSave() {
  959. for (var j = 0; j < this.listAddCont.length; j++) {
  960. console.log(this.listAddCont[j].amount)
  961. // eslint-disable-next-line use-isnan
  962. if (this.listAddCont[j].amount == null || this.listAddCont[j].amount === '') {
  963. this.$message({ type: 'warning', message: '请检查申购数量是否未填写', duration: 2000 })
  964. return false
  965. }
  966. }
  967. this.listAddCont[0].providerId = "0"
  968. this.listAddCont[0].eqId = "0"
  969. this.listAddCont[0].contractId = "0"
  970. var amount = 0
  971. if(this.createTemp.contract==0){
  972. amount = "@insertSpotList.amount"
  973. }else{
  974. amount = 0
  975. }
  976. var send_data = {
  977. "common": { "returnmap": "0" },
  978. "data": [
  979. {
  980. "name": "editBigoutsourcing", "type": "e",
  981. "parammaps": this.createTemp
  982. },
  983. {
  984. "name": "insertSpotList",
  985. "resultmaps": { "list": this.listAddCont },
  986. "children": [
  987. {
  988. "name": "editOutsourcing", "type": "e",
  989. "parammaps": {
  990. "bigId": "@insertSpotList.LastInsertId",
  991. "providerId": "@insertSpotList.providerId",
  992. "amount": amount,
  993. "eqId": "@insertSpotList.eqId",
  994. "eqCode": "@insertSpotList.eqCode",
  995. "eqName": "@insertSpotList.eqName",
  996. "typea": "@insertSpotList.typea",
  997. "date": "@insertSpotList.date",
  998. "contractId": "@insertSpotList.contractId",
  999. "id": "@insertSpotList.id",
  1000. "providerName": "@insertSpotList.providerName",
  1001. "contractCode": "@insertSpotList.contractCode"
  1002. }
  1003. }
  1004. ]
  1005. },
  1006. {
  1007. "name": "updateBigoutsourcingFlowCompeleted", "type": "e",
  1008. "parammaps":{
  1009. id:this.createTemp.id
  1010. }
  1011. },
  1012. ]
  1013. }
  1014. ExecDataByConfig(send_data).then(response => {
  1015. console.log('新增保存发送参数', send_data)
  1016. if (response.msg === 'fail') {
  1017. this.$notify({
  1018. title: '保存失败',
  1019. message: response.data,
  1020. type: 'warning',
  1021. duration: 2000
  1022. })
  1023. } else {
  1024. this.dialogFormVisible = false
  1025. this.get_table_data1()
  1026. this.$notify({
  1027. title: '',
  1028. message: '保存成功',
  1029. type: 'success',
  1030. duration: 2000
  1031. })
  1032. }
  1033. })
  1034. },
  1035. form_delete(row) {
  1036. console.log('点击了删除',row)
  1037. MessageBox.confirm('确认删除此条信息?', {
  1038. confirmButtonText: '确认',
  1039. cancelButtonText: '取消',
  1040. type: 'warning'
  1041. }).then(() => {
  1042. var send_data = {
  1043. "common": { "returnmap": "0" },
  1044. "data": [
  1045. {
  1046. "name": "deleteBigoutsourcing", "type": "e",
  1047. "parammaps": { "id":row.id }
  1048. }
  1049. ]
  1050. }
  1051. ExecDataByConfig(send_data).then(response => {
  1052. this.get_table_data1()
  1053. this.$notify({
  1054. title: '成功',
  1055. message: '删除成功',
  1056. type: 'success',
  1057. duration: 2000
  1058. })
  1059. })
  1060. }).catch(() => {
  1061. this.$message({
  1062. type: 'info',
  1063. message: '已取消删除'
  1064. })
  1065. })
  1066. },
  1067. change_statue(val) {
  1068. if (val == 2) {
  1069. this.statueReason = true
  1070. } else {
  1071. this.statueReason = false
  1072. }
  1073. },
  1074. form_examine(row) {
  1075. console.log('点击了设备处长审核',row)
  1076. if (row == undefined) {
  1077. this.examineTemp = this.createTemp
  1078. this.$set(this.createTemp, 'status', 1)
  1079. this.$set(this.createTemp, 'workflowNote', '')
  1080. } else {
  1081. this.examineTemp = Object.assign({}, row)
  1082. this.$set(this.examineTemp, 'status', 1)
  1083. this.$set(this.examineTemp, 'workflowNote', '')
  1084. }
  1085. this.dialogStatus = 'examine'
  1086. this.dialogFormVisible_Examine = true
  1087. this.statueReason = false
  1088. },
  1089. form_examine_save() {
  1090. console.log('点击了设备处长审核', this.examineTemp)
  1091. this.isokDisable = true
  1092. setTimeout(() => {
  1093. this.isokDisable = false
  1094. }, 1000)
  1095. this.$refs['examineTemp'].validate(valid => {
  1096. if (valid) {
  1097. //不通过
  1098. if(this.statueReason){
  1099. this.examineTemp.status = 2
  1100. //审核角色
  1101. this.examineTemp.flowCompeleted = "3"
  1102. } else {
  1103. this.examineTemp.status = 0
  1104. this.examineTemp.flowCompeleted = "2"
  1105. }
  1106. this.examineTemp.empid = Cookies.get('employeid')
  1107. var send_data = {
  1108. "common": { "returnmap": "0" },
  1109. "data": [
  1110. // {
  1111. // "name": "editBigoutsourcingEquipment", "type": "e",
  1112. // "parammaps": this.examineTemp
  1113. // },
  1114. {
  1115. "name": "editBigoutsourcingDepartment", "type": "e",
  1116. "parammaps": this.examineTemp
  1117. }
  1118. ]
  1119. }
  1120. console.log(send_data,'审核1保存')
  1121. ExecDataByConfig(send_data).then(response => {
  1122. console.log('审核确认发送参数', send_data)
  1123. if (response.msg !== 'fail') {
  1124. this.get_table_data1()
  1125. this.dialogFormVisible_Examine = false
  1126. this.statueReason = false
  1127. this.$notify({
  1128. title: '成功',
  1129. message: '审核成功',
  1130. type: 'success',
  1131. duration: 2000
  1132. })
  1133. } else {
  1134. failproccess(response, this.$notify)
  1135. }
  1136. })
  1137. }
  1138. })
  1139. },
  1140. form_examine2(row) {
  1141. console.log('点击了场长审核',row)
  1142. this.examineTemp = Object.assign({}, row)
  1143. if (row == undefined) {
  1144. // this.examineTemp = this.createTemp
  1145. this.$set(this.createTemp, 'status', 1)
  1146. this.$set(this.createTemp, 'workflowNote', '')
  1147. } else {
  1148. this.$set(this.examineTemp, 'status', 1)
  1149. this.$set(this.examineTemp, 'workflowNote', '')
  1150. }
  1151. this.dialogStatus = 'examine'
  1152. this.statueReason = false
  1153. this.dialogFormVisible_Examine = true
  1154. // GetDataByName(this.getParmCreateNumber).then(response => {
  1155. // this.$nextTick(() => {
  1156. // console.log('新增单号', response.data.list[0].orderCode)
  1157. // this.examineTemp.acceptanceCode = response.data.list[0].orderCode
  1158. // this.$set(this.examineTemp,'acceptanceCode',response.data.list[0].orderCode)
  1159. // this.$forceUpdate()
  1160. // })
  1161. // })
  1162. },
  1163. add_dialog_saveSave2() {
  1164. console.log(this.examineTemp,'=======contract')
  1165. // this.examineTemp.iscontract =
  1166. //牧场
  1167. var mydata = {
  1168. // acceptanceCode:this.createTemp.acceptanceCode,
  1169. pastureId: this.createTemp.pastureId,
  1170. departmentId: this.createTemp.departmentId,
  1171. applicant:Cookies.get('employeid'),
  1172. outsourcingCode:this.createTemp.outsourcingCode,
  1173. applyType:0,
  1174. date:parseTime(new Date(), '{y}-{m}-{d}'),
  1175. status:1
  1176. }
  1177. if(this.examineTemp.contract == 0){
  1178. mydata.iscontract = 1
  1179. }else{
  1180. mydata.iscontract = 0
  1181. }
  1182. var send_data = {
  1183. "common": { "returnmap": "0" },
  1184. "data": [
  1185. {
  1186. "name": "insertBigacceptance",
  1187. "type": "e",
  1188. "parammaps": mydata
  1189. }
  1190. ]
  1191. }
  1192. ExecDataByConfig(send_data).then(response => {
  1193. console.log('新增保存发送参数', send_data)
  1194. if (response.msg === 'fail') {
  1195. this.$notify({
  1196. title: '保存失败',
  1197. message: response.data,
  1198. type: 'warning',
  1199. duration: 2000
  1200. })
  1201. } else {
  1202. // this.$notify({
  1203. // title: '',
  1204. // message: '保存成功',
  1205. // type: 'success',
  1206. // duration: 2000
  1207. // })
  1208. }
  1209. })
  1210. },
  1211. form_examine_save2() {
  1212. console.log('点击了场长审核', this.examineTemp)
  1213. this.isokDisable = true
  1214. setTimeout(() => {
  1215. this.isokDisable = false
  1216. }, 1000)
  1217. // this.examineTemp.acceptanceCode = this.createTemp.acceptanceCode
  1218. this.$refs['examineTemp'].validate(valid => {
  1219. if (valid) {
  1220. //不通过
  1221. if(this.statueReason){
  1222. this.examineTemp.status = 2
  1223. //审核角色
  1224. this.examineTemp.flowCompeleted = "5"
  1225. } else {
  1226. // //总价大于等于10000 有高级设备工程师审核
  1227. // if(this.examineTemp.isAudit == 1){
  1228. // this.examineTemp.status = 0
  1229. // //总价小于10000 没有高级设备工程师,直接场长审核
  1230. // } else {
  1231. // this.examineTemp.status = 1
  1232. // }
  1233. this.examineTemp.status = 0
  1234. this.examineTemp.flowCompeleted = "4"
  1235. }
  1236. this.examineTemp.empid = Cookies.get('employeid')
  1237. var send_data = {
  1238. "common": { "returnmap": "0" },
  1239. "data": [
  1240. // {
  1241. // "name": "editBigoutsourcingField", "type": "e",
  1242. // "parammaps": this.examineTemp
  1243. // },
  1244. {
  1245. "name": "editBigoutsourcingEquipment", "type": "e",
  1246. "parammaps": this.examineTemp
  1247. }
  1248. ]
  1249. }
  1250. console.log(send_data,'审核2保存')
  1251. ExecDataByConfig(send_data).then(response => {
  1252. console.log('审核确认发送参数', send_data)
  1253. if (response.msg !== 'fail') {
  1254. if(this.examineTemp.status == 1){
  1255. this.add_dialog_saveSave2()
  1256. }
  1257. this.get_table_data1()
  1258. this.dialogFormVisible_Examine = false
  1259. this.statueReason = false
  1260. this.$notify({
  1261. title: '成功',
  1262. message: '审核成功',
  1263. type: 'success',
  1264. duration: 2000
  1265. })
  1266. } else {
  1267. failproccess(response, this.$notify)
  1268. }
  1269. })
  1270. }
  1271. })
  1272. },
  1273. form_examine3(row) {
  1274. console.log('点击了高级工程师 审核',row)
  1275. this.examineTemp = Object.assign({}, row)
  1276. if (row == undefined) {
  1277. //this.examineTemp = this.createTemp
  1278. this.$set(this.createTemp, 'status', 1)
  1279. this.$set(this.createTemp, 'workflowNote', '')
  1280. } else {
  1281. this.$set(this.examineTemp, 'status', 1)
  1282. this.$set(this.examineTemp, 'workflowNote', '')
  1283. }
  1284. this.dialogStatus = 'examine'
  1285. this.dialogFormVisible_Examine = true
  1286. this.statueReason = false
  1287. },
  1288. form_examine_save3() {
  1289. console.log('点击了高级工程师审核',this.examineTemp )
  1290. this.isokDisable = true
  1291. setTimeout(() => {
  1292. this.isokDisable = false
  1293. }, 1000)
  1294. this.$refs['examineTemp'].validate(valid => {
  1295. if (valid) {
  1296. //不通过
  1297. if(this.statueReason){
  1298. this.examineTemp.status = 2
  1299. //审核角色
  1300. this.examineTemp.flowCompeleted = "7"
  1301. } else {
  1302. //总价大于等于10000 有高级设备工程师审核
  1303. if(this.examineTemp.isAudit == 1){
  1304. this.examineTemp.status = 0
  1305. //总价小于10000 没有高级设备工程师,直接场长审核
  1306. } else {
  1307. this.examineTemp.status = 1
  1308. }
  1309. this.examineTemp.flowCompeleted = "6"
  1310. }
  1311. this.examineTemp.empid = Cookies.get('employeid')
  1312. var send_data = {
  1313. "common": { "returnmap": "0" },
  1314. "data": [
  1315. // {
  1316. // "name": "editBigoutsourcingAdvanceddate", "type": "e",
  1317. // "parammaps": this.examineTemp
  1318. // },
  1319. {
  1320. "name": "editBigoutsourcingField", "type": "e",
  1321. "parammaps": this.examineTemp
  1322. }
  1323. ]
  1324. }
  1325. console.log(send_data,'审核3保存',this.examineTemp)
  1326. ExecDataByConfig(send_data).then(response => {
  1327. console.log('审核确认发送参数', send_data)
  1328. if (response.msg !== 'fail') {
  1329. if(this.examineTemp.status == 1){
  1330. this.add_dialog_saveSave2()
  1331. }
  1332. this.get_table_data1()
  1333. this.dialogFormVisible_Examine = false
  1334. this.statueReason = false
  1335. this.$notify({
  1336. title: '成功',
  1337. message: '审核成功',
  1338. type: 'success',
  1339. duration: 2000
  1340. })
  1341. } else {
  1342. failproccess(response, this.$notify)
  1343. }
  1344. })
  1345. }
  1346. })
  1347. },
  1348. form_examine4(row) {
  1349. console.log('点击了高级工程师 审核',row)
  1350. this.examineTemp = Object.assign({}, row)
  1351. if (row == undefined) {
  1352. //this.examineTemp = this.createTemp
  1353. this.$set(this.createTemp, 'status', 1)
  1354. this.$set(this.createTemp, 'workflowNote', '')
  1355. } else {
  1356. this.$set(this.examineTemp, 'status', 1)
  1357. this.$set(this.examineTemp, 'workflowNote', '')
  1358. }
  1359. this.dialogStatus = 'examine'
  1360. this.dialogFormVisible_Examine = true
  1361. this.statueReason = false
  1362. },
  1363. form_examine_save4() {
  1364. console.log('点击了高级工程师审核',this.examineTemp )
  1365. this.isokDisable = true
  1366. setTimeout(() => {
  1367. this.isokDisable = false
  1368. }, 1000)
  1369. this.$refs['examineTemp'].validate(valid => {
  1370. if (valid) {
  1371. //不通过
  1372. if(this.statueReason){
  1373. this.examineTemp.status = 2
  1374. //审核角色
  1375. this.examineTemp.flowCompeleted = "9"
  1376. } else {
  1377. this.examineTemp.status = 1
  1378. this.examineTemp.flowCompeleted = "8"
  1379. }
  1380. this.examineTemp.empid = Cookies.get('employeid')
  1381. var send_data = {
  1382. "common": { "returnmap": "0" },
  1383. "data": [
  1384. // {
  1385. // "name": "editBigoutsourcingAdvanceddate", "type": "e",
  1386. // "parammaps": this.examineTemp
  1387. // },
  1388. {
  1389. "name": "editBigoutsourcingAdvanceddate", "type": "e",
  1390. "parammaps": this.examineTemp
  1391. }
  1392. ]
  1393. }
  1394. console.log(send_data,'审核4保存')
  1395. ExecDataByConfig(send_data).then(response => {
  1396. console.log('审核确认发送参数', send_data)
  1397. if (response.msg !== 'fail') {
  1398. if(this.examineTemp.status == 1){
  1399. this.add_dialog_saveSave2()
  1400. }
  1401. this.get_table_data1()
  1402. this.dialogFormVisible_Examine = false
  1403. this.statueReason = false
  1404. this.$notify({
  1405. title: '成功',
  1406. message: '审核成功',
  1407. type: 'success',
  1408. duration: 2000
  1409. })
  1410. } else {
  1411. failproccess(response, this.$notify)
  1412. }
  1413. })
  1414. }
  1415. })
  1416. },
  1417. }
  1418. }
  1419. </script>
  1420. <style lang="scss" scoped>
  1421. // .content{
  1422. // padding: 20px 20px;
  1423. // .title{
  1424. // text-align: center;
  1425. // font-weight: 700;
  1426. // }
  1427. // .title2{
  1428. // float: left;
  1429. // font-weight: 700;
  1430. // padding: 10px 0;
  1431. // }
  1432. // }
  1433. </style>