index.vue 108 KB

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