index.vue 70 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615
  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-input v-model="getdataListParm.parammaps.empName" placeholder="申购人" style="width: 200px;" class="filter-item" />
  19. <!-- <el-select v-model="getdataListParm.parammaps.empName " style="width: 140px;" placeholder="申购人" class="filter-item">
  20. <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
  21. </el-select> -->
  22. <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="结束日期" />
  23. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">搜索</el-button>
  24. <div>
  25. <el-button v-if="isSubscribeAdd" class="filter-item" type="primary" icon="el-icon-edit" @click="handleCreate">新增</el-button>
  26. <el-button v-if="isSubscribeExport" v-waves class="filter-item" type="success" icon="el-icon-upload2" @click="handleDownload">导出</el-button>
  27. <el-radio-group v-model="radioAll" style="margin-top:-9px" @change="changeAll()">
  28. <el-radio-button label="全部" />
  29. <el-badge :value="pending.total" class="item">
  30. <el-radio-button label="待处理" />
  31. </el-badge>
  32. <el-radio-button label="已处理" />
  33. </el-radio-group>
  34. </div>
  35. </div>
  36. <div class="filter-button" />
  37. <el-table
  38. :key="tableKey"
  39. v-loading="listLoading"
  40. element-loading-text="给我一点时间"
  41. :data="list"
  42. border
  43. fit
  44. highlight-current-row
  45. style="width: 100%;"
  46. :row-style="rowStyle"
  47. :cell-style="cellStyle"
  48. class="elTable"
  49. >
  50. <el-table-column label="序号" align="center" type="index" width="50px">
  51. <template slot-scope="scope">
  52. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  53. </template>
  54. </el-table-column>
  55. <el-table-column label="申购单号" min-width="150px" align="center">
  56. <template slot-scope="scope">
  57. <span>{{ scope.row.orderNumber }}</span>
  58. </template>
  59. </el-table-column>
  60. <el-table-column label="牧场" min-width="90px" align="center">
  61. <template slot-scope="scope">
  62. <span>{{ scope.row.pastureName }}</span>
  63. </template>
  64. </el-table-column>
  65. <el-table-column label="申购部门" min-width="80px" align="center">
  66. <template slot-scope="scope">
  67. <span>{{ scope.row.departmentName }}</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.empname }}</span>
  73. </template>
  74. </el-table-column>
  75. <el-table-column label="申购日期" sortable prop="inputTime" min-width="80px" align="center" />
  76. <el-table-column label="审核状态" min-width="80px" align="center" :formatter="statue" />
  77. <el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width" fixed="right">
  78. <template slot-scope="{row}">
  79. <el-button v-if="isSubscribeSee" type="primary" size="mini" @click="handleSee(row)">查看</el-button>
  80. <el-button v-if="row.statue == 4||row.statue == 6||row.statue == 8" style="display:inline-block" type="success" size="mini" @click="handleUpdate(row)">编辑</el-button>
  81. <el-button v-else style="display:none" type="success" size="mini" @click="handleUpdate(row)">编辑</el-button>
  82. <!-- 库管 -->
  83. <el-button v-if="isSubscribeExamineKG && row.statue == 2" style="display:inline-block" type="success" size="mini" @click="handleExamine(row)">审核1</el-button>
  84. <el-button v-else style="display:none" type="success" size="mini" @click="handleExamine(row)">审核1</el-button>
  85. <!-- 主管 -->
  86. <el-button v-if="isSubscribeExamineZG && row.statue == 3" style="display:inline-block" type="success" size="mini" @click="handleExamine2(row)">审核2</el-button>
  87. <el-button v-else style="display:none" type="success" size="mini" @click="handleExamine2(row)">审核2</el-button>
  88. <!-- 采购 -->
  89. <el-button v-if="isSubscribeExamineCG && row.statue == 5" style="display:inline-block" type="success" size="mini" @click="handleExamine3(row)">审核3</el-button>
  90. <el-button v-else style="display:none" type="success" size="mini" @click="handleExamine3(row)">审核3</el-button>
  91. <el-button v-if="isSubscribeDelete && (row.statue == 4||row.statue == 6||row.statue == 8)" style="display:inline-block" type="danger" size="mini" @click="handleDelete(row)">删除</el-button>
  92. <el-button v-else style="display:none" type="danger" size="mini" @click="handleDelete(row)">删除</el-button>
  93. </template>
  94. </el-table-column>
  95. </el-table>
  96. <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="getList" />
  97. <!-- 弹出层新增or修改 -->
  98. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="90%">
  99. <div class="app-container">
  100. <el-form
  101. ref="createTemp"
  102. :rules="rules"
  103. :model="createTemp"
  104. label-position="right"
  105. label-width="100px"
  106. style="width: 90%;margin:0 auto;"
  107. >
  108. <el-row>
  109. <el-col :span="8">
  110. <el-form-item label="申购单号:" prop="orderNumber">
  111. <el-input ref="orderNumber" v-model="createTemp.orderNumber" disabled />
  112. </el-form-item>
  113. </el-col>
  114. <el-col :span="8">
  115. <el-form-item label="牧场:" prop="pastureId">
  116. <el-select v-model="createTemp.pastureId" placeholder="牧场" class="filter-item" style="width:100%" :disabled="dialogStatus==='update'" @change="changePasture">
  117. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
  118. </el-select>
  119. </el-form-item>
  120. </el-col>
  121. <el-col :span="8">
  122. <el-form-item label="申购部门:" prop="departmentId">
  123. <el-select v-model="createTemp.departmentId" placeholder="申购部门" class="filter-item" style="width:100%" :disabled="dialogStatus==='update'" @change="changeDepart">
  124. <el-option v-for="item in createDepartList" :key="item.id" :label="item.name" :value="item.id" />
  125. </el-select>
  126. </el-form-item>
  127. </el-col>
  128. </el-row>
  129. <el-row>
  130. <el-col :span="8">
  131. <el-form-item label="申购人:" prop="employeId">
  132. <el-select v-model="createTemp.employeId" placeholder="申购人" class="filter-item" style="width:100%" :disabled="dialogStatus==='update'">
  133. <el-option v-for="item in findAllEmploye" :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="createTime">
  139. <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'" />
  140. </el-form-item>
  141. </el-col>
  142. <el-col v-if="dialogStatus==='create'" :span="8">
  143. <el-form-item label="线上采购:" prop="providerId">
  144. <el-select v-model="createTemp.providerId" placeholder="线上采购" clearable class="filter-item" style="width:100%" @change="changeProvider">
  145. <el-option v-for="item in onlineSubscriptionList" :key="item.id" :label="item.providerName" :value="item.id" />
  146. </el-select>
  147. </el-form-item>
  148. </el-col>
  149. <el-col v-if="dialogStatus==='update'" :span="8">
  150. <el-form-item label="线上采购:" prop="providerName">
  151. <el-input ref="providerName" v-model="createTemp.providerName" disabled />
  152. </el-form-item>
  153. </el-col>
  154. </el-row>
  155. <el-row>
  156. <el-col :span="16">
  157. <el-form-item label="备件:" prop="partCode">
  158. <el-autocomplete
  159. v-model="createTemp.partCode"
  160. value-key="name"
  161. class="inline-input"
  162. :fetch-suggestions="sparePartSearch"
  163. placeholder="请输入备件编号或备件名称或备件规格"
  164. style="width:100%"
  165. @select="handleSelectSparePart"
  166. >
  167. <template slot-scope="{ item }">
  168. <b>备件编号:</b><div class="name" style="display: inline;">{{ item.partCode }}</div>&nbsp;
  169. | &nbsp;<b>备件名称:</b><span class="addr">{{ item.partName }}</span>&nbsp;
  170. | &nbsp;<b>备件规格:</b><span class="addr">{{ item.specification }}</span>
  171. </template>
  172. </el-autocomplete>
  173. </el-form-item>
  174. </el-col>
  175. </el-row>
  176. </el-form>
  177. <el-table
  178. :key="tableKey"
  179. v-loading="listLoading"
  180. element-loading-text="给我一点时间"
  181. :data="listAdd"
  182. border
  183. fit
  184. highlight-current-row
  185. style="width: 100%;margin-bottom:30px"
  186. :row-style="rowStyle"
  187. :cell-style="cellStyle"
  188. class="elTable"
  189. >
  190. <!-- table表格 -->
  191. <el-table-column label="序号" align="center" type="index" width="50px" />
  192. <el-table-column label="备件编号" prop="partCode" align="center" min-width="90">
  193. <template slot-scope="scope">
  194. <span>{{ scope.row.partCode }}</span>
  195. </template>
  196. </el-table-column>
  197. <el-table-column label="备件名称" prop="partName" align="center" min-width="90">
  198. <template slot-scope="scope">
  199. <span>{{ scope.row.partName }}</span>
  200. </template>
  201. </el-table-column>
  202. <el-table-column label="备件规格" prop="specification" min-width="80px" align="center">
  203. <template slot-scope="scope">
  204. <span>{{ scope.row.specification }}</span>
  205. </template>
  206. </el-table-column>
  207. <el-table-column label="备件图片" prop="picpath" min-width="110px" align="center">
  208. <template slot-scope="scope">
  209. <el-popover placement="right" title="" trigger="hover">
  210. <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
  211. <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  212. </el-popover>
  213. </template>
  214. </el-table-column>
  215. <el-table-column label="备件品牌" prop="brand" align="center" min-width="60">
  216. <template slot-scope="scope">
  217. <span v-if="dialogStatus==='create'">{{ scope.row.brandName }}</span>
  218. <span v-if="dialogStatus==='update'">{{ scope.row.brandName }}</span>
  219. </template>
  220. </el-table-column>
  221. <el-table-column label="计量单位" prop="unit" align="center" min-width="60">
  222. <template slot-scope="scope">
  223. <span>{{ scope.row.unit }}</span>
  224. </template>
  225. </el-table-column>
  226. <el-table-column label="现有库存" prop="reportery" align="center" min-width="60">
  227. <template slot-scope="scope">
  228. <span>{{ scope.row.reportery }}</span>
  229. </template>
  230. </el-table-column>
  231. <el-table-column label="价格" prop="price" align="center" min-width="60">
  232. <template slot-scope="scope">
  233. <span v-if="createTemp.providerId == ''">{{ scope.row.price }}</span>
  234. <el-form v-else :model="scope.row" :rules="rules">
  235. <el-form-item prop="price">
  236. <el-input v-model="scope.row.price" style="margin-top:15px" />
  237. </el-form-item>
  238. </el-form>
  239. </template>
  240. </el-table-column>
  241. <el-table-column label="申购数量" min-width="120px" align="center" valign="middle">
  242. <template slot-scope="scope">
  243. <el-form :model="scope.row" :rules="rules">
  244. <el-form-item prop="amount">
  245. <el-input v-model="scope.row.amount" style="margin-top:15px" />
  246. </el-form-item>
  247. </el-form>
  248. </template>
  249. </el-table-column>
  250. <el-table-column label="备注" min-width="110px" align="center" valign="middle">
  251. <template slot-scope="scope">
  252. <el-input v-model="scope.row.purpose" />
  253. </template>
  254. </el-table-column>
  255. <el-table-column
  256. label="操作"
  257. align="center"
  258. width="100"
  259. class-name="small-padding fixed-width"
  260. fixed="right"
  261. >
  262. <template slot-scope="{row}">
  263. <a class="del" @click="partDelete(row)">删除</a>
  264. </template>
  265. </el-table-column>
  266. </el-table>
  267. <div slot="footer" class="dialog-footer" style="bottom:10px">
  268. <el-button type="primary" :disabled="isokDisable" @click="dialogStatus==='create'?createData():updateData()">保存并关闭</el-button>
  269. <el-button @click="dialogFormVisible = false;getList()">取消并关闭</el-button>
  270. </div>
  271. </div>
  272. </el-dialog>
  273. <!-- 查看 -->
  274. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisibleSee" :close-on-click-modal="false" width="90%">
  275. <div class="app-containerSee">
  276. <el-form
  277. ref="seeTemp"
  278. :rules="rules"
  279. :model="seeTemp"
  280. label-position="right"
  281. label-width="100px"
  282. style="width: 90%;margin:0 auto;"
  283. >
  284. <el-row>
  285. <el-col :span="8">
  286. <el-form-item label="申购单号:" prop="orderNumber">
  287. <el-input ref="orderNumber" v-model="seeTemp.orderNumber" disabled />
  288. </el-form-item>
  289. </el-col>
  290. <el-col :span="8">
  291. <el-form-item label="牧场:" prop="pastureId">
  292. <el-select v-model="seeTemp.pastureId" placeholder="牧场" class="filter-item" disabled style="width:100%">
  293. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
  294. </el-select>
  295. </el-form-item>
  296. </el-col>
  297. <el-col :span="8">
  298. <el-form-item label="申购部门:" prop="departmentName">
  299. <el-input ref="departmentName" v-model="seeTemp.departmentName" disabled />
  300. </el-form-item>
  301. </el-col>
  302. </el-row>
  303. <el-row>
  304. <el-col :span="8">
  305. <el-form-item label="申购人:" prop="empname">
  306. <el-input ref="empname" v-model="seeTemp.empname" disabled />
  307. </el-form-item>
  308. </el-col>
  309. <el-col :span="8">
  310. <el-form-item label="申购日期:" prop="createTime">
  311. <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 />
  312. </el-form-item>
  313. </el-col>
  314. <el-col :span="8">
  315. <el-form-item label="线上采购:" prop="providerName">
  316. <el-input ref="providerName" v-model="seeTemp.providerName" disabled />
  317. </el-form-item>
  318. </el-col>
  319. </el-row>
  320. </el-form>
  321. <el-table
  322. :key="tableKey"
  323. v-loading="listLoadingSee"
  324. element-loading-text="给我一点时间"
  325. :data="listSee"
  326. border
  327. fit
  328. highlight-current-row
  329. style="width: 100%;margin-bottom:30px"
  330. :row-style="rowStyle"
  331. :cell-style="cellStyle"
  332. class="elTable"
  333. @sort-change="tableSort"
  334. >
  335. <el-table-column type="index" label="序号" align="center" width="50px" />
  336. <el-table-column label="备件编号" prop="partCode" align="center" min-width="90">
  337. <template slot-scope="scope">
  338. <span>{{ scope.row.partCode }}</span>
  339. </template>
  340. </el-table-column>
  341. <el-table-column label="备件名称" prop="partName" align="center" min-width="90">
  342. <template slot-scope="scope">
  343. <span>{{ scope.row.partName }}</span>
  344. </template>
  345. </el-table-column>
  346. <el-table-column label="备件规格" prop="specification" min-width="90px" align="center">
  347. <template slot-scope="scope">
  348. <span>{{ scope.row.specification }}</span>
  349. </template>
  350. </el-table-column>
  351. <el-table-column label="备件图片" prop="picpath" min-width="110px" align="center">
  352. <template slot-scope="scope">
  353. <el-popover placement="right" title="" trigger="hover">
  354. <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
  355. <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  356. </el-popover>
  357. </template>
  358. </el-table-column>
  359. <el-table-column label="备件品牌" prop="brandName" align="center" min-width="60">
  360. <template slot-scope="scope">
  361. <span>{{ scope.row.brandName }}</span>
  362. </template>
  363. </el-table-column>
  364. <el-table-column label="计量单位" prop="unit" align="center" min-width="60">
  365. <template slot-scope="scope">
  366. <span>{{ scope.row.unit }}</span>
  367. </template>
  368. </el-table-column>
  369. <el-table-column label="现有库存" sortable prop="storageAmount" align="center" min-width="60" />
  370. <el-table-column label="价格" sortable prop="price" align="center" min-width="60" />
  371. <el-table-column label="申购数量" sortable prop="amount" align="center" min-width="60" />
  372. <el-table-column label="备注" min-width="110px" align="center">
  373. <template slot-scope="scope">
  374. <span>{{ scope.row.purpose }}</span>
  375. </template>
  376. </el-table-column>
  377. </el-table>
  378. <el-form
  379. ref="seeTemp"
  380. :rules="rules"
  381. :model="seeTemp"
  382. label-position="right"
  383. label-width="100px"
  384. style="width: 90%;margin:0 auto;"
  385. >
  386. <el-row>
  387. <el-col>
  388. <el-form-item label="流程进度" />
  389. <el-steps :active="active" align-center finish-status="success">
  390. <el-step
  391. v-for="(item,index) in activeList"
  392. :key="index"
  393. :title="item.title"
  394. :status="item.status"
  395. >
  396. <template slot="description">
  397. <div class="step-row">
  398. <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
  399. <div>{{ item.reason }}</div>
  400. </div>
  401. </template>
  402. </el-step>
  403. </el-steps>
  404. </el-col>
  405. </el-row>
  406. <el-row>
  407. <el-col>
  408. <el-form-item label="操作:">
  409. <!-- 库管 -->
  410. <el-button v-if="isSubscribeExamineKG && seeTemp.statue == 2" type="success" style="display:inline-block" @click="handleExamine(row)">审核1</el-button>
  411. <el-button v-else type="success" style="display:none" @click="handleExamine(row)">审核1</el-button>
  412. <!-- 主管 -->
  413. <el-button v-if="isSubscribeExamineZG && seeTemp.statue == 3" type="success" style="display:inline-block" @click="handleExamine2(row)">审核2</el-button>
  414. <el-button v-else type="success" style="display:none" @click="handleExamine2(row)">审核2</el-button>
  415. <!-- 采购 -->
  416. <el-button v-if="isSubscribeExamineCG && seeTemp.statue == 5" type="success" style="display:inline-block" @click="handleExamine3(row)">审核3</el-button>
  417. <el-button v-else type="success" style="display:none" @click="handleExamine3(row)">审核3</el-button>
  418. </el-form-item>
  419. </el-col>
  420. </el-row>
  421. </el-form>
  422. <div slot="footer" class="dialog-footer" style="bottom:5px;">
  423. <el-button @click="dialogFormVisibleSee = false">关闭</el-button>
  424. </div>
  425. </div>
  426. </el-dialog>
  427. <!-- 审核 -->
  428. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_Examine" :close-on-click-modal="false" width="30%">
  429. <div class="app-examine">
  430. <h3 style="width: 100%;margin:0 0 0 5%;line-height:50px;">请确认审核结果:</h3>
  431. <el-form ref="examineTemp" :rules="rules" :model="examineTemp" label-position="right" style="width: 50%;margin:0 auto;">
  432. <el-row style="width:88%;height:150px;margin:0 auto;">
  433. <el-col :span="20">
  434. <el-form-item>
  435. <el-radio-group v-model="examineTemp.statue" @change="changeStatue">
  436. <el-radio :label="1" checked>通过</el-radio>
  437. <el-radio :label="2">不通过</el-radio>
  438. </el-radio-group>
  439. </el-form-item>
  440. </el-col>
  441. <el-col v-if="statueReason" :span="20">
  442. <el-input v-model="examineTemp.workflowNote" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入不通过原因" />
  443. </el-col>
  444. </el-row>
  445. </el-form>
  446. </div>
  447. <div slot="footer" class="dialog-footer">
  448. <el-button v-if="dialogStatus==='examine'" type="primary" :disabled="isokDisable" @click="createExamineData()">确认</el-button>
  449. <el-button v-if="dialogStatus==='examine2'" type="primary" :disabled="isokDisable" @click="createExamineData2()">确认</el-button>
  450. <el-button v-if="dialogStatus==='examine3'" type="primary" :disabled="isokDisable" @click="createExamineData3()">确认</el-button>
  451. <el-button @click="dialogFormVisible_Examine = false;">关闭</el-button>
  452. </div>
  453. </el-dialog>
  454. </div>
  455. </template>
  456. <script>
  457. // / 引入
  458. import { GetDataByName, GetDataByNames, PostDataByName, ExecDataByConfig, checkButtons, failproccess, GetAccount } from '@/api/common'
  459. import waves from '@/directive/waves' // waves directive
  460. import { parseTime, sortChange, json2excel } from '@/utils/index.js'
  461. // eslint-disable-next-line no-unused-vars
  462. import { validateEMail } from '@/utils/validate.js'
  463. import Pagination from '@/components/Pagination' // secondary package based on el-pagination
  464. import { MessageBox } from 'element-ui'
  465. import Cookies from 'js-cookie'
  466. import { getToken } from '@/utils/auth'
  467. export default {
  468. name: 'Subscribe',
  469. components: { Pagination },
  470. directives: { waves },
  471. data() {
  472. return {
  473. isSubscribeAdd: [], isSubscribeTemplate: [], isSubscribeImport: [], isSubscribeExport: [], isSubscribeSee: [], isSubscribeDelete: [], isSubscribeExamineKG: [], isSubscribeExamineCG: [], isSubscribeExamineZG: [],
  474. isokDisable: false,
  475. findAllProvider: [],
  476. findAllPasture: [],
  477. findAllDepart: [],
  478. findAllEmploye: [],
  479. onlineSubscriptionList: [], createDepartList: [], edit: 0,
  480. requestParams: [
  481. { name: 'findAllProvider', offset: 0, pagecount: 0, params: [] },
  482. { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
  483. { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
  484. { name: 'getflexProviderList', offset: 0, pagecount: 0, parammaps: {}}
  485. ],
  486. getDepartParam: {
  487. name: 'findAllDepart', offset: 0, pagecount: 0,
  488. parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }
  489. },
  490. pickerOptions: {
  491. disabledDate(time) {
  492. return time.getTime() > Date.now()// 当天之前的时间可选
  493. }
  494. },
  495. textMap: {
  496. update: '编辑',
  497. create: '新增',
  498. see: '查看',
  499. examine: '审核1',
  500. examine2: '审核2',
  501. examine3: '审核3'
  502. },
  503. rules: {
  504. equipmentName: [{ required: true, message: '必填', trigger: 'blur' }]
  505. },
  506. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  507. cellStyle: { padding: 0 + 'px' },
  508. statues: [{ id: '0', name: '审核中' }, { id: '1', name: '已通过' }, { id: '2', name: '未通过' }],
  509. radioAll: '全部',
  510. getdataListParm: {
  511. name: 'getpartpurchaseList',
  512. page: 1,
  513. offset: 1,
  514. pagecount: 10,
  515. returntype: 'Map',
  516. parammaps: {
  517. pastureName: Cookies.get('pasturename'),
  518. empId: Cookies.get('employeid'),
  519. orderNumber: '',
  520. stuteSH: '',
  521. departmentId: '',
  522. inputDatetime: '',
  523. startTime: '',
  524. stopTime: '',
  525. loginId: Cookies.get('employeid'),
  526. menu: 'Subscribe',
  527. logindeptId: Cookies.get('departmentid'),
  528. loginpastureId: Cookies.get('pastureid')
  529. }
  530. },
  531. tableKey: 0,
  532. listLoading: true,
  533. total: 0,
  534. list: [],
  535. dialogStatus: '',
  536. dialogFormVisible: false,
  537. dialogFormVisibleSee: false,
  538. listLoadingSee: true,
  539. listSee: [],
  540. totalSee: 0,
  541. seeTemp: {},
  542. getdataListSee: {
  543. name: 'getpartpurchaseBybig',
  544. returntype: 'Map',
  545. parammaps: {}
  546. },
  547. createTemp: {
  548. pastureId: this.$store.state.user.pastureid,
  549. departmentId: this.$store.state.user.departmentid,
  550. employeId: this.$store.state.user.employeid,
  551. createTime: parseTime(new Date(), '{y}-{m}-{d}'),
  552. providerId: ''
  553. },
  554. requestSparePart: {
  555. name: 'getPartsListSG',
  556. page: 1,
  557. offset: 1,
  558. pagecount: 20,
  559. returntype: 'Map',
  560. parammaps: {
  561. pastureId: Cookies.get('pastureid')
  562. }
  563. },
  564. getParmCreateNumber: {
  565. name: 'autoCreatCode',
  566. page: 0,
  567. offset: 0,
  568. pagecount: 0,
  569. returntype: 'Map',
  570. parammaps: {
  571. pastureId: Cookies.get('pastureid'),
  572. codeType: 'SG'
  573. }
  574. },
  575. getParmCreateAmount: {
  576. name: 'getPartsListSGv2',
  577. page: 0,
  578. offset: 0,
  579. pagecount: 0,
  580. returntype: 'Map',
  581. parammaps: {
  582. pastureId: Cookies.get('pastureid')
  583. }
  584. },
  585. listAdd: [],
  586. postDataPramas: {},
  587. requestParam: {},
  588. dialogFormVisible_Examine: false,
  589. examineTemp: {
  590. statue: 1
  591. },
  592. statueReason: false,
  593. activeList: [],
  594. active: 3,
  595. buttons: [],
  596. downloadParam: {},
  597. isPercentage: false,
  598. percentage: 1,
  599. pending: {
  600. total: 0,
  601. getdataListParm: {
  602. name: 'getpartpurchaseWebListNO', page: 1, offset: 1, getTotal: 'total3', pagecount: 10, returntype: 'Map',
  603. parammaps: {
  604. loginId: Cookies.get('employeid'),
  605. menu: 'Subscribe', logindeptId: Cookies.get('departmentid'), loginpastureId: Cookies.get('pastureid'),
  606. empId: Cookies.get('employeid'), pastureId: Cookies.get('pastureid'), deptId: Cookies.get('departmentid')
  607. }
  608. }
  609. }
  610. }
  611. },
  612. created() {
  613. const that = this
  614. GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
  615. that.buttons = response.data.list
  616. that.getButtons()
  617. })
  618. this.getDownList()
  619. this.getList()
  620. this.getPendingList()
  621. },
  622. methods: {
  623. tableSort(column) {
  624. sortChange(column, this.listSee)
  625. },
  626. getButtons() {
  627. // 新增
  628. const SubscribeAdd = 'customs:subscribe:add'
  629. const isSubscribeAdd = checkButtons(this.$store.state.user.buttons, SubscribeAdd)
  630. this.isSubscribeAdd = isSubscribeAdd
  631. // 模板
  632. // eslint-disable-next-line no-redeclare
  633. const SubscribeTemplate = 'customs:subscribe:template'
  634. const isSubscribeTemplate = checkButtons(this.$store.state.user.buttons, SubscribeTemplate)
  635. this.isSubscribeTemplate = isSubscribeTemplate
  636. // 导入
  637. // eslint-disable-next-line no-redeclare
  638. const SubscribeImport = 'customs:subscribe:import'
  639. const isSubscribeImport = checkButtons(this.$store.state.user.buttons, SubscribeImport)
  640. this.isSubscribeImport = isSubscribeImport
  641. // 导出
  642. // eslint-disable-next-line no-redeclare
  643. const SubscribeExport = 'customs:subscribe:export'
  644. const isSubscribeExport = checkButtons(this.$store.state.user.buttons, SubscribeExport)
  645. this.isSubscribeExport = isSubscribeExport
  646. // 查看
  647. // eslint-disable-next-line no-redeclare
  648. const SubscribeSee = 'customs:subscribe:see'
  649. const isSubscribeSee = checkButtons(this.$store.state.user.buttons, SubscribeSee)
  650. this.isSubscribeSee = isSubscribeSee
  651. // 删除
  652. // eslint-disable-next-line no-redeclare
  653. const SubscribeDelete = 'customs:subscribe:delete'
  654. const isSubscribeDelete = checkButtons(this.$store.state.user.buttons, SubscribeDelete)
  655. this.isSubscribeDelete = isSubscribeDelete
  656. // 库管审核
  657. // eslint-disable-next-line no-redeclare
  658. const SubscribeExamineKG = 'customs:subscribe:examineKG'
  659. const isSubscribeExamineKG = checkButtons(this.$store.state.user.buttons, SubscribeExamineKG)
  660. this.isSubscribeExamineKG = isSubscribeExamineKG
  661. // 主管审核
  662. // eslint-disable-next-line no-redeclare
  663. const SubscribeExamineZG = 'customs:subscribe:examineZG'
  664. const isSubscribeExamineZG = checkButtons(this.$store.state.user.buttons, SubscribeExamineZG)
  665. this.isSubscribeExamineZG = isSubscribeExamineZG
  666. // 采购审核
  667. // eslint-disable-next-line no-redeclare
  668. const SubscribeExamineCG = 'customs:subscribe:examineCG'
  669. const isSubscribeExamineCG = checkButtons(this.$store.state.user.buttons, SubscribeExamineCG)
  670. this.isSubscribeExamineCG = isSubscribeExamineCG
  671. },
  672. getPendingList() {
  673. this.pending.getdataListParm.parammaps.pastureName = this.getdataListParm.parammaps.pastureName
  674. this.pending.getdataListParm.parammaps.orderNumber = this.getdataListParm.parammaps.orderNumber
  675. this.pending.getdataListParm.parammaps.stuteSH = this.getdataListParm.parammaps.stuteSH
  676. this.pending.getdataListParm.parammaps.departmentId = this.getdataListParm.parammaps.departmentId
  677. this.pending.getdataListParm.parammaps.inputDatetime = this.getdataListParm.parammaps.inputDatetime
  678. this.pending.getdataListParm.parammaps.loginId = this.getdataListParm.parammaps.loginId
  679. this.pending.getdataListParm.parammaps.menu = this.getdataListParm.parammaps.menu
  680. this.pending.getdataListParm.parammaps.logindeptId = this.getdataListParm.parammaps.logindeptId
  681. this.pending.getdataListParm.parammaps.loginpastureId = this.getdataListParm.parammaps.loginpastureId
  682. this.pending.getdataListParm.parammaps.empId = this.getdataListParm.parammaps.empId
  683. this.pending.getdataListParm.parammaps.pastureId = Cookies.get('pastureid')
  684. this.pending.getdataListParm.parammaps.deptId = Cookies.get('departmentid')
  685. GetDataByName(this.pending.getdataListParm).then(response => {
  686. this.pending.total = response.data.total3
  687. })
  688. },
  689. getList() {
  690. this.listLoading = true
  691. if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
  692. this.getdataListParm.parammaps.startTime = this.$refs['inputDatetime'].value[0]
  693. this.getdataListParm.parammaps.stopTime = this.$refs['inputDatetime'].value[1]
  694. } else {
  695. this.getdataListParm.parammaps.startTime = ''
  696. this.getdataListParm.parammaps.stopTime = ''
  697. }
  698. GetDataByName(this.getdataListParm).then(response => {
  699. if (response.data.list !== null) {
  700. console.log('table数据', response.data.list)
  701. this.list = response.data.list
  702. this.pageNum = response.data.pageNum
  703. this.pageSize = response.data.pageSize
  704. } else {
  705. this.list = []
  706. }
  707. this.total = response.data.total
  708. setTimeout(() => {
  709. this.listLoading = false
  710. }, 100)
  711. })
  712. },
  713. changeAll() {
  714. console.log(this.radioAll)
  715. if (this.radioAll === '全部') {
  716. this.getdataListParm.name = 'getpartpurchaseList'
  717. this.getdataListParm.offset = 1
  718. this.getdataListParm.parammaps = {
  719. pastureName: Cookies.get('pasturename'),
  720. orderNumber: '',
  721. departmentId: '',
  722. inputDatetime: '',
  723. startTime: '',
  724. stopTime: '',
  725. loginId: Cookies.get('employeid'),
  726. menu: 'Subscribe',
  727. logindeptId: Cookies.get('departmentid'),
  728. loginpastureId: Cookies.get('pastureid')
  729. }
  730. this.getList()
  731. } else if (this.radioAll === '待处理') {
  732. this.getdataListParm.name = 'getpartpurchaseWebListNO'
  733. this.getdataListParm.offset = 1
  734. this.getdataListParm.parammaps = {
  735. pastureName: this.getdataListParm.parammaps.pastureName,
  736. orderNumber: this.getdataListParm.parammaps.orderNumber,
  737. stuteSH: this.getdataListParm.parammaps.stuteSH,
  738. departmentId: this.getdataListParm.parammaps.departmentId,
  739. inputDatetime: this.getdataListParm.parammaps.inputDatetime,
  740. startTime: this.getdataListParm.parammaps.startTime,
  741. stopTime: this.getdataListParm.parammaps.stopTime,
  742. loginId: Cookies.get('employeid'),
  743. menu: 'Subscribe',
  744. logindeptId: Cookies.get('departmentid'),
  745. loginpastureId: Cookies.get('pastureid'),
  746. empId: Cookies.get('employeid'),
  747. pastureId: Cookies.get('pastureid'),
  748. deptId: Cookies.get('departmentid')
  749. }
  750. this.getList()
  751. } else if (this.radioAll === '已处理') {
  752. this.getdataListParm.name = 'getpartpurchaseWebList'
  753. this.getdataListParm.offset = 1
  754. this.getdataListParm.parammaps = {
  755. pastureName: this.getdataListParm.parammaps.pastureName,
  756. orderNumber: this.getdataListParm.parammaps.orderNumber,
  757. stuteSH: this.getdataListParm.parammaps.stuteSH,
  758. departmentId: this.getdataListParm.parammaps.departmentId,
  759. inputDatetime: this.getdataListParm.parammaps.inputDatetime,
  760. startTime: this.getdataListParm.parammaps.startTime,
  761. stopTime: this.getdataListParm.parammaps.stopTime,
  762. loginId: Cookies.get('employeid'),
  763. menu: 'Subscribe',
  764. logindeptId: Cookies.get('departmentid'),
  765. loginpastureId: Cookies.get('pastureid'),
  766. empId: Cookies.get('employeid'),
  767. pastureId: Cookies.get('pastureid'),
  768. deptId: Cookies.get('departmentid')
  769. }
  770. this.getList()
  771. }
  772. },
  773. statue: function(cellValue) {
  774. // console.log(cellValue.isZeroStock)
  775. if (cellValue.statue == 2) {
  776. return '审核中'
  777. } else if (cellValue.statue == 3) {
  778. return '审核中'
  779. } else if (cellValue.statue == 4) {
  780. return '未通过'
  781. } else if (cellValue.statue == 5) {
  782. return '审核中'
  783. } else if (cellValue.statue == 6) {
  784. return '未通过'
  785. } else if (cellValue.statue == 7) {
  786. return '已通过'
  787. } else if (cellValue.statue == 8) {
  788. return '未通过'
  789. }
  790. },
  791. handleFilter() {
  792. console.log('点击了table搜索')
  793. if (this.getdataListParm.parammaps.inputDatetime === null) {
  794. this.getdataListParm.parammaps.inputDatetime = ''
  795. }
  796. this.getdataListParm.offset = 1
  797. this.listLoading = true
  798. this.getList()
  799. this.getPendingList()
  800. },
  801. resetCreateTemp() {
  802. this.createTemp.pastureId = parseInt(Cookies.get('pastureid'))
  803. this.createTemp.departmentId = parseInt(Cookies.get('departmentid'))
  804. this.createTemp.employeId = parseInt(Cookies.get('employeid'))
  805. this.createTemp.createTime = parseTime(new Date(), '{y}-{m}-{d}')
  806. this.createTemp.orderNumber = ''
  807. this.createTemp.providerId = ''
  808. this.listAdd = []
  809. },
  810. handleCreate() {
  811. this.resetCreateTemp()
  812. this.edit = 1
  813. this.getDepartParam.parammaps.pastureId = this.createTemp.pastureId
  814. this.getCreateDepartDownList()
  815. this.dialogStatus = 'create'
  816. this.dialogFormVisible = true
  817. this.$nextTick(() => {
  818. this.$refs['createTemp'].clearValidate()
  819. })
  820. this.getCreateNumber()
  821. },
  822. getCreateNumber() {
  823. GetDataByName(this.getParmCreateNumber).then(response => {
  824. this.$nextTick(() => {
  825. console.log('新增申购单号', response.data.list[0].orderCode)
  826. this.createTemp.orderNumber = response.data.list[0].orderCode
  827. this.$forceUpdate()
  828. })
  829. })
  830. },
  831. // getPartsListSG
  832. changeProvider(item) {
  833. if (item !== '') {
  834. this.createTemp.providerName = this.onlineSubscriptionList.find(obj => obj.id == item).providerName
  835. }
  836. this.listAdd = []
  837. },
  838. sparePartSearch(queryString, cb) {
  839. console.log('备件模糊查询输入值', queryString)
  840. if (this.createTemp.providerId == '') {
  841. this.requestSparePart.name = 'getPartsListSG'
  842. } else {
  843. this.requestSparePart.name = 'getPartsListSGFlex'
  844. this.requestSparePart.parammaps.providerId = this.createTemp.providerId
  845. this.requestSparePart.parammaps.providerName = this.createTemp.providerName
  846. }
  847. this.requestSparePart.parammaps['partCode'] = queryString
  848. GetDataByName(this.requestSparePart).then(response => {
  849. console.log('备件模糊查询搜索data', response.data.list)
  850. if (response.data.list == null) {
  851. cb([])
  852. } else {
  853. cb(response.data.list)
  854. }
  855. })
  856. },
  857. handleSelectSparePart(item) {
  858. console.log('备件模糊查询选中值', item)
  859. console.log('备件模糊查询选中值', item.partId)
  860. console.log(this.listAdd)
  861. if (this.createTemp.providerId == '') {
  862. if (this.listAdd.length > 0) {
  863. // eslint-disable-next-line no-redeclare
  864. if (this.listAdd.find(obj => obj.partId == item.partId)) {
  865. this.$message({ type: 'warning', message: '此备件已存在,请重新选择备件' })
  866. } else {
  867. // this.getParmCreateAmount.parammaps.partCode = item.partCode
  868. // GetDataByName(this.getParmCreateAmount).then(response => {
  869. // this.$nextTick(() => {
  870. // console.log('新增根据编号获取备件库存数量', response.data.list[0].reporteryNum)
  871. // item.reportery = response.data.list[0].reporteryNum
  872. // if (item.srcpath !== null && item.picpath) {
  873. // this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  874. // this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  875. // } else {
  876. // item.srcpath = ''
  877. // item.picpath = ''
  878. // }
  879. // this.listAdd.unshift(item)
  880. // this.$forceUpdate()
  881. // })
  882. // })
  883. this.getParmCreateAmount.parammaps.partCode = item.partCode
  884. GetDataByName(this.getParmCreateAmount).then(response => {
  885. this.$nextTick(() => {
  886. console.log('新增根据编号获取备件库存数量', response.data.list[0])
  887. item = response.data.list[0]
  888. if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  889. this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  890. this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  891. } else {
  892. item.srcpath = ''
  893. item.picpath = ''
  894. }
  895. this.$set(item, 'amount', '')
  896. this.$set(item, 'purpose', '')
  897. this.listAdd.unshift(item)
  898. this.$forceUpdate()
  899. })
  900. })
  901. }
  902. } else {
  903. // this.getParmCreateAmount.parammaps.partCode = item.partCode
  904. // GetDataByName(this.getParmCreateAmount).then(response => {
  905. // this.$nextTick(() => {
  906. // console.log('新增根据编号获取备件库存数量', response.data.list[0].reporteryNum)
  907. // item.reportery = response.data.list[0].reporteryNum
  908. // if (item.srcpath !== null && item.picpath) {
  909. // this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  910. // this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  911. // } else {
  912. // item.srcpath = ''
  913. // item.picpath = ''
  914. // }
  915. // this.listAdd.unshift(item)
  916. // this.$forceUpdate()
  917. // })
  918. // })
  919. this.getParmCreateAmount.parammaps.partCode = item.partCode
  920. GetDataByName(this.getParmCreateAmount).then(response => {
  921. this.$nextTick(() => {
  922. console.log('新增根据编号获取备件库存数量', response.data.list[0])
  923. item = response.data.list[0]
  924. if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  925. this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  926. this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  927. } else {
  928. item.srcpath = ''
  929. item.picpath = ''
  930. }
  931. this.$set(item, 'amount', '')
  932. this.$set(item, 'purpose', '')
  933. this.listAdd.unshift(item)
  934. this.$forceUpdate()
  935. })
  936. })
  937. }
  938. this.$forceUpdate()
  939. } else {
  940. if (this.listAdd.length > 0) {
  941. if (this.listAdd.find(obj => obj.partId == item.partId)) {
  942. this.$message({ type: 'warning', message: '此备件已存在,请重新选择备件' })
  943. } else {
  944. if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  945. this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  946. this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  947. } else {
  948. item.srcpath = ''
  949. item.picpath = ''
  950. }
  951. this.$set(item, 'amount', '')
  952. this.$set(item, 'purpose', '')
  953. this.listAdd.unshift(item)
  954. }
  955. } else {
  956. if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  957. this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  958. this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  959. } else {
  960. item.srcpath = ''
  961. item.picpath = ''
  962. }
  963. this.$set(item, 'amount', '')
  964. this.$set(item, 'purpose', '')
  965. this.listAdd.unshift(item)
  966. this.$forceUpdate()
  967. }
  968. this.$forceUpdate()
  969. }
  970. },
  971. createData() {
  972. this.isokDisable = true
  973. setTimeout(() => {
  974. this.isokDisable = false
  975. }, 1000)
  976. this.$refs['createTemp'].validate(valid => {
  977. if (valid) {
  978. console.log(this.listAdd)
  979. if (this.createTemp.orderNumber == '' || this.createTemp.orderNumber == null || this.createTemp.orderNumber == undefined) {
  980. GetDataByName(this.getParmCreateNumber).then(response => {
  981. this.$nextTick(() => {
  982. console.log('新增申购单号', response.data.list[0].orderCode)
  983. this.createTemp.orderNumber = response.data.list[0].orderCode
  984. this.$forceUpdate()
  985. this.createDataSave()
  986. })
  987. })
  988. } else {
  989. this.createDataSave()
  990. }
  991. }
  992. })
  993. },
  994. createDataSave() {
  995. if (this.listAdd.length !== 0) {
  996. for (var j = 0; j < this.listAdd.length; j++) {
  997. console.log(this.listAdd[j].amount)
  998. if (this.listAdd[j].amount == null || this.listAdd[j].amount === '') {
  999. this.$message({ type: 'warning', message: '请检查申购数量是否未填写', duration: 2000 })
  1000. return false
  1001. } else {
  1002. var rulesAmount = /^[1-9]\d*$/
  1003. if (!rulesAmount.test(this.listAdd[j].amount)) {
  1004. this.$message({ type: 'error', message: '申购数量请输入正整数', duration: 2000 })
  1005. return false
  1006. }
  1007. }
  1008. if (this.createTemp.providerId !== '') {
  1009. if (this.listAdd[j].price == '') {
  1010. this.$message({ type: 'warning', message: '请检查单价是否为空', duration: 2000 })
  1011. return false
  1012. } else {
  1013. if (parseFloat(this.listAdd[j].price) == 0) {
  1014. this.$message({ type: 'warning', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
  1015. return false
  1016. } else {
  1017. var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,5})?$/
  1018. if (rulesPrice.test(this.listAdd[j].price) == false) {
  1019. this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
  1020. return false
  1021. }
  1022. }
  1023. }
  1024. }
  1025. }
  1026. this.postDataPramas.common = { 'returnmap': '0' }
  1027. this.postDataPramas.data = []
  1028. this.postDataPramas.data[0] = { 'name': 'insertBigPartpurchase', 'type': 'e', 'parammaps': {
  1029. pastureId: this.createTemp.pastureId,
  1030. departmentId: this.createTemp.departmentId,
  1031. orderNumber: this.createTemp.orderNumber,
  1032. useType: this.createTemp.useType,
  1033. createTime: this.createTemp.createTime,
  1034. employeId: this.createTemp.employeId,
  1035. providerId: this.createTemp.providerId
  1036. }}
  1037. // eslint-disable-next-line no-irregular-whitespace
  1038. this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
  1039. this.postDataPramas.data[1].children = []
  1040. this.postDataPramas.data[1].children[0] = { 'name': 'insertPartpurchase', 'type': 'e', 'parammaps': {
  1041. bigId: '@insertBigPartpurchase.LastInsertId',
  1042. pastureId: '@insertSpotList.pastureId',
  1043. partId: '@insertSpotList.partId',
  1044. partCode: '@insertSpotList.partCode',
  1045. partName: '@insertSpotList.partName',
  1046. specification: '@insertSpotList.specification',
  1047. unit: '@insertSpotList.unit',
  1048. brandId: '@insertSpotList.brandId',
  1049. storageAmount: '@insertSpotList.reportery',
  1050. purpose: '@insertSpotList.purpose',
  1051. amount: '@insertSpotList.amount',
  1052. price: '@insertSpotList.price',
  1053. contractId: '@insertSpotList.contractId'
  1054. }}
  1055. ExecDataByConfig(this.postDataPramas).then(response => {
  1056. console.log('新增保存发送参数', this.postDataPramas)
  1057. if (response.msg === 'fail') {
  1058. this.$notify({
  1059. title: '保存失败',
  1060. message: response.data,
  1061. type: 'warning',
  1062. duration: 2000
  1063. })
  1064. } else {
  1065. this.dialogFormVisible = false
  1066. this.getdataListParm.parammaps.inputDatetime = ''
  1067. this.getList()
  1068. this.getPendingList()
  1069. this.$notify({
  1070. title: '',
  1071. message: '保存成功',
  1072. type: 'success',
  1073. duration: 2000
  1074. })
  1075. }
  1076. })
  1077. return true
  1078. } else {
  1079. this.$message({
  1080. title: '',
  1081. message: '请选择备件',
  1082. type: 'warning',
  1083. duration: 2000
  1084. })
  1085. return false
  1086. }
  1087. },
  1088. partDelete(row) {
  1089. console.log(this.listAdd)
  1090. MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
  1091. confirmButtonText: '确认',
  1092. cancelButtonText: '取消',
  1093. type: 'warning'
  1094. }).then(() => {
  1095. // console.log(this.list2)
  1096. for (var i = 0; i < this.listAdd.length; i++) {
  1097. console.log(this.listAdd[i])
  1098. if (this.listAdd[i].id === row.id) {
  1099. var listAddIndex = this.listAdd.indexOf(this.listAdd[i])
  1100. }
  1101. if (listAddIndex > -1) {
  1102. this.listAdd.splice(listAddIndex, 1)
  1103. return
  1104. }
  1105. }
  1106. })
  1107. },
  1108. // 查看
  1109. handleSee(row) {
  1110. this.dialogStatus = 'see'
  1111. this.dialogFormVisibleSee = true
  1112. this.seeTemp = Object.assign({}, row)
  1113. console.log('查看上方数据(从table读取)', this.seeTemp)
  1114. this.listSee = []
  1115. this.getdataListSee.parammaps.id = this.seeTemp.id
  1116. this.getSeeList()
  1117. // 流程图
  1118. var reason = '未通过原因:' + this.seeTemp.workflowNote
  1119. if (this.seeTemp.statue === 2) {
  1120. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核' }, { title: '供应主管审核' }, { title: '采购审核' }]
  1121. this.active = 1
  1122. } else if (this.seeTemp.statue === 3) {
  1123. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '供应主管审核' }, { title: '采购审核' }]
  1124. this.active = 2
  1125. } else if (this.seeTemp.statue === 4) {
  1126. 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: '采购审核' }]
  1127. this.active = 2
  1128. } else if (this.seeTemp.statue === 5) {
  1129. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '采购审核' }]
  1130. this.active = 3
  1131. } else if (this.seeTemp.statue === 6) {
  1132. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson, status: 'error', reason: reason }, { title: '采购审核' }]
  1133. this.active = 3
  1134. } else if (this.seeTemp.statue === 7) {
  1135. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '采购审核', date: this.seeTemp.CGChargedate, name: this.seeTemp.CGChargePerson }]
  1136. this.active = 4
  1137. } else if (this.seeTemp.statue === 8) {
  1138. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '采购审核', date: this.seeTemp.CGChargedate, name: this.seeTemp.CGChargePerson, status: 'error', reason: reason }]
  1139. this.active = 4
  1140. }
  1141. },
  1142. getSeeList() {
  1143. GetDataByName(this.getdataListSee).then(response => {
  1144. if (response.data.list !== null) {
  1145. console.log('查看下方table数据', response.data.list)
  1146. this.listSee = response.data.list
  1147. this.listAdd = response.data.list
  1148. for (let i = 0; i < response.data.list.length; i++) {
  1149. 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) {
  1150. console.log(process.env.VUE_APP_BASE_API + response.data.list[i].srcpath, '=======1')
  1151. this.listSee[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  1152. this.listSee[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  1153. this.listAdd[i].srcpath = this.listSee[i].srcpath
  1154. this.listAdd[i].picpath = this.listSee[i].picpath
  1155. // this.seeTemp.providerName = response.data.list.providerName
  1156. this.pageNumSee = response.data.pageNum
  1157. this.pageSizeSee = response.data.pageSize
  1158. } else {
  1159. this.listSee[i].srcpath = ''
  1160. this.listSee[i].picpath = ''
  1161. this.listAdd[i].srcpath = ''
  1162. this.listAdd[i].picpath = ''
  1163. }
  1164. console.log(process.env.VUE_APP_BASE_API)
  1165. console.log(this.listSee, '============')
  1166. }
  1167. }
  1168. if (response.data.total) {
  1169. this.totalSee = response.data.total
  1170. }
  1171. setTimeout(() => {
  1172. this.listLoadingSee = false
  1173. }, 100)
  1174. })
  1175. },
  1176. handleUpdate(row) {
  1177. this.edit = 0
  1178. this.getDepartParam.parammaps.pastureId = row.pastureId
  1179. this.getCreateDepartDownList()
  1180. if (row.providerId == undefined) {
  1181. row.providerId = ''
  1182. row.providerName = ''
  1183. }
  1184. this.createTemp = Object.assign({}, row) // copy obj
  1185. this.dialogStatus = 'update'
  1186. this.dialogFormVisible = true
  1187. this.$nextTick(() => {
  1188. this.$refs['createTemp'].clearValidate()
  1189. })
  1190. this.getdataListSee.parammaps.id = this.createTemp.id
  1191. this.getSeeList()
  1192. },
  1193. updateData() {
  1194. this.isokDisable = true
  1195. setTimeout(() => {
  1196. this.isokDisable = false
  1197. }, 1000)
  1198. this.$refs['createTemp'].validate(valid => {
  1199. if (valid) {
  1200. this.updateDataSave()
  1201. }
  1202. })
  1203. },
  1204. updateDataSave() {
  1205. if (this.listAdd.length !== 0) {
  1206. for (var j = 0; j < this.listAdd.length; j++) {
  1207. console.log(this.listAdd[j].amount)
  1208. // eslint-disable-next-line use-isnan
  1209. if (this.listAdd[j].amount == null || this.listAdd[j].amount === '') {
  1210. this.$message({ type: 'warning', message: '请检查申购数量是否未填写', duration: 2000 })
  1211. return false
  1212. } else {
  1213. var rulesAmount = /^[1-9]\d*$/
  1214. if (!rulesAmount.test(this.listAdd[j].amount)) {
  1215. this.$message({ type: 'error', message: '申购数量请输入正整数', duration: 2000 })
  1216. return false
  1217. }
  1218. }
  1219. if (this.createTemp.providerId !== '') {
  1220. if (this.listAdd[j].price == '') {
  1221. this.$message({ type: 'warning', message: '请检查单价是否为空', duration: 2000 })
  1222. return false
  1223. } else {
  1224. if (parseFloat(this.listAdd[j].price) == 0) {
  1225. this.$message({ type: 'warning', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
  1226. return false
  1227. } else {
  1228. var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,5})?$/
  1229. if (rulesPrice.test(this.listAdd[j].price) == false) {
  1230. this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
  1231. return false
  1232. }
  1233. }
  1234. }
  1235. }
  1236. }
  1237. this.postDataPramas.common = { 'returnmap': '0' }
  1238. this.postDataPramas.data = []
  1239. this.postDataPramas.data[0] = { 'name': 'updatepartpurchaseCharge', 'type': 'e', 'parammaps': {
  1240. id: this.createTemp.id
  1241. }}
  1242. this.postDataPramas.data[1] = { 'name': 'deletePartpurchase', 'type': 'e', 'parammaps': {
  1243. bigId: this.createTemp.id
  1244. }}
  1245. // eslint-disable-next-line no-irregular-whitespace
  1246. this.postDataPramas.data[2] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
  1247. this.postDataPramas.data[2].children = []
  1248. this.postDataPramas.data[2].children[0] = { 'name': 'insertPartpurchase', 'type': 'e', 'parammaps': {
  1249. bigId: this.createTemp.id,
  1250. pastureId: '@insertSpotList.pastureId',
  1251. partId: '@insertSpotList.partId',
  1252. partCode: '@insertSpotList.partCode',
  1253. partName: '@insertSpotList.partName',
  1254. specification: '@insertSpotList.specification',
  1255. unit: '@insertSpotList.unit',
  1256. brandId: '@insertSpotList.brandId',
  1257. storageAmount: '@insertSpotList.reportery',
  1258. purpose: '@insertSpotList.purpose',
  1259. amount: '@insertSpotList.amount',
  1260. price: '@insertSpotList.price',
  1261. contractId: '@insertSpotList.contractId'
  1262. }}
  1263. ExecDataByConfig(this.postDataPramas).then(response => {
  1264. console.log('新增保存发送参数', this.postDataPramas)
  1265. if (response.msg === 'fail') {
  1266. this.$notify({
  1267. title: '保存失败',
  1268. message: response.data,
  1269. type: 'warning',
  1270. duration: 2000
  1271. })
  1272. } else {
  1273. this.dialogFormVisible = false
  1274. this.getdataListParm.parammaps.inputDatetime = ''
  1275. this.getList()
  1276. this.$notify({
  1277. title: '',
  1278. message: '保存成功',
  1279. type: 'success',
  1280. duration: 2000
  1281. })
  1282. }
  1283. })
  1284. return true
  1285. } else {
  1286. this.$message({
  1287. title: '',
  1288. message: '请选择备件',
  1289. type: 'warning',
  1290. duration: 2000
  1291. })
  1292. return false
  1293. }
  1294. },
  1295. getDownList() {
  1296. GetDataByNames(this.requestParams).then(response => {
  1297. this.findAllProvider = response.data.findAllProvider.list
  1298. this.findAllPasture = response.data.findAllPasture.list
  1299. this.findAllEmploye = response.data.findAllEmploye.list
  1300. this.onlineSubscriptionList = response.data.getflexProviderList.list
  1301. this.getDepartDownList()
  1302. })
  1303. },
  1304. getDepartDownList() {
  1305. GetDataByName(this.getDepartParam).then(response => {
  1306. this.findAllDepart = response.data.list
  1307. })
  1308. },
  1309. changePastureName(item) {
  1310. this.getDepartParam.parammaps.pastureId = this.findAllPasture.find(obj => obj.name == item).id
  1311. this.getdataListParm.parammaps.departmentId = ''
  1312. this.getDepartDownList()
  1313. },
  1314. getCreateDepartDownList() {
  1315. GetDataByName(this.getDepartParam).then(response => {
  1316. this.createDepartList = response.data.list
  1317. if (this.edit == 1) {
  1318. if (this.createDepartList.find(obj => obj.id == Cookies.get('departmentid'))) {
  1319. this.createTemp.departmentId = parseInt(Cookies.get('departmentid'))
  1320. this.createTemp.departmentName = this.createDepartList.find(obj => obj.id == Cookies.get('departmentid')).name
  1321. } else {
  1322. this.createTemp.departmentId = response.data.list[0].id
  1323. this.createTemp.departmentName = response.data.list[0].name
  1324. }
  1325. }
  1326. })
  1327. },
  1328. changePasture(item) {
  1329. this.getDepartParam.parammaps.pastureId = item
  1330. this.edit = 1
  1331. this.getCreateDepartDownList()
  1332. },
  1333. changeDepart(item) {
  1334. this.createTemp.departmentName = this.createDepartList.find(obj => obj.id == item).name
  1335. },
  1336. handleDownload() {
  1337. console.log('点击了下载')
  1338. this.$alert('备件申购正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  1339. this.isPercentage = true
  1340. this.percentage = 1
  1341. var timer = setInterval(() => {
  1342. this.percentage += 5
  1343. if (this.percentage > 95) {
  1344. this.percentage = 99
  1345. clearInterval(timer)
  1346. }
  1347. this.percentage = this.percentage
  1348. }, 1000)
  1349. this.downloadParam.name = 'downloadPartpurchaseList'
  1350. this.downloadParam.parammaps = this.getdataListParm.parammaps
  1351. GetAccount(this.downloadParam).then(response => {
  1352. if (response.data.list !== '') {
  1353. this.percentage = 99
  1354. setTimeout(() => {
  1355. this.isPercentage = false
  1356. }, 2000)
  1357. }
  1358. this.$nextTick(() => {
  1359. const ExcelDatas = [
  1360. {
  1361. tHeader: ['牧场', '申购单号', '申购时间', '备件编号', '备件名称', '规格型号', '品牌', '单位', '申购数量', '申购部门', '申购人', '备注'],
  1362. filterVal: ['pastureName', 'orderNumber', 'inputTime', 'partCode', 'partName', 'specification', 'brandName', 'unit', 'amount', 'departmentName', 'empname', 'purpose'],
  1363. tableDatas: response.data.list,
  1364. sheetName: '备件申购'
  1365. }
  1366. ]
  1367. json2excel(ExcelDatas, '备件申购', true, 'xlsx')
  1368. })
  1369. })
  1370. },
  1371. handleDelete(row) {
  1372. console.log('点击了删除')
  1373. MessageBox.confirm('确认删除此条信息?', {
  1374. confirmButtonText: '确认',
  1375. cancelButtonText: '取消',
  1376. type: 'warning'
  1377. }).then(() => {
  1378. this.postDataPramas.common = { 'returnmap': '0' }
  1379. this.postDataPramas.data = []
  1380. this.postDataPramas.data[0] = { 'name': 'deleteBigPartpurchase', 'type': 'e', 'parammaps': {
  1381. id: row.id
  1382. }}
  1383. this.postDataPramas.data[1] = { 'name': 'deletePartpurchase', 'type': 'e', 'parammaps': {
  1384. bigId: row.id
  1385. }}
  1386. ExecDataByConfig(this.postDataPramas).then(response => {
  1387. this.getList()
  1388. this.$notify({
  1389. title: '成功',
  1390. message: '删除成功',
  1391. type: 'success',
  1392. duration: 2000
  1393. })
  1394. })
  1395. }).catch(() => {
  1396. this.$message({
  1397. type: 'info',
  1398. message: '已取消删除'
  1399. })
  1400. })
  1401. },
  1402. handleExamine(row) {
  1403. console.log('点击了库管审核')
  1404. if (row == undefined) {
  1405. this.examineTemp = this.seeTemp
  1406. this.$set(this.seeTemp, 'statue', 1)
  1407. this.$set(this.seeTemp, 'workflowNote', '')
  1408. } else {
  1409. this.examineTemp = Object.assign({}, row)
  1410. this.$set(this.examineTemp, 'statue', 1)
  1411. this.$set(this.examineTemp, 'workflowNote', '')
  1412. }
  1413. this.dialogStatus = 'examine'
  1414. this.dialogFormVisible_Examine = true
  1415. this.statueReason = false
  1416. },
  1417. changeStatue(val) {
  1418. if (val == 2) {
  1419. this.statueReason = true
  1420. } else {
  1421. this.statueReason = false
  1422. }
  1423. },
  1424. createExamineData() {
  1425. console.log('点击了库管审核')
  1426. this.isokDisable = true
  1427. setTimeout(() => {
  1428. this.isokDisable = false
  1429. }, 1000)
  1430. this.$refs['examineTemp'].validate(valid => {
  1431. if (valid) {
  1432. this.requestParam = {}
  1433. this.requestParam.name = 'partpurchaseCharge'
  1434. this.requestParam.parammaps = {}
  1435. this.requestParam.parammaps.id = this.examineTemp.id
  1436. if (this.examineTemp.statue == 1) {
  1437. this.requestParam.parammaps.statue = 3
  1438. } else if (this.examineTemp.statue == 2) {
  1439. this.requestParam.parammaps.statue = 4
  1440. }
  1441. this.requestParam.parammaps.empId = Cookies.get('employeid')
  1442. this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
  1443. PostDataByName(this.requestParam).then(response => {
  1444. console.log('审核确认发送参数', this.requestParam)
  1445. if (response.msg !== 'fail') {
  1446. this.getList()
  1447. this.dialogFormVisible_Examine = false
  1448. this.dialogFormVisible_See = false
  1449. this.statueReason = false
  1450. this.$notify({
  1451. title: '成功',
  1452. message: '审核成功',
  1453. type: 'success',
  1454. duration: 2000
  1455. })
  1456. } else {
  1457. failproccess(response, this.$notify)
  1458. }
  1459. })
  1460. }
  1461. })
  1462. },
  1463. handleExamine2(row) {
  1464. console.log('点击了供应主管审核')
  1465. if (row == undefined) {
  1466. this.examineTemp = this.seeTemp
  1467. this.$set(this.seeTemp, 'statue', 1)
  1468. this.$set(this.seeTemp, 'workflowNote', '')
  1469. } else {
  1470. this.examineTemp = Object.assign({}, row)
  1471. this.$set(this.examineTemp, 'statue', 1)
  1472. this.$set(this.examineTemp, 'workflowNote', '')
  1473. }
  1474. this.dialogStatus = 'examine2'
  1475. this.dialogFormVisible_Examine = true
  1476. this.statueReason = false
  1477. },
  1478. createExamineData2() {
  1479. console.log('点击了供应主管审核')
  1480. this.isokDisable = true
  1481. setTimeout(() => {
  1482. this.isokDisable = false
  1483. }, 1000)
  1484. this.$refs['examineTemp'].validate(valid => {
  1485. if (valid) {
  1486. this.requestParam = {}
  1487. this.requestParam.name = 'partpurchaseCharge3'
  1488. this.requestParam.parammaps = {}
  1489. this.requestParam.parammaps.id = this.examineTemp.id
  1490. if (this.examineTemp.statue == 1) {
  1491. this.requestParam.parammaps.statue = 5
  1492. } else if (this.examineTemp.statue == 2) {
  1493. this.requestParam.parammaps.statue = 6
  1494. }
  1495. this.requestParam.parammaps.empId = Cookies.get('employeid')
  1496. this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
  1497. PostDataByName(this.requestParam).then(response => {
  1498. console.log('审核确认发送参数', this.requestParam)
  1499. if (response.msg !== 'fail') {
  1500. this.getList()
  1501. this.dialogFormVisible_Examine = false
  1502. this.dialogFormVisible_See = false
  1503. this.statueReason = false
  1504. this.$notify({
  1505. title: '成功',
  1506. message: '审核成功',
  1507. type: 'success',
  1508. duration: 2000
  1509. })
  1510. } else {
  1511. failproccess(response, this.$notify)
  1512. }
  1513. })
  1514. }
  1515. })
  1516. },
  1517. handleExamine3(row) {
  1518. console.log('点击了采购审核')
  1519. if (row == undefined) {
  1520. this.examineTemp = this.seeTemp
  1521. this.$set(this.seeTemp, 'statue', 1)
  1522. this.$set(this.seeTemp, 'workflowNote', '')
  1523. } else {
  1524. this.examineTemp = Object.assign({}, row)
  1525. this.$set(this.examineTemp, 'workflowNote', '')
  1526. this.$set(this.examineTemp, 'statue', 1)
  1527. }
  1528. this.dialogStatus = 'examine3'
  1529. this.dialogFormVisible_Examine = true
  1530. this.statueReason = false
  1531. },
  1532. createExamineData3() {
  1533. console.log('点击了采购审核')
  1534. this.isokDisable = true
  1535. setTimeout(() => {
  1536. this.isokDisable = false
  1537. }, 1000)
  1538. this.$refs['examineTemp'].validate(valid => {
  1539. if (valid) {
  1540. this.requestParam = {}
  1541. this.requestParam.parammaps = {}
  1542. this.requestParam.common = { 'returnmap': '0' }
  1543. this.requestParam.data = []
  1544. if (this.examineTemp.statue == 1) {
  1545. this.requestParam.data[0] = { 'name': 'partpurchaseCharge1', 'type': 'e', 'parammaps': {
  1546. id: this.examineTemp.id,
  1547. statue: 7,
  1548. empId: Cookies.get('employeid'),
  1549. workflowNote: this.examineTemp.workflowNote
  1550. }}
  1551. this.requestParam.data[1] = { 'name': 'createBuydetailBySG', 'type': 'e', 'parammaps': {
  1552. id: this.examineTemp.id,
  1553. pastureId: this.examineTemp.pastureId
  1554. }}
  1555. } else if (this.examineTemp.statue == 2) {
  1556. this.requestParam.data[0] = { 'name': 'partpurchaseCharge1', 'type': 'e', 'parammaps': {
  1557. id: this.examineTemp.id,
  1558. statue: 8,
  1559. empId: Cookies.get('employeid'),
  1560. workflowNote: this.examineTemp.workflowNote
  1561. }}
  1562. }
  1563. ExecDataByConfig(this.requestParam).then(response => {
  1564. if (response.msg !== 'fail') {
  1565. this.getList()
  1566. this.dialogFormVisible_Examine = false
  1567. this.dialogFormVisible_See = false
  1568. this.statueReason = false
  1569. this.$notify({ title: '成功', message: '审核成功', type: 'success', duration: 2000 })
  1570. } else {
  1571. failproccess(response, this.$notify)
  1572. }
  1573. })
  1574. }
  1575. })
  1576. }
  1577. }
  1578. }
  1579. </script>
  1580. <style lang="scss" scoped>
  1581. .pagination-container{
  1582. display: block !important;
  1583. }
  1584. /deep/ .el-badge__content.is-fixed{
  1585. z-index: 1;
  1586. }
  1587. </style>
  1588. <style lang="scss">
  1589. .el-step__head.is-success {
  1590. color: #409EFF;
  1591. border-color: #409EFF;
  1592. }
  1593. .el-step__title.is-success{
  1594. color: #409EFF;
  1595. }
  1596. .el-step__head.is-process{
  1597. color: #409EFF;
  1598. border-color: #409EFF;
  1599. .el-step__icon.is-text{
  1600. background: #409EFF;
  1601. color: #fff;
  1602. }
  1603. }
  1604. .step-row{
  1605. color: #000;
  1606. }
  1607. </style>