index.vue 100 KB

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