index.vue 64 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554
  1. <template>
  2. <div class="app-container">
  3. 这个页面取消,暂停开发
  4. </div>
  5. </template>
  6. <script>
  7. import echarts from 'echarts'
  8. require('echarts/theme/macarons')
  9. // 引入
  10. import { GetDataByName, GetDataByNames, PostDataByName, PostDataByNames, getRecuData, checkButtons, ExecDataByConfig, failproccess, GetAccount, GetReportform } from '@/api/common'
  11. import waves from '@/directive/waves'
  12. import { parseTime, sortChange, json2excel } from '@/utils/index.js'
  13. import Pagination from '@/components/Pagination'
  14. import { MessageBox } from 'element-ui'
  15. import TreeSelect from '@/components/TreeSelect'
  16. import Cookies from 'js-cookie'
  17. import { getToken } from '@/utils/auth'
  18. export default {
  19. inject: ['reload'],
  20. name: 'AssetDesignee',
  21. components: { Pagination, TreeSelect },
  22. directives: { waves },
  23. data() {
  24. return {
  25. isBasicsAdd: [], isBasicsCard: [], isBasicsUpdate: [], isBasicsDel: [], isBasicsDel2: [], isBasic: [], isBasicSH: [], isBasicExamine: [],
  26. rules: {
  27. // assetCode: [{ required: true, message: '必填', trigger: 'blur' }],
  28. eqName: [{ required: true, message: '必填', trigger: 'blur' }],
  29. eqCode: [{ required: true, message: '必填', trigger: 'blur' }],
  30. financeCode: [{ required: true, message: '必填', trigger: 'blur' }],
  31. departmentId: [{ required: true, message: '必填', trigger: 'blur' }],
  32. employeeId: [{ required: true, message: '必填', trigger: 'blur' }],
  33. depreciation: [{ type: 'number', required: true, validator: (rule, value, callback) => {
  34. if (!value) {
  35. callback(new Error('不能为空'))
  36. }
  37. setTimeout(() => {
  38. const re = /^[0-9]*[1-9][0-9]*$/ // /^[0-9]*[1-9][0-9]*$/
  39. const rsCheck = re.test(value)
  40. if (!rsCheck) {
  41. callback(new Error('请输入正整数'))
  42. } else {
  43. callback()
  44. }
  45. }, 0)
  46. }, trigger: 'blur' }]
  47. },
  48. placeholder:"请选择设备类别",
  49. findAllBrand: [], findAllProvider: [],
  50. findAllAssetType: [], findAllPasture: [], findAllDepart: [], findAllEmploye: [],
  51. getDictByName: [], upkeepgrades: [], createDepartList: [],
  52. statues: [{ id: '0', name: '审核中' }, { id: '1', name: '已通过' }, { id: '2', name: '未通过' }],
  53. depreciationAlertList: [{ id: '0', name: '正常' }, { id: '1', name: '到期预警' }, { id: '2', name: '超期使用' }],
  54. requestParams: [
  55. { name: 'findAllBrand', offset: 0, pagecount: 0, params: [] },
  56. { name: 'findAllProvider', offset: 0, pagecount: 0, params: [] },
  57. { name: 'findAlllAssetProvider', offset: 0, pagecount: 0, params: [] },
  58. { name: 'findAllAssetType', offset: 0, pagecount: 0, params: [] },
  59. { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
  60. { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
  61. { name: 'getDictByName', offset: 0, pagecount: 0, params: ['资产状态'] },
  62. { name: 'getdictbyname', offset: 0, pagecount: 0, params: ['保养级别'] }
  63. ],
  64. getDepartParam: { name: 'findAllDepart1', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }},
  65. disabled: false,
  66. nodeKey: 'id',
  67. defaultCheckedKeys: [],
  68. parentClass: [],
  69. defaultProps: { children: 'children', label: 'typeName' },
  70. getRecuListParm: { name: 'getAssetTypeList', idname: 'id', params: [-1] },
  71. tableKey: 0,
  72. list: [],
  73. total: 0,
  74. listLoading: true,
  75. getdataListParm: {
  76. name: 'getAssetList', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
  77. parammaps: {proId:'',brandId:'', assetCode:'',eqCode: '', eqName: '', departmentId: '', pastureId: Cookies.get('pastureid'), pastureName: Cookies.get('pasturename'), status: '', inputDatetime1: '', startTime: '', stopTime: '', inputDatetime2: '', startTime2: '', stopTime2: '', inputDatetime3: '', startTime3: '', stopTime3: '', warning: '', eqClassId: '' }
  78. },
  79. textMap: { update: '编辑', create: '新增', card: '查看设备信息', examine: '审核', change: '批量变更' },
  80. dialogFormVisible: false,
  81. dialogStatus: '',
  82. pickerOptions1: {
  83. disabledDate(time) {
  84. return time.getTime() > Date.now()// 当天之前的时间可选
  85. }
  86. },
  87. dialogImageUrl: '', dialogVisible: false,
  88. fileList: [], showUpload: false,
  89. headers: { optname: 'insertcustompic', id: 1, token: getToken() },
  90. uploadImageUrl: process.env.VUE_APP_BASE_API + 'authdata/uploaderimage',
  91. width: '',
  92. createTemp: { inputDatetime: parseTime(new Date(), '{y}-{m}-{d}'), employeId: this.$store.state.user.employeid, inputUser: this.$store.state.user.employeid, deptId: this.$store.state.user.departmentid, departmentName: Cookies.get('departmentname'), pastureId: this.$store.state.user.pastureid, assetCode: '', eqClassName: '', eqClassId: '', eqCode: '', eqName: '', specification: '', providerName: '', brandName: '', financeCode: '', status: '正常', purpose: '', purchaseDate: parseTime(new Date(), '{y}-{m}-{d}'), entranceDate: parseTime(new Date(), '{y}-{m}-{d}'), yearUpkeepCost: '', yearMaintainDost: '', yuanzhi: '', baseHours: '', upkeepgrade: '', salvage: '', subtractvalue: '', yearMaintainCost: '', brandId: '', providerId: '', inputUserName: '', employeName: this.$store.state.user.employename, depreciation: '' },
  93. requestParam: { name: 'insertAsset', offset: 0, pagecount: 0, parammaps: {}},
  94. seeTemp: {},
  95. dialogFormVisible_See: false,
  96. activeName: 'first',
  97. maintainTypes: [{ id: '0', name: '周保养' }, { id: '1', name: '月保养' }, { id: '2', name: '间隔保养' }],
  98. changeStates: [{ id: '17', name: '正常' }, { id: '18', name: '闲置' }, { id: '19', name: '报废' }, { id: '20', name: '封存' }],
  99. getdataEQNumber: { name: 'cerateEQNumber', page: 1, offset: 1, pagecount: 10, returntype: 'Map', parammaps: {}},
  100. dialoFormVisible_Examine: false,
  101. examineTemp: { SHstatue: 1 },
  102. statueReason: false,
  103. activeList: [],
  104. active: 3,
  105. isFlowChart: false,
  106. isDisplayRecord: false,
  107. buttons: [],
  108. // 查看-点检记录
  109. getAssetBigSpotCheckListParm: { name: 'getAssetBigSpotCheck1', page: 1, offset: 1, pagecount: 10, returntype: 'Map', parammaps: { inputDatetimeSpotCheck1: '', startTime: '', stopTime: '' }},
  110. listLoadingSpotCheck1: false,
  111. listSpotCheck1: [],
  112. totalSpotCheck1: 0,
  113. // 查看-保养记录
  114. getBigupkeepbyeqParm: { name: 'getBigupkeepbyeq', page: 1, offset: 1, pagecount: 10, returntype: 'Map', parammaps: { inputDatetimeUpkeepbyeq: '', startTime: '', stopTime: '', upkeepType: '', upkeepCode: '' }},
  115. listLoadingUpkeepbyeq: false,
  116. listUpkeepbyeq: [],
  117. totalUpkeepbyeq: 0,
  118. // 查看-维修记录
  119. getAssetMaintainParm: { name: 'getAssetMaintain1', page: 1, offset: 1, pagecount: 10, returntype: 'Map', parammaps: { inputDatetimeAssetMaintain: '', startTime: '', stopTime: '', repairCode: '' }},
  120. listLoadingAssetMaintain: false,
  121. listAssetMaintain: [],
  122. totalAssetMaintain: 0,
  123. // 查看-启停记录
  124. getAssetSTTParm: { name: 'getAssetSTT1', page: 1, offset: 1, pagecount: 10, returntype: 'Map', parammaps: { startTime: '', stopTime: '' }},
  125. listLoadingAssetSTT: false,
  126. listAssetSTT: [],
  127. totalAssetSTT: 0,
  128. // 查看-变更记录
  129. getAssetChangeParm: { name: 'getAssetChange1', page: 1, offset: 1, pagecount: 10, returntype: 'Map', parammaps: { startTime: '', stopTime: '', changeStatue: '', inputDatetimeAssetChange: '' }},
  130. listLoadingAssetChange: false,
  131. listAssetChange: [],
  132. totalAssetChange: 0,
  133. // 查看-备件领用记录
  134. getAssetPartApplyParm: { name: 'getAssetPartApply', page: 1, offset: 1, pagecount: 10, returntype: 'Map', parammaps: { startTime: '', stopTime: '', inputDatetimeAssetPartApply: '' }},
  135. listLoadingAssetPartApply: false,
  136. listAssetPartApply: [],
  137. totalAssetPartApply: 0,
  138. downLoadParm: {},
  139. downLoadList: [],
  140. requestBrand: {
  141. name: 'getBrandByPartCode',
  142. page: 0,
  143. offset: 0,
  144. pagecount: 10,
  145. returntype: 'Map',
  146. parammaps: {}
  147. },
  148. BrandList: [],
  149. requestEmploye: {
  150. name: 'findAllEmployeV2',
  151. page: 0,
  152. offset: 0,
  153. pagecount: 10,
  154. returntype: 'Map',
  155. parammaps: {
  156. pastureId: Cookies.get('pastureid')
  157. }
  158. },
  159. employeList: [],
  160. totaltitle: 0,
  161. getBarChart1Parm: {
  162. name: 'getReportEqCostYear',
  163. parammaps: {}
  164. },
  165. barChart1: null,
  166. chart_data1: {},
  167. getBarChart2Parm: {
  168. name: 'getReportEqCostMonth',
  169. parammaps: {
  170. receiveTime: new Date().getFullYear()
  171. }
  172. },
  173. barChart2: null,
  174. chart_data2: {},
  175. dialogFormVisible_ChartSee: false,
  176. getChartSeeParm: {
  177. name: 'getEqPartuseDetailList',
  178. page: 0,
  179. offset: 0,
  180. pagecount: 10,
  181. returntype: 'Map',
  182. parammaps: {
  183. receiveTime: '',
  184. eqId: '',
  185. useTypeV: '',
  186. inputDatetime2: '',
  187. stopTime: '',
  188. startTime: ''
  189. }
  190. },
  191. listLoadingChartSee: false,
  192. totalChartSee: 0,
  193. listChartSee: [],
  194. pageNum: 0,
  195. pageSize: 0,
  196. pageNumSH: 0,
  197. pageSizeSH: 0,
  198. useTypes: [{ id: 0, name: '维修' }, { id: 1, name: '保养' }],
  199. downLoadParm2: {},
  200. downLoadList2: [],
  201. isPercentage: false,
  202. percentage: 1,
  203. isokDisable: false,
  204. edit: 0,
  205. selectionList: [],
  206. dialogFormVisible_change: false,
  207. batchChange: {
  208. temp: { departmentId: '', employeeId: '' },
  209. getdataListParmDept: { name: 'getAssetAndEmpList', offset: 0, pagecount: 0, parammaps: {}},
  210. deptList: [],
  211. getdataListParmPerson: { name: 'getAllEmp', offset: 0, pagecount: 0, parammaps: {}},
  212. personList: []
  213. },
  214. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  215. cellStyle: { padding: 0 + 'px' }
  216. }
  217. },
  218. computed: {
  219. // 设置请求头
  220. // headers() {
  221. // return {
  222. // // 设置token
  223. // // eslint-disable-next-line no-undef
  224. // token: getToken()
  225. // }
  226. // },
  227. uploadData() {
  228. return {
  229. name: 'importStockUse',
  230. importParams: '牧场,设备类别,资产编号,设备名称,设备内部编号,设备规格,品牌,供应商,用途,状态,购置日期,入场日期,折旧年限,财务编号,原值,残值,月核减值,保养级别,保养费用,维修费用,维修费用,基数(小时),部门,责任人,录入人,录入时间,使用时长(年),使用率(%),SignColumn',
  231. sheetname: 'SheetJS'
  232. }
  233. },
  234. // 设置上传地址
  235. uploadExcelUrl() {
  236. // process.env.VUE_APP_BASE_API是服务器的路径,也是axios的基本路径
  237. return process.env.VUE_APP_BASE_API + 'authdata/equipment'
  238. }
  239. },
  240. created() {
  241. },
  242. methods: {
  243. // 导入
  244. beforeImportExcel(file) {
  245. const isLt2M = file.size / 1024 / 1024 < 10
  246. if (!isLt2M) {
  247. this.$message.error('上传文件大小不能超过 10MB!')
  248. }
  249. return isLt2M
  250. },
  251. handleImportExcelSuccess(res, file) {
  252. if (res.msg === 'ok') {
  253. this.$message({
  254. title: '成功',
  255. message: '导入成功:' + res.data.success + '条!',
  256. type: 'success',
  257. duration: 2000
  258. })
  259. if (res.data.err_count > 0) {
  260. this.$notify({
  261. title: '失败',
  262. message: '导入失败:' + res.data.err_count + '条!',
  263. type: 'danger',
  264. duration: 2000
  265. })
  266. }
  267. } else {
  268. this.$notify({
  269. title: '失败',
  270. message: '上传失败',
  271. type: 'danger',
  272. duration: 2000
  273. })
  274. }
  275. },
  276. formatJsonTemp(filterVal, jsonData) {
  277. return jsonData.map(v =>
  278. filterVal.map(j => {
  279. if (j === 'timestamp') {
  280. return parseTime(v[j])
  281. } else {
  282. return v[j]
  283. }
  284. })
  285. )
  286. },
  287. tableSort2(column) {
  288. sortChange(column, this.list)
  289. },
  290. tableSort(column) {
  291. if (this.activeName == 'third') {
  292. sortChange(column, this.listUpkeepbyeq)
  293. } else if (this.activeName == 'fouth') {
  294. sortChange(column, this.listAssetMaintain)
  295. } else if (this.activeName == 'seventh') {
  296. sortChange(column, this.listAssetPartApply)
  297. }
  298. },
  299. get_auto_buttons() {
  300. // 新增
  301. const BasicsAdd = 'asset:basics:add'
  302. const isBasicsAdd = checkButtons(this.$store.state.user.buttons, BasicsAdd)
  303. this.isBasicsAdd = isBasicsAdd
  304. // 卡片
  305. const BasicsCard = 'asset:basics:kapian'
  306. const isBasicsCard = checkButtons(this.$store.state.user.buttons, BasicsCard)
  307. this.isBasicsCard = isBasicsCard
  308. // 编辑
  309. const BasicsUpdate = 'asset:basics:update'
  310. const isBasicsUpdate = checkButtons(this.$store.state.user.buttons, BasicsUpdate)
  311. this.isBasicsUpdate = isBasicsUpdate
  312. // 删除
  313. const BasicsDel = 'asset:basics:del'
  314. const isBasicsDel = checkButtons(this.$store.state.user.buttons, BasicsDel)
  315. this.isBasicsDel = isBasicsDel
  316. // 设备基础信息-删除
  317. const BasicsDel2 = 'asset:basics:del2'
  318. const isBasicsDel2 = checkButtons(this.$store.state.user.buttons, BasicsDel2)
  319. this.isBasicsDel2 = isBasicsDel2
  320. // 设备基础信息
  321. const Basic = 'asset:basic:basic'
  322. const isBasic = checkButtons(this.$store.state.user.buttons, Basic)
  323. this.isBasic = isBasic
  324. // 设备审核
  325. const BasicSH = 'asset:basic:shjm'
  326. const isBasicSH = checkButtons(this.$store.state.user.buttons, BasicSH)
  327. this.isBasicSH = isBasicSH
  328. // 审核
  329. const BasicExamine = 'asset:basic:shenhe'
  330. const isBasicExamine = checkButtons(this.$store.state.user.buttons, BasicExamine)
  331. this.isBasicExamine = isBasicExamine
  332. },
  333. // 2-2:下拉框
  334. get_select_list() {
  335. GetDataByNames(this.requestParams).then(response => {
  336. if (response.data.list !== null) {
  337. this.findAllBrand = response.data.findAllBrand.list
  338. this.findAllProvider = response.data.findAllProvider.list
  339. this.findAllAssetType = response.data.findAllAssetType.list
  340. this.findAllPasture = response.data.findAllPasture.list
  341. this.findAllEmploye = response.data.findAllEmploye.list
  342. this.getDictByName = response.data.getDictByName.list
  343. this.upkeepgrades = response.data.getdictbyname.list
  344. this.getDepartDownList()
  345. }
  346. })
  347. },
  348. getDepartDownList() {
  349. GetDataByName(this.getDepartParam).then(response => {
  350. this.findAllDepart = response.data.list
  351. })
  352. },
  353. changePastureName(item) {
  354. this.getDepartParam.parammaps.pastureId = this.findAllPasture.find(obj => obj.name == item).id
  355. this.getdataListParm.parammaps.departmentId = ''
  356. this.getDepartDownList()
  357. },
  358. getCreateDepartDownList() {
  359. GetDataByName(this.getDepartParam).then(response => {
  360. this.createDepartList = response.data.list
  361. if (this.edit == 1) {
  362. if (this.createDepartList.find(obj => obj.id == Cookies.get('departmentid'))) {
  363. this.createTemp.departmentId = parseInt(Cookies.get('departmentid'))
  364. this.createTemp.departmentName = this.createDepartList.find(obj => obj.id == Cookies.get('departmentid')).name
  365. this.createTemp.deptId = parseInt(Cookies.get('departmentid'))
  366. } else {
  367. this.createTemp.departmentId = response.data.list[0].id
  368. this.createTemp.departmentId = response.data.list[0].id
  369. this.createTemp.deptId = response.data.list[0].name
  370. }
  371. }
  372. })
  373. },
  374. changePasture(item) {
  375. this.getDepartParam.parammaps.pastureId = item
  376. this.edit = 1
  377. this.getCreateDepartDownList()
  378. },
  379. changeDepart(item) {
  380. this.createTemp.departmentName = this.createDepartList.find(obj => obj.id == item).name
  381. },
  382. get_table_data() {
  383. this.listLoading = true
  384. if (this.getdataListParm.parammaps.inputDatetime1 == null) {
  385. this.getdataListParm.parammaps.inputDatetime1 = ''
  386. this.getdataListParm.parammaps.startTime = ''
  387. this.getdataListParm.parammaps.stopTime = ''
  388. } else {
  389. this.getdataListParm.parammaps.startTime = this.getdataListParm.parammaps.inputDatetime1[0]
  390. this.getdataListParm.parammaps.stopTime = this.getdataListParm.parammaps.inputDatetime1[1]
  391. }
  392. if (this.getdataListParm.parammaps.inputDatetime2 == null || this.getdataListParm.parammaps.inputDatetime2 == '') {
  393. this.getdataListParm.parammaps.inputDatetime2 = ''
  394. this.getdataListParm.parammaps.startTime2 = ''
  395. this.getdataListParm.parammaps.stopTime2 = ''
  396. } else {
  397. this.getdataListParm.parammaps.startTime2 = this.getdataListParm.parammaps.inputDatetime2[0]
  398. this.getdataListParm.parammaps.stopTime2 = this.getdataListParm.parammaps.inputDatetime2[1]
  399. }
  400. if (this.getdataListParm.parammaps.inputDatetime3 == null || this.getdataListParm.parammaps.inputDatetime3 == '') {
  401. this.getdataListParm.parammaps.inputDatetime3 = ''
  402. this.getdataListParm.parammaps.startTime3 = ''
  403. this.getdataListParm.parammaps.stopTime3 = ''
  404. } else {
  405. this.getdataListParm.parammaps.startTime3 = this.getdataListParm.parammaps.inputDatetime3[0]
  406. this.getdataListParm.parammaps.stopTime3 = this.getdataListParm.parammaps.inputDatetime3[1]
  407. }
  408. GetDataByName(this.getdataListParm).then(response => {
  409. console.log('table数据', response.data.list)
  410. if (response.data.list !== null) {
  411. this.list = response.data.list
  412. this.pageNum = response.data.pageNum
  413. this.pageSize = response.data.pageSize
  414. } else {
  415. this.list = []
  416. }
  417. this.total = response.data.total
  418. setTimeout(() => {
  419. this.listLoading = false
  420. }, 100)
  421. this.get_select_list()
  422. })
  423. },
  424. SHStatus: function(cellValue) {
  425. if (cellValue.SHStatus == 0) {
  426. return '审核中'
  427. } else if (cellValue.SHStatus == 1) {
  428. return '已通过'
  429. } else if (cellValue.SHStatus == 2) {
  430. return '未通过'
  431. } else if (cellValue.SHStatus == 3) {
  432. return '历史数据'
  433. }
  434. },
  435. form_search() {
  436. this.listLoading = true
  437. this.getdataListParm.parammaps.pastureId = ''
  438. if (this.getdataListParm.parammaps.warning !== '') {
  439. this.getdataListParm.parammaps.d1 = 1
  440. } else {
  441. this.getdataListParm.parammaps.d1 = ''
  442. }
  443. if (this.getdataListParm.parammaps.inputDatetime1 == null) {
  444. this.getdataListParm.parammaps.inputDatetime1 = ''
  445. this.getdataListParm.parammaps.startTime = ''
  446. this.getdataListParm.parammaps.stopTime = ''
  447. } else {
  448. this.getdataListParm.parammaps.startTime = this.getdataListParm.parammaps.inputDatetime1[0]
  449. this.getdataListParm.parammaps.stopTime = this.getdataListParm.parammaps.inputDatetime1[1]
  450. }
  451. console.log(this.getdataListParm.parammaps.inputDatetime2)
  452. if (this.getdataListParm.parammaps.inputDatetime2 == null) {
  453. this.getdataListParm.parammaps.inputDatetime2 = ''
  454. this.getdataListParm.parammaps.startTime2 = ''
  455. this.getdataListParm.parammaps.stopTime2 = ''
  456. } else {
  457. this.getdataListParm.parammaps.startTime2 = this.getdataListParm.parammaps.inputDatetime2[0]
  458. this.getdataListParm.parammaps.stopTime2 = this.getdataListParm.parammaps.inputDatetime2[1]
  459. }
  460. if (this.getdataListParm.parammaps.inputDatetime3 == null) {
  461. this.getdataListParm.parammaps.inputDatetime3 = ''
  462. this.getdataListParm.parammaps.startTime3 = ''
  463. this.getdataListParm.parammaps.stopTime3 = ''
  464. } else {
  465. this.getdataListParm.parammaps.startTime3 = this.getdataListParm.parammaps.inputDatetime3[0]
  466. this.getdataListParm.parammaps.stopTime3 = this.getdataListParm.parammaps.inputDatetime3[1]
  467. }
  468. this.getdataListParm.offset = 1
  469. this.get_table_data()
  470. },
  471. handlePicChange(file, fileList) {
  472. if (fileList.length > 0) {
  473. this.$nextTick(() => {
  474. this.showUpload = true
  475. })
  476. } else {
  477. this.$nextTick(() => {
  478. this.showUpload = false
  479. })
  480. }
  481. console.log(this.createTemp)
  482. },
  483. handlePicSuccess(response, file, fileList) {
  484. if (fileList.length > 0) {
  485. this.$nextTick(() => {
  486. this.showUpload = true
  487. })
  488. } else {
  489. this.$nextTick(() => {
  490. this.showUpload = false
  491. })
  492. }
  493. if (this.createTemp.picpath === undefined || this.createTemp.picpath === '' || this.createTemp.picpath == -1) {
  494. this.$set(this.createTemp, 'picpath', response.execresult.LastInsertId)
  495. }
  496. },
  497. handlePicRemove(file, fileList) {
  498. if (this.dialogStatus === 'create') {
  499. if (fileList.length < 1) {
  500. this.showUpload = false
  501. }
  502. for (const key in this.createTemp) {
  503. if (this.createTemp[key] === file.response.execresult.LastInsertId) {
  504. this.$delete(this.createTemp, key)
  505. }
  506. }
  507. } else {
  508. if (fileList.length < 1) {
  509. this.$nextTick(() => {
  510. this.showUpload = false
  511. })
  512. }
  513. const url = file.url
  514. console.log(url, 'url')
  515. for (const key in this.createTemp) {
  516. console.log(this.createTemp[key], 'createTemp[key]')
  517. if (this.createTemp[key] === url) {
  518. console.log(key)
  519. if (key === 'picpath') {
  520. this.$delete(this.createTemp, 'picpath')
  521. this.$delete(this.createTemp, 'picId')
  522. }
  523. }
  524. }
  525. }
  526. console.log(this.createTemp, '文件列表移除文件时的钩子row')
  527. },
  528. handlePicPreview(file) {
  529. this.dialogImageUrl = file.url
  530. this.dialogVisible = true
  531. },
  532. onLoad(e) {
  533. const img = e.target
  534. let width = 0
  535. if (img.fileSize > 0 || (img.width > 1 && img.height > 1)) {
  536. width = img.width + 40
  537. }
  538. this.width = width + 'px'
  539. },
  540. add_dialog_saveAdd() {
  541. console.log('点击了保存')
  542. this.isokDisable = true
  543. setTimeout(() => {
  544. this.isokDisable = false
  545. }, 1000)
  546. this.$refs['createTemp'].validate(valid => {
  547. if (valid) {
  548. for (var i = 0; i < this.listAdd.length; i++) {
  549. if (this.listAdd[i].score == null) {
  550. this.$message({ type: 'warning', message: '请检查检查结果是否为空', duration: 2000 })
  551. return false
  552. }
  553. if (this.listAdd[i].pic1 == undefined) {
  554. this.listAdd[i].pic1 = -1
  555. }
  556. if (this.listAdd[i].pic2 == undefined) {
  557. this.listAdd[i].pic2 = -1
  558. }
  559. if (this.listAdd[i].pic3 == undefined) {
  560. this.listAdd[i].pic3 = -1
  561. }
  562. }
  563. this.postDataPramas.common = { 'returnmap': '0' }
  564. this.postDataPramas.data = []
  565. this.postDataPramas.data[0] = { 'name': 'insertBigjudge', 'type': 'e', 'parammaps': {
  566. pastureId: this.createTemp.pastureId,
  567. batime: this.createTemp.batime,
  568. empId: this.createTemp.empId
  569. }}
  570. this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
  571. this.postDataPramas.data[1].children = []
  572. this.postDataPramas.data[1].children[0] = { 'name': 'insertjudge', 'type': 'e', 'parammaps': {
  573. bigId: '@insertBigjudge.LastInsertId',
  574. statue: '@insertSpotList.statue',
  575. score: '@insertSpotList.score',
  576. note: '@insertSpotList.note',
  577. pic1: '@insertSpotList.pic1',
  578. pic2: '@insertSpotList.pic2',
  579. pic3: '@insertSpotList.pic3'
  580. }}
  581. ExecDataByConfig(this.postDataPramas).then(response => {
  582. console.log('新增保存发送参数', this.postDataPramas)
  583. if (response.msg === 'fail') {
  584. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  585. } else {
  586. this.getdataListParm.parammaps.inputDatetime = ''
  587. this.get_table_data()
  588. this.dialogFormVisibleAdd = false
  589. this.createTemp.providerName = ''
  590. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  591. }
  592. })
  593. }
  594. })
  595. },
  596. beforeRemove(file, fileList) {
  597. console.log(file.response, '删除文件之前的钩子,参数为上传的文件和文件列表')
  598. return this.$confirm('删除当前图片, 是否继续?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' })
  599. },
  600. resetCreateTemp() {
  601. this.defaultCheckedKeys = []
  602. this.createTemp.defaultCheckedKeys = []
  603. this.createTemp.brandId = ''
  604. this.createTemp.providerId = ''
  605. this.createTemp.inputDatetime = parseTime(new Date(), '{y}-{m}-{d}')
  606. this.createTemp.eqClassName = ''
  607. this.createTemp.eqClassId = ''
  608. this.createTemp.employeName = Cookies.get('employename')
  609. this.createTemp.employeId = Cookies.get('employeid')
  610. this.createTemp.inputUser = Cookies.get('employeid')
  611. this.createTemp.deptId = parseInt(Cookies.get('departmentid'))
  612. this.createTemp.departmentName = Cookies.get('departmentname')
  613. this.createTemp.pastureId = parseInt(Cookies.get('pastureid'))
  614. this.createTemp.eqCode = ''
  615. this.createTemp.eqName = ''
  616. this.createTemp.specification = ''
  617. this.createTemp.providerName = ''
  618. this.createTemp.financeCode = ''
  619. this.createTemp.status = '正常'
  620. this.createTemp.providerName = ''
  621. this.createTemp.brandName = ''
  622. this.createTemp.purpose = ''
  623. this.createTemp.purchaseDate = parseTime(new Date(), '{y}-{m}-{d}')
  624. this.createTemp.entranceDate = parseTime(new Date(), '{y}-{m}-{d}')
  625. this.createTemp.assetCode = ''
  626. this.createTemp.yearUpkeepCost = ''
  627. this.createTemp.yearMaintainDost = ''
  628. this.createTemp.yuanzhi = ''
  629. this.createTemp.baseHours = ''
  630. this.createTemp.upkeepgrade = 113
  631. this.createTemp.salvage = ''
  632. this.createTemp.subtractvalue = ''
  633. this.createTemp.yearMaintainCost = ''
  634. this.createTemp.inputUserName = ''
  635. this.createTemp.picpath = ''
  636. this.fileList = []
  637. this.showUpload = false
  638. this.createTemp.fileList = []
  639. this.createTemp.depreciation = ''
  640. },
  641. form_add() {
  642. this.resetCreateTemp()
  643. this.edit = 1
  644. this.getDepartParam.parammaps.pastureId = this.createTemp.pastureId
  645. this.getCreateDepartDownList()
  646. this.dialogStatus = 'create'
  647. this.dialogFormVisible = true
  648. this.$nextTick(() => {
  649. this.$refs['createTemp'].clearValidate()
  650. })
  651. },
  652. changeBrand(item) {
  653. this.createTemp.brandName = this.findAllBrand.find(obj => obj.id === item).name
  654. },
  655. changeUpkeepgrade(item) {
  656. console.log(item)
  657. },
  658. upkeepgradeChange(e) {
  659. if (!e) {
  660. this.$refs['upkeepgrade'].blur()
  661. }
  662. },
  663. popoverHide(checkedIds, checkedData) {
  664. console.log(checkedIds, checkedData)
  665. if (checkedIds !== null) {
  666. this.getdataEQNumber.parammaps.eqCode = checkedData.typeCode
  667. // if (checkedData.children === undefined) {
  668. // this.createTemp.eqClassId = checkedData.eqClassId
  669. // this.createTemp.eqName = checkedData.NewName
  670. // this.getdataListParm.parammaps.eqClassId = checkedData.eqClassId
  671. // this.getEQNumber()
  672. // } else {
  673. // this.defaultCheckedKeys = []
  674. // this.createTemp.eqClassId = ''
  675. // this.getdataListParm.parammaps.eqClassId = ''
  676. // this.$message({ type: 'warning', message: '请选择具体设备类型' })
  677. // }
  678. this.createTemp.eqClassId = checkedData.eqClassId
  679. this.createTemp.eqName = checkedData.NewName
  680. this.getdataListParm.parammaps.eqClassId = checkedData.eqClassId
  681. this.getEQNumber()
  682. } else {
  683. this.defaultCheckedKeys = []
  684. this.createTemp.eqClassId = ''
  685. this.getdataListParm.parammaps.eqClassId = ''
  686. }
  687. },
  688. add_dialog_save() {
  689. this.isokDisable = true
  690. setTimeout(() => {
  691. this.isokDisable = false
  692. }, 1000)
  693. this.$refs['createTemp'].validate(valid => {
  694. if (valid) {
  695. console.log(this.createTemp)
  696. this.requestParam.name = 'insertAsset'
  697. if (this.createTemp.status == '正常') { this.createTemp.status = 17 }
  698. if (this.createTemp.providerId == '') { this.createTemp.providerId = 0 }
  699. if (this.createTemp.brandId == '') { this.createTemp.brandId = 0 }
  700. if (this.createTemp.yuanzhi == '') { this.createTemp.yuanzhi = 0 }
  701. if (this.createTemp.salvage == '') { this.createTemp.salvage = 0 }
  702. if (this.createTemp.subtractvalue == '') { this.createTemp.subtractvalue = 0 }
  703. if (this.createTemp.yearUpkeepCost == '') { this.createTemp.yearUpkeepCost = 0 }
  704. if (this.createTemp.yearMaintainCost == '') { this.createTemp.yearMaintainCost = 0 }
  705. if (this.createTemp.baseHours == '') { this.createTemp.baseHours = 0 }
  706. // 原值yuanzhi残值salvage月核减值subtractvalue保养费用yearUpkeepCost维修费用yearMaintainCost
  707. var rulesValue = /^\d+(\.\d{1,3})?$/
  708. this.requestParam.parammaps = this.createTemp
  709. this.requestParam.parammaps.picpath = this.createTemp.picpath
  710. if (this.createTemp.yuanzhi !== '' || this.createTemp.salvage !== '' || this.createTemp.subtractvalue !== '' || this.createTemp.yearUpkeepCost !== '' || this.createTemp.yearMaintainCost !== '') {
  711. this.requestParam.parammaps.yuanzhi = parseFloat(this.createTemp.yuanzhi)
  712. if (!rulesValue.test(parseFloat(this.createTemp.yuanzhi))) {
  713. this.$message({ type: 'error', message: '原值请输入自然数,最多保留三位小数点', duration: 2000 })
  714. return false
  715. }
  716. if (!rulesValue.test(parseFloat(this.createTemp.salvage))) {
  717. this.$message({ type: 'error', message: '残值请输入自然数,最多保留三位小数点', duration: 2000 })
  718. return false
  719. }
  720. if (!rulesValue.test(parseFloat(this.createTemp.subtractvalue))) {
  721. this.$message({ type: 'error', message: '月核减值请输入自然数,最多保留三位小数点', duration: 2000 })
  722. return false
  723. }
  724. if (!rulesValue.test(parseFloat(this.createTemp.yearUpkeepCost))) {
  725. this.$message({ type: 'error', message: '保养费用输入自然数,最多保留三位小数点', duration: 2000 })
  726. return false
  727. }
  728. if (!rulesValue.test(parseFloat(this.createTemp.yearMaintainCost))) {
  729. this.$message({ type: 'error', message: '维修费用请输入自然数,最多保留三位小数点', duration: 2000 })
  730. return false
  731. }
  732. }
  733. PostDataByName(this.requestParam).then(response => {
  734. console.log('新增保存发送参数', this.requestParam)
  735. if (response.msg !== 'fail') {
  736. if (this.getdataListParm.parammaps.inputDatetime1 === null) {
  737. this.getdataListParm.parammaps.inputDatetime1 = ''
  738. }
  739. this.dialogFormVisible = false
  740. this.get_table_data()
  741. this.$notify({ title: '成功', message: '新增成功', type: 'success', duration: 2000 })
  742. // this.reload()
  743. } else {
  744. failproccess(response, this.$notify)
  745. }
  746. })
  747. }
  748. })
  749. },
  750. // 继续新增
  751. add_dialog_save_again() {
  752. this.isokDisable = true
  753. setTimeout(() => {
  754. this.isokDisable = false
  755. }, 1000)
  756. this.$refs['createTemp'].validate(valid => {
  757. if (valid) {
  758. this.requestParam.name = 'insertAsset'
  759. if (this.createTemp.status == '正常') { this.createTemp.status = 17 }
  760. if (this.createTemp.providerId == '') { this.createTemp.providerId = 0 }
  761. if (this.createTemp.brandId == '') { this.createTemp.brandId = 0 }
  762. if (this.createTemp.yuanzhi == '') { this.createTemp.yuanzhi = 0 }
  763. if (this.createTemp.salvage == '') { this.createTemp.salvage = 0 }
  764. if (this.createTemp.subtractvalue == '') { this.createTemp.subtractvalue = 0 }
  765. if (this.createTemp.yearUpkeepCost == '') { this.createTemp.yearUpkeepCost = 0 }
  766. if (this.createTemp.yearMaintainCost == '') { this.createTemp.yearMaintainCost = 0 }
  767. if (this.createTemp.baseHours == '') { this.createTemp.baseHours = 0 }
  768. // 原值yuanzhi残值salvage月核减值subtractvalue保养费用yearUpkeepCost维修费用yearMaintainCost
  769. var rulesValue = /^\d+(\.\d{1,3})?$/
  770. this.requestParam.parammaps = this.createTemp
  771. this.requestParam.parammaps.picpath = this.createTemp.picpath
  772. if (this.createTemp.yuanzhi !== '' || this.createTemp.salvage !== '' || this.createTemp.subtractvalue !== '' || this.createTemp.yearUpkeepCost !== '' || this.createTemp.yearMaintainCost !== '') {
  773. this.requestParam.parammaps.yuanzhi = parseFloat(this.createTemp.yuanzhi)
  774. // if (!rulesValue.test(parseFloat(this.createTemp.yuanzhi)) || !rulesValue.test(parseFloat(this.createTemp.salvage)) || !rulesValue.test(parseFloat(this.createTemp.subtractvalue)) || !rulesValue.test(parseFloat(this.createTemp.yearUpkeepCost)) || !rulesValue.test(parseFloat(this.createTemp.yearMaintainCost))) {
  775. if (!rulesValue.test(parseFloat(this.createTemp.yuanzhi))) {
  776. this.$message({ type: 'error', message: '原值请输入自然数,最多保留三位小数点', duration: 2000 })
  777. return false
  778. }
  779. if (!rulesValue.test(parseFloat(this.createTemp.salvage))) {
  780. this.$message({ type: 'error', message: '残值请输入自然数,最多保留三位小数点', duration: 2000 })
  781. return false
  782. }
  783. if (!rulesValue.test(parseFloat(this.createTemp.subtractvalue))) {
  784. this.$message({ type: 'error', message: '月核减值请输入自然数,最多保留三位小数点', duration: 2000 })
  785. return false
  786. }
  787. if (!rulesValue.test(parseFloat(this.createTemp.yearUpkeepCost))) {
  788. this.$message({ type: 'error', message: '保养费用输入自然数,最多保留三位小数点', duration: 2000 })
  789. return false
  790. }
  791. if (!rulesValue.test(parseFloat(this.createTemp.yearMaintainCost))) {
  792. this.$message({ type: 'error', message: '维修费用请输入自然数,最多保留三位小数点', duration: 2000 })
  793. return false
  794. }
  795. }
  796. PostDataByName(this.requestParam).then(response => {
  797. console.log('新增保存发送参数', this.requestParam)
  798. if (response.msg !== 'fail') {
  799. if (this.getdataListParm.parammaps.inputDatetime === null) {
  800. this.getdataListParm.parammaps.inputDatetime = ''
  801. }
  802. this.resetCreateTemp()
  803. this.$notify({ title: '成功', message: '新增成功', type: 'success', duration: 2000 })
  804. } else {
  805. failproccess(response, this.$notify)
  806. }
  807. })
  808. }
  809. })
  810. },
  811. form_edit(row) {
  812. if (this.dialogFormVisible) {
  813. return
  814. }
  815. this.edit = 0
  816. this.getDepartParam.parammaps.pastureId = row.pastureId
  817. this.getCreateDepartDownList()
  818. this.createTemp = Object.assign({}, row) // copy obj
  819. if (row.inputUser !== undefined) {
  820. this.createTemp.inputUser = parseInt(row.inputUser)
  821. }
  822. if (this.createTemp.eqClassId !== undefined) {
  823. this.defaultCheckedKeys = [this.createTemp.eqClassId]
  824. } else {
  825. this.createTemp.eqClassId = ''
  826. this.defaultCheckedKeys = []
  827. }
  828. this.dialogStatus = 'update'
  829. this.dialogFormVisible = true
  830. this.$nextTick(() => {
  831. this.$refs['createTemp'].clearValidate()
  832. })
  833. const urlArray = []
  834. const fileList = []
  835. if (row.picpath == undefined) {
  836. urlArray.push()
  837. } else if (row.picpath == '') {
  838. urlArray.push()
  839. } else {
  840. urlArray.push(row.picpath)
  841. }
  842. for (let i = 0; i < urlArray.length; i++) {
  843. const urlObj = {}
  844. this.$set(urlObj, 'url', urlArray[i])
  845. fileList.push(urlObj)
  846. }
  847. this.$set(this.createTemp, 'fileList', fileList)
  848. console.log(this.createTemp)
  849. if (this.createTemp.fileList.length >= 1) {
  850. this.showUpload = true
  851. } else {
  852. this.showUpload = false
  853. }
  854. },
  855. edit_dialog_save() {
  856. this.$refs['createTemp'].validate(valid => {
  857. if (valid) {
  858. console.log('-----------', this.createTemp)
  859. console.log(this.createTemp.providerId)
  860. if (this.createTemp.eqClassId == '' || this.createTemp.eqClassId == undefined || this.createTemp.eqClassId == null) {
  861. this.$message({ type: 'warning', message: '请选择设备类别' })
  862. } else {
  863. this.requestParam.name = 'updateAsset'
  864. this.requestParam.parammaps = this.createTemp
  865. if (this.createTemp.status === '正常') { this.createTemp.status = 17 }
  866. if (this.createTemp.status === '闲置') { this.createTemp.status = 18 }
  867. if (this.createTemp.status === '报废') { this.createTemp.status = 19 }
  868. if (this.createTemp.status === '封存') { this.createTemp.status = 20 }
  869. if (this.createTemp.providerId === '' || this.createTemp.providerId === undefined) { this.createTemp.providerId = 0 }
  870. if (this.createTemp.brandId === '' || this.createTemp.brandId == undefined) { this.createTemp.brandId = 0 }
  871. if (this.createTemp.yuanzhi === '') { this.createTemp.yuanzhi = 0 }
  872. if (this.createTemp.salvage === '') { this.createTemp.salvage = 0 }
  873. if (this.createTemp.subtractvalue === '') { this.createTemp.subtractvalue = 0 }
  874. if (this.createTemp.yearUpkeepCost === '') { this.createTemp.yearUpkeepCost = 0 }
  875. if (this.createTemp.yearMaintainCost === '') { this.createTemp.yearMaintainCost = 0 }
  876. if (this.createTemp.baseHours === '') { this.createTemp.baseHours = 0 }
  877. if (this.createTemp.upkeepgrade === 'A' || this.createTemp.upkeepgrade === 'B' || this.createTemp.upkeepgrade === 'C') {
  878. this.createTemp.upkeepgrade = this.createTemp.upkeepgradeId
  879. this.createTemp.upkeepgradeId = ''
  880. }
  881. this.createTemp.deptId = this.createTemp.deptId
  882. this.createTemp.departmentName = this.createTemp.departmentName
  883. this.createTemp.employeeId = this.createTemp.employeId
  884. // var rulesValue = /^\d+(\.\d{1,3})?$/
  885. this.requestParam.parammaps = this.createTemp
  886. if (this.tabName === 'first') {
  887. this.requestParam.parammaps.SHStatus = this.createTemp.SHStatus
  888. } else if (this.tabName === 'second') {
  889. this.requestParam.parammaps.SHStatus = 0
  890. }
  891. const picpath = parseInt(this.createTemp.picpath)
  892. if (isNaN(picpath) == false) {
  893. this.requestParam.parammaps.picpath = this.createTemp.picpath
  894. } else {
  895. this.requestParam.parammaps.picpath = this.createTemp.picId
  896. }
  897. PostDataByName(this.requestParam).then(response => {
  898. console.log(response)
  899. if (response.msg !== 'fail') {
  900. if (this.getdataListParm.parammaps.inputDatetime1 === null) {
  901. this.getdataListParm.parammaps.inputDatetime1 = ''
  902. }
  903. this.get_table_data()
  904. this.get_table_dataSH()
  905. this.dialogFormVisible = false
  906. this.$notify({ title: '成功', message: '保存成功-', type: 'success', duration: 2000 })
  907. // this.reload()
  908. } else {
  909. failproccess(response, this.$notify)
  910. }
  911. })
  912. }
  913. }
  914. })
  915. },
  916. brandSearch(queryString, cb) {
  917. console.log('品牌模糊查询输入值', queryString)
  918. this.requestBrand.parammaps['brandName'] = queryString
  919. GetDataByName(this.requestBrand).then(response => {
  920. console.log('品牌模糊查询搜索data', response.data.list)
  921. this.BrandList = response.data.list
  922. cb(this.BrandList)
  923. })
  924. },
  925. handleSelectBrand(item) {
  926. console.log('品牌模糊查询选中值', item)
  927. this.$set(this.createTemp, 'brandName', item.brandName)
  928. this.$set(this.createTemp, 'brandId', item.brandId)
  929. this.$forceUpdate()
  930. },
  931. employeSearch(queryString, cb) {
  932. console.log('责任人模糊查询输入值', queryString)
  933. this.requestEmploye.parammaps['empname'] = queryString
  934. GetDataByName(this.requestEmploye).then(response => {
  935. console.log('责任人模糊查询搜索data', response.data.list)
  936. this.employeList = response.data.list
  937. cb(this.employeList)
  938. })
  939. },
  940. handleSelectEmploye(item) {
  941. console.log('责任人模糊查询选中值', item)
  942. this.$set(this.createTemp, 'employeId', item.id)
  943. this.$set(this.createTemp, 'employeName', item.name)
  944. this.$forceUpdate()
  945. },
  946. form_see(row) {
  947. console.log(row)
  948. this.seeTemp = Object.assign({}, row) // copy obj
  949. this.activeName = 'first'
  950. this.dialogStatus = 'card'
  951. this.dialogFormVisible_See = true
  952. // 流程图
  953. var reason = '未通过原因:' + this.seeTemp.workflowNote
  954. if (this.seeTemp.SHStatus === 0) {
  955. this.activeList = [{ title: '提交信息', date: this.seeTemp.inputDatetime, name: this.seeTemp.inputUserName }, { title: '设备中心审核' }]
  956. this.active = 1
  957. } else if (this.seeTemp.SHStatus === 1) {
  958. this.activeList = [{ title: '提交信息', date: this.seeTemp.inputDatetime, name: this.seeTemp.inputUserName }, { title: '设备中心审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }]
  959. this.active = 2
  960. } else if (this.seeTemp.SHStatus === 2) {
  961. this.activeList = [{ title: '提交信息', date: this.seeTemp.inputDatetime, name: this.seeTemp.inputUserName }, { title: '设备中心审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson, status: 'error', reason: reason }]
  962. this.active = 2
  963. }
  964. // 查看-点检记录
  965. },
  966. form_seeTabClick(val) {
  967. console.log(val)
  968. if (val.name == 'second') {
  969. this.getAssetBigSpotCheckList()
  970. } else if (val.name == 'third') {
  971. this.getBigupkeepbyeqList()
  972. } else if (val.name == 'fouth') {
  973. this.getAssetMaintainList()
  974. } else if (val.name == 'fifth') {
  975. this.getAssetSTTList()
  976. } else if (val.name == 'sixth') {
  977. this.getAssetChangeList()
  978. } else if (val.name == 'seventh') {
  979. this.getAssetPartApplyList()
  980. } else if (val.name == 'eighth') {
  981. this.getBarChart1Parm.parammaps.eqId = this.seeTemp.id
  982. this.getBarChart2Parm.parammaps.eqId = this.seeTemp.id
  983. this.getChartSeeParm.parammaps.eqId = this.seeTemp.id
  984. this.getBarChart1()
  985. this.getBarChart2()
  986. }
  987. },
  988. // 点检记录
  989. getAssetBigSpotCheckList() {
  990. this.listLoadingSpotCheck1 = true
  991. if (this.$refs['inputDatetimeCheck1'] !== undefined && this.$refs['inputDatetimeCheck1'].value !== null) {
  992. this.getAssetBigSpotCheckListParm.parammaps.startTime = this.$refs['inputDatetimeCheck1'].value[0]
  993. this.getAssetBigSpotCheckListParm.parammaps.stopTime = this.$refs['inputDatetimeCheck1'].value[1]
  994. } else {
  995. this.getAssetBigSpotCheckListParm.parammaps.startTime = ''
  996. this.getAssetBigSpotCheckListParm.parammaps.stopTime = ''
  997. }
  998. this.getAssetBigSpotCheckListParm.parammaps.assetId = this.seeTemp.assetId
  999. this.getAssetBigSpotCheckListParm.parammaps.pastureId = this.seeTemp.pastureId
  1000. GetDataByName(this.getAssetBigSpotCheckListParm).then(response => {
  1001. console.log('点检记录-table数据', response.data.list)
  1002. if (response.data.list !== null) {
  1003. this.listSpotCheck1 = response.data.list
  1004. this.pageNumSpotCheck1 = response.data.pageNum
  1005. this.pageSizeSpotCheck1 = response.data.pageSize
  1006. } else {
  1007. this.listSpotCheck1 = []
  1008. }
  1009. this.totalSpotCheck1 = response.data.total
  1010. setTimeout(() => {
  1011. this.listLoadingSpotCheck1 = false
  1012. }, 100)
  1013. })
  1014. },
  1015. form_searchSportCheck() {
  1016. if (this.getAssetBigSpotCheckListParm.parammaps.inputDatetimeCheck1 == null) {
  1017. this.getAssetBigSpotCheckListParm.parammaps.inputDatetimeCheck1 = ''
  1018. }
  1019. this.getAssetBigSpotCheckListParm.offset = 1
  1020. this.getAssetBigSpotCheckList()
  1021. },
  1022. // 保养记录
  1023. getBigupkeepbyeqList() {
  1024. this.listLoadingSpotCheck1 = true
  1025. if (this.$refs['inputDatetimeUpkeepbyeq'] !== undefined && this.$refs['inputDatetimeUpkeepbyeq'].value !== null) {
  1026. this.getBigupkeepbyeqParm.parammaps.startTime = this.$refs['inputDatetimeUpkeepbyeq'].value[0]
  1027. this.getBigupkeepbyeqParm.parammaps.stopTime = this.$refs['inputDatetimeUpkeepbyeq'].value[1]
  1028. } else {
  1029. this.getBigupkeepbyeqParm.parammaps.startTime = ''
  1030. this.getBigupkeepbyeqParm.parammaps.stopTime = ''
  1031. }
  1032. this.getBigupkeepbyeqParm.parammaps.assetId = this.seeTemp.assetId
  1033. this.getBigupkeepbyeqParm.parammaps.pastureId = this.seeTemp.pastureId
  1034. GetDataByName(this.getBigupkeepbyeqParm).then(response => {
  1035. console.log('保养记录-table数据', response.data.list)
  1036. if (response.data.list !== null) {
  1037. this.listUpkeepbyeq = response.data.list
  1038. this.pageNumUpkeepbyeq = response.data.pageNum
  1039. this.pageSizeUpkeepbyeq = response.data.pageSize
  1040. } else {
  1041. this.listUpkeepbyeq = []
  1042. }
  1043. this.totalUpkeepbyeq = response.data.total
  1044. setTimeout(() => {
  1045. this.listLoadingSpotCheck1 = false
  1046. }, 100)
  1047. })
  1048. },
  1049. form_searchUpkeepbyeq() {
  1050. if (this.getBigupkeepbyeqParm.parammaps.inputDatetimeUpkeepbyeq === null) {
  1051. this.getBigupkeepbyeqParm.parammaps.inputDatetimeUpkeepbyeq = ''
  1052. }
  1053. this.getBigupkeepbyeqParm.offset = 1
  1054. this.getBigupkeepbyeqList()
  1055. },
  1056. // 维修记录
  1057. getAssetMaintainList() {
  1058. this.listLoadingAssetMaintain = true
  1059. if (this.$refs['inputDatetimeAssetMaintain'] !== undefined && this.$refs['inputDatetimeAssetMaintain'].value !== null) {
  1060. this.getAssetMaintainParm.parammaps.startTime = this.$refs['inputDatetimeAssetMaintain'].value[0]
  1061. this.getAssetMaintainParm.parammaps.stopTime = this.$refs['inputDatetimeAssetMaintain'].value[1]
  1062. } else {
  1063. this.getAssetMaintainParm.parammaps.startTime = ''
  1064. this.getAssetMaintainParm.parammaps.stopTime = ''
  1065. }
  1066. this.getAssetMaintainParm.parammaps.assetId = this.seeTemp.assetId
  1067. this.getAssetMaintainParm.parammaps.pastureId = this.seeTemp.pastureId
  1068. GetDataByName(this.getAssetMaintainParm).then(response => {
  1069. console.log('维修记录-tabile数据', response.data.list)
  1070. if (response.data.list !== null) {
  1071. this.listAssetMaintain = response.data.list
  1072. this.pageNumAssetMaintain = response.data.pageNum
  1073. this.pageSizeAssetMaintain = response.data.pageSize
  1074. } else {
  1075. this.listAssetMaintain = []
  1076. }
  1077. this.totalAssetMaintain = response.data.total
  1078. setTimeout(() => {
  1079. this.listLoadingAssetMaintain = false
  1080. }, 100)
  1081. })
  1082. },
  1083. form_searchAssetMaintain() {
  1084. if (this.getBigupkeepbyeqParm.parammaps.inputDatetimeAssetMaintan === null) {
  1085. this.getBigupkeepbyeqParm.parammaps.inputDatetimeAssetMaintan = ''
  1086. }
  1087. this.getBigupkeepbyeqParm.offset = 1
  1088. this.getAssetMaintainList()
  1089. },
  1090. // 启停记录
  1091. getAssetSTTList() {
  1092. this.listLoadingAssetSTT = true
  1093. this.getAssetSTTParm.parammaps.assetId = this.seeTemp.assetId
  1094. this.getAssetSTTParm.parammaps.pastureId = this.seeTemp.pastureId
  1095. GetDataByName(this.getAssetSTTParm).then(response => {
  1096. console.log('启停记录-tabile数据', response.data.list)
  1097. if (response.data.list !== null) {
  1098. this.listAssetSTT = response.data.list
  1099. this.pageNumAssetSTT = response.data.pageNum
  1100. this.pageSizeAssetSTT = response.data.pageSize
  1101. } else {
  1102. this.listAssetSTT = []
  1103. }
  1104. this.totalAssetSTT = response.data.total
  1105. setTimeout(() => {
  1106. this.listLoadingAssetSTT = false
  1107. }, 100)
  1108. })
  1109. },
  1110. form_searchAssetSTT() {
  1111. if (this.getAssetSTTParm.parammaps.startTime == null) {
  1112. this.getAssetSTTParm.parammaps.startTime = ''
  1113. }
  1114. if (this.getAssetSTTParm.parammaps.stopTime == null) {
  1115. this.getAssetSTTParm.parammaps.stopTime = ''
  1116. }
  1117. this.getAssetSTTParm.offset = 1
  1118. this.getAssetSTTList()
  1119. },
  1120. // 变更记录
  1121. getAssetChangeList() {
  1122. this.listLoadingAssetChange = true
  1123. console.log(this.$refs['inputDatetimeAssetChange'])
  1124. if (this.$refs['inputDatetimeAssetChange'] !== undefined && this.$refs['inputDatetimeAssetChange'].value !== null) {
  1125. this.getAssetChangeParm.parammaps.startTime = this.$refs['inputDatetimeAssetChange'].value[0]
  1126. this.getAssetChangeParm.parammaps.stopTime = this.$refs['inputDatetimeAssetChange'].value[1]
  1127. } else {
  1128. this.getAssetChangeParm.parammaps.startTime = ''
  1129. this.getAssetChangeParm.parammaps.stopTime = ''
  1130. }
  1131. this.getAssetChangeParm.parammaps.assetId = this.seeTemp.assetId
  1132. this.getAssetChangeParm.parammaps.pastureId = this.seeTemp.pastureId
  1133. GetDataByName(this.getAssetChangeParm).then(response => {
  1134. console.log('变更记录-tabile数据', response.data.list)
  1135. if (response.data.list !== null) {
  1136. this.listAssetChange = response.data.list
  1137. this.pageNumAssetChange = response.data.pageNum
  1138. this.pageSizeAssetChange = response.data.pageSize
  1139. } else {
  1140. this.listAssetChange = []
  1141. }
  1142. this.totalAssetChange = response.data.total
  1143. setTimeout(() => {
  1144. this.listLoadingAssetChange = false
  1145. }, 100)
  1146. })
  1147. },
  1148. form_searchAssetChange() {
  1149. if (this.getAssetChangeParm.parammaps.inputDatetimeAssetChange === null) {
  1150. this.getAssetChangeParm.parammaps.inputDatetimeAssetChange = ''
  1151. }
  1152. this.getAssetChangeParm.offset = 1
  1153. this.getAssetChangeList()
  1154. },
  1155. changeStatue: function(cellValue) {
  1156. if (cellValue.changeStatue == 17) {
  1157. return '正常'
  1158. } else if (cellValue.changeStatue == 18) {
  1159. return '闲置'
  1160. } else if (cellValue.changeStatue == 19) {
  1161. return '报废'
  1162. } else if (cellValue.changeStatue == 20) {
  1163. return '封存'
  1164. }
  1165. },
  1166. // 备件领用记录
  1167. getAssetPartApplyList() {
  1168. this.listLoadingAssetChange = true
  1169. console.log(this.$refs['inputDatetimeAssetPartApply'].value)
  1170. if (this.$refs['inputDatetimeAssetPartApply'] !== undefined && this.$refs['inputDatetimeAssetPartApply'].value !== null && this.$refs['inputDatetimeAssetPartApply'].value !== '') {
  1171. this.getAssetPartApplyParm.parammaps.startTime = this.$refs['inputDatetimeAssetPartApply'].value[0]
  1172. this.getAssetPartApplyParm.parammaps.stopTime = this.$refs['inputDatetimeAssetPartApply'].value[1]
  1173. } else {
  1174. this.getAssetPartApplyParm.parammaps.startTime = ''
  1175. this.getAssetPartApplyParm.parammaps.stopTime = ''
  1176. }
  1177. this.getAssetPartApplyParm.parammaps.assetId = this.seeTemp.assetId
  1178. this.getAssetPartApplyParm.parammaps.pastureId = this.seeTemp.pastureId
  1179. GetDataByName(this.getAssetPartApplyParm).then(response => {
  1180. console.log('备件领用记录-tabile数据', response.data.list)
  1181. if (response.data.list !== null) {
  1182. this.listAssetPartApply = response.data.list
  1183. this.pageNumAssetPartApply = response.data.pageNum
  1184. this.pageSizeAssetPartApply = response.data.pageSize
  1185. } else {
  1186. this.listAssetPartApply = []
  1187. }
  1188. this.totalAssetPartApply = response.data.total
  1189. setTimeout(() => {
  1190. this.listLoadingAssetPartApply = false
  1191. }, 100)
  1192. })
  1193. },
  1194. form_searchAssetPartApply() {
  1195. this.listLoadingAssetChange = true
  1196. if (this.getAssetPartApplyParm.parammaps.inputDatetimeAssetChange == null) {
  1197. this.getAssetPartApplyParm.parammaps.inputDatetimeAssetChange = ''
  1198. }
  1199. this.getAssetPartApplyParm.offset = 1
  1200. this.getAssetPartApplyList()
  1201. },
  1202. getBarChart1() {
  1203. GetReportform(this.getBarChart1Parm).then(response => {
  1204. console.log('图1', response)
  1205. this.chart_data1 = response.data.chart_data
  1206. var repireCost = response.data.chart_data.repireCost
  1207. var upkeepCost = response.data.chart_data.upkeepCost
  1208. var totaltitle1 = 0
  1209. if (repireCost !== null || repireCost !== undefined) {
  1210. repireCost.forEach(function(item, index) {
  1211. console.log(parseFloat(item))
  1212. totaltitle1 = totaltitle1 + parseFloat(item)
  1213. })
  1214. }
  1215. var totaltitle2 = 0
  1216. if (upkeepCost !== null || upkeepCost !== undefined) {
  1217. upkeepCost.forEach(function(item, index) {
  1218. console.log(parseFloat(item))
  1219. totaltitle2 = totaltitle2 + parseFloat(item)
  1220. })
  1221. }
  1222. this.totaltitle = totaltitle1 + totaltitle2
  1223. this.roadBarChart1(this.chart_data1, this.totaltitle.toFixed(2))
  1224. })
  1225. },
  1226. roadBarChart1(chart_data1, totaltitle) {
  1227. console.log(chart_data1, totaltitle)
  1228. if (this.barChart1 != null) {
  1229. this.barChart1.dispose()
  1230. }
  1231. this.barChart1 = echarts.init(document.getElementById('barChart1'))
  1232. var option = {
  1233. title: { text: '年度费用统计(总费用:' + totaltitle + '元)', textStyle: { color: '#769cfc' }},
  1234. tooltip: {
  1235. trigger: 'axis',
  1236. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  1237. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  1238. },
  1239. formatter: function(data) {
  1240. console.log(data.length)
  1241. var value = 0
  1242. let val = ''
  1243. if (data.length == 1) {
  1244. val += data[0].seriesName + ':' + data[0].data + '元<br/>'
  1245. } else {
  1246. value = (parseFloat(data[0].value) + parseFloat(data[1].value)).toFixed(2)
  1247. // eslint-disable-next-line no-unused-vars
  1248. val = data[0].name + '年设备总费用:' + value + '元' + '<br/>'
  1249. val += '维修费用:' + data[0].data + '元<br/>'
  1250. val += '保养费用:' + data[1].data + '元<br/>'
  1251. }
  1252. return val
  1253. }
  1254. },
  1255. legend: {
  1256. data: ['维修费用', '保养费用'],
  1257. x: 'right'
  1258. },
  1259. color: ['#769cfc', '#42b983'],
  1260. grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
  1261. xAxis: [
  1262. { type: 'category', data: this.chart_data1.year }
  1263. ],
  1264. yAxis: [
  1265. { type: 'value', name: '费用(元)' }
  1266. ],
  1267. series: [
  1268. { name: '维修费用', type: 'bar', barWidth: 60, stack: '广告', data: this.chart_data1.repireCost },
  1269. { name: '保养费用', type: 'bar', barWidth: 60, stack: '广告', data: this.chart_data1.upkeepCost }
  1270. ]
  1271. }
  1272. this.barChart1.setOption(option)
  1273. var that = this
  1274. window.onresize = function() {
  1275. that.barChart1.resize()
  1276. }
  1277. this.barChart1.on('click', function(param, i) {
  1278. console.log(param)
  1279. that.getBarChart2Parm.parammaps.receiveTime = param.name
  1280. that.getBarChart2()
  1281. that.getBarChart1()
  1282. })
  1283. },
  1284. getBarChart2() {
  1285. GetReportform(this.getBarChart2Parm).then(response => {
  1286. console.log('图2', response)
  1287. this.chart_data2 = response.data.chart_data
  1288. this.roadBarChart2(this.chart_data2)
  1289. })
  1290. },
  1291. roadBarChart2(chart_data1) {
  1292. if (this.barChart2 != null) {
  1293. this.barChart2.dispose()
  1294. }
  1295. this.barChart2 = echarts.init(document.getElementById('barChart2'))
  1296. var option = {
  1297. title: { text: this.getBarChart2Parm.parammaps.receiveTime + '年月度费用统计', textStyle: { color: '#769cfc' }},
  1298. tooltip: {
  1299. trigger: 'axis',
  1300. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  1301. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  1302. },
  1303. formatter: function(data) {
  1304. console.log(data)
  1305. var value = 0
  1306. var val = ''
  1307. if (data.length == 1) {
  1308. val += data[0].seriesName + ':' + data[0].data + '元<br/>'
  1309. } else {
  1310. value = (parseFloat(data[0].value) + parseFloat(data[1].value)).toFixed(2)
  1311. val = data[0].name + '月设备总费用:' + value + '元' + '<br/>'
  1312. val += '维修费用:' + data[0].data + '元<br/>'
  1313. val += '保养费用:' + data[1].data + '元<br/>'
  1314. }
  1315. return val
  1316. }
  1317. },
  1318. legend: {
  1319. data: ['维修费用', '保养费用'],
  1320. x: 'right'
  1321. },
  1322. color: ['#769cfc', '#42b983'],
  1323. grid: {
  1324. left: '3%',
  1325. right: '4%',
  1326. bottom: '3%',
  1327. containLabel: true
  1328. },
  1329. xAxis: [
  1330. { type: 'category', data: this.chart_data2.months }
  1331. ],
  1332. yAxis: [
  1333. { type: 'value', name: '费用(元)' }
  1334. ],
  1335. series: [
  1336. { name: '维修费用', type: 'bar', stack: '广告', data: this.chart_data2.repireCost },
  1337. { name: '保养费用', type: 'bar', stack: '广告', data: this.chart_data2.upkeepCost }
  1338. ]
  1339. }
  1340. this.barChart2.setOption(option)
  1341. var that = this
  1342. window.onresize = function() {
  1343. that.barChart2.resize()
  1344. }
  1345. this.barChart2.on('click', function(param, i) {
  1346. console.log(param)
  1347. that.dialogFormVisible_ChartSee = true
  1348. that.dialogStatus = 'card'
  1349. that.getChartSeeParm.parammaps.receiveTime = param.name
  1350. that.getChartSeeList()
  1351. that.getBarChart1()
  1352. that.getBarChart2()
  1353. })
  1354. },
  1355. getChartSeeList() {
  1356. this.listLoadingChartSee = true
  1357. if (this.$refs['inputDatetime2'] !== undefined && this.$refs['inputDatetime2'].value !== null) {
  1358. this.getChartSeeParm.parammaps.startTime = this.$refs['inputDatetime2'].value[0]
  1359. this.getChartSeeParm.parammaps.stopTime = this.$refs['inputDatetime2'].value[1]
  1360. } else {
  1361. this.getChartSeeParm.parammaps.startTime = ''
  1362. this.getChartSeeParm.parammaps.stopTime = ''
  1363. }
  1364. GetDataByName(this.getChartSeeParm).then(response => {
  1365. console.log('table数据', response.data.list)
  1366. if (response.data.list !== null) {
  1367. this.listChartSee = response.data.list
  1368. this.pageNumChartSee = response.data.pageNum
  1369. this.pageSizeChartSee = response.data.pageSize
  1370. if (response.data.total) {
  1371. this.totalChartSee = response.data.total
  1372. }
  1373. } else {
  1374. this.listChartSee = []
  1375. }
  1376. setTimeout(() => {
  1377. this.listLoadingChartSee = false
  1378. }, 100)
  1379. })
  1380. },
  1381. form_searchChartSee() {
  1382. this.listLoadingChartSee = true
  1383. if (this.getChartSeeParm.parammaps.inputDatetime2 === null) {
  1384. this.getChartSeeParm.parammaps.inputDatetime2 = ''
  1385. }
  1386. this.getChartSeeParm.offset = 1
  1387. this.getChartSeeList()
  1388. },
  1389. form_delete(row) {
  1390. MessageBox.confirm('确认删除此信息?', {
  1391. confirmButtonText: '确认',
  1392. cancelButtonText: '取消',
  1393. type: 'warning'
  1394. }).then(() => {
  1395. this.requestParam.name = 'deleteAsset'
  1396. this.requestParam.parammaps = {}
  1397. this.requestParam.parammaps['id'] = row.id
  1398. PostDataByName(this.requestParam).then(() => {
  1399. if (this.getdataListParm.parammaps.inputDatetime1 === null) {
  1400. this.getdataListParm.parammaps.inputDatetime1 = ''
  1401. }
  1402. this.get_table_data()
  1403. this.dialogFormVisible = false
  1404. this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
  1405. })
  1406. }).catch(() => {
  1407. this.$message({ type: 'info', message: '已取消删除' })
  1408. })
  1409. },
  1410. getDownClassList() {
  1411. getRecuData(this.getRecuListParm).then(response => {
  1412. this.parentClass = response.data
  1413. })
  1414. },
  1415. getEQNumber() {
  1416. this.getdataEQNumber.parammaps.pastureId = Cookies.get('pastureid')
  1417. GetDataByName(this.getdataEQNumber).then(response => {
  1418. this.createTemp.assetCode = response.data.list[0].createNumber
  1419. console.log(response.data.list[0].createNumber)
  1420. console.log(this.createTemp.assetCode)
  1421. this.$forceUpdate()
  1422. })
  1423. },
  1424. changeSHStatue(val) {
  1425. if (val == 2) {
  1426. this.statueReason = true
  1427. } else {
  1428. this.statueReason = false
  1429. }
  1430. },
  1431. changeBatchDept(item) {
  1432. console.log(item)
  1433. this.batchChange.getdataListParmPerson.parammaps.deptId = item
  1434. this.batchChange.temp.employeeId = ''
  1435. this.batchChange.getdataListParmPerson.parammaps.pastureId = this.batchChange.deptList.find(obj => obj.deptid == item).pastureId
  1436. this.getBatchChangePersonDownList()
  1437. },
  1438. getBatchChangePersonDownList() {
  1439. GetDataByName(this.batchChange.getdataListParmPerson).then(response => {
  1440. if (response.data.list !== null) {
  1441. this.batchChange.personList = response.data.list
  1442. } else {
  1443. this.batchChange.personList = []
  1444. }
  1445. })
  1446. },
  1447. changeBatchPerson(item) {
  1448. console.log(item)
  1449. this.batchChange.temp.employeeId = item
  1450. this.batchChange.temp.employeName = this.batchChange.personList.find(obj => obj.id == item).empname
  1451. this.$forceUpdate()
  1452. },
  1453. changeData() {
  1454. this.isokDisable = true
  1455. setTimeout(() => {
  1456. this.isokDisable = false
  1457. }, 1000)
  1458. this.$refs['batchChangeTemp'].validate(valid => {
  1459. if (valid) {
  1460. this.requestParam = {}
  1461. var array = []
  1462. for (let i = 0; i < this.selectionList.length; i++) {
  1463. var obj = {}
  1464. var parammaps = {}
  1465. obj.name = 'updateEquipmentALL'
  1466. obj.offset = 0
  1467. obj.pagecount = 0
  1468. parammaps.departmentId = this.batchChange.temp.departmentId
  1469. parammaps.employeeId = this.batchChange.temp.employeeId
  1470. parammaps.employeName = this.batchChange.temp.employeName
  1471. parammaps.id = this.selectionList[i].id
  1472. obj.parammaps = parammaps
  1473. array.push(obj)
  1474. }
  1475. this.requestParam.array = array
  1476. PostDataByNames(this.requestParam).then(response => {
  1477. if (response.msg !== 'fail') {
  1478. this.dialogFormVisible_change = false
  1479. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  1480. this.get_table_data()
  1481. } else {
  1482. failproccess(response, this.$notify)
  1483. }
  1484. })
  1485. }
  1486. })
  1487. }
  1488. }
  1489. }
  1490. </script>
  1491. <style lang="scss" scoped>
  1492. .el-autocomplete-suggestion li{
  1493. padding:0 3px!important;
  1494. }
  1495. .el-table .warning-row {
  1496. background: oldlace;
  1497. }
  1498. .el-table .success-row {
  1499. background: #f0f9eb;
  1500. }
  1501. </style>
  1502. <style lang="scss">
  1503. .upkeepgrade .el-form-item__label{
  1504. line-height: 20px;
  1505. }
  1506. .inputDatetime .el-range-separator{
  1507. padding: 0;
  1508. margin: 0 10px;
  1509. }
  1510. .el-radio__label{
  1511. padding-left: 2px !important;
  1512. }
  1513. </style>
  1514. <style>
  1515. .el-table .goBeyond { background: #F47C7C ; }
  1516. .el-table .warning { background: #989DF0; }
  1517. .el-table .scrap { background: #D7D7D7; }
  1518. </style>