index.vue 103 KB

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