index.vue 91 KB

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