index.vue 103 KB

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