index1.vue 103 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528
  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. <el-tabs v-model="activeName" @tab-click="handleClick">
  8. <el-tab-pane v-if="isDistributionSheet" label="采购配单" name="first">
  9. <div class="purchaseDistributionSheet">
  10. <el-table
  11. :key="tableKey1"
  12. v-loading="listLoading1"
  13. element-loading-text="给我一点时间"
  14. :data="list1"
  15. border
  16. fit
  17. :row-style="tableRowStyle"
  18. :cell-style="tableCellStyle"
  19. highlight-current-row
  20. style="width: 100%;"
  21. class="elTable table-fixed"
  22. @cell-click="cellClick"
  23. @sort-change="tableSort"
  24. >
  25. <el-table-column label="序号" align="center" type="index" width="50px">
  26. <template slot-scope="scope">
  27. <span>{{ scope.$index + (pageNum1-1) * pageSize1 + 1 }}</span>
  28. </template>
  29. </el-table-column>
  30. <el-table-column label="备件编号" align="center" min-width="150px">
  31. <template slot-scope="scope">
  32. <span>{{ scope.row.partCode }}</span>
  33. </template>
  34. </el-table-column>
  35. <el-table-column label="备件名称" align="center" min-width="120px">
  36. <template slot-scope="scope">
  37. <span>{{ scope.row.partName }}</span>
  38. </template>
  39. </el-table-column>
  40. <el-table-column label="备件规格" align="center" min-width="120px">
  41. <template slot-scope="scope">
  42. <span>{{ scope.row.specification }}</span>
  43. </template>
  44. </el-table-column>
  45. <el-table-column label="备件品牌" min-width="100px" align="center">
  46. <template slot-scope="scope">
  47. <span>{{ scope.row.brand }}</span>
  48. </template>
  49. </el-table-column>
  50. <el-table-column label="计量单位" min-width="80px" align="center">
  51. <template slot-scope="scope">
  52. <span>{{ scope.row.unit }}</span>
  53. </template>
  54. </el-table-column>
  55. <el-table-column label="图片" min-width="110px" align="center">
  56. <template slot-scope="scope">
  57. <el-popover placement="right" title="" trigger="hover">
  58. <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
  59. <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  60. </el-popover>
  61. </template>
  62. </el-table-column>
  63. <el-table-column label="供应商" min-width="110px" align="center">
  64. <template slot-scope="scope">
  65. <span>{{ scope.row.providerName }}</span>
  66. </template>
  67. </el-table-column>
  68. <el-table-column sortable prop="price" label="单价" min-width="70px" align="center">
  69. <template slot-scope="scope">
  70. <span>{{ scope.row.price }}</span>
  71. </template>
  72. </el-table-column>
  73. <el-table-column sortable prop="sumAmount" label="申购数量" min-width="90px" align="center">
  74. <template slot-scope="scope">
  75. <span>{{ scope.row.sumAmount }}</span>
  76. </template>
  77. </el-table-column>
  78. <el-table-column label="采购数量" min-width="110px" align="center">
  79. <template slot-scope="scope">
  80. <el-form :model="scope.row" :rules="rules">
  81. <el-form-item prop="amount">
  82. <el-input
  83. v-model="scope.row.amount"
  84. style="width:80px;margin-top:25px;height:10px"
  85. />
  86. </el-form-item>
  87. </el-form>
  88. </template>
  89. </el-table-column>
  90. </el-table>
  91. <el-button :disabled="confirmationSheetDisabled" type="primary" style="float: right;margin-top: 10px;" @click="confirmationSheet()">确认配单</el-button>
  92. <el-dialog :title="textMap[dialogStatusConfirmation]" :visible.sync="dialogFormVisibleConfirmation" :close-on-click-modal="false" style="width:100%;margin: 0 auto;overflow:auto">
  93. <div class="app-contentConfirmationSheet">
  94. <el-form ref="temp1" :rules="rules" :model="temp1" label-position="right" label-width="90px" style="width:100%;margin-bottom:50px">
  95. <el-row>
  96. <el-col :span="8">
  97. <el-form-item label="配单号:" prop="matchCode">
  98. <el-input ref="matchCode" v-model="temp1.matchCode" disabled />
  99. </el-form-item>
  100. </el-col>
  101. <el-col :span="8">
  102. <el-form-item label="提交日期:" prop="buyerDate">
  103. <el-date-picker
  104. v-model="temp1.buyerDate"
  105. :picker-options="pickerOptions"
  106. type="date"
  107. placeholder="提交日期"
  108. format="yyyy-MM-dd"
  109. value-format="yyyy-MM-dd"
  110. style="width:170px;"
  111. />
  112. </el-form-item>
  113. </el-col>
  114. <el-col :span="8">
  115. <el-form-item label="采购员:" prop="buyerPerson">
  116. <el-select v-model="temp1.buyerPerson" placeholder="采购员" class="filter-item">
  117. <el-option
  118. v-for="item in findAllEmploye"
  119. :key="item.id"
  120. :label="item.name"
  121. :value="item.id"
  122. />
  123. </el-select>
  124. </el-form-item>
  125. </el-col>
  126. </el-row>
  127. </el-form>
  128. <div v-for="(item,index) in listConfirmationSheet" :key="index" class="app-content">
  129. <div class="title">
  130. <div>
  131. <b>采购单号:</b>
  132. <span>{{ item.orderNumber }}</span>
  133. </div>
  134. <div>
  135. <b>供应商:</b>
  136. <span>{{ item.providerName }}</span>
  137. </div>
  138. </div>
  139. <el-table
  140. :key="tableKey1"
  141. v-loading="listLoading1"
  142. element-loading-text="给我一点时间"
  143. :data="item.list"
  144. border
  145. fit
  146. highlight-current-row
  147. style="width: 97%;margin:0 auto"
  148. :row-style="rowStyle"
  149. :cell-style="cellStyle"
  150. class="elTable table-fixed"
  151. >
  152. <!-- table表格 -->
  153. <el-table-column label="序号" align="center" type="index" width="50px">
  154. <template slot-scope="scope">
  155. <span>{{ scope.$index + (pageNum1-1) * pageSize1 + 1 }}</span>
  156. </template>
  157. </el-table-column>
  158. <el-table-column label="备件编号" align="center" min-width="150px">
  159. <template slot-scope="scope">
  160. <span>{{ scope.row.partCode }}</span>
  161. </template>
  162. </el-table-column>
  163. <el-table-column label="备件名称" align="center" min-width="120px">
  164. <template slot-scope="scope">
  165. <span>{{ scope.row.partName }}</span>
  166. </template>
  167. </el-table-column>
  168. <el-table-column label="备件规格" align="center" min-width="120px">
  169. <template slot-scope="scope">
  170. <span>{{ scope.row.specification }}</span>
  171. </template>
  172. </el-table-column>
  173. <el-table-column label="图片" min-width="110px" align="center">
  174. <template slot-scope="scope">
  175. <el-popover placement="right" title="" trigger="hover">
  176. <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
  177. <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  178. </el-popover>
  179. </template>
  180. </el-table-column>
  181. <el-table-column label="备件品牌" min-width="100px" align="center">
  182. <template slot-scope="scope">
  183. <span>{{ scope.row.brand }}</span>
  184. </template>
  185. </el-table-column>
  186. <el-table-column label="计量单位" min-width="80px" align="center">
  187. <template slot-scope="scope">
  188. <span>{{ scope.row.unit }}</span>
  189. </template>
  190. </el-table-column>
  191. <el-table-column label="单价" min-width="70px" align="center">
  192. <template slot-scope="scope">
  193. <span>{{ scope.row. price }}</span>
  194. </template>
  195. </el-table-column>
  196. <el-table-column label="申购数量" min-width="90px" align="center">
  197. <template slot-scope="scope">
  198. <span>{{ scope.row.sumAmount }}</span>
  199. </template>
  200. </el-table-column>
  201. <el-table-column label="合计采购数量" min-width="90px" align="center">
  202. <template slot-scope="scope">
  203. <span>{{ scope.row.amount }}</span>
  204. </template>
  205. </el-table-column>
  206. <el-table-column label="总价" min-width="90px" align="center">
  207. <template slot-scope="scope">
  208. <span>{{ (scope.row.sumPrice = scope.row.price * parseFloat(scope.row.amount))| keepTwoNum }}</span>
  209. </template>
  210. </el-table-column>
  211. </el-table>
  212. <div ref="total" class="total">
  213. 合计:
  214. <span>{{ item.Sum }}</span>
  215. </div>
  216. </div>
  217. <div slot="footer" class="dialog-footer" style="bottom:10px">
  218. <el-button type="primary" :disabled="isokDisable" @click="confirmationSheetData()">确认</el-button>
  219. <el-button @click="dialogFormVisibleConfirmation= false;getList1();">取消</el-button>
  220. </div>
  221. </div>
  222. </el-dialog>
  223. </div>
  224. </el-tab-pane>
  225. <el-tab-pane v-if="isDistributionManagement" label="配单管理" name="fouth">
  226. <div class="DistributionManagement">
  227. <div class="filter-container">
  228. <el-select v-model="getdataListParm4.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item">
  229. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
  230. </el-select>
  231. <el-input v-model="getdataListParm4.parammaps.matchCode" placeholder="配单号" clearable style="width: 200px;" class="filter-item" />
  232. <el-select v-model="getdataListParm4.parammaps.statue" clearable placeholder="审核状态" class="filter-item" style="width: 120px;">
  233. <el-option v-for="item in status2" :key="item.id" :label="item.name" :value="item.id" />
  234. </el-select>
  235. <el-date-picker ref="inputDatetime4" v-model="getdataListParm4.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 270px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始提交日期" end-placeholder="结束提交日期" />
  236. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search4">搜索</el-button>
  237. </div>
  238. <el-table
  239. :key="tableKey4"
  240. v-loading="listLoading4"
  241. element-loading-text="给我一点时间"
  242. :data="list4"
  243. border
  244. fit
  245. highlight-current-row
  246. style="width: 100%;"
  247. :row-style="rowStyle"
  248. :cell-style="cellStyle"
  249. class="elTable table-fixed"
  250. @sort-change="tableSort"
  251. @current-change="handleCurrentChange"
  252. >
  253. <el-table-column label="序号" align="center" type="index" width="50px">
  254. <template slot-scope="scope">
  255. <span>{{ scope.$index + (pageNum2-1) * pageSize2 + 1 }}</span>
  256. </template>
  257. </el-table-column>
  258. <el-table-column label="牧场" min-width="110px" align="center">
  259. <template slot-scope="scope">
  260. <span>{{ scope.row.pastureName }}</span>
  261. </template>
  262. </el-table-column>
  263. <el-table-column label="配单号" min-width="110px" align="center">
  264. <template slot-scope="scope">
  265. <span>{{ scope.row.matchCode }}</span>
  266. </template>
  267. </el-table-column>
  268. <el-table-column label="采购员" min-width="130px" align="center">
  269. <template slot-scope="scope">
  270. <span>{{ scope.row.empname }}</span>
  271. </template>
  272. </el-table-column>
  273. <el-table-column label="提交日期" sortable prop="dealTime" min-width="110px" align="center" />
  274. <el-table-column sortable prop="cou" label="采购单数" min-width="110px" align="center">
  275. <template slot-scope="scope">
  276. <span>{{ scope.row.cou }}</span>
  277. </template>
  278. </el-table-column>
  279. <el-table-column label="审核状态" min-width="80px" align="center" :formatter="statue" />
  280. <el-table-column label="操作" align="center" width="250px" class-name="small-padding fixed-width" fixed="right">
  281. <template slot-scope="{row}">
  282. <el-button v-if="isPurchaseSee" type="primary" size="mini" @click="form_see4(row)">查看</el-button>
  283. <el-button v-if="parseFloat(row.statue) === 0 && isExamineDM" style="display:inline-block" type="success" size="mini" @click="handleExamine(row)">审核</el-button>
  284. <el-button v-else style="display:none;" type="success" size="mini" @click="handleExamine(row)">审核</el-button>
  285. <el-button v-if="parseFloat(row.statue) === 2" type="success" style="display:inline-block" size="mini" @click="form_edit(row)">编辑</el-button>
  286. <el-button v-else style="display:none;" type="success" size="mini" @click="form_edit(row)">编辑</el-button>
  287. </template>
  288. </el-table-column>
  289. </el-table>
  290. <pagination v-show="total4>0" :total="total4" :page.sync="getdataListParm4.offset" :limit.sync="getdataListParm4.pagecount" @pagination="getList4" />
  291. <el-dialog :title="textMap[dialogStatusSee4]" :visible.sync="dialogFormVisibleSee4" :close-on-click-modal="false">
  292. <div class="app-contentSee">
  293. <el-form ref="temp4" :rules="rules" :model="temp4" label-position="right" label-width="80px" style="width: 800px;margin-bottom:30px">
  294. <el-row>
  295. <el-col :span="8">
  296. <el-form-item label="配单号:" prop="matchCode">
  297. <span>{{ temp4.matchCode }}</span>
  298. </el-form-item>
  299. </el-col>
  300. <el-col :span="8">
  301. <el-form-item label="采购员:" prop="empname">
  302. <span>{{ temp4.empname }}</span>
  303. </el-form-item>
  304. </el-col>
  305. <el-col :span="8">
  306. <el-form-item label="配单日期:" prop="dealTime">
  307. <span>{{ temp4.dealTime }}</span>
  308. </el-form-item>
  309. </el-col>
  310. </el-row>
  311. </el-form>
  312. <el-table
  313. :key="tableKeySee4"
  314. v-loading="listLoadingSee4"
  315. element-loading-text="给我一点时间"
  316. :data="listSee4"
  317. border
  318. fit
  319. highlight-current-row
  320. style="width: 100%;margin-bottom:100px"
  321. :row-style="rowStyle"
  322. :cell-style="cellStyle"
  323. class="elTable table-fixed"
  324. >
  325. <el-table-column label="序号" align="center" type="index" width="50px" />
  326. <el-table-column label="采购单号" min-width="110px" align="center">
  327. <template slot-scope="scope">
  328. <span>{{ scope.row.buyeCode }}</span>
  329. </template>
  330. </el-table-column>
  331. <el-table-column label="备件编号" min-width="110px" align="center">
  332. <template slot-scope="scope">
  333. <span>{{ scope.row.partCode }}</span>
  334. </template>
  335. </el-table-column>
  336. <el-table-column label="备件名称" min-width="110px" align="center">
  337. <template slot-scope="scope">
  338. <span>{{ scope.row.partName }}</span>
  339. </template>
  340. </el-table-column>
  341. <el-table-column label="备件规格" min-width="110px" align="center">
  342. <template slot-scope="scope">
  343. <span>{{ scope.row.specification }}</span>
  344. </template>
  345. </el-table-column>
  346. <el-table-column label="备件品牌" min-width="110px" align="center">
  347. <template slot-scope="scope">
  348. <span>{{ scope.row.brand }}</span>
  349. </template>
  350. </el-table-column>
  351. <el-table-column label="计量单位" min-width="60px" align="center">
  352. <template slot-scope="scope">
  353. <span>{{ scope.row.unit }}</span>
  354. </template>
  355. </el-table-column>
  356. <el-table-column label="供应商" min-width="110px" align="center">
  357. <template slot-scope="scope">
  358. <span>{{ scope.row.providerName }}</span>
  359. </template>
  360. </el-table-column>
  361. <el-table-column sortable prop="price" label="单价" min-width="60px" align="center">
  362. <template slot-scope="scope">
  363. <span>{{ scope.row.price }}</span>
  364. </template>
  365. </el-table-column>
  366. <el-table-column sortable prop="sumAmount" label="申购数量" min-width="60px" align="center">
  367. <template slot-scope="scope">
  368. <span>{{ scope.row.sumAmount }}</span>
  369. </template>
  370. </el-table-column>
  371. <el-table-column sortable prop="amount" label="采购数量" min-width="60px" align="center">
  372. <template slot-scope="scope">
  373. <span>{{ scope.row.amount }}</span>
  374. </template>
  375. </el-table-column>
  376. <el-table-column sortable prop="sumPrice" label="总价" min-width="60px" align="center">
  377. <template slot-scope="scope">
  378. <span>{{ scope.row.sumPrice }}</span>
  379. </template>
  380. </el-table-column>
  381. <el-table-column label="备件图片" min-width="110px" align="center">
  382. <template slot-scope="scope">
  383. <el-popover placement="right" title="" trigger="hover">
  384. <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
  385. <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  386. </el-popover>
  387. </template>
  388. </el-table-column>
  389. <el-table-column prop="SGremark" label="备注" min-width="60px" align="center" />
  390. </el-table>
  391. <el-form ref="temp4" :rules="rules" :model="temp4" label-position="right" label-width="120px" style="width: 90%;margin:0 auto;">
  392. <el-row>
  393. <el-col>
  394. <el-form-item label="流程进度" />
  395. <el-steps :active="active" align-center finish-status="success">
  396. <el-step
  397. v-for="(item,index) in activeList"
  398. :key="index"
  399. :title="item.title"
  400. :status="item.status"
  401. >
  402. <template slot="description">
  403. <div class="step-row">
  404. <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
  405. <div>{{ item.reason }}</div>
  406. </div>
  407. </template>
  408. </el-step>
  409. </el-steps>
  410. </el-col>
  411. </el-row>
  412. <el-row>
  413. <el-col>
  414. <el-form-item label="操作:">
  415. <!-- 审核 -->
  416. <el-button v-if="isExamineDM && temp4.statue == 0" type="success" style="display:inline-block" @click="handleExamine()">审核</el-button>
  417. <el-button v-else type="success" style="display:none" @click="handleExamine()">审核</el-button>
  418. </el-form-item>
  419. </el-col>
  420. </el-row>
  421. </el-form>
  422. <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
  423. <el-button @click="dialogFormVisibleSee4 = false;">关闭</el-button>
  424. </div>
  425. </div>
  426. </el-dialog>
  427. <el-dialog :title="textMap[dialogStatusUpdate4]" width="90%" :visible.sync="dialogFormVisibleUpdate4" :close-on-click-modal="false">
  428. <div class="app-contentUpdate">
  429. <el-form
  430. ref="updateTemp4"
  431. :rules="rules"
  432. :model="updateTemp4"
  433. label-position="right"
  434. label-width="80px"
  435. style="width:80%;margin-bottom:30px"
  436. >
  437. <el-row>
  438. <el-col :span="8">
  439. <el-form-item label="配单号:" prop="matchCode">
  440. <span>{{ updateTemp4.matchCode }}</span>
  441. </el-form-item>
  442. </el-col>
  443. <el-col :span="8">
  444. <el-form-item label="采购员:" prop="empname">
  445. <span>{{ updateTemp4.empname }}</span>
  446. </el-form-item>
  447. </el-col>
  448. <el-col :span="8">
  449. <el-form-item label="配单日期:" prop="dealTime">
  450. <span>{{ updateTemp4.dealTime }}</span>
  451. </el-form-item>
  452. </el-col>
  453. </el-row>
  454. </el-form>
  455. <el-table
  456. :key="tableKeyUpdate4"
  457. v-loading="listLoadingUpdate4"
  458. element-loading-text="给我一点时间"
  459. :data="listUpdate4"
  460. border
  461. fit
  462. highlight-current-row
  463. style="width: 100%;margin-bottom:100px"
  464. :row-style="rowStyle"
  465. :cell-style="cellStyle"
  466. class="elTable table-fixed"
  467. >
  468. <!-- table表格 -->
  469. <el-table-column label="序号" align="center" type="index" width="50px" />
  470. <el-table-column label="采购单号" min-width="110px" align="center">
  471. <template slot-scope="scope">
  472. <span>{{ scope.row.buyeCode }}</span>
  473. </template>
  474. </el-table-column>
  475. <el-table-column label="备件编号" min-width="110px" align="center">
  476. <template slot-scope="scope">
  477. <span>{{ scope.row.partCode }}</span>
  478. </template>
  479. </el-table-column>
  480. <el-table-column label="备件名称" min-width="110px" align="center">
  481. <template slot-scope="scope">
  482. <span>{{ scope.row.partName }}</span>
  483. </template>
  484. </el-table-column>
  485. <el-table-column label="备件规格" min-width="110px" align="center">
  486. <template slot-scope="scope">
  487. <span>{{ scope.row.specification }}</span>
  488. </template>
  489. </el-table-column>
  490. <el-table-column label="备件品牌" min-width="110px" align="center">
  491. <template slot-scope="scope">
  492. <span>{{ scope.row.brand }}</span>
  493. </template>
  494. </el-table-column>
  495. <el-table-column label="计量单位" min-width="60px" align="center">
  496. <template slot-scope="scope">
  497. <span>{{ scope.row.unit }}</span>
  498. </template>
  499. </el-table-column>
  500. <el-table-column label="供应商" min-width="110px" align="center">
  501. <template slot-scope="scope">
  502. <span>{{ scope.row.providerName }}</span>
  503. </template>
  504. </el-table-column>
  505. <el-table-column label="单价" min-width="60px" align="center">
  506. <template slot-scope="scope">
  507. <span>{{ scope.row.price }}</span>
  508. </template>
  509. </el-table-column>
  510. <el-table-column label="申购数量" min-width="60px" align="center">
  511. <template slot-scope="scope">
  512. <span>{{ scope.row.sumAmount }}</span>
  513. </template>
  514. </el-table-column>
  515. <el-table-column label="采购数量" min-width="100px" align="center">
  516. <template slot-scope="scope">
  517. <el-form :model="scope.row" :rules="rules">
  518. <el-form-item prop="amount">
  519. <el-input
  520. v-model="scope.row.amount"
  521. style="width:80px;margin-top:25px;height:10px"
  522. />
  523. </el-form-item>
  524. </el-form>
  525. </template>
  526. </el-table-column>
  527. <el-table-column label="总价" min-width="60px" align="center">
  528. <template slot-scope="scope">
  529. <span>{{ (parseFloat(scope.row.price) * parseFloat(scope.row.amount)) | keepTwoNum2 }}</span>
  530. </template>
  531. </el-table-column>
  532. <el-table-column label="备件图片" min-width="110px" align="center">
  533. <template slot-scope="scope">
  534. <el-popover placement="right" title="" trigger="hover">
  535. <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
  536. <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  537. </el-popover>
  538. </template>
  539. </el-table-column>
  540. </el-table>
  541. <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
  542. <el-button type="primary" :disabled="isokDisable" @click="edit_dialog_save()">确认</el-button>
  543. <el-button @click="dialogFormVisibleUpdate4 = false;">关闭</el-button>
  544. </div>
  545. </div>
  546. </el-dialog>
  547. <el-dialog :title="textMap[dialogStatus_Examine]" :visible.sync="dialogFormVisible_Examine" :close-on-click-modal="false" width="30%">
  548. <div class="app-examine">
  549. <h3 style="width: 100%;margin:0 0 0 5%;line-height:50px;">请确认审核结果:</h3>
  550. <el-form ref="examineTemp" :rules="rules" :model="examineTemp" label-position="right" style="width: 50%;margin:0 auto;">
  551. <el-row style="width:88%;height:150px;margin:0 auto;">
  552. <el-col :span="20">
  553. <el-form-item>
  554. <el-radio-group v-model="examineTemp.SHstatue" @change="changeSHStatue">
  555. <el-radio :label="1" checked>通过</el-radio>
  556. <el-radio :label="2">不通过</el-radio>
  557. </el-radio-group>
  558. </el-form-item>
  559. </el-col>
  560. <el-col v-if="statueReason" :span="20">
  561. <el-input v-model="examineTemp.workflowNote" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入不通过原因" />
  562. </el-col>
  563. </el-row>
  564. </el-form>
  565. </div>
  566. <div slot="footer" class="dialog-footer">
  567. <el-button type="primary" :disabled="isokDisable" @click="dialogStatus_Examine==='examine'?createExamineData():createExamineData()">确认</el-button>
  568. <el-button @click="dialogFormVisible_Examine = false;">关闭</el-button>
  569. </div>
  570. </el-dialog>
  571. </div>
  572. </el-tab-pane>
  573. <el-tab-pane label="采购单管理" name="second">
  574. <div class="purchaseOrderManagement">
  575. <div class="filter-container">
  576. <el-select v-model="getdataListParm2.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item">
  577. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
  578. </el-select>
  579. <el-input v-model="getdataListParm2.parammaps.buyeCode" placeholder="采购单号" clearable style="width: 200px;" class="filter-item" />
  580. <el-select v-model="getdataListParm2.parammaps.statu" clearable placeholder="单据状态" class="filter-item" style="width: 120px;">
  581. <el-option v-for="item in status" :key="item.id" :label="item.name" :value="item.id" />
  582. </el-select>
  583. <el-autocomplete v-model="getdataListParm2.parammaps.providerName" value-key="providerName" class="inline-input" :fetch-suggestions="providerSearch" placeholder="供应商" style="width:150px;top:-3px;" @select="handleSelectProvider" />
  584. <el-date-picker ref="inputDatetime2" v-model="getdataListParm2.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 270px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始提交日期" end-placeholder="结束提交日期" />
  585. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search2">搜索</el-button>
  586. <el-button v-waves v-if="isPurchaseSap" class="filter-item" type="primary" @click="sapUpload">SAP上传</el-button>
  587. <el-button v-waves v-if="isPurchaseSrm" class="filter-item" type="primary" @click="srmUpload">SRM上传</el-button>
  588. </div>
  589. <el-table
  590. :key="tableKey2"
  591. v-loading="listLoading2"
  592. element-loading-text="给我一点时间"
  593. :data="list2"
  594. border
  595. fit
  596. highlight-current-row
  597. style="width: 100%;"
  598. :row-style="rowStyle"
  599. :cell-style="cellStyle"
  600. class="elTable table-fixed"
  601. @sort-change="tableSort"
  602. @selection-change="change_table_selection"
  603. >
  604. <el-table-column type="selection" :selectable="checkboxInit" align="center" width="50" />
  605. <el-table-column label="序号" align="center" type="index" width="50px">
  606. <template slot-scope="scope">
  607. <span>{{ scope.$index + (pageNum2-1) * pageSize2 + 1 }}</span>
  608. </template>
  609. </el-table-column>
  610. <el-table-column label="牧场" min-width="110px" align="center">
  611. <template slot-scope="scope">
  612. <span>{{ scope.row.pastureName }}</span>
  613. </template>
  614. </el-table-column>
  615. <el-table-column label="采购单号" min-width="110px" align="center">
  616. <template slot-scope="scope">
  617. <span>{{ scope.row.buyeCode }}</span>
  618. </template>
  619. </el-table-column>
  620. <el-table-column label="供应商" min-width="130px" align="center">
  621. <template slot-scope="scope">
  622. <span>{{ scope.row.providerName }}</span>
  623. </template>
  624. </el-table-column>
  625. <el-table-column label="采购员" min-width="110px" align="center">
  626. <template slot-scope="scope">
  627. <span>{{ scope.row.empname }}</span>
  628. </template>
  629. </el-table-column>
  630. <el-table-column label="提交日期" sortable prop="buyerDate" min-width="110px" align="center" />
  631. <el-table-column label="最近到货日期" sortable prop="DoneDate" min-width="110px" align="center" />
  632. <el-table-column label="单据状态" min-width="80px" align="center" :formatter="statu" />
  633. <el-table-column prop="sapNumber" label="sap编码" min-width="80px" align="center">
  634. <template slot-scope="scope">
  635. <span>{{scope.row.sapNumber}}</span>
  636. </template>
  637. </el-table-column>
  638. <el-table-column prop
  639. <el-table-column prop="sapstatus" label="sap上传状态" min-width="80px" align="center">
  640. <template slot-scope="scope">
  641. <span v-show="scope.row.sapstatus == 1">上传失败</span>
  642. <span v-show="scope.row.sapstatus == -1">未上传</span>
  643. <span v-show="scope.row.sapstatus == 0">上传成功</span>
  644. </template>
  645. </el-table-column>
  646. <el-table-column prop="srmstatus" label="srm上传状态" min-width="80px" align="center">
  647. <template slot-scope="scope">
  648. <span v-show="scope.row.srmstatus == 1">上传失败</span>
  649. <span v-show="scope.row.srmstatus == -1">未上传</span>
  650. <span v-show="scope.row.srmstatus == 0">上传成功</span>
  651. </template>
  652. </el-table-column>
  653. <el-table-column label="操作" align="center" width="250px" class-name="small-padding fixed-width" fixed="right">
  654. <template slot-scope="{row}">
  655. <el-button v-if="isPurchaseSee" type="primary" size="mini" @click="form_see2(row)">查看</el-button>
  656. <el-button v-if="(row.statu === 2 || row.statu === 4) && isPurchaseClose" style="display:none" type="danger" size="mini" @click="handleClose2(row)">关闭</el-button>
  657. <el-button v-else-if="isPurchaseClose" style="display:inline-block" type="danger" size="mini" @click="handleClose2(row)">关闭</el-button>
  658. </template>
  659. </el-table-column>
  660. </el-table>
  661. <pagination v-show="total2>0" :total="total2" :page.sync="getdataListParm2.offset" :limit.sync="getdataListParm2.pagecount" @pagination="getList2" />
  662. <el-dialog :title="textMap[dialogStatusSee2]" :visible.sync="dialogFormVisibleSee2" :close-on-click-modal="false">
  663. <div class="app-contentSee">
  664. <el-form
  665. ref="temp2"
  666. :rules="rules"
  667. :model="temp2"
  668. label-position="right"
  669. label-width="80px"
  670. style="width: 800px;margin-bottom:30px"
  671. >
  672. <el-row>
  673. <el-col :span="8">
  674. <el-form-item label="采购单号:" prop="buyeCode">
  675. <span>{{ temp2.buyeCode }}</span>
  676. </el-form-item>
  677. </el-col>
  678. <el-col :span="6">
  679. <el-form-item label="供应商:" prop="providerName">
  680. <span>{{ temp2.providerName }}</span>
  681. </el-form-item>
  682. </el-col>
  683. <el-col :span="5">
  684. <el-form-item label="采购员:" prop="empname">
  685. <span>{{ temp2.empname }}</span>
  686. </el-form-item>
  687. </el-col>
  688. <el-col :span="5">
  689. <el-form-item label="提交日期:" prop="buyerDate">
  690. <span>{{ temp2.buyerDate }}</span>
  691. </el-form-item>
  692. </el-col>
  693. </el-row>
  694. </el-form>
  695. <el-table
  696. :key="tableKeySee2"
  697. v-loading="listLoadingSee2"
  698. element-loading-text="给我一点时间"
  699. :data="listSee2"
  700. border
  701. fit
  702. highlight-current-row
  703. style="width: 100%;margin-bottom:100px"
  704. :row-style="rowStyle"
  705. :cell-style="cellStyle"
  706. class="elTable table-fixed"
  707. @sort-change="tableSort2"
  708. >
  709. <el-table-column label="序号" align="center" type="index" width="50px" />
  710. <el-table-column label="备件编号" min-width="110px" align="center">
  711. <template slot-scope="scope">
  712. <span>{{ scope.row.partCode }}</span>
  713. </template>
  714. </el-table-column>
  715. <el-table-column label="备件名称" min-width="110px" align="center">
  716. <template slot-scope="scope">
  717. <span>{{ scope.row.partName }}</span>
  718. </template>
  719. </el-table-column>
  720. <el-table-column label="备件规格" min-width="110px" align="center">
  721. <template slot-scope="scope">
  722. <span>{{ scope.row.specification }}</span>
  723. </template>
  724. </el-table-column>
  725. <el-table-column label="备件图片" min-width="110px" align="center">
  726. <template slot-scope="scope">
  727. <el-popover placement="right" title="" trigger="hover">
  728. <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
  729. <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  730. </el-popover>
  731. </template>
  732. </el-table-column>
  733. <el-table-column label="备件品牌" min-width="110px" align="center">
  734. <template slot-scope="scope">
  735. <span>{{ scope.row.brand }}</span>
  736. </template>
  737. </el-table-column>
  738. <el-table-column label="计量单位" min-width="130px" align="center">
  739. <template slot-scope="scope">
  740. <span>{{ scope.row.unit }}</span>
  741. </template>
  742. </el-table-column>
  743. <el-table-column sortable prop="price" label="单价(元)" min-width="110px" align="center">
  744. <template slot-scope="scope">
  745. <span>{{ scope.row.price }}</span>
  746. </template>
  747. </el-table-column>
  748. <el-table-column sortable prop="sumAmount" label="申购数量" min-width="110px" align="center">
  749. <template slot-scope="scope">
  750. <span>{{ scope.row.sumAmount }}</span>
  751. </template>
  752. </el-table-column>
  753. <el-table-column sortable prop="amount" label="采购数量" min-width="130px" align="center">
  754. <template slot-scope="scope">
  755. <span>{{ scope.row.amount }}</span>
  756. </template>
  757. </el-table-column>
  758. <el-table-column sortable prop="sumPrice" label="总价(元)" min-width="110px" align="center">
  759. <template slot-scope="scope">
  760. <span>{{ scope.row.sumPrice }}</span>
  761. </template>
  762. </el-table-column>
  763. <el-table-column sortable prop="receiveAmount" label="入库数" min-width="110px" align="center">
  764. <template slot-scope="scope">
  765. <span>{{ scope.row.receiveAmount }}</span>
  766. </template>
  767. </el-table-column>
  768. <el-table-column prop="SGremark" label="备注" min-width="110px" align="center">
  769. <template slot-scope="scope">
  770. <span>{{ scope.row.SGremark }}</span>
  771. </template>
  772. </el-table-column>
  773. </el-table>
  774. <div class="sum" style="right:30px;position:absolute;bottom:90px">
  775. <b>总计:{{ temp2.sumPrices }}元</b>
  776. </div>
  777. <div class="stuts" style="left:30px;position:absolute;bottom:70px">
  778. <b>单据状态:{{ temp2.statu }}</b>
  779. <b v-if="isStatu">关闭原因:{{ temp2.note }}</b>
  780. <div v-if="isExtensionDays">延期天数:{{ temp2.extensionDays }}</div>
  781. </div>
  782. <div
  783. slot="footer"
  784. class="dialog-footer"
  785. style="right:30px;position:absolute;bottom:10px"
  786. >
  787. <el-button @click="dialogFormVisibleSee2 = false;getList2()">关闭</el-button>
  788. </div>
  789. </div>
  790. </el-dialog>
  791. <el-dialog :title="textMap[dialogStatusClose]" :visible.sync="dialogFormVisibleClose" :close-on-click-modal="false" style="width:70%;margin: 0 auto">
  792. <div class="app-contentClose">
  793. <el-form
  794. ref="temp2"
  795. :rules="rules"
  796. :model="temp2"
  797. label-position="right"
  798. label-width="80px"
  799. style="width: 300px;margin-bottom:30px"
  800. >
  801. <el-row>
  802. <el-col :span="24">
  803. <el-form-item label="采购单号:" prop="orderNo">
  804. <span>{{ temp2.buyeCode }}</span>
  805. </el-form-item>
  806. </el-col>
  807. </el-row>
  808. <el-row>
  809. <el-col :span="24">
  810. <el-form-item label="" prop="note">
  811. <el-input ref="note" v-model="temp2.note" type="textarea" placeholder="请输入关闭该采购单原因" />
  812. </el-form-item>
  813. </el-col>
  814. </el-row>
  815. </el-form>
  816. <div
  817. slot="footer"
  818. class="dialog-footer"
  819. style="right:30px;position:absolute;bottom:10px"
  820. >
  821. <el-button @click="dialogFormVisibleClose = false;getList2();">取消</el-button>
  822. <el-button type="primary" :disabled="isokDisable" @click="closeData()">确认关闭</el-button>
  823. </div>
  824. </div>
  825. </el-dialog>
  826. </div>
  827. </el-tab-pane>
  828. <el-tab-pane label="采购明细" name="third">
  829. <div class="procurementDetails">
  830. <div class="filter-container">
  831. <el-select v-model="getdataListParm3.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item">
  832. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
  833. </el-select>
  834. <el-input v-model="getdataListParm3.parammaps.partCode" placeholder="备件编号" style="width: 200px;" class="filter-item" />
  835. <el-input v-model="getdataListParm3.parammaps.partName" placeholder="备件名称" style="width: 140px;" class="filter-item" />
  836. <el-autocomplete v-model="getdataListParm3.parammaps.providerName" value-key="providerName" class="inline-input" :fetch-suggestions="providerSearch" placeholder="供应商" style="width:150px;top:-3px;" @select="handleSelectProvider" />
  837. <el-input v-model="getdataListParm3.parammaps.matchCode" placeholder="配单号" style="width: 140px;" class="filter-item" />
  838. <el-input v-model="getdataListParm3.parammaps.buyeCode" placeholder="采购单号" style="width: 140px;" class="filter-item" />
  839. <el-select v-model="getdataListParm3.parammaps.isStorage" clearable placeholder="到货情况" class="filter-item" style="width: 120px;">
  840. <el-option v-for="item in isStorages" :key="item.id" :label="item.name" :value="item.id" />
  841. </el-select>
  842. <el-date-picker ref="inputDatetime3" v-model="getdataListParm3.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 270px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
  843. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search3">搜索</el-button>
  844. <el-button v-if="isPurchaseExport" class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-edit" @click="handleDownload3">导出</el-button>
  845. </div>
  846. <el-table
  847. :key="tableKey3"
  848. v-loading="listLoading3"
  849. element-loading-text="给我一点时间"
  850. :data="list3"
  851. border
  852. fit
  853. highlight-current-row
  854. style="width: 100%;"
  855. :row-style="rowStyle"
  856. :cell-style="cellStyle"
  857. class="elTable table-fixed"
  858. @sort-change="tableSort"
  859. >
  860. <el-table-column label="序号" align="center" type="index" width="50px">
  861. <template slot-scope="scope">
  862. <span>{{ scope.$index + (pageNum3-1) * pageSize3 + 1 }}</span>
  863. </template>
  864. </el-table-column>
  865. <el-table-column label="牧场" min-width="110px" align="center">
  866. <template slot-scope="scope">
  867. <span>{{ scope.row.pastureName }}</span>
  868. </template>
  869. </el-table-column>
  870. <el-table-column label="配单号" min-width="110px" align="center">
  871. <template slot-scope="scope">
  872. <span>{{ scope.row.matchCode }}</span>
  873. </template>
  874. </el-table-column>
  875. <el-table-column label="采购单号" min-width="110px" align="center">
  876. <template slot-scope="scope">
  877. <span>{{ scope.row.buyeCode }}</span>
  878. </template>
  879. </el-table-column>
  880. <el-table-column label="备件编号" min-width="110px" align="center">
  881. <template slot-scope="scope">
  882. <span>{{ scope.row.partCode }}</span>
  883. </template>
  884. </el-table-column>
  885. <el-table-column label="备件名称" min-width="130px" align="center">
  886. <template slot-scope="scope">
  887. <span>{{ scope.row.partName }}</span>
  888. </template>
  889. </el-table-column>
  890. <el-table-column label="备件规格" min-width="130px" align="center">
  891. <template slot-scope="scope">
  892. <span>{{ scope.row.specification }}</span>
  893. </template>
  894. </el-table-column>
  895. <el-table-column label="备件品牌" min-width="130px" align="center">
  896. <template slot-scope="scope">
  897. <span>{{ scope.row.brand }}</span>
  898. </template>
  899. </el-table-column>
  900. <el-table-column label="计量单位" min-width="130px" align="center">
  901. <template slot-scope="scope">
  902. <span>{{ scope.row.unit }}</span>
  903. </template>
  904. </el-table-column>
  905. <el-table-column label="供应商" min-width="110px" align="center">
  906. <template slot-scope="scope">
  907. <span>{{ scope.row.providerName }}</span>
  908. </template>
  909. </el-table-column>
  910. <el-table-column sortable prop="price" label="单价" min-width="110px" align="center">
  911. <template slot-scope="scope">
  912. <span>{{ scope.row.price }}</span>
  913. </template>
  914. </el-table-column>
  915. <el-table-column sortable prop="sumAmount" label="申购数量" min-width="110px" align="center">
  916. <template slot-scope="scope">
  917. <span>{{ scope.row.sumAmount }}</span>
  918. </template>
  919. </el-table-column>
  920. <el-table-column sortable prop="amount" label="采购数量" min-width="110px" align="center">
  921. <template slot-scope="scope">
  922. <span>{{ scope.row.amount }}</span>
  923. </template>
  924. </el-table-column>
  925. <el-table-column sortable prop="receiveAmount" label="入库数" min-width="110px" align="center">
  926. <template slot-scope="scope">
  927. <span>{{ scope.row.receiveAmount }}</span>
  928. </template>
  929. </el-table-column>
  930. <el-table-column label="申购部门" min-width="110px" align="center">
  931. <template slot-scope="scope">
  932. <span>{{ scope.row.departmentName }}</span>
  933. </template>
  934. </el-table-column>
  935. <el-table-column label="采购人" min-width="110px" align="center">
  936. <template slot-scope="scope">
  937. <span>{{ scope.row.empname }}</span>
  938. </template>
  939. </el-table-column>
  940. <el-table-column label="配单日期" sortable prop="buyerDate" min-width="110px" align="center" />
  941. <!-- <el-table-column label="备注" min-width="110px" align="center">
  942. <template slot-scope="scope">
  943. <span>{{ scope.row.note }}</span>
  944. </template>
  945. </el-table-column> -->
  946. </el-table>
  947. <pagination v-show="total3>=0" :total="total3" :page.sync="getdataListParm3.offset" :limit.sync="getdataListParm3.pagecount" @pagination="getList3" />
  948. </div>
  949. </el-tab-pane>
  950. </el-tabs>
  951. </div>
  952. </template>
  953. <script>
  954. // 引入
  955. import { GetDataByName, GetDataByNames, ExecDataByConfig, PostDataByName, failproccess, checkButtons, GetAccount,SapOrder,SrmOrder } from '@/api/common'
  956. import waves from '@/directive/waves' // waves directive
  957. import Pagination from '@/components/Pagination' // secondary package based on el-pagination
  958. import Cookies from 'js-cookie'
  959. import { parseTime, sortChange, json2excel } from '@/utils/index.js'
  960. export default {
  961. name: 'Purchase',
  962. components: { Pagination },
  963. directives: { waves },
  964. filters: {
  965. keepTwoNum(value) {
  966. value = Number(value)
  967. return value.toFixed(3)
  968. },
  969. keepTwoNum2(value) {
  970. value = Number(value)
  971. return value.toFixed(2)
  972. }
  973. },
  974. data() {
  975. return {
  976. isSap:1,
  977. isSrm:1,
  978. selectList: [],
  979. isPurchaseSap: [],isPurchaseSrm: [],
  980. isPurchaseSee: [], isPurchaseClose: [], isPurchaseExport: [], isDistributionSheet: [], isDistributionManagement: [], isExamineDM: [],
  981. stripe: true,
  982. activeName: 'first',
  983. listLoading1: false,
  984. tableKey1: 0,
  985. list1: [],
  986. confirmationSheetDisabled: false,
  987. isokDisable: false,
  988. pickerOptions: {
  989. disabledDate(time) {
  990. return time.getTime() > Date.now() // 当天之前的时间可选
  991. }
  992. },
  993. temp: {},
  994. total: 0,
  995. total1: 0,
  996. listParmConfirmation: [],
  997. listConfirmationSheet: null,
  998. getParmPurchaseOrderNumber: {
  999. name: 'autoCreatCode',
  1000. page: 1,
  1001. offset: 1,
  1002. returntype: 'Map',
  1003. parammaps: {
  1004. pastureId: Cookies.get('pastureid'),
  1005. codeType: 'CG'
  1006. }
  1007. },
  1008. postDataPramas: {},
  1009. requestProvider: {
  1010. name: 'getProviderList',
  1011. page: 1,
  1012. offset: 1,
  1013. pagecount: 10,
  1014. returntype: 'Map',
  1015. parammaps: {}
  1016. },
  1017. listLoading2: false,
  1018. tableKey2: 0,
  1019. list2: [],
  1020. status2: [
  1021. { id: '0', name: '审核中' },
  1022. { id: '1', name: '审核通过' },
  1023. { id: '2', name: '审核驳回' }
  1024. ],
  1025. status: [
  1026. { id: '0', name: '未到货' },
  1027. { id: '1', name: '部分到货' },
  1028. { id: '2', name: '按时到货' },
  1029. { id: '3', name: '已延期' },
  1030. { id: '4', name: '已关闭' },
  1031. { id: '5', name: '部分到货-延期' },
  1032. { id: '6', name: '全部到货-延期' }
  1033. ],
  1034. isStorages: [
  1035. { id: '0', name: '未入库' },
  1036. { id: '1', name: '已入库' }
  1037. ],
  1038. isStatu: false,
  1039. listLoadingSee2: false,
  1040. tableKeySee2: 0,
  1041. total2: 0,
  1042. total3: 0,
  1043. listLoading3: false,
  1044. tableKey3: 0,
  1045. list3: [],
  1046. findAllEmploye: [],
  1047. findAllPasture: [],
  1048. requestParams: [
  1049. { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
  1050. { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}
  1051. ],
  1052. getdataListParm1: {
  1053. name: 'getbuydetailParts',
  1054. page: 1,
  1055. // offset: 1,
  1056. // pagecount: 10,
  1057. returntype: 'Map',
  1058. parammaps: {
  1059. pastureId: Cookies.get('pastureid')
  1060. }
  1061. },
  1062. getdataListPart: {
  1063. name: 'getpartpurchasebg',
  1064. page: 1,
  1065. // offset: 1,
  1066. // pagecount: 10,
  1067. returntype: 'Map',
  1068. parammaps: {
  1069. id: Cookies.get('pastureid')
  1070. }
  1071. },
  1072. partData: [],
  1073. getParmCreateNumber: {
  1074. name: 'autoCreatCode',
  1075. page: 1,
  1076. offset: 1,
  1077. returntype: 'Map',
  1078. parammaps: {
  1079. pastureId: Cookies.get('pastureid'),
  1080. codeType: 'PD'
  1081. }
  1082. },
  1083. pageNum1: 0,
  1084. pageSize1: 0,
  1085. temp1: {
  1086. pastureId: Cookies.get('pastureid'),
  1087. buyerPerson: this.$store.state.user.employeid,
  1088. buyerDate: parseTime(new Date(), '{y}-{m}-{d}')
  1089. },
  1090. getdataListParm2: {
  1091. name: 'getBigbuydetailList',
  1092. page: 1,
  1093. offset: 1,
  1094. pagecount: 10,
  1095. returntype: 'Map',
  1096. parammaps: {
  1097. providerName: '',
  1098. buyeCode: '',
  1099. inputDatetime: '',
  1100. // pastureId: Cookies.get('pastureid'),
  1101. pastureName: Cookies.get('pasturename')
  1102. }
  1103. },
  1104. dialogFormVisibleConfirmation: false,
  1105. dialogStatusConfirmation: '',
  1106. pageNum2: 0,
  1107. pageSize2: 0,
  1108. temp2: {
  1109. note: ''
  1110. },
  1111. getdataListParm3: {
  1112. name: 'getbuydetailList',
  1113. page: 1,
  1114. offset: 1,
  1115. pagecount: 10,
  1116. returntype: 'Map',
  1117. parammaps: {
  1118. pastureName: Cookies.get('pasturename'),
  1119. providerName: '',
  1120. partCode: '',
  1121. partName: '',
  1122. matchCode: '',
  1123. buyeCode: '',
  1124. isStorage: '',
  1125. startTime: '',
  1126. stopTime: '',
  1127. inputDatetime: ''
  1128. }
  1129. },
  1130. isExtensionDays: false,
  1131. listSee2: [],
  1132. getdataListSee2: {
  1133. name: 'getbuydetailListbyBig',
  1134. returntype: 'Map',
  1135. parammaps: {}
  1136. },
  1137. requestParamStute: {
  1138. name: 'updateBigbuydetailStatu',
  1139. returntype: 'Map',
  1140. parammaps: {}
  1141. },
  1142. pageNum3: 0,
  1143. pageSize3: 0,
  1144. temp3: {},
  1145. dialogFormVisibleSee2: false,
  1146. dialogStatusSee2: '',
  1147. // 配单管理
  1148. listLoading4: false,
  1149. tableKey4: 0,
  1150. list4: [],
  1151. pageNum4: 0,
  1152. pageSize4: 0,
  1153. total4: 0,
  1154. getdataListParm4: {
  1155. name: 'getbigpartdeallist',
  1156. page: 1,
  1157. offset: 1,
  1158. pagecount: 10,
  1159. returntype: 'Map',
  1160. parammaps: {
  1161. pastureName: Cookies.get('pasturename'),
  1162. matchCode: '',
  1163. statue: '',
  1164. inputDatetime: '',
  1165. startTime: '',
  1166. stopTime: ''
  1167. }
  1168. },
  1169. dialogFormVisibleSee4: false,
  1170. dialogStatusSee4: '',
  1171. temp4: {},
  1172. listSee4: [],
  1173. tableKeySee4: 0,
  1174. listLoadingSee4: false,
  1175. getdataListSee4: {
  1176. name: 'getbigpartdealdetiallist',
  1177. returntype: 'Map',
  1178. parammaps: {}
  1179. },
  1180. activeList: [],
  1181. active: 3,
  1182. currentRow:{},
  1183. dialogStatusUpdate4: '',
  1184. dialogFormVisibleUpdate4: false,
  1185. updateTemp4: {},
  1186. listUpdate4: [],
  1187. tableKeyUpdate4: 0,
  1188. listLoadingUpdate4: false,
  1189. dialogFormVisible_Examine: false,
  1190. dialogStatus_Examine: '',
  1191. examineTemp: {
  1192. SHstatue: 1,
  1193. workflowNote: ''
  1194. },
  1195. statueReason: false,
  1196. dialogFormVisibleClose: false,
  1197. dialogStatusClose: '',
  1198. textMap: {
  1199. confirmation: '确认配单',
  1200. see: '查看详情',
  1201. close: '关闭提示',
  1202. examine: '审核',
  1203. update: '编辑'
  1204. },
  1205. // 校验规则
  1206. rules: {
  1207. equipmentName: [{ required: true, message: '必填', trigger: 'blur' }],
  1208. note: [{ required: true, message: '必填', trigger: 'blur' }]
  1209. },
  1210. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  1211. cellStyle: { padding: 0 + 'px' },
  1212. buttons: [],
  1213. downloadListParm3: {},
  1214. downloadList3: [],
  1215. isPercentage: false,
  1216. percentage: 1
  1217. }
  1218. },
  1219. created() {
  1220. const that = this
  1221. // GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
  1222. // that.buttons = response.data.list
  1223. // that.get_auto_buttons()
  1224. // if (this.isDistributionSheet == true) {
  1225. // this.activeName = 'first'
  1226. // console.log(1, this.isDistributionSheet, this.isDistributionManagement)
  1227. // } else if (this.isDistributionManagement == true) {
  1228. // this.activeName = 'fouth'
  1229. // console.log(2, this.isDistributionSheet, this.isDistributionManagement)
  1230. // } else if (this.isDistributionSheet == false && this.isDistributionManagement == false) {
  1231. // this.activeName = 'second'
  1232. // console.log(3, this.isDistributionSheet, this.isDistributionManagement)
  1233. // }
  1234. // })
  1235. // this.get_select_list()
  1236. // this.getList1()
  1237. // this.getList2()
  1238. // this.getList3()
  1239. // this.getList4()
  1240. // if (this.$route.query.activeName !== undefined) {
  1241. // this.activeName = this.$route.query.activeName
  1242. // }
  1243. },
  1244. methods: {
  1245. tableSort(column) {
  1246. if (this.activeName == 'first') {
  1247. sortChange(column, this.list1)
  1248. } else if (this.activeName == 'second') {
  1249. sortChange(column, this.list2)
  1250. } else if (this.activeName == 'third') {
  1251. sortChange(column, this.list3)
  1252. } else if (this.activeName == 'fouth') {
  1253. sortChange(column, this.list4)
  1254. }
  1255. },
  1256. tableSort2(column) {
  1257. sortChange(column, this.listSee2)
  1258. },
  1259. get_auto_buttons() {
  1260. const DistributionSheet = 'customs:purchase:distributionSheet'
  1261. const isDistributionSheet = checkButtons(this.$store.state.user.buttons, DistributionSheet)
  1262. this.isDistributionSheet = isDistributionSheet
  1263. const PurchaseSee = 'customs:purchase:see'
  1264. const isPurchaseSee = checkButtons(this.$store.state.user.buttons, PurchaseSee)
  1265. this.isPurchaseSee = isPurchaseSee
  1266. const PurchaseClose = 'customs:purchase:close'
  1267. const isPurchaseClose = checkButtons(this.$store.state.user.buttons, PurchaseClose)
  1268. this.isPurchaseClose = isPurchaseClose
  1269. const PurchaseSap = 'customs:purchase:sap'
  1270. const isPurchaseSap = checkButtons(this.$store.state.user.buttons, PurchaseSap)
  1271. this.isPurchaseSap = isPurchaseSap
  1272. const PurchaseSrm = 'customs:purchase:srm'
  1273. const isPurchaseSrm = checkButtons(this.$store.state.user.buttons, PurchaseSrm)
  1274. this.isPurchaseSrm = isPurchaseSrm
  1275. const PurchaseExport = 'customs:purchase:export'
  1276. const isPurchaseExport = checkButtons(this.$store.state.user.buttons, PurchaseExport)
  1277. this.isPurchaseExport = isPurchaseExport
  1278. const ExamineDM = 'customs:purchase:shenhe'
  1279. const isExamineDM = checkButtons(this.$store.state.user.buttons, ExamineDM)
  1280. this.isExamineDM = isExamineDM
  1281. const DistributionManagement = 'customs:purchase:peidanjiemian'
  1282. const isDistributionManagement = checkButtons(this.$store.state.user.buttons, DistributionManagement)
  1283. this.isDistributionManagement = isDistributionManagement
  1284. },
  1285. cellClick(row, column, cell, event) {
  1286. console.log(cell)
  1287. console.log('column', column)
  1288. console.log('行索引', row.id)
  1289. console.log('列索引', column.id)
  1290. return {
  1291. background: '#eceb3c'
  1292. }
  1293. // console.log('event',event)
  1294. },
  1295. tableRowStyle({ row, rowIndex }) {
  1296. console.log(row, row)
  1297. console.log(' row.isParity', row.isParity)
  1298. console.log(parseInt(row.isParity) % 2 == 0)
  1299. if (parseInt(row.isParity) % 2 == 0) {
  1300. return {
  1301. background: '#eee'
  1302. }
  1303. }
  1304. return {
  1305. background: ''
  1306. }
  1307. },
  1308. tableCellStyle({ row, column, rowIndex, columnIndex }) {
  1309. if (row.isNo == 'No' && columnIndex === 10) {
  1310. return {
  1311. background: 'red'
  1312. }
  1313. }
  1314. return {
  1315. background: ''
  1316. }
  1317. },
  1318. handleClick(tab, event) {
  1319. console.log(tab, event)
  1320. if (tab.name === 'first') {
  1321. this.getList1()
  1322. } else if (tab.name === 'fouth') {
  1323. this.getList4()
  1324. } else if (tab.name === 'second') {
  1325. this.getList2()
  1326. } else if (tab.name === 'third') {
  1327. this.getList3()
  1328. }
  1329. },
  1330. get_select_list() {
  1331. GetDataByNames(this.requestParams).then(response => {
  1332. this.findAllEmploye = response.data.findAllEmploye.list
  1333. this.findAllPasture = response.data.findAllPasture.list
  1334. })
  1335. },
  1336. providerSearch(queryString, cb) {
  1337. console.log('供应商模糊查询输入值', queryString)
  1338. this.requestProvider.parammaps['providerName'] = queryString
  1339. GetDataByName(this.requestProvider).then(response => {
  1340. console.log('供应商模糊查询搜索data', response.data.list)
  1341. cb(response.data.list)
  1342. })
  1343. },
  1344. handleSelectProvider(item) {
  1345. console.log('供应商模糊查询选中值', item)
  1346. },
  1347. getList1() {
  1348. this.listLoading1 = true
  1349. GetDataByName(this.getdataListPart).then(response => {
  1350. console.log(response)
  1351. this.partData = response.data.list
  1352. })
  1353. GetDataByName(this.getdataListParm1).then(response => {
  1354. console.log('this.list1', response.data.list)
  1355. if (response.data.list === null) {
  1356. this.list1 = []
  1357. this.confirmationSheetDisabled = true
  1358. } else {
  1359. // eslint-disable-next-line no-unused-vars
  1360. var list1
  1361. list1 = response.data.list
  1362. var result = []
  1363. list1.forEach((i, j) => {
  1364. // eslint-disable-next-line no-irregular-whitespace
  1365. Array.from(new Set(list1.map(function(item) { return item.partCode }))).forEach((x, y) => {
  1366. if (i.partCode === x) {
  1367. result.push({
  1368. 'amount': i.amount,
  1369. 'amountPre': i.amountPre,
  1370. 'bigId': i.bigId,
  1371. 'brand': i.brand,
  1372. 'brandId': i.brandId,
  1373. 'contractCode': i.contractCode,
  1374. 'count': i.count,
  1375. 'enable': i.enable,
  1376. 'id': i.id,
  1377. 'inventoryType': i.inventoryType,
  1378. 'isZeroStock': i.isZeroStock,
  1379. 'orderNumber': i.orderNumber,
  1380. 'partCode': i.partCode,
  1381. 'partId': i.partId,
  1382. 'partName': i.partName,
  1383. 'pastureId': i.pastureId,
  1384. 'pastureName': i.pastureName,
  1385. 'planAmount': i.planAmount,
  1386. 'price': i.price,
  1387. 'providerId': i.providerId,
  1388. 'providerName': i.providerName,
  1389. 'purpose': i.purpose,
  1390. 'remark': i.remark,
  1391. 'specification': i.specification,
  1392. 'sumAmount': i.sumAmount,
  1393. 'unit': i.unit,
  1394. 'isNo': i.isNo,
  1395. 'srcpath': i.srcpath,
  1396. 'picpath': i.picpath,
  1397. 'departmentName': i.departmentName,
  1398. 'isParity': y
  1399. })
  1400. }
  1401. })
  1402. })
  1403. console.log(result)
  1404. if (result !== null) {
  1405. for (let i = 0; i < result.length; i++) {
  1406. console.log(result[i].srcpath)
  1407. if (result[i].srcpath !== null && result[i].picpath !== null && result[i].srcpath !== undefined && result[i].picpath !== undefined) {
  1408. result[i].srcpath = process.env.VUE_APP_BASE_API + result[i].srcpath
  1409. result[i].picpath = process.env.VUE_APP_BASE_API + result[i].picpath
  1410. } else {
  1411. // this.$set(result[i], 'srcpath', '')
  1412. // this.$set(result[i], 'picpath', '')
  1413. result[i].srcpath = ''
  1414. result[i].picpath = ''
  1415. }
  1416. }
  1417. }
  1418. // console.log(result)
  1419. this.list1 = result
  1420. console.log('处理后table数', this.list1)
  1421. this.confirmationSheetDisabled = false
  1422. }
  1423. var tem = ''
  1424. for (var i = 0; i < this.list1.length; i++) {
  1425. if (tem !== this.list1[i].partCode) {
  1426. this.list1[i].amount = this.list1[i].sumAmount
  1427. tem = this.list1[i].partCode
  1428. } else {
  1429. this.list1[i].amount = 0
  1430. }
  1431. }
  1432. // var a = 0
  1433. // var b = 0
  1434. // for (var i = 0; i < this.list1.length; i++) {
  1435. // if (parseInt(this.list1[i].amountPre) !== 0) {
  1436. // console.log(parseInt(this.list1[i].amountPre))
  1437. // if (a <= 0) {
  1438. // a = this.list1[i].count - 1
  1439. // if (b === 0) {
  1440. // b = parseInt(this.list1[i].amountPre)
  1441. // }
  1442. // } else {
  1443. // a--
  1444. // }
  1445. // if (b > 0) {
  1446. // this.list1[i].amount = this.list1[i].amount + 1
  1447. // b--
  1448. // }
  1449. // }
  1450. // }
  1451. if (response.data.total) {
  1452. this.total1 = response.data.total
  1453. }
  1454. // Just to simulate the time of the request
  1455. setTimeout(() => {
  1456. this.listLoading1 = false
  1457. }, 300)
  1458. })
  1459. },
  1460. confirmationSheet() {
  1461. console.log('点击立确认配单')
  1462. this.temp1.matchCode = ''
  1463. console.log(this.list1) // table表格数据
  1464. // -------------------------------------------
  1465. function groupBy1(array, f) {
  1466. var groups1 = {}
  1467. array.forEach(function(o) {
  1468. var group2 = JSON.stringify(f(o))
  1469. console.log("group2",group2)
  1470. groups1[group2] = groups1[group2] || []
  1471. groups1[group2].push(o)
  1472. })
  1473. return Object.keys(groups1).map(function(group2) {
  1474. return groups1[group2]
  1475. })
  1476. }
  1477. var sorted1 = groupBy1(this.list1, function(item) {
  1478. return [item.partCode]
  1479. })
  1480. console.log('表格数据根据供应商分划', sorted1)
  1481. for (var i = 0; i < sorted1.length; i++) {
  1482. var b = 0
  1483. var c = 0
  1484. for (var j = 0; j < sorted1[i].length; j++) {
  1485. // eslint-disable-next-line no-self-compare
  1486. if (sorted1[i][j].partCode === sorted1[i][j].partCode) {
  1487. // console.log(sorted1[i][j])
  1488. var element = sorted1[i][j]
  1489. b += parseInt(element.amount)
  1490. c = parseInt(element.sumAmount)
  1491. // console.log("amount", element.amount);
  1492. }
  1493. }
  1494. if (b > c || b < c) {
  1495. console.log('No')
  1496. console.log(element.id)
  1497. for (var a = 0; a < this.list1.length; a++) {
  1498. if (element.id === this.list1[a].id) {
  1499. console.log(this.list1[a].partCode)
  1500. for (var b = 0; b < this.list1.length; b++) {
  1501. if (this.list1[b].partCode === this.list1[a].partCode) {
  1502. console.log(this.list1[b])
  1503. this.$set(this.list1[b], 'isNo', 'No')
  1504. } else {
  1505. this.$set(this.list1[b], 'isNo', 'Yes')
  1506. }
  1507. }
  1508. } else {
  1509. this.$set(this.list1[a], 'isNo', 'Yes')
  1510. }
  1511. }
  1512. console.log(b)
  1513. this.$message({
  1514. type: 'warning',
  1515. message: '同一备件多个供应商合计采购数量总和等于申购数量'
  1516. })
  1517. return
  1518. } else {
  1519. for (var a = 0; a < this.list1.length; a++) {
  1520. this.$set(this.list1[a], 'isNo', 'Yes')
  1521. var rulesAmount = /^[0-9]\d*$/
  1522. if (!rulesAmount.test(this.list1[a].amount)) {
  1523. this.$message({
  1524. type: 'error',
  1525. message: '采购数量请输入正整数',
  1526. duration: 2000
  1527. })
  1528. return false
  1529. }
  1530. }
  1531. // console.log('Yes')
  1532. }
  1533. }
  1534. this.getCreateNumber()
  1535. // -------------------------------------------
  1536. this.dialogStatusConfirmation = 'confirmation'
  1537. this.dialogFormVisibleConfirmation = true
  1538. console.log('确认配单data------', JSON.stringify(this.list1) )
  1539. // this.list1 = this.list1.filter(i => parseFloat(i.amount) !== 0)
  1540. console.log(this.list1)
  1541. console.log('根据供应商分类', sorted1)
  1542. console.log('根据供应商分类表格listConfirmationSheet', this.listConfirmationSheet)
  1543. // 处理渲染数据
  1544. var providerNameMap = {}
  1545. var providerNameDest = []
  1546. var departmentNameMap = {}
  1547. // // eslint-disable-next-line no-redeclare
  1548. // for (var i = 0; i < this.list1.length; i++) {
  1549. // console.log(this.list1[i])
  1550. // var ai = this.list1[i]
  1551. // var price = this.list1[i].price
  1552. // var amount = this.list1[i].amount
  1553. // // console.log(price, amount)
  1554. // var sumPrice = 0
  1555. // sumPrice = parseFloat(price) * parseFloat(amount)
  1556. // if (!providerNameMap[ai.providerName]) {
  1557. // providerNameDest.push({
  1558. // price: [price],
  1559. // amount: [amount],
  1560. // sumPrice: [sumPrice],
  1561. // providerId: ai.providerId,
  1562. // providerName: ai.providerName,
  1563. // purpose: ai.purpose,
  1564. // list: [ai]
  1565. // })
  1566. // providerNameMap[ai.providerName] = ai
  1567. // providerNameMap[ai.providerId] = ai
  1568. // } else {
  1569. // // eslint-disable-next-line no-redeclare
  1570. // for (var j = 0; j < providerNameDest.length; j++) {
  1571. // console.log(providerNameDest[j])
  1572. // var dj = providerNameDest[j]
  1573. // if (dj.providerName === ai.providerName) {
  1574. // dj.sumPrice.push(sumPrice)
  1575. // dj.price.push(price)
  1576. // // eslint-disable-next-line no-mixed-spaces-and-tabs
  1577. // dj.amount.push(amount)
  1578. // dj.list.push(ai)
  1579. // break
  1580. // }
  1581. // }
  1582. // }
  1583. // }
  1584. // var providerNameArray = []
  1585. // // eslint-disable-next-line no-redeclare
  1586. // for (var i = 0; i < this.list1.length; i++) {
  1587. // providerNameArray.push(this.list1[i].providerName)
  1588. // }
  1589. // // console.log('原供应商', providerNameArray)
  1590. // function unique(providerNameArray) {
  1591. // return Array.from(new Set(providerNameArray))
  1592. // }
  1593. // var uniqueProviderNameArray = unique(providerNameArray)
  1594. // console.log('去重后供应商', uniqueProviderNameArray) // ["泰森机电", "浩祥晟机电", "国宇商贸", "赛娜牧业"]
  1595. // // ------------------------------------------
  1596. // var OrderNumberArray = []
  1597. // this.postDataPramas.common = { 'returnmap': '0' }
  1598. // this.postDataPramas.data = []
  1599. // for (var i = 0; i < uniqueProviderNameArray.length; i++) {
  1600. // this.postDataPramas.data[i] = { 'name': 'autoCreatCode', 'type': 'sm', 'parammaps': {
  1601. // pastureId: Cookies.get('pastureid'),
  1602. // codeType: 'CG'
  1603. // }}
  1604. // }
  1605. // ExecDataByConfig(this.postDataPramas).then(response => {
  1606. // console.log('采购单请求发送参数', this.postDataPramas)
  1607. // for (var i = 0; i < response.data.length; i++) {
  1608. // // console.log(response.data[i].resultmaps[0].orderCode)
  1609. // OrderNumberArray.push(response.data[i].resultmaps[0].orderCode)
  1610. // }
  1611. // console.log(OrderNumberArray)
  1612. // this.listConfirmationSheet.map((item, index) => {
  1613. // item.orderNumber = OrderNumberArray[index]
  1614. // return item
  1615. // })
  1616. // this.$forceUpdate()
  1617. // })
  1618. // console.log(OrderNumberArray)
  1619. // this.listConfirmationSheet = providerNameDest
  1620. // // console.log(JSON.stringify(this.listConfirmationSheet))
  1621. // console.log('根据供应商分类表格listConfirmationSheet', this.listConfirmationSheet)
  1622. // var SumArray = []
  1623. // this.listConfirmationSheet.forEach((item, index) => {
  1624. // console.log(item.sumPrice)
  1625. // // console.log(item.sumPrice.reduce((count, v) => count + v, 0))
  1626. // SumArray.push(item.sumPrice.reduce((count, v) => count + v, 0).toFixed(3))
  1627. // })
  1628. // this.listConfirmationSheet.map((item, index) => {
  1629. // // console.log(item, index)
  1630. // item.Sum = SumArray[index]
  1631. // return item
  1632. // })
  1633. // console.log('根据供应商分类表格listConfirmationSheet', this.listConfirmationSheet)
  1634. // -------------------------------------------
  1635. },
  1636. getCreateNumber() {
  1637. GetDataByName(this.getParmCreateNumber).then(response => {
  1638. this.$nextTick(() => {
  1639. this.show = false
  1640. console.log('配单号', response.data.list[0].orderCode)
  1641. this.temp1.matchCode = response.data.list[0].orderCode
  1642. this.$forceUpdate()
  1643. })
  1644. })
  1645. },
  1646. confirmationSheetData() {
  1647. this.isokDisable = true
  1648. setTimeout(() => {
  1649. this.isokDisable = false
  1650. }, 1000)
  1651. console.log('点击了确认配单提交')
  1652. this.$refs['temp1'].validate(valid => {
  1653. if (valid) {
  1654. // orderNumber
  1655. if (this.temp1.matchCode == '' || this.temp1.matchCode == null || this.temp1.matchCode == undefined) {
  1656. this.getCreateNumber()
  1657. }
  1658. this.postDataPramas.common = { 'returnmap': '0' }
  1659. this.postDataPramas.data = []
  1660. console.log(this.listConfirmationSheet)
  1661. for (let i = 0; i < this.listConfirmationSheet.length; i++) {
  1662. if (this.listConfirmationSheet[i].orderNumber == null || this.listConfirmationSheet[i].orderNumber == undefined) {
  1663. this.$notify({
  1664. title: '保存失败',
  1665. message: '网络异常未生成采购单,请刷新后重新进行配单',
  1666. type: 'warning',
  1667. duration: 2000
  1668. })
  1669. return false
  1670. }
  1671. }
  1672. var a = this.listConfirmationSheet.length
  1673. this.listConfirmationSheet.forEach((item, index) => {
  1674. console.log(item)
  1675. this.postDataPramas.data[index] = { 'name': 'insertBigbuydetail', 'resultname': 'insertBigbuydetail' + index, 'type': 'e', 'parammaps': {
  1676. pastureId: Cookies.get('pastureid'),
  1677. buyeCode: item.orderNumber,
  1678. providerId: item.providerId,
  1679. buyerPerson: this.temp1.buyerPerson,
  1680. buyerDate: this.temp1.buyerDate,
  1681. matchCode: this.temp1.matchCode
  1682. }}
  1683. this.postDataPramas.data[a] = { 'name': 'insertSpotList', 'resultmaps': { 'list': item.list }}
  1684. this.postDataPramas.data[a].children = []
  1685. this.postDataPramas.data[a].children[0] = { 'name': 'insertbuydetail', 'type': 'e', 'parammaps': {
  1686. bigId: '@insertBigbuydetail' + index + '.LastInsertId',
  1687. pastureId: '@insertSpotList.pastureId',
  1688. contractCode: '@insertSpotList.contractCode',
  1689. amount: '@insertSpotList.amount',
  1690. sumAmount: '@insertSpotList.sumAmount',
  1691. contractId: '@insertSpotList.id',
  1692. departmentName: '@insertSpotList.departmentName',
  1693. remark: '@insertSpotList.purpose'
  1694. }}
  1695. a = a + 1
  1696. })
  1697. this.postDataPramas.data[a] = { 'name': 'insertSpotListbpp', 'resultmaps': { 'list': this.partData }}
  1698. this.postDataPramas.data[a].children = []
  1699. this.postDataPramas.data[a].children[0] = { 'name': 'updateBigpartpurchaseStatu', 'type': 'e', 'parammaps': {
  1700. id: '@insertSpotListbpp.id',
  1701. matchCode: this.temp1.matchCode
  1702. }}
  1703. this.postDataPramas.data.push({ 'name': 'insertbigpartdeal', 'type': 'e', 'parammaps': {
  1704. empId: this.temp1.buyerPerson,
  1705. pastureId: Cookies.get('pastureid'),
  1706. matchCode: this.temp1.matchCode
  1707. }}
  1708. )
  1709. ExecDataByConfig(this.postDataPramas).then(response => {
  1710. if (response.msg === 'fail') {
  1711. var buyeCode = new RegExp('buyeCode')
  1712. if (buyeCode.test(response.data)) {
  1713. this.$notify({
  1714. title: '',
  1715. message: '网络异常未生成采购单,请刷新后重新进行配单',
  1716. type: 'warning',
  1717. duration: 2000
  1718. })
  1719. } else {
  1720. this.$notify({
  1721. title: '保存失败',
  1722. message: response.data,
  1723. type: 'warning',
  1724. duration: 2000
  1725. })
  1726. }
  1727. } else {
  1728. this.dialogFormVisibleConfirmation = false
  1729. this.activeName = 'fouth'
  1730. this.getList4()
  1731. this.$notify({
  1732. title: '',
  1733. message: '保存成功',
  1734. type: 'success',
  1735. duration: 2000
  1736. })
  1737. }
  1738. })
  1739. }
  1740. })
  1741. },
  1742. getList2() {
  1743. this.listLoading2 = true
  1744. if (this.$refs['inputDatetime2'] !== undefined && this.$refs['inputDatetime2'].value !== null) {
  1745. this.getdataListParm2.parammaps.startTime = this.$refs['inputDatetime2'].value[0]
  1746. this.getdataListParm2.parammaps.stopTime = this.$refs['inputDatetime2'].value[1]
  1747. } else {
  1748. this.getdataListParm2.parammaps.startTime = ''
  1749. this.getdataListParm2.parammaps.stopTime = ''
  1750. }
  1751. GetDataByName(this.getdataListParm2).then(response => {
  1752. this.list2 = response.data.list
  1753. this.pageNum2 = response.data.pageNum
  1754. this.pageSize2 = response.data.pageSize
  1755. if (response.data.total) {
  1756. this.total2 = response.data.total
  1757. }
  1758. // Just to simulate the time of the request
  1759. setTimeout(() => {
  1760. this.listLoading2 = false
  1761. }, 300)
  1762. })
  1763. },
  1764. form_search2() {
  1765. this.listLoading = true
  1766. if (this.getdataListParm2.parammaps.inputDatetime === null) {
  1767. this.getdataListParm2.parammaps.inputDatetime = ''
  1768. }
  1769. this.getdataListParm2.offset = 1
  1770. this.getList2()
  1771. },
  1772. statu: function(cellValue) {
  1773. if (cellValue.statu === 0) {
  1774. return '未到货'
  1775. } else if (cellValue.statu === 1) {
  1776. return '部分到货'
  1777. } else if (cellValue.statu === 2) {
  1778. return '按时到货'
  1779. } else if (cellValue.statu === 3) {
  1780. return '已延期'
  1781. } else if (cellValue.statu === 4) {
  1782. return '已关闭'
  1783. } else if (cellValue.statu === 5) {
  1784. return '部分到货-延期'
  1785. } else if (cellValue.statu === 6) {
  1786. return '全部到货-延期'
  1787. }
  1788. },
  1789. statue: function(cellValue) {
  1790. if (cellValue.statue === 0) {
  1791. return '审核中'
  1792. } else if (cellValue.statue === 1) {
  1793. return '审核通过'
  1794. } else if (cellValue.statue === 2) {
  1795. return '未通过'
  1796. }
  1797. },
  1798. form_see2(row) {
  1799. this.temp2 = Object.assign({}, row)
  1800. if (this.temp2.statu === 0) {
  1801. this.isStatu = false
  1802. this.temp2.statu = '未到货'
  1803. this.isExtensionDays = false
  1804. } else if (this.temp2.statu === 1) {
  1805. this.isStatu = false
  1806. this.temp2.statu = '部分到货'
  1807. this.isExtensionDays = false
  1808. } else if (this.temp2.statu === 2) {
  1809. this.isStatu = false
  1810. this.temp2.statu = '按时到货'
  1811. this.isExtensionDays = false
  1812. } else if (this.temp2.statu === 3) {
  1813. this.isStatu = false
  1814. this.temp2.statu = '已延期'
  1815. this.isExtensionDays = true
  1816. } else if (this.temp2.statu === 4) {
  1817. this.temp2.statu = '已关闭'
  1818. this.isStatu = true
  1819. this.isExtensionDays = false
  1820. } else if (this.temp2.statu === 5) {
  1821. this.isStatu = false
  1822. this.temp2.statu = '部分到货-延期'
  1823. this.isExtensionDays = true
  1824. } else if (this.temp2.statu === 6) {
  1825. this.isStatu = false
  1826. this.temp2.statu = '全部到货-延期'
  1827. this.isExtensionDays = true
  1828. }
  1829. this.dialogStatusSee2 = 'see'
  1830. this.dialogFormVisibleSee2 = true
  1831. this.getdataListSee2.parammaps.id = row.id
  1832. this.getSeeList2()
  1833. },
  1834. getSeeList2() {
  1835. GetDataByName(this.getdataListSee2).then(response => {
  1836. this.listSee2 = response.data.list
  1837. if (response.data.list !== null) {
  1838. for (let i = 0; i < response.data.list.length; i++) {
  1839. 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) {
  1840. this.listSee2[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  1841. this.listSee2[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  1842. } else {
  1843. this.listSee2[i].srcpath = ''
  1844. this.listSee2[i].picpath = ''
  1845. }
  1846. }
  1847. }
  1848. console.log('查看下方table数据', response.data.list)
  1849. // this.pageNum2 = response.data.pageNum
  1850. // this.pageSize2 = response.data.pageSize
  1851. var sumArray = []
  1852. for (var i = 0; i < this.listSee2.length; i++) {
  1853. console.log()
  1854. sumArray.push(
  1855. this.listSee2[i].sumPrice
  1856. )
  1857. }
  1858. console.log('总价', sumArray)
  1859. var arrvalue = 0
  1860. for (var i = 0; i < sumArray.length; i++) {
  1861. console.log('table内总价每一个值', sumArray[i])
  1862. arrvalue += parseFloat(sumArray[i])// 数组的索引是从0开始的
  1863. }
  1864. this.temp2.sumPrices = arrvalue.toFixed(3)
  1865. setTimeout(() => {
  1866. this.listLoadingSee = false
  1867. }, 100)
  1868. })
  1869. },
  1870. resetCloseTemp() {
  1871. this.temp2.note = ''
  1872. },
  1873. handleClose2(row) {
  1874. this.resetCloseTemp()
  1875. this.temp2 = Object.assign({}, row)
  1876. this.dialogStatusClose = 'close'
  1877. this.dialogFormVisibleClose = true
  1878. },
  1879. handleCurrentChange(val) {
  1880. this.currentRow = val;
  1881. console.log("currentRow",this.currentRow)
  1882. },
  1883. sapUpload(){
  1884. const that = this
  1885. console.log("currentRow",this.currentRow.sapstatus)
  1886. var send_data = this.selectList
  1887. if(send_data.length == 0){
  1888. that.$notify({ title: '失败', message: '请勾选数据!' , type: 'error', duration: 2000 })
  1889. return false
  1890. }
  1891. console.log(that.isSap)
  1892. if(that.isSap == 1){
  1893. that.isSap = 0
  1894. SapOrder(send_data).then(response => {
  1895. console.log('response', response)
  1896. if (response.msg !== 'fail') {
  1897. that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
  1898. that.selectList = []
  1899. that.getList2()
  1900. } else {
  1901. that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
  1902. }
  1903. })
  1904. } else {
  1905. that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击' , type: 'error', duration: 2000 })
  1906. }
  1907. setTimeout(() => {
  1908. that.isSap = 1
  1909. }, 3000)
  1910. // if(this.currentRow.sapstatus){
  1911. // if(this.currentRow.sapstatus != 0){
  1912. // const sapArr = this.currentRow.sapbuyeCode.split(",")
  1913. // console.log("sapArr",sapArr)
  1914. // sapArr.forEach(function(item){
  1915. // console.log("sapArr item",item)
  1916. // var send_data = {
  1917. // "code":item,
  1918. // "pastureid":Cookies.get('pastureid')
  1919. // }
  1920. // SapOrder(send_data).then(response => {
  1921. // console.log('response', response)
  1922. // if (response.msg !== 'fail') {
  1923. // that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
  1924. // that.getList()
  1925. // } else {
  1926. // that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
  1927. // }
  1928. // })
  1929. // })
  1930. // }
  1931. // }
  1932. },
  1933. checkboxInit(row,index){
  1934. // console.log(row)
  1935. var data1 = new Date(row.creatTime)
  1936. var data2 = new Date('2022-10-25')
  1937. if(data1 > data2){ return 1 } else {return 0}
  1938. },
  1939. //监听 - 表格 - 勾选
  1940. change_table_selection(val) {
  1941. this.selectList = val
  1942. console.log('勾选数据selectList', this.selectList)
  1943. },
  1944. srmUpload(){
  1945. const that = this
  1946. console.log("currentRow",this.currentRow.srmstatus)
  1947. console.log('勾选数据selectList', this.selectList)
  1948. var send_data = this.selectList
  1949. if(send_data.length == 0){
  1950. that.$notify({ title: '失败', message: '请勾选数据!' , type: 'error', duration: 2000 })
  1951. return false
  1952. }
  1953. console.log(that.isSrm)
  1954. if(that.isSrm == 1){
  1955. that.isSrm = 0
  1956. SrmOrder(send_data).then(response => {
  1957. console.log('response', response)
  1958. if (response.msg !== 'fail') {
  1959. that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
  1960. that.selectList = []
  1961. that.getList2()
  1962. } else {
  1963. that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
  1964. }
  1965. })
  1966. } else {
  1967. that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击' , type: 'error', duration: 2000 })
  1968. }
  1969. setTimeout(() => {
  1970. that.isSrm = 1
  1971. }, 3000)
  1972. // if(this.currentRow.srmstatus){
  1973. // if(this.currentRow.srmstatus != 0){
  1974. // const srmArr = this.currentRow.srmbuyeCode.split(",")
  1975. // console.log("srmArr",srmArr)
  1976. // srmArr.forEach(function(item){
  1977. // console.log("srmArr item",item)
  1978. // var send_data = {
  1979. // "code":item,
  1980. // "pastureid":Cookies.get('pastureid')
  1981. // }
  1982. // SrmOrder(send_data).then(response => {
  1983. // console.log('response', response)
  1984. // if (response.msg !== 'fail') {
  1985. // that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
  1986. // that.getList()
  1987. // } else {
  1988. // that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
  1989. // }
  1990. // })
  1991. // })
  1992. // }
  1993. // }
  1994. },
  1995. closeData() {
  1996. this.isokDisable = true
  1997. setTimeout(() => {
  1998. this.isokDisable = false
  1999. }, 1000)
  2000. console.log('点击确认关闭', this.temp2)
  2001. this.$refs['temp2'].validate(valid => {
  2002. if (valid) {
  2003. this.requestParamStute.parammaps.id = this.temp2.id
  2004. this.requestParamStute.parammaps.note = this.temp2.note
  2005. PostDataByName(this.requestParamStute).then(response => {
  2006. console.log('新增保存发送参数', this.requestParamStute)
  2007. if (response.msg !== 'fail') {
  2008. this.getList2()
  2009. this.dialogFormVisibleClose = false
  2010. this.$notify({
  2011. title: '成功',
  2012. message: '关闭成功',
  2013. type: 'success',
  2014. duration: 2000
  2015. })
  2016. } else {
  2017. failproccess(response, this.$notify)
  2018. }
  2019. })
  2020. }
  2021. })
  2022. },
  2023. getList3() {
  2024. this.listLoading3 = true
  2025. if (this.$refs['inputDatetime3'] !== undefined && this.$refs['inputDatetime3'].value !== null) {
  2026. this.getdataListParm3.parammaps.startTime = this.$refs['inputDatetime3'].value[0]
  2027. this.getdataListParm3.parammaps.stopTime = this.$refs['inputDatetime3'].value[1]
  2028. } else {
  2029. this.getdataListParm3.parammaps.startTime = ''
  2030. this.getdataListParm3.parammaps.stopTime = ''
  2031. }
  2032. GetDataByName(this.getdataListParm3).then(response => {
  2033. this.list3 = response.data.list
  2034. this.pageNum3 = response.data.pageNum
  2035. this.pageSize3 = response.data.pageSize
  2036. if (response.data.total) {
  2037. this.total3 = response.data.total
  2038. }
  2039. // Just to simulate the time of the request
  2040. setTimeout(() => {
  2041. this.listLoading3 = false
  2042. }, 300)
  2043. })
  2044. },
  2045. form_search3() {
  2046. this.listLoading = true
  2047. if (this.getdataListParm3.parammaps.inputDatetime === null) {
  2048. this.getdataListParm3.parammaps.inputDatetime = ''
  2049. }
  2050. this.getdataListParm3.offset = 1
  2051. this.getList3()
  2052. },
  2053. handleDownload3() {
  2054. console.log('点击了采购明细导出')
  2055. this.$alert('采购明细正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  2056. this.isPercentage = true
  2057. this.percentage = 1
  2058. var timer = setInterval(() => {
  2059. this.percentage += 5
  2060. if (this.percentage > 95) {
  2061. this.percentage = 99
  2062. clearInterval(timer)
  2063. }
  2064. this.percentage = this.percentage
  2065. }, 1000)
  2066. this.downloadListParm3.name = this.getdataListParm3.name
  2067. this.downloadListParm3.parammaps = this.getdataListParm3.parammaps
  2068. GetAccount(this.downloadListParm3).then(response => {
  2069. if (response.data.list !== '') {
  2070. this.percentage = 99
  2071. setTimeout(() => {
  2072. this.isPercentage = false
  2073. }, 2000)
  2074. }
  2075. this.downloadList3 = response.data.list
  2076. const elecExcelDatas = [
  2077. {
  2078. tHeader: ['配单号', '采购单号', '备件编号', '备件名称', '备件规格', '备件品牌', '计量单位', '供应商', '单价', '申购数量', '采购数量', '入库数', '申购部门', '采购人', '配单日期'],
  2079. filterVal: ['matchCode', 'buyeCode', 'partCode', 'partName', 'specification', 'brand', 'unit', 'providerName', 'price', 'sumAmount', 'amount', 'receiveAmount', 'departmentName', 'empname', 'buyerDate'],
  2080. tableDatas: this.downloadList3,
  2081. sheetName: '采购明细'
  2082. }
  2083. ]
  2084. json2excel(elecExcelDatas, '采购明细', true, 'xlsx')
  2085. })
  2086. },
  2087. getList4() {
  2088. this.listLoading4 = true
  2089. if (this.$refs['inputDatetime4'] !== undefined && this.$refs['inputDatetime4'].value !== null) {
  2090. this.getdataListParm4.parammaps.startTime = this.$refs['inputDatetime4'].value[0]
  2091. this.getdataListParm4.parammaps.stopTime = this.$refs['inputDatetime4'].value[1]
  2092. } else {
  2093. this.getdataListParm4.parammaps.startTime = ''
  2094. this.getdataListParm4.parammaps.stopTime = ''
  2095. }
  2096. GetDataByName(this.getdataListParm4).then(response => {
  2097. this.list4 = response.data.list
  2098. this.pageNum4 = response.data.pageNum
  2099. this.pageSize4 = response.data.pageSize
  2100. if (response.data.total) {
  2101. this.total4 = response.data.total
  2102. }
  2103. // Just to simulate the time of the request
  2104. setTimeout(() => {
  2105. this.listLoading4 = false
  2106. }, 300)
  2107. })
  2108. },
  2109. form_search4() {
  2110. this.listLoading = true
  2111. if (this.getdataListParm4.parammaps.inputDatetime === null) {
  2112. this.getdataListParm4.parammaps.inputDatetime = ''
  2113. }
  2114. this.getdataListParm4.offset = 1
  2115. this.getList4()
  2116. },
  2117. form_see4(row) {
  2118. this.dialogStatusSee4 = 'see'
  2119. this.dialogFormVisibleSee4 = true
  2120. this.temp4 = Object.assign({}, row)
  2121. this.getdataListSee4.parammaps.matchCode = row.matchCode
  2122. this.getSeeList4()
  2123. var reason = '未通过原因:' + this.temp4.workflowNote
  2124. if (this.temp4.statue === 0) {
  2125. this.activeList = [{ title: '配单', date: this.temp4.dealTime, name: this.temp4.empname }, { title: '办公室主任审核' }]
  2126. this.active = 1
  2127. } else if (this.temp4.statue === 1) {
  2128. this.activeList = [{ title: '配单', date: this.temp4.dealTime, name: this.temp4.empname }, { title: '办公室主任审核', date: this.temp4.chargeDate, name: this.temp4.chargeName }]
  2129. this.active = 2
  2130. } else if (this.temp4.statue === 2) {
  2131. this.activeList = [{ title: '配单', date: this.temp4.dealTime, name: this.temp4.empname }, { title: '办公室主任审核', date: this.temp4.chargeDate, name: this.temp4.chargeName, status: 'error', reason: reason }]
  2132. this.active = 2
  2133. }
  2134. },
  2135. getSeeList4() {
  2136. GetDataByName(this.getdataListSee4).then(response => {
  2137. this.listSee4 = response.data.list
  2138. this.listUpdate4 = response.data.list
  2139. if (response.data.list !== null) {
  2140. for (let i = 0; i < response.data.list.length; i++) {
  2141. console.log(response.data.list[i].srcpath)
  2142. console.log(response.data.list[i].picpath)
  2143. console.log(process.env.VUE_APP_BASE_API + response.data.list[i].srcpath)
  2144. 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) {
  2145. if (this.dialogStatusSee4 == 'see') {
  2146. this.listSee4[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  2147. this.listSee4[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  2148. } else {
  2149. this.listUpdate4[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  2150. this.listUpdate4[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  2151. }
  2152. } else {
  2153. this.listSee4[i].srcpath = ''
  2154. this.listSee4[i].picpath = ''
  2155. this.listUpdate4[i].srcpath = ''
  2156. this.listUpdate4[i].picpath = ''
  2157. }
  2158. }
  2159. }
  2160. console.log('查看下方table数据', response.data.list)
  2161. this.pageNum4 = response.data.pageNum
  2162. this.pageSize4 = response.data.pageSize
  2163. })
  2164. },
  2165. handleExamine(row) {
  2166. if (row == undefined) {
  2167. this.examineTemp = this.temp4
  2168. this.$set(this.temp4, 'SHstatue', 1)
  2169. this.$set(this.temp4, 'workflowNote', '')
  2170. } else {
  2171. this.examineTemp = Object.assign({}, row)
  2172. this.$set(this.examineTemp, 'SHstatue', 1)
  2173. this.$set(this.examineTemp, 'workflowNote', '')
  2174. }
  2175. this.dialogStatus_Examine = 'examine'
  2176. this.dialogFormVisible_Examine = true
  2177. this.statueReason = false
  2178. },
  2179. changeSHStatue(val) {
  2180. if (val == 2) {
  2181. this.statueReason = true
  2182. } else {
  2183. this.statueReason = false
  2184. }
  2185. },
  2186. createExamineData() {
  2187. console.log(this.examineTemp)
  2188. this.$refs['examineTemp'].validate(valid => {
  2189. if (valid) {
  2190. if (this.examineTemp.SHstatue == 1) {
  2191. console.log('通过')
  2192. this.postDataPramas.common = { 'returnmap': '0' }
  2193. this.postDataPramas.data = []
  2194. this.postDataPramas.data[0] = { 'name': 'partdealCharge', 'type': 'e', 'parammaps': {
  2195. 'id': this.examineTemp.id,
  2196. 'statue': this.examineTemp.SHstatue,
  2197. 'empId': Cookies.get('employeid'),
  2198. 'workflowNote': this.examineTemp.workflowNote
  2199. }}
  2200. this.postDataPramas.data[1] = { 'name': 'updatebigbuydetailenable', 'type': 'e', 'parammaps': {
  2201. 'matchCode': this.examineTemp.matchCode
  2202. }}
  2203. this.postDataPramas.data[2] = { 'name': 'updatebigbuydetailZero', 'type': 'e', 'parammaps': {
  2204. 'matchCode': this.examineTemp.matchCode
  2205. }}
  2206. ExecDataByConfig(this.postDataPramas).then(response => {
  2207. console.log('审核保存发送参数', this.postDataPramas)
  2208. if (response.msg === 'fail') {
  2209. this.$notify({
  2210. title: '审核失败',
  2211. message: response.data,
  2212. type: 'warning',
  2213. duration: 2000
  2214. })
  2215. } else {
  2216. this.dialogFormVisible_Examine = false
  2217. this.getList4()
  2218. this.$notify({
  2219. title: '',
  2220. message: '审核成功',
  2221. type: 'success',
  2222. duration: 2000
  2223. })
  2224. }
  2225. })
  2226. } else if (this.examineTemp.SHstatue == 2) {
  2227. console.log('不通过')
  2228. this.postDataPramas.common = { 'returnmap': '0' }
  2229. this.postDataPramas.data = []
  2230. this.postDataPramas.data[0] = { 'name': 'partdealCharge', 'type': 'e', 'parammaps': {
  2231. 'id': this.examineTemp.id,
  2232. 'statue': this.examineTemp.SHstatue,
  2233. 'empId': Cookies.get('employeid'),
  2234. 'workflowNote': this.examineTemp.workflowNote
  2235. }}
  2236. // this.postDataPramas.data[1] = { 'name': 'updatepartpurchase', 'type': 'e', 'parammaps': {
  2237. // 'matchCode': this.examineTemp.matchCode
  2238. // }}
  2239. ExecDataByConfig(this.postDataPramas).then(response => {
  2240. console.log('审核保存发送参数', this.postDataPramas)
  2241. if (response.msg === 'fail') {
  2242. this.$notify({
  2243. title: '审核失败',
  2244. message: response.data,
  2245. type: 'warning',
  2246. duration: 2000
  2247. })
  2248. } else {
  2249. this.dialogFormVisible_Examine = false
  2250. this.getList4()
  2251. this.$notify({
  2252. title: '',
  2253. message: '审核成功',
  2254. type: 'success',
  2255. duration: 2000
  2256. })
  2257. }
  2258. })
  2259. }
  2260. }
  2261. })
  2262. },
  2263. form_edit(row) {
  2264. this.dialogStatusUpdate4 = 'update'
  2265. this.dialogFormVisibleUpdate4 = true
  2266. this.getdataListSee4.parammaps.matchCode = row.matchCode
  2267. this.updateTemp4 = Object.assign(row, {})
  2268. this.getSeeList4()
  2269. },
  2270. edit_dialog_save() {
  2271. this.$refs['updateTemp4'].validate(valid => {
  2272. if (valid) {
  2273. // for (let i = 0; i < this.listUpdate4.length; i++) {
  2274. // var rulesAmount = /^\d+$/
  2275. // if ((this.listUpdate4[i].amount == '' || this.listUpdate4[i].amount == undefined) && parseFloat(this.listUpdate4[i].amount) !== 0) {
  2276. // this.$message({
  2277. // type: 'error',
  2278. // message: '采购数量不可为空',
  2279. // duration: 2000
  2280. // })
  2281. // return false
  2282. // } else if (!rulesAmount.test(parseFloat(this.listUpdate4[i].amount))) {
  2283. // this.$message({
  2284. // type: 'error',
  2285. // message: '采购数量不可为空',
  2286. // duration: 2000
  2287. // })
  2288. // return false
  2289. // }
  2290. // }
  2291. for (let i = 0; i < this.listUpdate4.length; i++) {
  2292. console.log(this.listUpdate4[i].amount)
  2293. var rulesAmount = /^\d+$/
  2294. if ((this.listUpdate4[i].amount == '' || this.listUpdate4[i].amount == undefined) && parseFloat(this.listUpdate4[i].amount) !== 0) {
  2295. this.$message({
  2296. type: 'error',
  2297. message: '采购数量不可为空',
  2298. duration: 2000
  2299. })
  2300. return false
  2301. } else if (!rulesAmount.test(parseFloat(this.listUpdate4[i].amount))) {
  2302. this.$message({
  2303. type: 'error',
  2304. message: '采购数量请输入大于等于0的整数',
  2305. duration: 2000
  2306. })
  2307. return false
  2308. } else {
  2309. this.postDataPramas.common = { 'returnmap': '0' }
  2310. this.postDataPramas.data = []
  2311. this.postDataPramas.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listUpdate4 }}
  2312. this.postDataPramas.data[0].children = []
  2313. this.postDataPramas.data[0].children[0] = { 'name': 'updatePDbuydetail', 'type': 'e', 'parammaps': {
  2314. amount: '@insertSpotList.amount',
  2315. id: '@insertSpotList.id'
  2316. }}
  2317. this.postDataPramas.data[1] = { 'name': 'partdealCharge', 'type': 'e', 'parammaps': {
  2318. id: this.updateTemp4.id,
  2319. statue: '0',
  2320. empId: Cookies.get('employeid')
  2321. }}
  2322. }
  2323. }
  2324. ExecDataByConfig(this.postDataPramas).then(response => {
  2325. console.log('新增保存发送参数', this.postDataPramas)
  2326. if (response.msg === 'fail') {
  2327. this.$notify({
  2328. title: '保存失败',
  2329. message: response.data,
  2330. type: 'warning',
  2331. duration: 2000
  2332. })
  2333. } else {
  2334. this.dialogFormVisibleUpdate4 = false
  2335. this.getdataListParm4.parammaps.inputDatetime = ''
  2336. this.getList4()
  2337. this.$notify({
  2338. title: '',
  2339. message: '保存成功',
  2340. type: 'success',
  2341. duration: 2000
  2342. })
  2343. }
  2344. })
  2345. return true
  2346. }
  2347. })
  2348. }
  2349. }
  2350. }
  2351. </script>
  2352. <style lang="scss" >
  2353. .el-table .warning-row {
  2354. background: red;
  2355. }
  2356. .el-table .color-row {
  2357. background: #eee;
  2358. }
  2359. </style>
  2360. <style lang="scss" scoped>
  2361. .app-contentClose .el-form-item__content {
  2362. margin-left: 0 !important;
  2363. }
  2364. </style>
  2365. <style lang="scss" scoped>
  2366. .app-contentConfirmationSheet {
  2367. margin-bottom: 50px;
  2368. }
  2369. .app-content {
  2370. background: #eee;
  2371. margin-bottom: 50px;
  2372. .title {
  2373. line-height: 40px;
  2374. div {
  2375. float: left;
  2376. margin-right: 50px;
  2377. b {
  2378. padding-left: 10px;
  2379. }
  2380. }
  2381. }
  2382. .total {
  2383. margin-left: 80%;
  2384. line-height: 30px;
  2385. }
  2386. }
  2387. </style>