index.vue 81 KB

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