index2.vue 75 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700
  1. <template>
  2. <div class="app-container">
  3. <div v-if="isPercentage" class="percentage" style="width: 210px;height: 90px;background: #fff;position: fixed;bottom: 0;left: 0;z-index: 9999999999999;">
  4. <h4 style="padding-left: 10px;line-height: 0;">导出进度:</h4>
  5. <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
  6. </div>
  7. <div class="filter-container">
  8. <el-select v-model="getdataListParm.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item" @change="changePastureName">
  9. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
  10. </el-select>
  11. <el-input v-model="getdataListParm.parammaps.orderNumber" placeholder="申购单号" style="width: 200px;" class="filter-item" />
  12. <el-select v-model="getdataListParm.parammaps.stuteSH" style="width: 140px;" clearable placeholder="审核状态" class="filter-item">
  13. <el-option v-for="item in statues" :key="item.id" :label="item.name" :value="item.id" />
  14. </el-select>
  15. <el-select v-model="getdataListParm.parammaps.departmentId" clearable style="width: 140px;" placeholder="申购部门" class="filter-item">
  16. <el-option v-for="item in findAllDepart" :key="item.id" :label="item.name" :value="item.id" />
  17. </el-select>
  18. <el-input v-model="getdataListParm.parammaps.empName" placeholder="申购人" style="width: 200px;" class="filter-item" />
  19. <!-- <el-select v-model="getdataListParm.parammaps.empName " style="width: 140px;" placeholder="申购人" class="filter-item">
  20. <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
  21. </el-select> -->
  22. <el-date-picker ref="inputDatetime" v-model="getdataListParm.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
  23. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
  24. <div>
  25. <el-button v-if="isSubscribeAdd" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
  26. <el-button v-if="isSubscribeExport" v-waves class="filter-item" type="success" icon="el-icon-upload2" @click="handleDownload">导出</el-button>
  27. <el-radio-group v-model="radioAll" style="margin-top:-9px" @change="changeAll()">
  28. <el-radio-button label="全部" />
  29. <el-badge :value="pending.total" class="item">
  30. <el-radio-button label="待处理" />
  31. </el-badge>
  32. <el-radio-button label="已处理" />
  33. </el-radio-group>
  34. </div>
  35. </div>
  36. <div class="filter-button" />
  37. <el-table
  38. :key="tableKey"
  39. v-loading="listLoading"
  40. element-loading-text="给我一点时间"
  41. :data="list"
  42. border
  43. fit
  44. highlight-current-row
  45. style="width: 100%;"
  46. :row-style="rowStyle"
  47. :cell-style="cellStyle"
  48. class="elTable"
  49. :max-height="myHeight"
  50. >
  51. <el-table-column label="序号" align="center" type="index" width="50px">
  52. <template slot-scope="scope">
  53. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="申购单号" min-width="150px" align="center">
  57. <template slot-scope="scope">
  58. <span>{{ scope.row.orderNumber }}</span>
  59. </template>
  60. </el-table-column>
  61. <el-table-column label="牧场" min-width="90px" align="center">
  62. <template slot-scope="scope">
  63. <span>{{ scope.row.pastureName }}</span>
  64. </template>
  65. </el-table-column>
  66. <el-table-column label="申购部门" min-width="80px" align="center">
  67. <template slot-scope="scope">
  68. <span>{{ scope.row.departmentName }}</span>
  69. </template>
  70. </el-table-column>
  71. <el-table-column label="申购人" min-width="80px" align="center">
  72. <template slot-scope="scope">
  73. <span>{{ scope.row.empname }}</span>
  74. </template>
  75. </el-table-column>
  76. <el-table-column label="申购日期" sortable prop="inputTime" min-width="80px" align="center" />
  77. <el-table-column label="审核状态" min-width="80px" align="center" :formatter="statue" />
  78. <el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width" fixed="right">
  79. <template slot-scope="{row}">
  80. <el-button v-if="isSubscribeSee" type="primary" size="mini" @click="form_see(row)">查看</el-button>
  81. <el-button v-if="row.statue == 4||row.statue == 6||row.statue == 8" style="display:inline-block" type="success" size="mini" @click="form_edit(row)">编辑</el-button>
  82. <el-button v-else style="display:none" type="success" size="mini" @click="form_edit(row)">编辑</el-button>
  83. <!-- 库管 -->
  84. <el-button v-if="isSubscribeExamineKG && row.statue == 2" style="display:inline-block" type="success" size="mini" @click="handleExamine(row)">审核1</el-button>
  85. <el-button v-else style="display:none" type="success" size="mini" @click="handleExamine(row)">审核1</el-button>
  86. <!-- 设备 -->
  87. <el-button v-if="isSubscribeExamineSBZG && row.statue == 3" style="display:inline-block" type="success" size="mini" @click="handleExamine22(row)">审核2</el-button>
  88. <el-button v-else style="display:none" type="success" size="mini" @click="handleExamine22(row)">审核2</el-button>
  89. <!-- 主管 -->
  90. <el-button v-if="isSubscribeExamineZG && row.statue == 9" style="display:inline-block" type="success" size="mini" @click="handleExamine2(row)">审核3</el-button>
  91. <el-button v-else style="display:none" type="success" size="mini" @click="handleExamine2(row)">审核3</el-button>
  92. <!-- 采购 -->
  93. <el-button v-if="isSubscribeExamineCG && row.statue == 5" style="display:inline-block" type="success" size="mini" @click="handleExamine3(row)">审核4</el-button>
  94. <el-button v-else style="display:none" type="success" size="mini" @click="handleExamine3(row)">审核4</el-button>
  95. <el-button v-if="isSubscribeDelete && (row.statue == 4||row.statue == 6||row.statue == 8)" style="display:inline-block" type="danger" size="mini" @click="form_delete(row)">删除</el-button>
  96. <el-button v-else style="display:none" type="danger" size="mini" @click="form_delete(row)">删除</el-button>
  97. </template>
  98. </el-table-column>
  99. </el-table>
  100. <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="get_table_data" />
  101. <!-- 弹出层新增or修改 -->
  102. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="90%">
  103. <div class="app-container">
  104. <el-form
  105. ref="createTemp"
  106. :rules="rules"
  107. :model="createTemp"
  108. label-position="right"
  109. label-width="100px"
  110. style="width: 90%;margin:0 auto;"
  111. >
  112. <el-row>
  113. <el-col :span="8">
  114. <el-form-item label="申购单号:" prop="orderNumber">
  115. <el-input ref="orderNumber" v-model="createTemp.orderNumber" disabled />
  116. </el-form-item>
  117. </el-col>
  118. <el-col :span="8">
  119. <el-form-item label="牧场:" prop="pastureId">
  120. <el-select v-model="createTemp.pastureId" placeholder="牧场" class="filter-item" style="width:100%" :disabled="dialogStatus==='update'" @change="changePasture">
  121. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
  122. </el-select>
  123. </el-form-item>
  124. </el-col>
  125. <el-col :span="8">
  126. <el-form-item label="申购部门:" prop="departmentId">
  127. <el-select v-model="createTemp.departmentId" placeholder="申购部门" class="filter-item" style="width:100%" :disabled="dialogStatus==='update'" @change="changeDepart">
  128. <el-option v-for="item in createDepartList" :key="item.id" :label="item.name" :value="item.id" />
  129. </el-select>
  130. </el-form-item>
  131. </el-col>
  132. </el-row>
  133. <el-row>
  134. <el-col :span="8">
  135. <el-form-item label="申购人:" prop="employeId">
  136. <el-select v-model="createTemp.employeId" placeholder="申购人" class="filter-item" style="width:100%" :disabled="dialogStatus==='update'">
  137. <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
  138. </el-select>
  139. </el-form-item>
  140. </el-col>
  141. <el-col :span="8">
  142. <el-form-item label="申购日期:" prop="createTime">
  143. <el-date-picker v-model="createTemp.createTime" :picker-options="pickerOptions" type="date" placeholder="申购日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='update'" />
  144. </el-form-item>
  145. </el-col>
  146. <el-col v-if="dialogStatus==='create'" :span="8">
  147. <el-form-item label="线上采购:" prop="providerId">
  148. <el-select v-model="createTemp.providerId" placeholder="线上采购" clearable class="filter-item" style="width:100%" @change="changeProvider">
  149. <el-option v-for="item in onlineSubscriptionList" :key="item.id" :label="item.providerName" :value="item.id" />
  150. </el-select>
  151. </el-form-item>
  152. </el-col>
  153. <el-col v-if="dialogStatus==='update'" :span="8">
  154. <el-form-item label="线上采购:" prop="providerName">
  155. <el-input ref="providerName" v-model="createTemp.providerName" disabled />
  156. </el-form-item>
  157. </el-col>
  158. </el-row>
  159. <el-row>
  160. <el-col :span="16">
  161. <el-form-item label="备件:" prop="partCode">
  162. <el-autocomplete
  163. v-model="createTemp.partCode"
  164. value-key="name"
  165. class="inline-input"
  166. :fetch-suggestions="sparePartSearch"
  167. placeholder="请输入备件编号或备件名称或备件规格"
  168. style="width:100%"
  169. @select="handleSelectSparePart"
  170. >
  171. <template slot-scope="{ item }">
  172. <b>备件编号:</b><div class="name" style="display: inline;">{{ item.partCode }}</div>&nbsp;
  173. | &nbsp;<b>备件名称:</b><span class="addr">{{ item.partName }}</span>&nbsp;
  174. | &nbsp;<b>备件规格:</b><span class="addr">{{ item.specification }}</span>
  175. </template>
  176. </el-autocomplete>
  177. </el-form-item>
  178. </el-col>
  179. </el-row>
  180. </el-form>
  181. <el-table
  182. :key="tableKey"
  183. v-loading="listLoading"
  184. element-loading-text="给我一点时间"
  185. :data="listAdd"
  186. border
  187. fit
  188. highlight-current-row
  189. style="width: 100%;margin-bottom:30px"
  190. :row-style="rowStyle"
  191. :cell-style="cellStyle"
  192. class="elTable"
  193. >
  194. <!-- table表格 -->
  195. <el-table-column label="序号" align="center" type="index" width="50px" />
  196. <el-table-column label="备件编号" prop="partCode" align="center" min-width="90">
  197. <template slot-scope="scope">
  198. <span>{{ scope.row.partCode }}</span>
  199. </template>
  200. </el-table-column>
  201. <el-table-column label="备件名称" prop="partName" align="center" min-width="90">
  202. <template slot-scope="scope">
  203. <span>{{ scope.row.partName }}</span>
  204. </template>
  205. </el-table-column>
  206. <el-table-column label="备件规格" prop="specification" min-width="80px" align="center">
  207. <template slot-scope="scope">
  208. <span>{{ scope.row.specification }}</span>
  209. </template>
  210. </el-table-column>
  211. <el-table-column label="备件图片" prop="picpath" min-width="110px" align="center">
  212. <template slot-scope="scope">
  213. <el-popover placement="right" title="" trigger="hover">
  214. <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
  215. <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  216. </el-popover>
  217. </template>
  218. </el-table-column>
  219. <el-table-column label="备件品牌" prop="brand" align="center" min-width="60">
  220. <template slot-scope="scope">
  221. <span v-if="dialogStatus==='create'">{{ scope.row.brandName }}</span>
  222. <span v-if="dialogStatus==='update'">{{ scope.row.brandName }}</span>
  223. </template>
  224. </el-table-column>
  225. <el-table-column label="计量单位" prop="unit" align="center" min-width="60">
  226. <template slot-scope="scope">
  227. <span>{{ scope.row.unit }}</span>
  228. </template>
  229. </el-table-column>
  230. <el-table-column label="现有库存" prop="reportery" align="center" min-width="60">
  231. <template slot-scope="scope">
  232. <span>{{ scope.row.reportery }}</span>
  233. </template>
  234. </el-table-column>
  235. <el-table-column label="价格" prop="price" align="center" min-width="60">
  236. <template slot-scope="scope">
  237. <span v-if="createTemp.providerId == ''">{{ scope.row.price }}</span>
  238. <el-form v-else :model="scope.row" :rules="rules">
  239. <el-form-item prop="price">
  240. <el-input v-model="scope.row.price" style="margin-top:15px" />
  241. </el-form-item>
  242. </el-form>
  243. </template>
  244. </el-table-column>
  245. <el-table-column label="申购数量" min-width="120px" align="center" valign="middle">
  246. <template slot-scope="scope">
  247. <el-form :model="scope.row" :rules="rules">
  248. <el-form-item prop="amount">
  249. <el-input v-model="scope.row.amount" style="margin-top:15px" />
  250. </el-form-item>
  251. </el-form>
  252. </template>
  253. </el-table-column>
  254. <el-table-column label="备注" min-width="110px" align="center" valign="middle">
  255. <template slot-scope="scope">
  256. <el-input v-model="scope.row.purpose" />
  257. </template>
  258. </el-table-column>
  259. <el-table-column
  260. label="操作"
  261. align="center"
  262. width="100"
  263. class-name="small-padding fixed-width"
  264. fixed="right"
  265. >
  266. <template slot-scope="{row}">
  267. <a class="del" @click="partDelete(row)">删除</a>
  268. </template>
  269. </el-table-column>
  270. </el-table>
  271. <div slot="footer" class="dialog-footer" style="bottom:10px">
  272. <el-button type="primary" :disabled="isokDisable" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()">保存并关闭</el-button>
  273. <el-button @click="dialogFormVisible = false;get_table_data()">取消并关闭</el-button>
  274. </div>
  275. </div>
  276. </el-dialog>
  277. <!-- 查看 -->
  278. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisibleSee" :close-on-click-modal="false" width="90%">
  279. <div class="app-containerSee">
  280. <el-form
  281. ref="seeTemp"
  282. :rules="rules"
  283. :model="seeTemp"
  284. label-position="right"
  285. label-width="100px"
  286. style="width: 90%;margin:0 auto;"
  287. >
  288. <el-row>
  289. <el-col :span="8">
  290. <el-form-item label="申购单号:" prop="orderNumber">
  291. <el-input ref="orderNumber" v-model="seeTemp.orderNumber" disabled />
  292. </el-form-item>
  293. </el-col>
  294. <el-col :span="8">
  295. <el-form-item label="牧场:" prop="pastureId">
  296. <el-select v-model="seeTemp.pastureId" placeholder="牧场" class="filter-item" disabled style="width:100%">
  297. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
  298. </el-select>
  299. </el-form-item>
  300. </el-col>
  301. <el-col :span="8">
  302. <el-form-item label="申购部门:" prop="departmentName">
  303. <el-input ref="departmentName" v-model="seeTemp.departmentName" disabled />
  304. </el-form-item>
  305. </el-col>
  306. </el-row>
  307. <el-row>
  308. <el-col :span="8">
  309. <el-form-item label="申购人:" prop="empname">
  310. <el-input ref="empname" v-model="seeTemp.empname" disabled />
  311. </el-form-item>
  312. </el-col>
  313. <el-col :span="8">
  314. <el-form-item label="申购日期:" prop="createTime">
  315. <el-date-picker v-model="seeTemp.createTime" :picker-options="pickerOptions" type="date" placeholder="申购日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" disabled />
  316. </el-form-item>
  317. </el-col>
  318. <el-col :span="8">
  319. <el-form-item label="线上采购:" prop="providerName">
  320. <el-input ref="providerName" v-model="seeTemp.providerName" disabled />
  321. </el-form-item>
  322. </el-col>
  323. </el-row>
  324. </el-form>
  325. <el-table
  326. :key="tableKey"
  327. v-loading="listLoadingSee"
  328. element-loading-text="给我一点时间"
  329. :data="listSee"
  330. border
  331. fit
  332. highlight-current-row
  333. style="width: 100%;margin-bottom:30px"
  334. :row-style="rowStyle"
  335. :cell-style="cellStyle"
  336. class="elTable"
  337. @sort-change="tableSort"
  338. >
  339. <el-table-column type="index" label="序号" align="center" width="50px" />
  340. <el-table-column label="备件编号" prop="partCode" align="center" min-width="90">
  341. <template slot-scope="scope">
  342. <span>{{ scope.row.partCode }}</span>
  343. </template>
  344. </el-table-column>
  345. <el-table-column label="备件名称" prop="partName" align="center" min-width="90">
  346. <template slot-scope="scope">
  347. <span>{{ scope.row.partName }}</span>
  348. </template>
  349. </el-table-column>
  350. <el-table-column label="备件规格" prop="specification" min-width="90px" align="center">
  351. <template slot-scope="scope">
  352. <span>{{ scope.row.specification }}</span>
  353. </template>
  354. </el-table-column>
  355. <el-table-column label="备件图片" prop="picpath" min-width="110px" align="center">
  356. <template slot-scope="scope">
  357. <el-popover placement="right" title="" trigger="hover">
  358. <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
  359. <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  360. </el-popover>
  361. </template>
  362. </el-table-column>
  363. <el-table-column label="备件品牌" prop="brandName" align="center" min-width="60">
  364. <template slot-scope="scope">
  365. <span>{{ scope.row.brandName }}</span>
  366. </template>
  367. </el-table-column>
  368. <el-table-column label="计量单位" prop="unit" align="center" min-width="60">
  369. <template slot-scope="scope">
  370. <span>{{ scope.row.unit }}</span>
  371. </template>
  372. </el-table-column>
  373. <el-table-column label="现有库存" sortable prop="storageAmount" align="center" min-width="60" />
  374. <el-table-column label="价格" sortable prop="price" align="center" min-width="60" />
  375. <el-table-column label="申购数量" sortable prop="amount" align="center" min-width="60" />
  376. <el-table-column label="备注" min-width="110px" align="center">
  377. <template slot-scope="scope">
  378. <span>{{ scope.row.purpose }}</span>
  379. </template>
  380. </el-table-column>
  381. </el-table>
  382. <el-form
  383. ref="seeTemp"
  384. :rules="rules"
  385. :model="seeTemp"
  386. label-position="right"
  387. label-width="100px"
  388. style="width: 90%;margin:0 auto;"
  389. >
  390. <el-row>
  391. <el-col>
  392. <el-form-item label="流程进度" />
  393. <el-steps :active="active" align-center finish-status="success">
  394. <el-step
  395. v-for="(item,index) in activeList"
  396. :key="index"
  397. :title="item.title"
  398. :status="item.status"
  399. >
  400. <template slot="description">
  401. <div class="step-row">
  402. <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
  403. <div>{{ item.reason }}</div>
  404. </div>
  405. </template>
  406. </el-step>
  407. </el-steps>
  408. </el-col>
  409. </el-row>
  410. <el-row>
  411. <el-col>
  412. <el-form-item label="操作:">
  413. <!-- 库管 -->
  414. <el-button v-if="isSubscribeExamineKG && seeTemp.statue == 2" type="success" style="display:inline-block" @click="handleExamine(row)">审核1</el-button>
  415. <el-button v-else type="success" style="display:none" @click="handleExamine(row)">审核1</el-button>
  416. <!-- 设备 -->
  417. <el-button v-if="isSubscribeExamineSBZG && seeTemp.statue == 3" type="success" style="display:inline-block" @click="handleExamine22(row)">审核2</el-button>
  418. <el-button v-else type="success" style="display:none" @click="handleExamine22(row)">审核2</el-button>
  419. <!-- 主管 -->
  420. <el-button v-if="isSubscribeExamineZG && seeTemp.statue == 9" type="success" style="display:inline-block" @click="handleExamine2(row)">审核3</el-button>
  421. <el-button v-else type="success" style="display:none" @click="handleExamine2(row)">审核3</el-button>
  422. <!-- 采购 -->
  423. <el-button v-if="isSubscribeExamineCG && seeTemp.statue == 5" type="success" style="display:inline-block" @click="handleExamine3(row)">审核4</el-button>
  424. <el-button v-else type="success" style="display:none" @click="handleExamine3(row)">审核4</el-button>
  425. </el-form-item>
  426. </el-col>
  427. </el-row>
  428. </el-form>
  429. <div slot="footer" class="dialog-footer" style="bottom:5px;">
  430. <el-button @click="dialogFormVisibleSee = false">关闭</el-button>
  431. </div>
  432. </div>
  433. </el-dialog>
  434. <!-- 审核 -->
  435. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_Examine" :close-on-click-modal="false" width="30%">
  436. <div class="app-examine">
  437. <h3 style="width: 100%;margin:0 0 0 5%;line-height:50px;">请确认审核结果:</h3>
  438. <el-form ref="examineTemp" :rules="rules" :model="examineTemp" label-position="right" style="width: 50%;margin:0 auto;">
  439. <el-row style="width:88%;height:150px;margin:0 auto;">
  440. <el-col :span="20">
  441. <el-form-item>
  442. <el-radio-group v-model="examineTemp.statue" @change="changeStatue">
  443. <el-radio :label="1" checked>通过</el-radio>
  444. <el-radio :label="2">不通过</el-radio>
  445. </el-radio-group>
  446. </el-form-item>
  447. </el-col>
  448. <el-col v-if="statueReason" :span="20">
  449. <el-input v-model="examineTemp.workflowNote" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入不通过原因" />
  450. </el-col>
  451. </el-row>
  452. </el-form>
  453. </div>
  454. <div slot="footer" class="dialog-footer">
  455. <el-button v-if="dialogStatus==='examine'" type="primary" :disabled="isokDisable" @click="createExamineData()">确认</el-button>
  456. <el-button v-if="dialogStatus==='examine22'" type="primary" :disabled="isokDisable" @click="createExamineData22()">确认</el-button>
  457. <el-button v-if="dialogStatus==='examine2'" type="primary" :disabled="isokDisable" @click="createExamineData2()">确认</el-button>
  458. <el-button v-if="dialogStatus==='examine3'" type="primary" :disabled="isokDisable" @click="createExamineData3()">确认</el-button>
  459. <el-button @click="dialogFormVisible_Examine = false;">关闭</el-button>
  460. </div>
  461. </el-dialog>
  462. </div>
  463. </template>
  464. <script>
  465. // / 引入
  466. import { GetDataByName, GetDataByNames, PostDataByName, ExecDataByConfig, checkButtons, failproccess, GetAccount } from '@/api/common'
  467. import waves from '@/directive/waves' // waves directive
  468. import { parseTime, sortChange, json2excel } from '@/utils/index.js'
  469. // eslint-disable-next-line no-unused-vars
  470. import { validateEMail } from '@/utils/validate.js'
  471. import Pagination from '@/components/Pagination' // secondary package based on el-pagination
  472. import { MessageBox } from 'element-ui'
  473. import Cookies from 'js-cookie'
  474. import { getToken } from '@/utils/auth'
  475. export default {
  476. name: 'Subscribe',
  477. components: { Pagination },
  478. directives: { waves },
  479. data() {
  480. return {
  481. myHeight:document.documentElement.clientHeight - 85- 150,
  482. isSubscribeAdd: [], isSubscribeExamineSBZG:[],isSubscribeTemplate: [], isSubscribeImport: [], isSubscribeExport: [], isSubscribeSee: [], isSubscribeDelete: [], isSubscribeExamineKG: [], isSubscribeExamineCG: [], isSubscribeExamineZG: [],
  483. isokDisable: false,
  484. findAllProvider: [],
  485. findAllPasture: [],
  486. findAllDepart: [],
  487. findAllEmploye: [],
  488. onlineSubscriptionList: [], createDepartList: [], edit: 0,
  489. requestParams: [
  490. { name: 'findAllProvider', offset: 0, pagecount: 0, params: [] },
  491. { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
  492. { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
  493. { name: 'getflexProviderList', offset: 0, pagecount: 0, parammaps: {}}
  494. ],
  495. getDepartParam: {
  496. name: 'findAllDepart', offset: 0, pagecount: 0,
  497. parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }
  498. },
  499. pickerOptions: {
  500. disabledDate(time) {
  501. return time.getTime() > Date.now()// 当天之前的时间可选
  502. }
  503. },
  504. textMap: {
  505. update: '编辑',
  506. create: '新增',
  507. see: '查看',
  508. examine: '审核1',
  509. examine22: '审核2',
  510. examine2: '审核3',
  511. examine3: '审核4'
  512. },
  513. rules: {
  514. equipmentName: [{ required: true, message: '必填', trigger: 'blur' }]
  515. },
  516. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  517. cellStyle: { padding: 0 + 'px' },
  518. statues: [{ id: '0', name: '审核中' }, { id: '1', name: '已通过' }, { id: '2', name: '未通过' }],
  519. radioAll: '全部',
  520. getdataListParm: {
  521. name: 'getpartpurchaseList',
  522. page: 1,
  523. offset: 1,
  524. pagecount: 10,
  525. returntype: 'Map',
  526. parammaps: {
  527. pastureName: Cookies.get('pasturename'),
  528. empId: Cookies.get('employeid'),
  529. orderNumber: '',
  530. stuteSH: '',
  531. departmentId: '',
  532. inputDatetime: '',
  533. startTime: '',
  534. stopTime: '',
  535. loginId: Cookies.get('employeid'),
  536. menu: 'Subscribe',
  537. logindeptId: Cookies.get('departmentid'),
  538. loginpastureId: Cookies.get('pastureid')
  539. }
  540. },
  541. tableKey: 0,
  542. listLoading: true,
  543. total: 0,
  544. list: [],
  545. dialogStatus: '',
  546. dialogFormVisible: false,
  547. dialogFormVisibleSee: false,
  548. listLoadingSee: true,
  549. listSee: [],
  550. totalSee: 0,
  551. seeTemp: {},
  552. getdataListSee: {
  553. name: 'getpartpurchaseBybig',
  554. returntype: 'Map',
  555. parammaps: {}
  556. },
  557. createTemp: {
  558. pastureId: this.$store.state.user.pastureid,
  559. departmentId: this.$store.state.user.departmentid,
  560. employeId: this.$store.state.user.employeid,
  561. createTime: parseTime(new Date(), '{y}-{m}-{d}'),
  562. providerId: ''
  563. },
  564. requestSparePart: {
  565. name: 'getPartsListSG',
  566. page: 1,
  567. offset: 1,
  568. pagecount: 20,
  569. returntype: 'Map',
  570. parammaps: {
  571. pastureId: Cookies.get('pastureid')
  572. }
  573. },
  574. getParmCreateNumber: {
  575. name: 'autoCreatCode',
  576. page: 0,
  577. offset: 0,
  578. pagecount: 0,
  579. returntype: 'Map',
  580. parammaps: {
  581. pastureId: Cookies.get('pastureid'),
  582. codeType: 'SG'
  583. }
  584. },
  585. getParmCreateAmount: {
  586. name: 'getPartsListSGv2',
  587. page: 0,
  588. offset: 0,
  589. pagecount: 0,
  590. returntype: 'Map',
  591. parammaps: {
  592. pastureId: Cookies.get('pastureid')
  593. }
  594. },
  595. listAdd: [],
  596. postDataPramas: {},
  597. requestParam: {},
  598. dialogFormVisible_Examine: false,
  599. examineTemp: {
  600. statue: 1
  601. },
  602. statueReason: false,
  603. activeList: [],
  604. active: 3,
  605. buttons: [],
  606. downloadParam: {},
  607. isPercentage: false,
  608. percentage: 1,
  609. pending: {
  610. total: 0,
  611. getdataListParm: {
  612. name: 'getpartpurchaseWebListNO', page: 1, offset: 1, getTotal: 'total3', pagecount: 10, returntype: 'Map',
  613. parammaps: {
  614. loginId: Cookies.get('employeid'),
  615. menu: 'Subscribe', logindeptId: Cookies.get('departmentid'), loginpastureId: Cookies.get('pastureid'),
  616. empId: Cookies.get('employeid'), pastureId: Cookies.get('pastureid'), deptId: Cookies.get('departmentid')
  617. }
  618. }
  619. }
  620. }
  621. },
  622. created() {
  623. const that = this
  624. GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
  625. that.buttons = response.data.list
  626. that.get_auto_buttons()
  627. })
  628. this.get_select_list()
  629. this.get_table_data()
  630. this.getPendingList()
  631. },
  632. methods: {
  633. tableSort(column) {
  634. sortChange(column, this.listSee)
  635. },
  636. get_auto_buttons() {
  637. // 新增
  638. const SubscribeAdd = 'customs:subscribe:add'
  639. const isSubscribeAdd = checkButtons(this.$store.state.user.buttons, SubscribeAdd)
  640. this.isSubscribeAdd = isSubscribeAdd
  641. // 模板
  642. // eslint-disable-next-line no-redeclare
  643. const SubscribeTemplate = 'customs:subscribe:template'
  644. const isSubscribeTemplate = checkButtons(this.$store.state.user.buttons, SubscribeTemplate)
  645. this.isSubscribeTemplate = isSubscribeTemplate
  646. // 导入
  647. // eslint-disable-next-line no-redeclare
  648. const SubscribeImport = 'customs:subscribe:import'
  649. const isSubscribeImport = checkButtons(this.$store.state.user.buttons, SubscribeImport)
  650. this.isSubscribeImport = isSubscribeImport
  651. // 导出
  652. // eslint-disable-next-line no-redeclare
  653. const SubscribeExport = 'customs:subscribe:export'
  654. const isSubscribeExport = checkButtons(this.$store.state.user.buttons, SubscribeExport)
  655. this.isSubscribeExport = isSubscribeExport
  656. // 查看
  657. // eslint-disable-next-line no-redeclare
  658. const SubscribeSee = 'customs:subscribe:see'
  659. const isSubscribeSee = checkButtons(this.$store.state.user.buttons, SubscribeSee)
  660. this.isSubscribeSee = isSubscribeSee
  661. // 删除
  662. // eslint-disable-next-line no-redeclare
  663. const SubscribeDelete = 'customs:subscribe:delete'
  664. const isSubscribeDelete = checkButtons(this.$store.state.user.buttons, SubscribeDelete)
  665. this.isSubscribeDelete = isSubscribeDelete
  666. // 库管审核
  667. // eslint-disable-next-line no-redeclare
  668. const SubscribeExamineKG = 'customs:subscribe:examineKG'
  669. const isSubscribeExamineKG = checkButtons(this.$store.state.user.buttons, SubscribeExamineKG)
  670. this.isSubscribeExamineKG = isSubscribeExamineKG
  671. // 设备主管审核
  672. const SubscribeExamineSBZG = 'customs:subscribe:examineSBZG'
  673. const isSubscribeExamineSBZG = checkButtons(this.$store.state.user.buttons, SubscribeExamineSBZG)
  674. this.isSubscribeExamineSBZG = isSubscribeExamineSBZG
  675. // 主管审核
  676. // eslint-disable-next-line no-redeclare
  677. const SubscribeExamineZG = 'customs:subscribe:examineZG'
  678. const isSubscribeExamineZG = checkButtons(this.$store.state.user.buttons, SubscribeExamineZG)
  679. this.isSubscribeExamineZG = isSubscribeExamineZG
  680. // 采购审核
  681. // eslint-disable-next-line no-redeclare
  682. const SubscribeExamineCG = 'customs:subscribe:examineCG'
  683. const isSubscribeExamineCG = checkButtons(this.$store.state.user.buttons, SubscribeExamineCG)
  684. this.isSubscribeExamineCG = isSubscribeExamineCG
  685. },
  686. getPendingList() {
  687. this.pending.getdataListParm.parammaps.pastureName = this.getdataListParm.parammaps.pastureName
  688. this.pending.getdataListParm.parammaps.orderNumber = this.getdataListParm.parammaps.orderNumber
  689. this.pending.getdataListParm.parammaps.stuteSH = this.getdataListParm.parammaps.stuteSH
  690. this.pending.getdataListParm.parammaps.departmentId = this.getdataListParm.parammaps.departmentId
  691. this.pending.getdataListParm.parammaps.inputDatetime = this.getdataListParm.parammaps.inputDatetime
  692. this.pending.getdataListParm.parammaps.loginId = this.getdataListParm.parammaps.loginId
  693. this.pending.getdataListParm.parammaps.menu = this.getdataListParm.parammaps.menu
  694. this.pending.getdataListParm.parammaps.logindeptId = this.getdataListParm.parammaps.logindeptId
  695. this.pending.getdataListParm.parammaps.loginpastureId = this.getdataListParm.parammaps.loginpastureId
  696. this.pending.getdataListParm.parammaps.empId = this.getdataListParm.parammaps.empId
  697. this.pending.getdataListParm.parammaps.pastureId = Cookies.get('pastureid')
  698. this.pending.getdataListParm.parammaps.deptId = Cookies.get('departmentid')
  699. GetDataByName(this.pending.getdataListParm).then(response => {
  700. this.pending.total = response.data.total3
  701. })
  702. },
  703. get_table_data() {
  704. this.listLoading = true
  705. if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
  706. this.getdataListParm.parammaps.startTime = this.$refs['inputDatetime'].value[0]
  707. this.getdataListParm.parammaps.stopTime = this.$refs['inputDatetime'].value[1]
  708. } else {
  709. this.getdataListParm.parammaps.startTime = ''
  710. this.getdataListParm.parammaps.stopTime = ''
  711. }
  712. GetDataByName(this.getdataListParm).then(response => {
  713. if (response.data.list !== null) {
  714. console.log('table数据', response.data.list)
  715. this.list = response.data.list
  716. this.pageNum = response.data.pageNum
  717. this.pageSize = response.data.pageSize
  718. } else {
  719. this.list = []
  720. }
  721. this.total = response.data.total
  722. setTimeout(() => {
  723. this.listLoading = false
  724. }, 100)
  725. })
  726. },
  727. changeAll() {
  728. console.log(this.radioAll)
  729. if (this.radioAll === '全部') {
  730. this.getdataListParm.name = 'getpartpurchaseList'
  731. this.getdataListParm.offset = 1
  732. this.getdataListParm.parammaps = {
  733. pastureName: Cookies.get('pasturename'),
  734. orderNumber: '',
  735. departmentId: '',
  736. inputDatetime: '',
  737. startTime: '',
  738. stopTime: '',
  739. loginId: Cookies.get('employeid'),
  740. menu: 'Subscribe',
  741. logindeptId: Cookies.get('departmentid'),
  742. loginpastureId: Cookies.get('pastureid')
  743. }
  744. this.get_table_data()
  745. } else if (this.radioAll === '待处理') {
  746. this.getdataListParm.name = 'getpartpurchaseWebListNO'
  747. this.getdataListParm.offset = 1
  748. this.getdataListParm.parammaps = {
  749. pastureName: this.getdataListParm.parammaps.pastureName,
  750. orderNumber: this.getdataListParm.parammaps.orderNumber,
  751. stuteSH: this.getdataListParm.parammaps.stuteSH,
  752. departmentId: this.getdataListParm.parammaps.departmentId,
  753. inputDatetime: this.getdataListParm.parammaps.inputDatetime,
  754. startTime: this.getdataListParm.parammaps.startTime,
  755. stopTime: this.getdataListParm.parammaps.stopTime,
  756. loginId: Cookies.get('employeid'),
  757. menu: 'Subscribe',
  758. logindeptId: Cookies.get('departmentid'),
  759. loginpastureId: Cookies.get('pastureid'),
  760. empId: Cookies.get('employeid'),
  761. pastureId: Cookies.get('pastureid'),
  762. deptId: Cookies.get('departmentid')
  763. }
  764. this.get_table_data()
  765. } else if (this.radioAll === '已处理') {
  766. this.getdataListParm.name = 'getpartpurchaseWebList'
  767. this.getdataListParm.offset = 1
  768. this.getdataListParm.parammaps = {
  769. pastureName: this.getdataListParm.parammaps.pastureName,
  770. orderNumber: this.getdataListParm.parammaps.orderNumber,
  771. stuteSH: this.getdataListParm.parammaps.stuteSH,
  772. departmentId: this.getdataListParm.parammaps.departmentId,
  773. inputDatetime: this.getdataListParm.parammaps.inputDatetime,
  774. startTime: this.getdataListParm.parammaps.startTime,
  775. stopTime: this.getdataListParm.parammaps.stopTime,
  776. loginId: Cookies.get('employeid'),
  777. menu: 'Subscribe',
  778. logindeptId: Cookies.get('departmentid'),
  779. loginpastureId: Cookies.get('pastureid'),
  780. empId: Cookies.get('employeid'),
  781. pastureId: Cookies.get('pastureid'),
  782. deptId: Cookies.get('departmentid')
  783. }
  784. this.get_table_data()
  785. }
  786. },
  787. statue: function(cellValue) {
  788. // console.log(cellValue.isZeroStock)
  789. if (cellValue.statue == 2) {
  790. return '审核中'
  791. } else if (cellValue.statue == 3) {
  792. return '审核中'
  793. } else if (cellValue.statue == 4) {
  794. return '未通过'
  795. } else if (cellValue.statue == 5) {
  796. return '审核中'
  797. } else if (cellValue.statue == 6) {
  798. return '未通过'
  799. } else if (cellValue.statue == 7) {
  800. return '已通过'
  801. } else if (cellValue.statue == 8) {
  802. return '未通过'
  803. } else if (cellValue.statue == 9) {
  804. return '审核中'
  805. } else if (cellValue.statue == 10) {
  806. return '未通过'
  807. }
  808. },
  809. form_search() {
  810. console.log('点击了table搜索')
  811. if (this.getdataListParm.parammaps.inputDatetime === null) {
  812. this.getdataListParm.parammaps.inputDatetime = ''
  813. }
  814. this.getdataListParm.offset = 1
  815. this.listLoading = true
  816. this.get_table_data()
  817. this.getPendingList()
  818. },
  819. resetCreateTemp() {
  820. this.createTemp.pastureId = parseInt(Cookies.get('pastureid'))
  821. this.createTemp.departmentId = parseInt(Cookies.get('departmentid'))
  822. this.createTemp.employeId = parseInt(Cookies.get('employeid'))
  823. this.createTemp.createTime = parseTime(new Date(), '{y}-{m}-{d}')
  824. this.createTemp.orderNumber = ''
  825. this.createTemp.providerId = ''
  826. this.listAdd = []
  827. },
  828. form_add() {
  829. this.resetCreateTemp()
  830. this.edit = 1
  831. this.getDepartParam.parammaps.pastureId = this.createTemp.pastureId
  832. this.getCreateDepartDownList()
  833. this.dialogStatus = 'create'
  834. this.dialogFormVisible = true
  835. this.$nextTick(() => {
  836. this.$refs['createTemp'].clearValidate()
  837. })
  838. this.getCreateNumber()
  839. },
  840. getCreateNumber() {
  841. GetDataByName(this.getParmCreateNumber).then(response => {
  842. this.$nextTick(() => {
  843. console.log('新增申购单号', response.data.list[0].orderCode)
  844. this.createTemp.orderNumber = response.data.list[0].orderCode
  845. this.$forceUpdate()
  846. })
  847. })
  848. },
  849. // getPartsListSG
  850. changeProvider(item) {
  851. if (item !== '') {
  852. this.createTemp.providerName = this.onlineSubscriptionList.find(obj => obj.id == item).providerName
  853. }
  854. this.listAdd = []
  855. },
  856. sparePartSearch(queryString, cb) {
  857. console.log('备件模糊查询输入值', queryString)
  858. if (this.createTemp.providerId == '') {
  859. this.requestSparePart.name = 'getPartsListSG'
  860. } else {
  861. this.requestSparePart.name = 'getPartsListSGFlex'
  862. this.requestSparePart.parammaps.providerId = this.createTemp.providerId
  863. this.requestSparePart.parammaps.providerName = this.createTemp.providerName
  864. }
  865. this.requestSparePart.parammaps['partCode'] = queryString
  866. GetDataByName(this.requestSparePart).then(response => {
  867. console.log('备件模糊查询搜索data', response.data.list)
  868. if (response.data.list == null) {
  869. cb([])
  870. } else {
  871. cb(response.data.list)
  872. }
  873. })
  874. },
  875. handleSelectSparePart(item) {
  876. console.log('备件模糊查询选中值', item)
  877. console.log('备件模糊查询选中值', item.partId)
  878. console.log(this.listAdd)
  879. if (this.createTemp.providerId == '') {
  880. if (this.listAdd.length > 0) {
  881. // eslint-disable-next-line no-redeclare
  882. if (this.listAdd.find(obj => obj.partId == item.partId)) {
  883. this.$message({ type: 'warning', message: '此备件已存在,请重新选择备件' })
  884. } else {
  885. // this.getParmCreateAmount.parammaps.partCode = item.partCode
  886. // GetDataByName(this.getParmCreateAmount).then(response => {
  887. // this.$nextTick(() => {
  888. // console.log('新增根据编号获取备件库存数量', response.data.list[0].reporteryNum)
  889. // item.reportery = response.data.list[0].reporteryNum
  890. // if (item.srcpath !== null && item.picpath) {
  891. // this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  892. // this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  893. // } else {
  894. // item.srcpath = ''
  895. // item.picpath = ''
  896. // }
  897. // this.listAdd.unshift(item)
  898. // this.$forceUpdate()
  899. // })
  900. // })
  901. this.getParmCreateAmount.parammaps.partCode = item.partCode
  902. GetDataByName(this.getParmCreateAmount).then(response => {
  903. this.$nextTick(() => {
  904. console.log('新增根据编号获取备件库存数量', response.data.list[0])
  905. item = response.data.list[0]
  906. if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  907. this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  908. this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  909. } else {
  910. item.srcpath = ''
  911. item.picpath = ''
  912. }
  913. this.$set(item, 'amount', '')
  914. this.$set(item, 'purpose', '')
  915. this.listAdd.unshift(item)
  916. this.$forceUpdate()
  917. })
  918. })
  919. }
  920. } else {
  921. // this.getParmCreateAmount.parammaps.partCode = item.partCode
  922. // GetDataByName(this.getParmCreateAmount).then(response => {
  923. // this.$nextTick(() => {
  924. // console.log('新增根据编号获取备件库存数量', response.data.list[0].reporteryNum)
  925. // item.reportery = response.data.list[0].reporteryNum
  926. // if (item.srcpath !== null && item.picpath) {
  927. // this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  928. // this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  929. // } else {
  930. // item.srcpath = ''
  931. // item.picpath = ''
  932. // }
  933. // this.listAdd.unshift(item)
  934. // this.$forceUpdate()
  935. // })
  936. // })
  937. this.getParmCreateAmount.parammaps.partCode = item.partCode
  938. GetDataByName(this.getParmCreateAmount).then(response => {
  939. this.$nextTick(() => {
  940. console.log('新增根据编号获取备件库存数量', response.data.list[0])
  941. item = response.data.list[0]
  942. if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  943. this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  944. this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  945. } else {
  946. item.srcpath = ''
  947. item.picpath = ''
  948. }
  949. this.$set(item, 'amount', '')
  950. this.$set(item, 'purpose', '')
  951. this.listAdd.unshift(item)
  952. this.$forceUpdate()
  953. })
  954. })
  955. }
  956. this.$forceUpdate()
  957. } else {
  958. if (this.listAdd.length > 0) {
  959. if (this.listAdd.find(obj => obj.partId == item.partId)) {
  960. this.$message({ type: 'warning', message: '此备件已存在,请重新选择备件' })
  961. } else {
  962. if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  963. this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  964. this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  965. } else {
  966. item.srcpath = ''
  967. item.picpath = ''
  968. }
  969. this.$set(item, 'amount', '')
  970. this.$set(item, 'purpose', '')
  971. this.listAdd.unshift(item)
  972. }
  973. } else {
  974. if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  975. this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  976. this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  977. } else {
  978. item.srcpath = ''
  979. item.picpath = ''
  980. }
  981. this.$set(item, 'amount', '')
  982. this.$set(item, 'purpose', '')
  983. this.listAdd.unshift(item)
  984. this.$forceUpdate()
  985. }
  986. this.$forceUpdate()
  987. }
  988. },
  989. add_dialog_save() {
  990. this.isokDisable = true
  991. setTimeout(() => {
  992. this.isokDisable = false
  993. }, 1000)
  994. this.$refs['createTemp'].validate(valid => {
  995. if (valid) {
  996. console.log(this.listAdd)
  997. if (this.createTemp.orderNumber == '' || this.createTemp.orderNumber == null || this.createTemp.orderNumber == undefined) {
  998. GetDataByName(this.getParmCreateNumber).then(response => {
  999. this.$nextTick(() => {
  1000. console.log('新增申购单号', response.data.list[0].orderCode)
  1001. this.createTemp.orderNumber = response.data.list[0].orderCode
  1002. this.$forceUpdate()
  1003. this.add_dialog_saveSave()
  1004. })
  1005. })
  1006. } else {
  1007. this.add_dialog_saveSave()
  1008. }
  1009. }
  1010. })
  1011. },
  1012. add_dialog_saveSave() {
  1013. if (this.listAdd.length !== 0) {
  1014. for (var j = 0; j < this.listAdd.length; j++) {
  1015. console.log(this.listAdd[j].amount)
  1016. if (this.listAdd[j].amount == null || this.listAdd[j].amount === '') {
  1017. this.$message({ type: 'warning', message: '请检查申购数量是否未填写', duration: 2000 })
  1018. return false
  1019. } else {
  1020. var rulesAmount = /^[1-9]\d*$/
  1021. if (!rulesAmount.test(this.listAdd[j].amount)) {
  1022. this.$message({ type: 'error', message: '申购数量请输入正整数', duration: 2000 })
  1023. return false
  1024. }
  1025. }
  1026. if (this.createTemp.providerId !== '') {
  1027. if (this.listAdd[j].price == '') {
  1028. this.$message({ type: 'warning', message: '请检查单价是否为空', duration: 2000 })
  1029. return false
  1030. } else {
  1031. if (parseFloat(this.listAdd[j].price) == 0) {
  1032. this.$message({ type: 'warning', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
  1033. return false
  1034. } else {
  1035. var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,5})?$/
  1036. if (rulesPrice.test(this.listAdd[j].price) == false) {
  1037. this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
  1038. return false
  1039. }
  1040. }
  1041. }
  1042. }
  1043. }
  1044. this.postDataPramas.common = { 'returnmap': '0' }
  1045. this.postDataPramas.data = []
  1046. this.postDataPramas.data[0] = { 'name': 'insertBigPartpurchase', 'type': 'e', 'parammaps': {
  1047. pastureId: this.createTemp.pastureId,
  1048. departmentId: this.createTemp.departmentId,
  1049. orderNumber: this.createTemp.orderNumber,
  1050. useType: this.createTemp.useType,
  1051. createTime: this.createTemp.createTime,
  1052. employeId: this.createTemp.employeId,
  1053. providerId: this.createTemp.providerId
  1054. }}
  1055. // eslint-disable-next-line no-irregular-whitespace
  1056. this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
  1057. this.postDataPramas.data[1].children = []
  1058. this.postDataPramas.data[1].children[0] = { 'name': 'insertPartpurchase', 'type': 'e', 'parammaps': {
  1059. bigId: '@insertBigPartpurchase.LastInsertId',
  1060. pastureId: '@insertSpotList.pastureId',
  1061. partId: '@insertSpotList.partId',
  1062. partCode: '@insertSpotList.partCode',
  1063. partName: '@insertSpotList.partName',
  1064. specification: '@insertSpotList.specification',
  1065. unit: '@insertSpotList.unit',
  1066. brandId: '@insertSpotList.brandId',
  1067. storageAmount: '@insertSpotList.reportery',
  1068. purpose: '@insertSpotList.purpose',
  1069. amount: '@insertSpotList.amount',
  1070. price: '@insertSpotList.price',
  1071. contractId: '@insertSpotList.contractId'
  1072. }}
  1073. ExecDataByConfig(this.postDataPramas).then(response => {
  1074. console.log('新增保存发送参数', this.postDataPramas)
  1075. if (response.msg === 'fail') {
  1076. this.$notify({
  1077. title: '保存失败',
  1078. message: response.data,
  1079. type: 'warning',
  1080. duration: 2000
  1081. })
  1082. } else {
  1083. this.dialogFormVisible = false
  1084. this.getdataListParm.parammaps.inputDatetime = ''
  1085. this.get_table_data()
  1086. this.getPendingList()
  1087. this.$notify({
  1088. title: '',
  1089. message: '保存成功',
  1090. type: 'success',
  1091. duration: 2000
  1092. })
  1093. }
  1094. })
  1095. return true
  1096. } else {
  1097. this.$message({
  1098. title: '',
  1099. message: '请选择备件',
  1100. type: 'warning',
  1101. duration: 2000
  1102. })
  1103. return false
  1104. }
  1105. },
  1106. partDelete(row) {
  1107. console.log(this.listAdd)
  1108. MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
  1109. confirmButtonText: '确认',
  1110. cancelButtonText: '取消',
  1111. type: 'warning'
  1112. }).then(() => {
  1113. // console.log(this.list2)
  1114. for (var i = 0; i < this.listAdd.length; i++) {
  1115. console.log(this.listAdd[i])
  1116. if (this.listAdd[i].id === row.id) {
  1117. var listAddIndex = this.listAdd.indexOf(this.listAdd[i])
  1118. }
  1119. if (listAddIndex > -1) {
  1120. this.listAdd.splice(listAddIndex, 1)
  1121. return
  1122. }
  1123. }
  1124. })
  1125. },
  1126. // 查看
  1127. form_see(row) {
  1128. this.dialogStatus = 'see'
  1129. this.dialogFormVisibleSee = true
  1130. this.seeTemp = Object.assign({}, row)
  1131. console.log('查看上方数据(从table读取)', this.seeTemp)
  1132. this.listSee = []
  1133. this.getdataListSee.parammaps.id = this.seeTemp.id
  1134. this.getSeeList()
  1135. // 流程图
  1136. var reason = '未通过原因:' + this.seeTemp.workflowNote
  1137. if (this.seeTemp.statue === 2) {
  1138. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核' },{ title: '设备主管审核' }, { title: '供应主管审核' }, { title: '采购审核' }]
  1139. this.active = 1
  1140. } else if (this.seeTemp.statue === 3) {
  1141. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson },{ title: '设备主管审核' }, { title: '供应主管审核' }, { title: '采购审核' }]
  1142. this.active = 2
  1143. } else if (this.seeTemp.statue === 4) {
  1144. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson, status: 'error', reason: reason },{ title: '设备主管审核' }, { title: '供应主管审核' }, { title: '采购审核' }]
  1145. this.active = 2
  1146. } else if (this.seeTemp.statue === 9) {
  1147. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson },{ title: '供应主管审核' }, { title: '采购审核' }]
  1148. this.active = 3
  1149. } else if (this.seeTemp.statue === 10) {
  1150. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson, status: 'error', reason: reason }, { title: '供应主管审核' }, { title: '采购审核' }]
  1151. this.active = 3
  1152. } else if (this.seeTemp.statue === 5) {
  1153. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '采购审核' }]
  1154. this.active = 4
  1155. } else if (this.seeTemp.statue === 6) {
  1156. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson, status: 'error', reason: reason }, { title: '采购审核' }]
  1157. this.active = 4
  1158. } else if (this.seeTemp.statue === 7) {
  1159. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '采购审核', date: this.seeTemp.CGChargedate, name: this.seeTemp.CGChargePerson }]
  1160. this.active = 5
  1161. } else if (this.seeTemp.statue === 8) {
  1162. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '采购审核', date: this.seeTemp.CGChargedate, name: this.seeTemp.CGChargePerson, status: 'error', reason: reason }]
  1163. this.active = 5
  1164. }
  1165. },
  1166. getSeeList() {
  1167. GetDataByName(this.getdataListSee).then(response => {
  1168. if (response.data.list !== null) {
  1169. console.log('查看下方table数据', response.data.list)
  1170. this.listSee = response.data.list
  1171. this.listAdd = response.data.list
  1172. for (let i = 0; i < response.data.list.length; i++) {
  1173. if (response.data.list[i].srcpath !== null && response.data.list[i].picpath !== null && response.data.list[i].srcpath !== undefined && response.data.list[i].picpath !== undefined) {
  1174. console.log(process.env.VUE_APP_BASE_API + response.data.list[i].srcpath, '=======1')
  1175. this.listSee[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  1176. this.listSee[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  1177. this.listAdd[i].srcpath = this.listSee[i].srcpath
  1178. this.listAdd[i].picpath = this.listSee[i].picpath
  1179. // this.seeTemp.providerName = response.data.list.providerName
  1180. this.pageNumSee = response.data.pageNum
  1181. this.pageSizeSee = response.data.pageSize
  1182. } else {
  1183. this.listSee[i].srcpath = ''
  1184. this.listSee[i].picpath = ''
  1185. this.listAdd[i].srcpath = ''
  1186. this.listAdd[i].picpath = ''
  1187. }
  1188. console.log(process.env.VUE_APP_BASE_API)
  1189. console.log(this.listSee, '============')
  1190. }
  1191. }
  1192. if (response.data.total) {
  1193. this.totalSee = response.data.total
  1194. }
  1195. setTimeout(() => {
  1196. this.listLoadingSee = false
  1197. }, 100)
  1198. })
  1199. },
  1200. form_edit(row) {
  1201. this.edit = 0
  1202. this.getDepartParam.parammaps.pastureId = row.pastureId
  1203. this.getCreateDepartDownList()
  1204. if (row.providerId == undefined) {
  1205. row.providerId = ''
  1206. row.providerName = ''
  1207. }
  1208. this.createTemp = Object.assign({}, row) // copy obj
  1209. this.dialogStatus = 'update'
  1210. this.dialogFormVisible = true
  1211. this.$nextTick(() => {
  1212. this.$refs['createTemp'].clearValidate()
  1213. })
  1214. this.getdataListSee.parammaps.id = this.createTemp.id
  1215. this.getSeeList()
  1216. },
  1217. edit_dialog_save() {
  1218. this.isokDisable = true
  1219. setTimeout(() => {
  1220. this.isokDisable = false
  1221. }, 1000)
  1222. this.$refs['createTemp'].validate(valid => {
  1223. if (valid) {
  1224. this.edit_dialog_saveSave()
  1225. }
  1226. })
  1227. },
  1228. edit_dialog_saveSave() {
  1229. if (this.listAdd.length !== 0) {
  1230. for (var j = 0; j < this.listAdd.length; j++) {
  1231. console.log(this.listAdd[j].amount)
  1232. // eslint-disable-next-line use-isnan
  1233. if (this.listAdd[j].amount == null || this.listAdd[j].amount === '') {
  1234. this.$message({ type: 'warning', message: '请检查申购数量是否未填写', duration: 2000 })
  1235. return false
  1236. } else {
  1237. var rulesAmount = /^[1-9]\d*$/
  1238. if (!rulesAmount.test(this.listAdd[j].amount)) {
  1239. this.$message({ type: 'error', message: '申购数量请输入正整数', duration: 2000 })
  1240. return false
  1241. }
  1242. }
  1243. if (this.createTemp.providerId !== '') {
  1244. if (this.listAdd[j].price == '') {
  1245. this.$message({ type: 'warning', message: '请检查单价是否为空', duration: 2000 })
  1246. return false
  1247. } else {
  1248. if (parseFloat(this.listAdd[j].price) == 0) {
  1249. this.$message({ type: 'warning', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
  1250. return false
  1251. } else {
  1252. var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,5})?$/
  1253. if (rulesPrice.test(this.listAdd[j].price) == false) {
  1254. this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
  1255. return false
  1256. }
  1257. }
  1258. }
  1259. }
  1260. }
  1261. this.postDataPramas.common = { 'returnmap': '0' }
  1262. this.postDataPramas.data = []
  1263. this.postDataPramas.data[0] = { 'name': 'updatepartpurchaseCharge', 'type': 'e', 'parammaps': {
  1264. id: this.createTemp.id
  1265. }}
  1266. this.postDataPramas.data[1] = { 'name': 'deletePartpurchase', 'type': 'e', 'parammaps': {
  1267. bigId: this.createTemp.id
  1268. }}
  1269. // eslint-disable-next-line no-irregular-whitespace
  1270. this.postDataPramas.data[2] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
  1271. this.postDataPramas.data[2].children = []
  1272. this.postDataPramas.data[2].children[0] = { 'name': 'insertPartpurchase', 'type': 'e', 'parammaps': {
  1273. bigId: this.createTemp.id,
  1274. pastureId: '@insertSpotList.pastureId',
  1275. partId: '@insertSpotList.partId',
  1276. partCode: '@insertSpotList.partCode',
  1277. partName: '@insertSpotList.partName',
  1278. specification: '@insertSpotList.specification',
  1279. unit: '@insertSpotList.unit',
  1280. brandId: '@insertSpotList.brandId',
  1281. storageAmount: '@insertSpotList.reportery',
  1282. purpose: '@insertSpotList.purpose',
  1283. amount: '@insertSpotList.amount',
  1284. price: '@insertSpotList.price',
  1285. contractId: '@insertSpotList.contractId'
  1286. }}
  1287. ExecDataByConfig(this.postDataPramas).then(response => {
  1288. console.log('新增保存发送参数', this.postDataPramas)
  1289. if (response.msg === 'fail') {
  1290. this.$notify({
  1291. title: '保存失败',
  1292. message: response.data,
  1293. type: 'warning',
  1294. duration: 2000
  1295. })
  1296. } else {
  1297. this.dialogFormVisible = false
  1298. this.getdataListParm.parammaps.inputDatetime = ''
  1299. this.get_table_data()
  1300. this.$notify({
  1301. title: '',
  1302. message: '保存成功',
  1303. type: 'success',
  1304. duration: 2000
  1305. })
  1306. }
  1307. })
  1308. return true
  1309. } else {
  1310. this.$message({
  1311. title: '',
  1312. message: '请选择备件',
  1313. type: 'warning',
  1314. duration: 2000
  1315. })
  1316. return false
  1317. }
  1318. },
  1319. get_select_list() {
  1320. GetDataByNames(this.requestParams).then(response => {
  1321. this.findAllProvider = response.data.findAllProvider.list
  1322. this.findAllPasture = response.data.findAllPasture.list
  1323. this.findAllEmploye = response.data.findAllEmploye.list
  1324. this.onlineSubscriptionList = response.data.getflexProviderList.list
  1325. this.getDepartDownList()
  1326. })
  1327. },
  1328. getDepartDownList() {
  1329. GetDataByName(this.getDepartParam).then(response => {
  1330. this.findAllDepart = response.data.list
  1331. })
  1332. },
  1333. changePastureName(item) {
  1334. this.getDepartParam.parammaps.pastureId = this.findAllPasture.find(obj => obj.name == item).id
  1335. this.getdataListParm.parammaps.departmentId = ''
  1336. this.getDepartDownList()
  1337. },
  1338. getCreateDepartDownList() {
  1339. GetDataByName(this.getDepartParam).then(response => {
  1340. this.createDepartList = response.data.list
  1341. if (this.edit == 1) {
  1342. if (this.createDepartList.find(obj => obj.id == Cookies.get('departmentid'))) {
  1343. this.createTemp.departmentId = parseInt(Cookies.get('departmentid'))
  1344. this.createTemp.departmentName = this.createDepartList.find(obj => obj.id == Cookies.get('departmentid')).name
  1345. } else {
  1346. this.createTemp.departmentId = response.data.list[0].id
  1347. this.createTemp.departmentName = response.data.list[0].name
  1348. }
  1349. }
  1350. })
  1351. },
  1352. changePasture(item) {
  1353. this.getDepartParam.parammaps.pastureId = item
  1354. this.edit = 1
  1355. this.getCreateDepartDownList()
  1356. },
  1357. changeDepart(item) {
  1358. this.createTemp.departmentName = this.createDepartList.find(obj => obj.id == item).name
  1359. },
  1360. handleDownload() {
  1361. console.log('点击了下载')
  1362. this.$alert('备件申购正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  1363. this.isPercentage = true
  1364. this.percentage = 1
  1365. var timer = setInterval(() => {
  1366. this.percentage += 5
  1367. if (this.percentage > 95) {
  1368. this.percentage = 99
  1369. clearInterval(timer)
  1370. }
  1371. this.percentage = this.percentage
  1372. }, 1000)
  1373. this.downloadParam.name = 'downloadPartpurchaseList'
  1374. this.downloadParam.parammaps = this.getdataListParm.parammaps
  1375. GetAccount(this.downloadParam).then(response => {
  1376. if (response.data.list !== '') {
  1377. this.percentage = 99
  1378. setTimeout(() => {
  1379. this.isPercentage = false
  1380. }, 2000)
  1381. }
  1382. this.$nextTick(() => {
  1383. const ExcelDatas = [
  1384. {
  1385. tHeader: ['牧场', '申购单号', '申购时间', '备件编号', '备件名称', '规格型号', '品牌', '单位', '申购数量', '申购部门', '申购人', '备注'],
  1386. filterVal: ['pastureName', 'orderNumber', 'inputTime', 'partCode', 'partName', 'specification', 'brandName', 'unit', 'amount', 'departmentName', 'empname', 'purpose'],
  1387. tableDatas: response.data.list,
  1388. sheetName: '备件申购'
  1389. }
  1390. ]
  1391. json2excel(ExcelDatas, '备件申购', true, 'xlsx')
  1392. })
  1393. })
  1394. },
  1395. form_delete(row) {
  1396. console.log('点击了删除')
  1397. MessageBox.confirm('确认删除此条信息?', {
  1398. confirmButtonText: '确认',
  1399. cancelButtonText: '取消',
  1400. type: 'warning'
  1401. }).then(() => {
  1402. this.postDataPramas.common = { 'returnmap': '0' }
  1403. this.postDataPramas.data = []
  1404. this.postDataPramas.data[0] = { 'name': 'deleteBigPartpurchase', 'type': 'e', 'parammaps': {
  1405. id: row.id
  1406. }}
  1407. this.postDataPramas.data[1] = { 'name': 'deletePartpurchase', 'type': 'e', 'parammaps': {
  1408. bigId: row.id
  1409. }}
  1410. ExecDataByConfig(this.postDataPramas).then(response => {
  1411. this.get_table_data()
  1412. this.$notify({
  1413. title: '成功',
  1414. message: '删除成功',
  1415. type: 'success',
  1416. duration: 2000
  1417. })
  1418. })
  1419. }).catch(() => {
  1420. this.$message({
  1421. type: 'info',
  1422. message: '已取消删除'
  1423. })
  1424. })
  1425. },
  1426. handleExamine(row) {
  1427. console.log('点击了库管审核')
  1428. if (row == undefined) {
  1429. this.examineTemp = this.seeTemp
  1430. this.$set(this.seeTemp, 'statue', 1)
  1431. this.$set(this.seeTemp, 'workflowNote', '')
  1432. } else {
  1433. this.examineTemp = Object.assign({}, row)
  1434. this.$set(this.examineTemp, 'statue', 1)
  1435. this.$set(this.examineTemp, 'workflowNote', '')
  1436. }
  1437. this.dialogStatus = 'examine'
  1438. this.dialogFormVisible_Examine = true
  1439. this.statueReason = false
  1440. },
  1441. changeStatue(val) {
  1442. if (val == 2) {
  1443. this.statueReason = true
  1444. } else {
  1445. this.statueReason = false
  1446. }
  1447. },
  1448. createExamineData() {
  1449. console.log('点击了库管审核')
  1450. this.isokDisable = true
  1451. setTimeout(() => {
  1452. this.isokDisable = false
  1453. }, 1000)
  1454. this.$refs['examineTemp'].validate(valid => {
  1455. if (valid) {
  1456. this.requestParam = {}
  1457. this.requestParam.name = 'partpurchaseCharge'
  1458. this.requestParam.parammaps = {}
  1459. this.requestParam.parammaps.id = this.examineTemp.id
  1460. if (this.examineTemp.statue == 1) {
  1461. this.requestParam.parammaps.statue = 3
  1462. } else if (this.examineTemp.statue == 2) {
  1463. this.requestParam.parammaps.statue = 4
  1464. }
  1465. this.requestParam.parammaps.empId = Cookies.get('employeid')
  1466. this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
  1467. PostDataByName(this.requestParam).then(response => {
  1468. console.log('审核确认发送参数', this.requestParam)
  1469. if (response.msg !== 'fail') {
  1470. this.get_table_data()
  1471. this.dialogFormVisible_Examine = false
  1472. this.dialogFormVisible_See = false
  1473. this.statueReason = false
  1474. this.$notify({
  1475. title: '成功',
  1476. message: '审核成功',
  1477. type: 'success',
  1478. duration: 2000
  1479. })
  1480. } else {
  1481. failproccess(response, this.$notify)
  1482. }
  1483. })
  1484. }
  1485. })
  1486. },
  1487. handleExamine22(row) {
  1488. console.log('点击了设备主管审核')
  1489. if (row == undefined) {
  1490. this.examineTemp = this.seeTemp
  1491. this.$set(this.seeTemp, 'statue', 1)
  1492. this.$set(this.seeTemp, 'workflowNote', '')
  1493. } else {
  1494. this.examineTemp = Object.assign({}, row)
  1495. this.$set(this.examineTemp, 'statue', 1)
  1496. this.$set(this.examineTemp, 'workflowNote', '')
  1497. }
  1498. this.dialogStatus = 'examine22'
  1499. this.dialogFormVisible_Examine = true
  1500. this.statueReason = false
  1501. },
  1502. createExamineData22() {
  1503. console.log('点击了设备主管审核')
  1504. this.isokDisable = true
  1505. setTimeout(() => {
  1506. this.isokDisable = false
  1507. }, 1000)
  1508. this.$refs['examineTemp'].validate(valid => {
  1509. if (valid) {
  1510. this.requestParam = {}
  1511. this.requestParam.name = 'partpurchaseEquipment'
  1512. this.requestParam.parammaps = {}
  1513. this.requestParam.parammaps.id = this.examineTemp.id
  1514. if (this.examineTemp.statue == 1) {
  1515. this.requestParam.parammaps.statue = 9
  1516. } else if (this.examineTemp.statue == 2) {
  1517. this.requestParam.parammaps.statue = 10
  1518. }
  1519. this.requestParam.parammaps.empId = Cookies.get('employeid')
  1520. this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
  1521. PostDataByName(this.requestParam).then(response => {
  1522. console.log('审核确认发送参数', this.requestParam)
  1523. if (response.msg !== 'fail') {
  1524. this.get_table_data()
  1525. this.dialogFormVisible_Examine = false
  1526. this.dialogFormVisible_See = false
  1527. this.statueReason = false
  1528. this.$notify({
  1529. title: '成功',
  1530. message: '审核成功',
  1531. type: 'success',
  1532. duration: 2000
  1533. })
  1534. } else {
  1535. failproccess(response, this.$notify)
  1536. }
  1537. })
  1538. }
  1539. })
  1540. },
  1541. handleExamine2(row) {
  1542. console.log('点击了供应主管审核')
  1543. if (row == undefined) {
  1544. this.examineTemp = this.seeTemp
  1545. this.$set(this.seeTemp, 'statue', 1)
  1546. this.$set(this.seeTemp, 'workflowNote', '')
  1547. } else {
  1548. this.examineTemp = Object.assign({}, row)
  1549. this.$set(this.examineTemp, 'statue', 1)
  1550. this.$set(this.examineTemp, 'workflowNote', '')
  1551. }
  1552. this.dialogStatus = 'examine2'
  1553. this.dialogFormVisible_Examine = true
  1554. this.statueReason = false
  1555. },
  1556. createExamineData2() {
  1557. console.log('点击了供应主管审核')
  1558. this.isokDisable = true
  1559. setTimeout(() => {
  1560. this.isokDisable = false
  1561. }, 1000)
  1562. this.$refs['examineTemp'].validate(valid => {
  1563. if (valid) {
  1564. this.requestParam = {}
  1565. this.requestParam.name = 'partpurchaseCharge3'
  1566. this.requestParam.parammaps = {}
  1567. this.requestParam.parammaps.id = this.examineTemp.id
  1568. if (this.examineTemp.statue == 1) {
  1569. this.requestParam.parammaps.statue = 5
  1570. } else if (this.examineTemp.statue == 2) {
  1571. this.requestParam.parammaps.statue = 6
  1572. }
  1573. this.requestParam.parammaps.empId = Cookies.get('employeid')
  1574. this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
  1575. PostDataByName(this.requestParam).then(response => {
  1576. console.log('审核确认发送参数', this.requestParam)
  1577. if (response.msg !== 'fail') {
  1578. this.get_table_data()
  1579. this.dialogFormVisible_Examine = false
  1580. this.dialogFormVisible_See = false
  1581. this.statueReason = false
  1582. this.$notify({
  1583. title: '成功',
  1584. message: '审核成功',
  1585. type: 'success',
  1586. duration: 2000
  1587. })
  1588. } else {
  1589. failproccess(response, this.$notify)
  1590. }
  1591. })
  1592. }
  1593. })
  1594. },
  1595. handleExamine3(row) {
  1596. console.log('点击了采购审核')
  1597. if (row == undefined) {
  1598. this.examineTemp = this.seeTemp
  1599. this.$set(this.seeTemp, 'statue', 1)
  1600. this.$set(this.seeTemp, 'workflowNote', '')
  1601. } else {
  1602. this.examineTemp = Object.assign({}, row)
  1603. this.$set(this.examineTemp, 'workflowNote', '')
  1604. this.$set(this.examineTemp, 'statue', 1)
  1605. }
  1606. this.dialogStatus = 'examine3'
  1607. this.dialogFormVisible_Examine = true
  1608. this.statueReason = false
  1609. },
  1610. createExamineData3() {
  1611. console.log('点击了采购审核')
  1612. this.isokDisable = true
  1613. setTimeout(() => {
  1614. this.isokDisable = false
  1615. }, 1000)
  1616. this.$refs['examineTemp'].validate(valid => {
  1617. if (valid) {
  1618. this.requestParam = {}
  1619. this.requestParam.parammaps = {}
  1620. this.requestParam.common = { 'returnmap': '0' }
  1621. this.requestParam.data = []
  1622. if (this.examineTemp.statue == 1) {
  1623. this.requestParam.data[0] = { 'name': 'partpurchaseCharge1', 'type': 'e', 'parammaps': {
  1624. id: this.examineTemp.id,
  1625. statue: 7,
  1626. empId: Cookies.get('employeid'),
  1627. workflowNote: this.examineTemp.workflowNote
  1628. }}
  1629. this.requestParam.data[1] = { 'name': 'createBuydetailBySG', 'type': 'e', 'parammaps': {
  1630. id: this.examineTemp.id,
  1631. pastureId: this.examineTemp.pastureId
  1632. }}
  1633. } else if (this.examineTemp.statue == 2) {
  1634. this.requestParam.data[0] = { 'name': 'partpurchaseCharge1', 'type': 'e', 'parammaps': {
  1635. id: this.examineTemp.id,
  1636. statue: 8,
  1637. empId: Cookies.get('employeid'),
  1638. workflowNote: this.examineTemp.workflowNote
  1639. }}
  1640. }
  1641. ExecDataByConfig(this.requestParam).then(response => {
  1642. if (response.msg !== 'fail') {
  1643. this.get_table_data()
  1644. this.dialogFormVisible_Examine = false
  1645. this.dialogFormVisible_See = false
  1646. this.statueReason = false
  1647. this.$notify({ title: '成功', message: '审核成功', type: 'success', duration: 2000 })
  1648. } else {
  1649. failproccess(response, this.$notify)
  1650. }
  1651. })
  1652. }
  1653. })
  1654. }
  1655. }
  1656. }
  1657. </script>
  1658. <style lang="scss" scoped>
  1659. .pagination-container{
  1660. display: block !important;
  1661. }
  1662. /deep/ .el-badge__content.is-fixed{
  1663. z-index: 1;
  1664. }
  1665. </style>
  1666. <style lang="scss">
  1667. .el-step__head.is-success {
  1668. color: #409EFF;
  1669. border-color: #409EFF;
  1670. }
  1671. .el-step__title.is-success{
  1672. color: #409EFF;
  1673. }
  1674. .el-step__head.is-process{
  1675. color: #409EFF;
  1676. border-color: #409EFF;
  1677. .el-step__icon.is-text{
  1678. background: #409EFF;
  1679. color: #fff;
  1680. }
  1681. }
  1682. .step-row{
  1683. color: #000;
  1684. }
  1685. </style>