index.vue 115 KB

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