123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554 |
- <template>
- <div class="app-container">
- 这个页面取消,暂停开发
-
- </div>
- </template>
- <script>
- import echarts from 'echarts'
- require('echarts/theme/macarons')
- // 引入
- import { GetDataByName, GetDataByNames, PostDataByName, PostDataByNames, getRecuData, checkButtons, ExecDataByConfig, failproccess, GetAccount, GetReportform } from '@/api/common'
- import waves from '@/directive/waves'
- import { parseTime, sortChange, json2excel } from '@/utils/index.js'
- import Pagination from '@/components/Pagination'
- import { MessageBox } from 'element-ui'
- import TreeSelect from '@/components/TreeSelect'
- import Cookies from 'js-cookie'
- import { getToken } from '@/utils/auth'
- export default {
- inject: ['reload'],
- name: 'AssetDesignee',
- components: { Pagination, TreeSelect },
- directives: { waves },
- data() {
- return {
- isBasicsAdd: [], isBasicsCard: [], isBasicsUpdate: [], isBasicsDel: [], isBasicsDel2: [], isBasic: [], isBasicSH: [], isBasicExamine: [],
- rules: {
- // assetCode: [{ required: true, message: '必填', trigger: 'blur' }],
- eqName: [{ required: true, message: '必填', trigger: 'blur' }],
- eqCode: [{ required: true, message: '必填', trigger: 'blur' }],
- financeCode: [{ required: true, message: '必填', trigger: 'blur' }],
- departmentId: [{ required: true, message: '必填', trigger: 'blur' }],
- employeeId: [{ required: true, message: '必填', trigger: 'blur' }],
- depreciation: [{ type: 'number', required: true, validator: (rule, value, callback) => {
- if (!value) {
- callback(new Error('不能为空'))
- }
- setTimeout(() => {
- const re = /^[0-9]*[1-9][0-9]*$/ // /^[0-9]*[1-9][0-9]*$/
- const rsCheck = re.test(value)
- if (!rsCheck) {
- callback(new Error('请输入正整数'))
- } else {
- callback()
- }
- }, 0)
- }, trigger: 'blur' }]
- },
- placeholder:"请选择设备类别",
- findAllBrand: [], findAllProvider: [],
- findAllAssetType: [], findAllPasture: [], findAllDepart: [], findAllEmploye: [],
- getDictByName: [], upkeepgrades: [], createDepartList: [],
- statues: [{ id: '0', name: '审核中' }, { id: '1', name: '已通过' }, { id: '2', name: '未通过' }],
- depreciationAlertList: [{ id: '0', name: '正常' }, { id: '1', name: '到期预警' }, { id: '2', name: '超期使用' }],
- requestParams: [
- { name: 'findAllBrand', offset: 0, pagecount: 0, params: [] },
- { name: 'findAllProvider', offset: 0, pagecount: 0, params: [] },
- { name: 'findAlllAssetProvider', offset: 0, pagecount: 0, params: [] },
- { name: 'findAllAssetType', offset: 0, pagecount: 0, params: [] },
- { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
- { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
- { name: 'getDictByName', offset: 0, pagecount: 0, params: ['资产状态'] },
- { name: 'getdictbyname', offset: 0, pagecount: 0, params: ['保养级别'] }
- ],
- getDepartParam: { name: 'findAllDepart1', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }},
- disabled: false,
- nodeKey: 'id',
- defaultCheckedKeys: [],
- parentClass: [],
- defaultProps: { children: 'children', label: 'typeName' },
- getRecuListParm: { name: 'getAssetTypeList', idname: 'id', params: [-1] },
- tableKey: 0,
- list: [],
- total: 0,
- listLoading: true,
- getdataListParm: {
- name: 'getAssetList', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
- 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: '' }
- },
-
- textMap: { update: '编辑', create: '新增', card: '查看设备信息', examine: '审核', change: '批量变更' },
- dialogFormVisible: false,
- dialogStatus: '',
- pickerOptions1: {
- disabledDate(time) {
- return time.getTime() > Date.now()// 当天之前的时间可选
- }
- },
- dialogImageUrl: '', dialogVisible: false,
- fileList: [], showUpload: false,
- headers: { optname: 'insertcustompic', id: 1, token: getToken() },
- uploadImageUrl: process.env.VUE_APP_BASE_API + 'authdata/uploaderimage',
- width: '',
- 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: '' },
- requestParam: { name: 'insertAsset', offset: 0, pagecount: 0, parammaps: {}},
- seeTemp: {},
-
- dialogFormVisible_See: false,
- activeName: 'first',
- maintainTypes: [{ id: '0', name: '周保养' }, { id: '1', name: '月保养' }, { id: '2', name: '间隔保养' }],
- changeStates: [{ id: '17', name: '正常' }, { id: '18', name: '闲置' }, { id: '19', name: '报废' }, { id: '20', name: '封存' }],
- getdataEQNumber: { name: 'cerateEQNumber', page: 1, offset: 1, pagecount: 10, returntype: 'Map', parammaps: {}},
- dialoFormVisible_Examine: false,
- examineTemp: { SHstatue: 1 },
- statueReason: false,
- activeList: [],
- active: 3,
- isFlowChart: false,
- isDisplayRecord: false,
- buttons: [],
- // 查看-点检记录
- getAssetBigSpotCheckListParm: { name: 'getAssetBigSpotCheck1', page: 1, offset: 1, pagecount: 10, returntype: 'Map', parammaps: { inputDatetimeSpotCheck1: '', startTime: '', stopTime: '' }},
- listLoadingSpotCheck1: false,
- listSpotCheck1: [],
- totalSpotCheck1: 0,
- // 查看-保养记录
- getBigupkeepbyeqParm: { name: 'getBigupkeepbyeq', page: 1, offset: 1, pagecount: 10, returntype: 'Map', parammaps: { inputDatetimeUpkeepbyeq: '', startTime: '', stopTime: '', upkeepType: '', upkeepCode: '' }},
- listLoadingUpkeepbyeq: false,
- listUpkeepbyeq: [],
- totalUpkeepbyeq: 0,
- // 查看-维修记录
- getAssetMaintainParm: { name: 'getAssetMaintain1', page: 1, offset: 1, pagecount: 10, returntype: 'Map', parammaps: { inputDatetimeAssetMaintain: '', startTime: '', stopTime: '', repairCode: '' }},
- listLoadingAssetMaintain: false,
- listAssetMaintain: [],
- totalAssetMaintain: 0,
- // 查看-启停记录
- getAssetSTTParm: { name: 'getAssetSTT1', page: 1, offset: 1, pagecount: 10, returntype: 'Map', parammaps: { startTime: '', stopTime: '' }},
- listLoadingAssetSTT: false,
- listAssetSTT: [],
- totalAssetSTT: 0,
- // 查看-变更记录
- getAssetChangeParm: { name: 'getAssetChange1', page: 1, offset: 1, pagecount: 10, returntype: 'Map', parammaps: { startTime: '', stopTime: '', changeStatue: '', inputDatetimeAssetChange: '' }},
- listLoadingAssetChange: false,
- listAssetChange: [],
- totalAssetChange: 0,
- // 查看-备件领用记录
- getAssetPartApplyParm: { name: 'getAssetPartApply', page: 1, offset: 1, pagecount: 10, returntype: 'Map', parammaps: { startTime: '', stopTime: '', inputDatetimeAssetPartApply: '' }},
- listLoadingAssetPartApply: false,
- listAssetPartApply: [],
- totalAssetPartApply: 0,
- downLoadParm: {},
- downLoadList: [],
- requestBrand: {
- name: 'getBrandByPartCode',
- page: 0,
- offset: 0,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {}
- },
- BrandList: [],
- requestEmploye: {
- name: 'findAllEmployeV2',
- page: 0,
- offset: 0,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid')
- }
- },
- employeList: [],
- totaltitle: 0,
- getBarChart1Parm: {
- name: 'getReportEqCostYear',
- parammaps: {}
- },
- barChart1: null,
- chart_data1: {},
- getBarChart2Parm: {
- name: 'getReportEqCostMonth',
- parammaps: {
- receiveTime: new Date().getFullYear()
- }
- },
- barChart2: null,
- chart_data2: {},
- dialogFormVisible_ChartSee: false,
- getChartSeeParm: {
- name: 'getEqPartuseDetailList',
- page: 0,
- offset: 0,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {
- receiveTime: '',
- eqId: '',
- useTypeV: '',
- inputDatetime2: '',
- stopTime: '',
- startTime: ''
- }
- },
- listLoadingChartSee: false,
- totalChartSee: 0,
- listChartSee: [],
- pageNum: 0,
- pageSize: 0,
- pageNumSH: 0,
- pageSizeSH: 0,
- useTypes: [{ id: 0, name: '维修' }, { id: 1, name: '保养' }],
- downLoadParm2: {},
- downLoadList2: [],
- isPercentage: false,
- percentage: 1,
- isokDisable: false,
- edit: 0,
- selectionList: [],
- dialogFormVisible_change: false,
- batchChange: {
- temp: { departmentId: '', employeeId: '' },
- getdataListParmDept: { name: 'getAssetAndEmpList', offset: 0, pagecount: 0, parammaps: {}},
- deptList: [],
- getdataListParmPerson: { name: 'getAllEmp', offset: 0, pagecount: 0, parammaps: {}},
- personList: []
- },
- rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
- cellStyle: { padding: 0 + 'px' }
- }
- },
- computed: {
- // 设置请求头
- // headers() {
- // return {
- // // 设置token
- // // eslint-disable-next-line no-undef
- // token: getToken()
- // }
- // },
- uploadData() {
- return {
- name: 'importStockUse',
- importParams: '牧场,设备类别,资产编号,设备名称,设备内部编号,设备规格,品牌,供应商,用途,状态,购置日期,入场日期,折旧年限,财务编号,原值,残值,月核减值,保养级别,保养费用,维修费用,维修费用,基数(小时),部门,责任人,录入人,录入时间,使用时长(年),使用率(%),SignColumn',
- sheetname: 'SheetJS'
- }
- },
-
- // 设置上传地址
- uploadExcelUrl() {
- // process.env.VUE_APP_BASE_API是服务器的路径,也是axios的基本路径
- return process.env.VUE_APP_BASE_API + 'authdata/equipment'
- }
- },
- created() {
-
-
- },
- methods: {
- // 导入
- beforeImportExcel(file) {
- const isLt2M = file.size / 1024 / 1024 < 10
- if (!isLt2M) {
- this.$message.error('上传文件大小不能超过 10MB!')
- }
- return isLt2M
- },
- handleImportExcelSuccess(res, file) {
- if (res.msg === 'ok') {
- this.$message({
- title: '成功',
- message: '导入成功:' + res.data.success + '条!',
- type: 'success',
- duration: 2000
- })
- if (res.data.err_count > 0) {
- this.$notify({
- title: '失败',
- message: '导入失败:' + res.data.err_count + '条!',
- type: 'danger',
- duration: 2000
- })
-
- }
- } else {
- this.$notify({
- title: '失败',
- message: '上传失败',
- type: 'danger',
- duration: 2000
- })
- }
- },
- formatJsonTemp(filterVal, jsonData) {
- return jsonData.map(v =>
- filterVal.map(j => {
- if (j === 'timestamp') {
- return parseTime(v[j])
- } else {
- return v[j]
- }
- })
- )
- },
- tableSort2(column) {
- sortChange(column, this.list)
- },
- tableSort(column) {
- if (this.activeName == 'third') {
- sortChange(column, this.listUpkeepbyeq)
- } else if (this.activeName == 'fouth') {
- sortChange(column, this.listAssetMaintain)
- } else if (this.activeName == 'seventh') {
- sortChange(column, this.listAssetPartApply)
- }
- },
- get_auto_buttons() {
- // 新增
- const BasicsAdd = 'asset:basics:add'
- const isBasicsAdd = checkButtons(this.$store.state.user.buttons, BasicsAdd)
- this.isBasicsAdd = isBasicsAdd
- // 卡片
- const BasicsCard = 'asset:basics:kapian'
- const isBasicsCard = checkButtons(this.$store.state.user.buttons, BasicsCard)
- this.isBasicsCard = isBasicsCard
- // 编辑
- const BasicsUpdate = 'asset:basics:update'
- const isBasicsUpdate = checkButtons(this.$store.state.user.buttons, BasicsUpdate)
- this.isBasicsUpdate = isBasicsUpdate
- // 删除
- const BasicsDel = 'asset:basics:del'
- const isBasicsDel = checkButtons(this.$store.state.user.buttons, BasicsDel)
- this.isBasicsDel = isBasicsDel
- // 设备基础信息-删除
- const BasicsDel2 = 'asset:basics:del2'
- const isBasicsDel2 = checkButtons(this.$store.state.user.buttons, BasicsDel2)
- this.isBasicsDel2 = isBasicsDel2
- // 设备基础信息
- const Basic = 'asset:basic:basic'
- const isBasic = checkButtons(this.$store.state.user.buttons, Basic)
- this.isBasic = isBasic
- // 设备审核
- const BasicSH = 'asset:basic:shjm'
- const isBasicSH = checkButtons(this.$store.state.user.buttons, BasicSH)
- this.isBasicSH = isBasicSH
- // 审核
- const BasicExamine = 'asset:basic:shenhe'
- const isBasicExamine = checkButtons(this.$store.state.user.buttons, BasicExamine)
- this.isBasicExamine = isBasicExamine
- },
- // 2-2:下拉框
- get_select_list() {
- GetDataByNames(this.requestParams).then(response => {
- if (response.data.list !== null) {
- this.findAllBrand = response.data.findAllBrand.list
- this.findAllProvider = response.data.findAllProvider.list
- this.findAllAssetType = response.data.findAllAssetType.list
- this.findAllPasture = response.data.findAllPasture.list
- this.findAllEmploye = response.data.findAllEmploye.list
- this.getDictByName = response.data.getDictByName.list
- this.upkeepgrades = response.data.getdictbyname.list
- this.getDepartDownList()
- }
- })
- },
- getDepartDownList() {
- GetDataByName(this.getDepartParam).then(response => {
- this.findAllDepart = response.data.list
- })
- },
- changePastureName(item) {
- this.getDepartParam.parammaps.pastureId = this.findAllPasture.find(obj => obj.name == item).id
- this.getdataListParm.parammaps.departmentId = ''
- this.getDepartDownList()
- },
- getCreateDepartDownList() {
- GetDataByName(this.getDepartParam).then(response => {
- this.createDepartList = response.data.list
- if (this.edit == 1) {
- if (this.createDepartList.find(obj => obj.id == Cookies.get('departmentid'))) {
- this.createTemp.departmentId = parseInt(Cookies.get('departmentid'))
- this.createTemp.departmentName = this.createDepartList.find(obj => obj.id == Cookies.get('departmentid')).name
- this.createTemp.deptId = parseInt(Cookies.get('departmentid'))
- } else {
- this.createTemp.departmentId = response.data.list[0].id
- this.createTemp.departmentId = response.data.list[0].id
- this.createTemp.deptId = response.data.list[0].name
- }
- }
- })
- },
- changePasture(item) {
- this.getDepartParam.parammaps.pastureId = item
- this.edit = 1
- this.getCreateDepartDownList()
- },
- changeDepart(item) {
- this.createTemp.departmentName = this.createDepartList.find(obj => obj.id == item).name
- },
- get_table_data() {
- this.listLoading = true
- if (this.getdataListParm.parammaps.inputDatetime1 == null) {
- this.getdataListParm.parammaps.inputDatetime1 = ''
- this.getdataListParm.parammaps.startTime = ''
- this.getdataListParm.parammaps.stopTime = ''
- } else {
- this.getdataListParm.parammaps.startTime = this.getdataListParm.parammaps.inputDatetime1[0]
- this.getdataListParm.parammaps.stopTime = this.getdataListParm.parammaps.inputDatetime1[1]
- }
- if (this.getdataListParm.parammaps.inputDatetime2 == null || this.getdataListParm.parammaps.inputDatetime2 == '') {
- this.getdataListParm.parammaps.inputDatetime2 = ''
- this.getdataListParm.parammaps.startTime2 = ''
- this.getdataListParm.parammaps.stopTime2 = ''
- } else {
- this.getdataListParm.parammaps.startTime2 = this.getdataListParm.parammaps.inputDatetime2[0]
- this.getdataListParm.parammaps.stopTime2 = this.getdataListParm.parammaps.inputDatetime2[1]
- }
- if (this.getdataListParm.parammaps.inputDatetime3 == null || this.getdataListParm.parammaps.inputDatetime3 == '') {
- this.getdataListParm.parammaps.inputDatetime3 = ''
- this.getdataListParm.parammaps.startTime3 = ''
- this.getdataListParm.parammaps.stopTime3 = ''
- } else {
- this.getdataListParm.parammaps.startTime3 = this.getdataListParm.parammaps.inputDatetime3[0]
- this.getdataListParm.parammaps.stopTime3 = this.getdataListParm.parammaps.inputDatetime3[1]
- }
- GetDataByName(this.getdataListParm).then(response => {
- console.log('table数据', response.data.list)
- if (response.data.list !== null) {
- this.list = response.data.list
-
- this.pageNum = response.data.pageNum
- this.pageSize = response.data.pageSize
- } else {
- this.list = []
- }
- this.total = response.data.total
- setTimeout(() => {
- this.listLoading = false
- }, 100)
- this.get_select_list()
- })
- },
-
- SHStatus: function(cellValue) {
- if (cellValue.SHStatus == 0) {
- return '审核中'
- } else if (cellValue.SHStatus == 1) {
- return '已通过'
- } else if (cellValue.SHStatus == 2) {
- return '未通过'
- } else if (cellValue.SHStatus == 3) {
- return '历史数据'
- }
- },
- form_search() {
- this.listLoading = true
- this.getdataListParm.parammaps.pastureId = ''
- if (this.getdataListParm.parammaps.warning !== '') {
- this.getdataListParm.parammaps.d1 = 1
- } else {
- this.getdataListParm.parammaps.d1 = ''
- }
- if (this.getdataListParm.parammaps.inputDatetime1 == null) {
- this.getdataListParm.parammaps.inputDatetime1 = ''
- this.getdataListParm.parammaps.startTime = ''
- this.getdataListParm.parammaps.stopTime = ''
- } else {
- this.getdataListParm.parammaps.startTime = this.getdataListParm.parammaps.inputDatetime1[0]
- this.getdataListParm.parammaps.stopTime = this.getdataListParm.parammaps.inputDatetime1[1]
- }
- console.log(this.getdataListParm.parammaps.inputDatetime2)
- if (this.getdataListParm.parammaps.inputDatetime2 == null) {
- this.getdataListParm.parammaps.inputDatetime2 = ''
- this.getdataListParm.parammaps.startTime2 = ''
- this.getdataListParm.parammaps.stopTime2 = ''
- } else {
- this.getdataListParm.parammaps.startTime2 = this.getdataListParm.parammaps.inputDatetime2[0]
- this.getdataListParm.parammaps.stopTime2 = this.getdataListParm.parammaps.inputDatetime2[1]
- }
- if (this.getdataListParm.parammaps.inputDatetime3 == null) {
- this.getdataListParm.parammaps.inputDatetime3 = ''
- this.getdataListParm.parammaps.startTime3 = ''
- this.getdataListParm.parammaps.stopTime3 = ''
- } else {
- this.getdataListParm.parammaps.startTime3 = this.getdataListParm.parammaps.inputDatetime3[0]
- this.getdataListParm.parammaps.stopTime3 = this.getdataListParm.parammaps.inputDatetime3[1]
- }
- this.getdataListParm.offset = 1
- this.get_table_data()
- },
-
- handlePicChange(file, fileList) {
- if (fileList.length > 0) {
- this.$nextTick(() => {
- this.showUpload = true
- })
- } else {
- this.$nextTick(() => {
- this.showUpload = false
- })
- }
- console.log(this.createTemp)
- },
- handlePicSuccess(response, file, fileList) {
- if (fileList.length > 0) {
- this.$nextTick(() => {
- this.showUpload = true
- })
- } else {
- this.$nextTick(() => {
- this.showUpload = false
- })
- }
- if (this.createTemp.picpath === undefined || this.createTemp.picpath === '' || this.createTemp.picpath == -1) {
- this.$set(this.createTemp, 'picpath', response.execresult.LastInsertId)
- }
- },
- handlePicRemove(file, fileList) {
- if (this.dialogStatus === 'create') {
- if (fileList.length < 1) {
- this.showUpload = false
- }
- for (const key in this.createTemp) {
- if (this.createTemp[key] === file.response.execresult.LastInsertId) {
- this.$delete(this.createTemp, key)
- }
- }
- } else {
- if (fileList.length < 1) {
- this.$nextTick(() => {
- this.showUpload = false
- })
- }
- const url = file.url
- console.log(url, 'url')
- for (const key in this.createTemp) {
- console.log(this.createTemp[key], 'createTemp[key]')
- if (this.createTemp[key] === url) {
- console.log(key)
- if (key === 'picpath') {
- this.$delete(this.createTemp, 'picpath')
- this.$delete(this.createTemp, 'picId')
- }
- }
- }
- }
- console.log(this.createTemp, '文件列表移除文件时的钩子row')
- },
- handlePicPreview(file) {
- this.dialogImageUrl = file.url
- this.dialogVisible = true
- },
- onLoad(e) {
- const img = e.target
- let width = 0
- if (img.fileSize > 0 || (img.width > 1 && img.height > 1)) {
- width = img.width + 40
- }
- this.width = width + 'px'
- },
- add_dialog_saveAdd() {
- console.log('点击了保存')
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- this.$refs['createTemp'].validate(valid => {
- if (valid) {
- for (var i = 0; i < this.listAdd.length; i++) {
- if (this.listAdd[i].score == null) {
- this.$message({ type: 'warning', message: '请检查检查结果是否为空', duration: 2000 })
- return false
- }
- if (this.listAdd[i].pic1 == undefined) {
- this.listAdd[i].pic1 = -1
- }
- if (this.listAdd[i].pic2 == undefined) {
- this.listAdd[i].pic2 = -1
- }
- if (this.listAdd[i].pic3 == undefined) {
- this.listAdd[i].pic3 = -1
- }
- }
- this.postDataPramas.common = { 'returnmap': '0' }
- this.postDataPramas.data = []
- this.postDataPramas.data[0] = { 'name': 'insertBigjudge', 'type': 'e', 'parammaps': {
- pastureId: this.createTemp.pastureId,
- batime: this.createTemp.batime,
- empId: this.createTemp.empId
- }}
- this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
- this.postDataPramas.data[1].children = []
- this.postDataPramas.data[1].children[0] = { 'name': 'insertjudge', 'type': 'e', 'parammaps': {
- bigId: '@insertBigjudge.LastInsertId',
- statue: '@insertSpotList.statue',
- score: '@insertSpotList.score',
- note: '@insertSpotList.note',
- pic1: '@insertSpotList.pic1',
- pic2: '@insertSpotList.pic2',
- pic3: '@insertSpotList.pic3'
- }}
- ExecDataByConfig(this.postDataPramas).then(response => {
- console.log('新增保存发送参数', this.postDataPramas)
- if (response.msg === 'fail') {
- this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
- } else {
- this.getdataListParm.parammaps.inputDatetime = ''
- this.get_table_data()
- this.dialogFormVisibleAdd = false
- this.createTemp.providerName = ''
- this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
- }
- })
- }
- })
- },
- beforeRemove(file, fileList) {
- console.log(file.response, '删除文件之前的钩子,参数为上传的文件和文件列表')
- return this.$confirm('删除当前图片, 是否继续?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' })
- },
- resetCreateTemp() {
- this.defaultCheckedKeys = []
- this.createTemp.defaultCheckedKeys = []
- this.createTemp.brandId = ''
- this.createTemp.providerId = ''
- this.createTemp.inputDatetime = parseTime(new Date(), '{y}-{m}-{d}')
- this.createTemp.eqClassName = ''
- this.createTemp.eqClassId = ''
- this.createTemp.employeName = Cookies.get('employename')
- this.createTemp.employeId = Cookies.get('employeid')
- this.createTemp.inputUser = Cookies.get('employeid')
- this.createTemp.deptId = parseInt(Cookies.get('departmentid'))
- this.createTemp.departmentName = Cookies.get('departmentname')
- this.createTemp.pastureId = parseInt(Cookies.get('pastureid'))
- this.createTemp.eqCode = ''
- this.createTemp.eqName = ''
- this.createTemp.specification = ''
- this.createTemp.providerName = ''
- this.createTemp.financeCode = ''
- this.createTemp.status = '正常'
- this.createTemp.providerName = ''
- this.createTemp.brandName = ''
- this.createTemp.purpose = ''
- this.createTemp.purchaseDate = parseTime(new Date(), '{y}-{m}-{d}')
- this.createTemp.entranceDate = parseTime(new Date(), '{y}-{m}-{d}')
- this.createTemp.assetCode = ''
- this.createTemp.yearUpkeepCost = ''
- this.createTemp.yearMaintainDost = ''
- this.createTemp.yuanzhi = ''
-
- this.createTemp.baseHours = ''
- this.createTemp.upkeepgrade = 113
- this.createTemp.salvage = ''
- this.createTemp.subtractvalue = ''
- this.createTemp.yearMaintainCost = ''
- this.createTemp.inputUserName = ''
- this.createTemp.picpath = ''
- this.fileList = []
- this.showUpload = false
- this.createTemp.fileList = []
- this.createTemp.depreciation = ''
- },
- form_add() {
- this.resetCreateTemp()
- this.edit = 1
- this.getDepartParam.parammaps.pastureId = this.createTemp.pastureId
- this.getCreateDepartDownList()
- this.dialogStatus = 'create'
- this.dialogFormVisible = true
- this.$nextTick(() => {
- this.$refs['createTemp'].clearValidate()
- })
- },
- changeBrand(item) {
- this.createTemp.brandName = this.findAllBrand.find(obj => obj.id === item).name
- },
- changeUpkeepgrade(item) {
- console.log(item)
- },
- upkeepgradeChange(e) {
- if (!e) {
- this.$refs['upkeepgrade'].blur()
- }
- },
- popoverHide(checkedIds, checkedData) {
- console.log(checkedIds, checkedData)
- if (checkedIds !== null) {
- this.getdataEQNumber.parammaps.eqCode = checkedData.typeCode
- // if (checkedData.children === undefined) {
- // this.createTemp.eqClassId = checkedData.eqClassId
- // this.createTemp.eqName = checkedData.NewName
- // this.getdataListParm.parammaps.eqClassId = checkedData.eqClassId
- // this.getEQNumber()
- // } else {
- // this.defaultCheckedKeys = []
- // this.createTemp.eqClassId = ''
- // this.getdataListParm.parammaps.eqClassId = ''
- // this.$message({ type: 'warning', message: '请选择具体设备类型' })
- // }
- this.createTemp.eqClassId = checkedData.eqClassId
- this.createTemp.eqName = checkedData.NewName
- this.getdataListParm.parammaps.eqClassId = checkedData.eqClassId
- this.getEQNumber()
- } else {
- this.defaultCheckedKeys = []
- this.createTemp.eqClassId = ''
- this.getdataListParm.parammaps.eqClassId = ''
- }
- },
- add_dialog_save() {
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- this.$refs['createTemp'].validate(valid => {
- if (valid) {
- console.log(this.createTemp)
- this.requestParam.name = 'insertAsset'
- if (this.createTemp.status == '正常') { this.createTemp.status = 17 }
- if (this.createTemp.providerId == '') { this.createTemp.providerId = 0 }
- if (this.createTemp.brandId == '') { this.createTemp.brandId = 0 }
- if (this.createTemp.yuanzhi == '') { this.createTemp.yuanzhi = 0 }
- if (this.createTemp.salvage == '') { this.createTemp.salvage = 0 }
- if (this.createTemp.subtractvalue == '') { this.createTemp.subtractvalue = 0 }
- if (this.createTemp.yearUpkeepCost == '') { this.createTemp.yearUpkeepCost = 0 }
- if (this.createTemp.yearMaintainCost == '') { this.createTemp.yearMaintainCost = 0 }
- if (this.createTemp.baseHours == '') { this.createTemp.baseHours = 0 }
- // 原值yuanzhi残值salvage月核减值subtractvalue保养费用yearUpkeepCost维修费用yearMaintainCost
- var rulesValue = /^\d+(\.\d{1,3})?$/
- this.requestParam.parammaps = this.createTemp
- this.requestParam.parammaps.picpath = this.createTemp.picpath
- if (this.createTemp.yuanzhi !== '' || this.createTemp.salvage !== '' || this.createTemp.subtractvalue !== '' || this.createTemp.yearUpkeepCost !== '' || this.createTemp.yearMaintainCost !== '') {
- this.requestParam.parammaps.yuanzhi = parseFloat(this.createTemp.yuanzhi)
- if (!rulesValue.test(parseFloat(this.createTemp.yuanzhi))) {
- this.$message({ type: 'error', message: '原值请输入自然数,最多保留三位小数点', duration: 2000 })
- return false
- }
- if (!rulesValue.test(parseFloat(this.createTemp.salvage))) {
- this.$message({ type: 'error', message: '残值请输入自然数,最多保留三位小数点', duration: 2000 })
- return false
- }
- if (!rulesValue.test(parseFloat(this.createTemp.subtractvalue))) {
- this.$message({ type: 'error', message: '月核减值请输入自然数,最多保留三位小数点', duration: 2000 })
- return false
- }
- if (!rulesValue.test(parseFloat(this.createTemp.yearUpkeepCost))) {
- this.$message({ type: 'error', message: '保养费用输入自然数,最多保留三位小数点', duration: 2000 })
- return false
- }
- if (!rulesValue.test(parseFloat(this.createTemp.yearMaintainCost))) {
- this.$message({ type: 'error', message: '维修费用请输入自然数,最多保留三位小数点', duration: 2000 })
- return false
- }
- }
- PostDataByName(this.requestParam).then(response => {
- console.log('新增保存发送参数', this.requestParam)
- if (response.msg !== 'fail') {
- if (this.getdataListParm.parammaps.inputDatetime1 === null) {
- this.getdataListParm.parammaps.inputDatetime1 = ''
- }
- this.dialogFormVisible = false
- this.get_table_data()
- this.$notify({ title: '成功', message: '新增成功', type: 'success', duration: 2000 })
- // this.reload()
- } else {
- failproccess(response, this.$notify)
- }
- })
- }
- })
- },
- // 继续新增
- add_dialog_save_again() {
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- this.$refs['createTemp'].validate(valid => {
- if (valid) {
- this.requestParam.name = 'insertAsset'
- if (this.createTemp.status == '正常') { this.createTemp.status = 17 }
- if (this.createTemp.providerId == '') { this.createTemp.providerId = 0 }
- if (this.createTemp.brandId == '') { this.createTemp.brandId = 0 }
- if (this.createTemp.yuanzhi == '') { this.createTemp.yuanzhi = 0 }
- if (this.createTemp.salvage == '') { this.createTemp.salvage = 0 }
- if (this.createTemp.subtractvalue == '') { this.createTemp.subtractvalue = 0 }
- if (this.createTemp.yearUpkeepCost == '') { this.createTemp.yearUpkeepCost = 0 }
- if (this.createTemp.yearMaintainCost == '') { this.createTemp.yearMaintainCost = 0 }
- if (this.createTemp.baseHours == '') { this.createTemp.baseHours = 0 }
- // 原值yuanzhi残值salvage月核减值subtractvalue保养费用yearUpkeepCost维修费用yearMaintainCost
- var rulesValue = /^\d+(\.\d{1,3})?$/
- this.requestParam.parammaps = this.createTemp
- this.requestParam.parammaps.picpath = this.createTemp.picpath
- if (this.createTemp.yuanzhi !== '' || this.createTemp.salvage !== '' || this.createTemp.subtractvalue !== '' || this.createTemp.yearUpkeepCost !== '' || this.createTemp.yearMaintainCost !== '') {
- this.requestParam.parammaps.yuanzhi = parseFloat(this.createTemp.yuanzhi)
- // 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))) {
- if (!rulesValue.test(parseFloat(this.createTemp.yuanzhi))) {
- this.$message({ type: 'error', message: '原值请输入自然数,最多保留三位小数点', duration: 2000 })
- return false
- }
- if (!rulesValue.test(parseFloat(this.createTemp.salvage))) {
- this.$message({ type: 'error', message: '残值请输入自然数,最多保留三位小数点', duration: 2000 })
- return false
- }
- if (!rulesValue.test(parseFloat(this.createTemp.subtractvalue))) {
- this.$message({ type: 'error', message: '月核减值请输入自然数,最多保留三位小数点', duration: 2000 })
- return false
- }
- if (!rulesValue.test(parseFloat(this.createTemp.yearUpkeepCost))) {
- this.$message({ type: 'error', message: '保养费用输入自然数,最多保留三位小数点', duration: 2000 })
- return false
- }
- if (!rulesValue.test(parseFloat(this.createTemp.yearMaintainCost))) {
- this.$message({ type: 'error', message: '维修费用请输入自然数,最多保留三位小数点', duration: 2000 })
- return false
- }
- }
- PostDataByName(this.requestParam).then(response => {
- console.log('新增保存发送参数', this.requestParam)
- if (response.msg !== 'fail') {
- if (this.getdataListParm.parammaps.inputDatetime === null) {
- this.getdataListParm.parammaps.inputDatetime = ''
- }
- this.resetCreateTemp()
- this.$notify({ title: '成功', message: '新增成功', type: 'success', duration: 2000 })
- } else {
- failproccess(response, this.$notify)
- }
- })
- }
- })
- },
- form_edit(row) {
- if (this.dialogFormVisible) {
- return
- }
- this.edit = 0
- this.getDepartParam.parammaps.pastureId = row.pastureId
- this.getCreateDepartDownList()
- this.createTemp = Object.assign({}, row) // copy obj
- if (row.inputUser !== undefined) {
- this.createTemp.inputUser = parseInt(row.inputUser)
- }
- if (this.createTemp.eqClassId !== undefined) {
- this.defaultCheckedKeys = [this.createTemp.eqClassId]
- } else {
- this.createTemp.eqClassId = ''
- this.defaultCheckedKeys = []
- }
- this.dialogStatus = 'update'
- this.dialogFormVisible = true
- this.$nextTick(() => {
- this.$refs['createTemp'].clearValidate()
- })
- const urlArray = []
- const fileList = []
- if (row.picpath == undefined) {
- urlArray.push()
- } else if (row.picpath == '') {
- urlArray.push()
- } else {
- urlArray.push(row.picpath)
- }
- for (let i = 0; i < urlArray.length; i++) {
- const urlObj = {}
- this.$set(urlObj, 'url', urlArray[i])
- fileList.push(urlObj)
- }
- this.$set(this.createTemp, 'fileList', fileList)
- console.log(this.createTemp)
- if (this.createTemp.fileList.length >= 1) {
- this.showUpload = true
- } else {
- this.showUpload = false
- }
- },
- edit_dialog_save() {
- this.$refs['createTemp'].validate(valid => {
- if (valid) {
- console.log('-----------', this.createTemp)
- console.log(this.createTemp.providerId)
- if (this.createTemp.eqClassId == '' || this.createTemp.eqClassId == undefined || this.createTemp.eqClassId == null) {
- this.$message({ type: 'warning', message: '请选择设备类别' })
- } else {
- this.requestParam.name = 'updateAsset'
- this.requestParam.parammaps = this.createTemp
- if (this.createTemp.status === '正常') { this.createTemp.status = 17 }
- if (this.createTemp.status === '闲置') { this.createTemp.status = 18 }
- if (this.createTemp.status === '报废') { this.createTemp.status = 19 }
- if (this.createTemp.status === '封存') { this.createTemp.status = 20 }
- if (this.createTemp.providerId === '' || this.createTemp.providerId === undefined) { this.createTemp.providerId = 0 }
- if (this.createTemp.brandId === '' || this.createTemp.brandId == undefined) { this.createTemp.brandId = 0 }
- if (this.createTemp.yuanzhi === '') { this.createTemp.yuanzhi = 0 }
- if (this.createTemp.salvage === '') { this.createTemp.salvage = 0 }
- if (this.createTemp.subtractvalue === '') { this.createTemp.subtractvalue = 0 }
- if (this.createTemp.yearUpkeepCost === '') { this.createTemp.yearUpkeepCost = 0 }
- if (this.createTemp.yearMaintainCost === '') { this.createTemp.yearMaintainCost = 0 }
- if (this.createTemp.baseHours === '') { this.createTemp.baseHours = 0 }
- if (this.createTemp.upkeepgrade === 'A' || this.createTemp.upkeepgrade === 'B' || this.createTemp.upkeepgrade === 'C') {
- this.createTemp.upkeepgrade = this.createTemp.upkeepgradeId
- this.createTemp.upkeepgradeId = ''
- }
- this.createTemp.deptId = this.createTemp.deptId
- this.createTemp.departmentName = this.createTemp.departmentName
- this.createTemp.employeeId = this.createTemp.employeId
- // var rulesValue = /^\d+(\.\d{1,3})?$/
- this.requestParam.parammaps = this.createTemp
- if (this.tabName === 'first') {
- this.requestParam.parammaps.SHStatus = this.createTemp.SHStatus
- } else if (this.tabName === 'second') {
- this.requestParam.parammaps.SHStatus = 0
- }
- const picpath = parseInt(this.createTemp.picpath)
- if (isNaN(picpath) == false) {
- this.requestParam.parammaps.picpath = this.createTemp.picpath
- } else {
- this.requestParam.parammaps.picpath = this.createTemp.picId
- }
- PostDataByName(this.requestParam).then(response => {
- console.log(response)
- if (response.msg !== 'fail') {
- if (this.getdataListParm.parammaps.inputDatetime1 === null) {
- this.getdataListParm.parammaps.inputDatetime1 = ''
- }
- this.get_table_data()
- this.get_table_dataSH()
- this.dialogFormVisible = false
- this.$notify({ title: '成功', message: '保存成功-', type: 'success', duration: 2000 })
- // this.reload()
- } else {
- failproccess(response, this.$notify)
- }
- })
- }
- }
- })
- },
- brandSearch(queryString, cb) {
- console.log('品牌模糊查询输入值', queryString)
- this.requestBrand.parammaps['brandName'] = queryString
- GetDataByName(this.requestBrand).then(response => {
- console.log('品牌模糊查询搜索data', response.data.list)
- this.BrandList = response.data.list
- cb(this.BrandList)
- })
- },
- handleSelectBrand(item) {
- console.log('品牌模糊查询选中值', item)
- this.$set(this.createTemp, 'brandName', item.brandName)
- this.$set(this.createTemp, 'brandId', item.brandId)
- this.$forceUpdate()
- },
- employeSearch(queryString, cb) {
- console.log('责任人模糊查询输入值', queryString)
- this.requestEmploye.parammaps['empname'] = queryString
- GetDataByName(this.requestEmploye).then(response => {
- console.log('责任人模糊查询搜索data', response.data.list)
- this.employeList = response.data.list
- cb(this.employeList)
- })
- },
- handleSelectEmploye(item) {
- console.log('责任人模糊查询选中值', item)
- this.$set(this.createTemp, 'employeId', item.id)
- this.$set(this.createTemp, 'employeName', item.name)
- this.$forceUpdate()
- },
- form_see(row) {
- console.log(row)
- this.seeTemp = Object.assign({}, row) // copy obj
- this.activeName = 'first'
- this.dialogStatus = 'card'
- this.dialogFormVisible_See = true
- // 流程图
- var reason = '未通过原因:' + this.seeTemp.workflowNote
- if (this.seeTemp.SHStatus === 0) {
- this.activeList = [{ title: '提交信息', date: this.seeTemp.inputDatetime, name: this.seeTemp.inputUserName }, { title: '设备中心审核' }]
- this.active = 1
- } else if (this.seeTemp.SHStatus === 1) {
- this.activeList = [{ title: '提交信息', date: this.seeTemp.inputDatetime, name: this.seeTemp.inputUserName }, { title: '设备中心审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }]
- this.active = 2
- } else if (this.seeTemp.SHStatus === 2) {
- this.activeList = [{ title: '提交信息', date: this.seeTemp.inputDatetime, name: this.seeTemp.inputUserName }, { title: '设备中心审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson, status: 'error', reason: reason }]
- this.active = 2
- }
- // 查看-点检记录
- },
- form_seeTabClick(val) {
- console.log(val)
- if (val.name == 'second') {
- this.getAssetBigSpotCheckList()
- } else if (val.name == 'third') {
- this.getBigupkeepbyeqList()
- } else if (val.name == 'fouth') {
- this.getAssetMaintainList()
- } else if (val.name == 'fifth') {
- this.getAssetSTTList()
- } else if (val.name == 'sixth') {
- this.getAssetChangeList()
- } else if (val.name == 'seventh') {
- this.getAssetPartApplyList()
- } else if (val.name == 'eighth') {
- this.getBarChart1Parm.parammaps.eqId = this.seeTemp.id
- this.getBarChart2Parm.parammaps.eqId = this.seeTemp.id
- this.getChartSeeParm.parammaps.eqId = this.seeTemp.id
- this.getBarChart1()
- this.getBarChart2()
- }
- },
- // 点检记录
- getAssetBigSpotCheckList() {
- this.listLoadingSpotCheck1 = true
- if (this.$refs['inputDatetimeCheck1'] !== undefined && this.$refs['inputDatetimeCheck1'].value !== null) {
- this.getAssetBigSpotCheckListParm.parammaps.startTime = this.$refs['inputDatetimeCheck1'].value[0]
- this.getAssetBigSpotCheckListParm.parammaps.stopTime = this.$refs['inputDatetimeCheck1'].value[1]
- } else {
- this.getAssetBigSpotCheckListParm.parammaps.startTime = ''
- this.getAssetBigSpotCheckListParm.parammaps.stopTime = ''
- }
- this.getAssetBigSpotCheckListParm.parammaps.assetId = this.seeTemp.assetId
- this.getAssetBigSpotCheckListParm.parammaps.pastureId = this.seeTemp.pastureId
- GetDataByName(this.getAssetBigSpotCheckListParm).then(response => {
- console.log('点检记录-table数据', response.data.list)
- if (response.data.list !== null) {
- this.listSpotCheck1 = response.data.list
- this.pageNumSpotCheck1 = response.data.pageNum
- this.pageSizeSpotCheck1 = response.data.pageSize
- } else {
- this.listSpotCheck1 = []
- }
- this.totalSpotCheck1 = response.data.total
- setTimeout(() => {
- this.listLoadingSpotCheck1 = false
- }, 100)
- })
- },
- form_searchSportCheck() {
- if (this.getAssetBigSpotCheckListParm.parammaps.inputDatetimeCheck1 == null) {
- this.getAssetBigSpotCheckListParm.parammaps.inputDatetimeCheck1 = ''
- }
- this.getAssetBigSpotCheckListParm.offset = 1
- this.getAssetBigSpotCheckList()
- },
- // 保养记录
- getBigupkeepbyeqList() {
- this.listLoadingSpotCheck1 = true
- if (this.$refs['inputDatetimeUpkeepbyeq'] !== undefined && this.$refs['inputDatetimeUpkeepbyeq'].value !== null) {
- this.getBigupkeepbyeqParm.parammaps.startTime = this.$refs['inputDatetimeUpkeepbyeq'].value[0]
- this.getBigupkeepbyeqParm.parammaps.stopTime = this.$refs['inputDatetimeUpkeepbyeq'].value[1]
- } else {
- this.getBigupkeepbyeqParm.parammaps.startTime = ''
- this.getBigupkeepbyeqParm.parammaps.stopTime = ''
- }
- this.getBigupkeepbyeqParm.parammaps.assetId = this.seeTemp.assetId
- this.getBigupkeepbyeqParm.parammaps.pastureId = this.seeTemp.pastureId
- GetDataByName(this.getBigupkeepbyeqParm).then(response => {
- console.log('保养记录-table数据', response.data.list)
- if (response.data.list !== null) {
- this.listUpkeepbyeq = response.data.list
- this.pageNumUpkeepbyeq = response.data.pageNum
- this.pageSizeUpkeepbyeq = response.data.pageSize
- } else {
- this.listUpkeepbyeq = []
- }
- this.totalUpkeepbyeq = response.data.total
- setTimeout(() => {
- this.listLoadingSpotCheck1 = false
- }, 100)
- })
- },
- form_searchUpkeepbyeq() {
- if (this.getBigupkeepbyeqParm.parammaps.inputDatetimeUpkeepbyeq === null) {
- this.getBigupkeepbyeqParm.parammaps.inputDatetimeUpkeepbyeq = ''
- }
- this.getBigupkeepbyeqParm.offset = 1
- this.getBigupkeepbyeqList()
- },
- // 维修记录
- getAssetMaintainList() {
- this.listLoadingAssetMaintain = true
- if (this.$refs['inputDatetimeAssetMaintain'] !== undefined && this.$refs['inputDatetimeAssetMaintain'].value !== null) {
- this.getAssetMaintainParm.parammaps.startTime = this.$refs['inputDatetimeAssetMaintain'].value[0]
- this.getAssetMaintainParm.parammaps.stopTime = this.$refs['inputDatetimeAssetMaintain'].value[1]
- } else {
- this.getAssetMaintainParm.parammaps.startTime = ''
- this.getAssetMaintainParm.parammaps.stopTime = ''
- }
- this.getAssetMaintainParm.parammaps.assetId = this.seeTemp.assetId
- this.getAssetMaintainParm.parammaps.pastureId = this.seeTemp.pastureId
- GetDataByName(this.getAssetMaintainParm).then(response => {
- console.log('维修记录-tabile数据', response.data.list)
- if (response.data.list !== null) {
- this.listAssetMaintain = response.data.list
- this.pageNumAssetMaintain = response.data.pageNum
- this.pageSizeAssetMaintain = response.data.pageSize
- } else {
- this.listAssetMaintain = []
- }
- this.totalAssetMaintain = response.data.total
- setTimeout(() => {
- this.listLoadingAssetMaintain = false
- }, 100)
- })
- },
- form_searchAssetMaintain() {
- if (this.getBigupkeepbyeqParm.parammaps.inputDatetimeAssetMaintan === null) {
- this.getBigupkeepbyeqParm.parammaps.inputDatetimeAssetMaintan = ''
- }
- this.getBigupkeepbyeqParm.offset = 1
- this.getAssetMaintainList()
- },
- // 启停记录
- getAssetSTTList() {
- this.listLoadingAssetSTT = true
- this.getAssetSTTParm.parammaps.assetId = this.seeTemp.assetId
- this.getAssetSTTParm.parammaps.pastureId = this.seeTemp.pastureId
- GetDataByName(this.getAssetSTTParm).then(response => {
- console.log('启停记录-tabile数据', response.data.list)
- if (response.data.list !== null) {
- this.listAssetSTT = response.data.list
- this.pageNumAssetSTT = response.data.pageNum
- this.pageSizeAssetSTT = response.data.pageSize
- } else {
- this.listAssetSTT = []
- }
- this.totalAssetSTT = response.data.total
- setTimeout(() => {
- this.listLoadingAssetSTT = false
- }, 100)
- })
- },
- form_searchAssetSTT() {
- if (this.getAssetSTTParm.parammaps.startTime == null) {
- this.getAssetSTTParm.parammaps.startTime = ''
- }
- if (this.getAssetSTTParm.parammaps.stopTime == null) {
- this.getAssetSTTParm.parammaps.stopTime = ''
- }
- this.getAssetSTTParm.offset = 1
- this.getAssetSTTList()
- },
- // 变更记录
- getAssetChangeList() {
- this.listLoadingAssetChange = true
- console.log(this.$refs['inputDatetimeAssetChange'])
- if (this.$refs['inputDatetimeAssetChange'] !== undefined && this.$refs['inputDatetimeAssetChange'].value !== null) {
- this.getAssetChangeParm.parammaps.startTime = this.$refs['inputDatetimeAssetChange'].value[0]
- this.getAssetChangeParm.parammaps.stopTime = this.$refs['inputDatetimeAssetChange'].value[1]
- } else {
- this.getAssetChangeParm.parammaps.startTime = ''
- this.getAssetChangeParm.parammaps.stopTime = ''
- }
- this.getAssetChangeParm.parammaps.assetId = this.seeTemp.assetId
- this.getAssetChangeParm.parammaps.pastureId = this.seeTemp.pastureId
- GetDataByName(this.getAssetChangeParm).then(response => {
- console.log('变更记录-tabile数据', response.data.list)
- if (response.data.list !== null) {
- this.listAssetChange = response.data.list
- this.pageNumAssetChange = response.data.pageNum
- this.pageSizeAssetChange = response.data.pageSize
- } else {
- this.listAssetChange = []
- }
- this.totalAssetChange = response.data.total
- setTimeout(() => {
- this.listLoadingAssetChange = false
- }, 100)
- })
- },
- form_searchAssetChange() {
- if (this.getAssetChangeParm.parammaps.inputDatetimeAssetChange === null) {
- this.getAssetChangeParm.parammaps.inputDatetimeAssetChange = ''
- }
- this.getAssetChangeParm.offset = 1
- this.getAssetChangeList()
- },
- changeStatue: function(cellValue) {
- if (cellValue.changeStatue == 17) {
- return '正常'
- } else if (cellValue.changeStatue == 18) {
- return '闲置'
- } else if (cellValue.changeStatue == 19) {
- return '报废'
- } else if (cellValue.changeStatue == 20) {
- return '封存'
- }
- },
- // 备件领用记录
- getAssetPartApplyList() {
- this.listLoadingAssetChange = true
- console.log(this.$refs['inputDatetimeAssetPartApply'].value)
- if (this.$refs['inputDatetimeAssetPartApply'] !== undefined && this.$refs['inputDatetimeAssetPartApply'].value !== null && this.$refs['inputDatetimeAssetPartApply'].value !== '') {
- this.getAssetPartApplyParm.parammaps.startTime = this.$refs['inputDatetimeAssetPartApply'].value[0]
- this.getAssetPartApplyParm.parammaps.stopTime = this.$refs['inputDatetimeAssetPartApply'].value[1]
- } else {
- this.getAssetPartApplyParm.parammaps.startTime = ''
- this.getAssetPartApplyParm.parammaps.stopTime = ''
- }
- this.getAssetPartApplyParm.parammaps.assetId = this.seeTemp.assetId
- this.getAssetPartApplyParm.parammaps.pastureId = this.seeTemp.pastureId
- GetDataByName(this.getAssetPartApplyParm).then(response => {
- console.log('备件领用记录-tabile数据', response.data.list)
- if (response.data.list !== null) {
- this.listAssetPartApply = response.data.list
- this.pageNumAssetPartApply = response.data.pageNum
- this.pageSizeAssetPartApply = response.data.pageSize
- } else {
- this.listAssetPartApply = []
- }
- this.totalAssetPartApply = response.data.total
- setTimeout(() => {
- this.listLoadingAssetPartApply = false
- }, 100)
- })
- },
- form_searchAssetPartApply() {
- this.listLoadingAssetChange = true
- if (this.getAssetPartApplyParm.parammaps.inputDatetimeAssetChange == null) {
- this.getAssetPartApplyParm.parammaps.inputDatetimeAssetChange = ''
- }
- this.getAssetPartApplyParm.offset = 1
- this.getAssetPartApplyList()
- },
- getBarChart1() {
- GetReportform(this.getBarChart1Parm).then(response => {
- console.log('图1', response)
- this.chart_data1 = response.data.chart_data
- var repireCost = response.data.chart_data.repireCost
- var upkeepCost = response.data.chart_data.upkeepCost
- var totaltitle1 = 0
- if (repireCost !== null || repireCost !== undefined) {
- repireCost.forEach(function(item, index) {
- console.log(parseFloat(item))
- totaltitle1 = totaltitle1 + parseFloat(item)
- })
- }
- var totaltitle2 = 0
- if (upkeepCost !== null || upkeepCost !== undefined) {
- upkeepCost.forEach(function(item, index) {
- console.log(parseFloat(item))
- totaltitle2 = totaltitle2 + parseFloat(item)
- })
- }
- this.totaltitle = totaltitle1 + totaltitle2
- this.roadBarChart1(this.chart_data1, this.totaltitle.toFixed(2))
- })
- },
- roadBarChart1(chart_data1, totaltitle) {
- console.log(chart_data1, totaltitle)
- if (this.barChart1 != null) {
- this.barChart1.dispose()
- }
- this.barChart1 = echarts.init(document.getElementById('barChart1'))
- var option = {
- title: { text: '年度费用统计(总费用:' + totaltitle + '元)', textStyle: { color: '#769cfc' }},
- tooltip: {
- trigger: 'axis',
- axisPointer: { // 坐标轴指示器,坐标轴触发有效
- type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
- },
- formatter: function(data) {
- console.log(data.length)
- var value = 0
- let val = ''
- if (data.length == 1) {
- val += data[0].seriesName + ':' + data[0].data + '元<br/>'
- } else {
- value = (parseFloat(data[0].value) + parseFloat(data[1].value)).toFixed(2)
- // eslint-disable-next-line no-unused-vars
- val = data[0].name + '年设备总费用:' + value + '元' + '<br/>'
- val += '维修费用:' + data[0].data + '元<br/>'
- val += '保养费用:' + data[1].data + '元<br/>'
- }
- return val
- }
- },
- legend: {
- data: ['维修费用', '保养费用'],
- x: 'right'
- },
- color: ['#769cfc', '#42b983'],
- grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
- xAxis: [
- { type: 'category', data: this.chart_data1.year }
- ],
- yAxis: [
- { type: 'value', name: '费用(元)' }
- ],
- series: [
- { name: '维修费用', type: 'bar', barWidth: 60, stack: '广告', data: this.chart_data1.repireCost },
- { name: '保养费用', type: 'bar', barWidth: 60, stack: '广告', data: this.chart_data1.upkeepCost }
- ]
- }
- this.barChart1.setOption(option)
- var that = this
- window.onresize = function() {
- that.barChart1.resize()
- }
- this.barChart1.on('click', function(param, i) {
- console.log(param)
- that.getBarChart2Parm.parammaps.receiveTime = param.name
- that.getBarChart2()
- that.getBarChart1()
- })
- },
- getBarChart2() {
- GetReportform(this.getBarChart2Parm).then(response => {
- console.log('图2', response)
- this.chart_data2 = response.data.chart_data
- this.roadBarChart2(this.chart_data2)
- })
- },
- roadBarChart2(chart_data1) {
- if (this.barChart2 != null) {
- this.barChart2.dispose()
- }
- this.barChart2 = echarts.init(document.getElementById('barChart2'))
- var option = {
- title: { text: this.getBarChart2Parm.parammaps.receiveTime + '年月度费用统计', textStyle: { color: '#769cfc' }},
- tooltip: {
- trigger: 'axis',
- axisPointer: { // 坐标轴指示器,坐标轴触发有效
- type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
- },
- formatter: function(data) {
- console.log(data)
- var value = 0
- var val = ''
- if (data.length == 1) {
- val += data[0].seriesName + ':' + data[0].data + '元<br/>'
- } else {
- value = (parseFloat(data[0].value) + parseFloat(data[1].value)).toFixed(2)
- val = data[0].name + '月设备总费用:' + value + '元' + '<br/>'
- val += '维修费用:' + data[0].data + '元<br/>'
- val += '保养费用:' + data[1].data + '元<br/>'
- }
- return val
- }
- },
- legend: {
- data: ['维修费用', '保养费用'],
- x: 'right'
- },
- color: ['#769cfc', '#42b983'],
- grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
- containLabel: true
- },
- xAxis: [
- { type: 'category', data: this.chart_data2.months }
- ],
- yAxis: [
- { type: 'value', name: '费用(元)' }
- ],
- series: [
- { name: '维修费用', type: 'bar', stack: '广告', data: this.chart_data2.repireCost },
- { name: '保养费用', type: 'bar', stack: '广告', data: this.chart_data2.upkeepCost }
- ]
- }
- this.barChart2.setOption(option)
- var that = this
- window.onresize = function() {
- that.barChart2.resize()
- }
- this.barChart2.on('click', function(param, i) {
- console.log(param)
- that.dialogFormVisible_ChartSee = true
- that.dialogStatus = 'card'
- that.getChartSeeParm.parammaps.receiveTime = param.name
- that.getChartSeeList()
- that.getBarChart1()
- that.getBarChart2()
- })
- },
- getChartSeeList() {
- this.listLoadingChartSee = true
- if (this.$refs['inputDatetime2'] !== undefined && this.$refs['inputDatetime2'].value !== null) {
- this.getChartSeeParm.parammaps.startTime = this.$refs['inputDatetime2'].value[0]
- this.getChartSeeParm.parammaps.stopTime = this.$refs['inputDatetime2'].value[1]
- } else {
- this.getChartSeeParm.parammaps.startTime = ''
- this.getChartSeeParm.parammaps.stopTime = ''
- }
- GetDataByName(this.getChartSeeParm).then(response => {
- console.log('table数据', response.data.list)
- if (response.data.list !== null) {
- this.listChartSee = response.data.list
- this.pageNumChartSee = response.data.pageNum
- this.pageSizeChartSee = response.data.pageSize
- if (response.data.total) {
- this.totalChartSee = response.data.total
- }
- } else {
- this.listChartSee = []
- }
- setTimeout(() => {
- this.listLoadingChartSee = false
- }, 100)
- })
- },
- form_searchChartSee() {
- this.listLoadingChartSee = true
- if (this.getChartSeeParm.parammaps.inputDatetime2 === null) {
- this.getChartSeeParm.parammaps.inputDatetime2 = ''
- }
- this.getChartSeeParm.offset = 1
- this.getChartSeeList()
- },
-
- form_delete(row) {
- MessageBox.confirm('确认删除此信息?', {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.requestParam.name = 'deleteAsset'
- this.requestParam.parammaps = {}
- this.requestParam.parammaps['id'] = row.id
- PostDataByName(this.requestParam).then(() => {
- if (this.getdataListParm.parammaps.inputDatetime1 === null) {
- this.getdataListParm.parammaps.inputDatetime1 = ''
- }
- this.get_table_data()
-
- this.dialogFormVisible = false
- this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
- })
- }).catch(() => {
- this.$message({ type: 'info', message: '已取消删除' })
- })
- },
- getDownClassList() {
- getRecuData(this.getRecuListParm).then(response => {
- this.parentClass = response.data
- })
- },
- getEQNumber() {
- this.getdataEQNumber.parammaps.pastureId = Cookies.get('pastureid')
- GetDataByName(this.getdataEQNumber).then(response => {
-
- this.createTemp.assetCode = response.data.list[0].createNumber
- console.log(response.data.list[0].createNumber)
- console.log(this.createTemp.assetCode)
- this.$forceUpdate()
-
- })
- },
-
-
- changeSHStatue(val) {
- if (val == 2) {
- this.statueReason = true
- } else {
- this.statueReason = false
- }
- },
-
-
-
-
- changeBatchDept(item) {
- console.log(item)
- this.batchChange.getdataListParmPerson.parammaps.deptId = item
- this.batchChange.temp.employeeId = ''
- this.batchChange.getdataListParmPerson.parammaps.pastureId = this.batchChange.deptList.find(obj => obj.deptid == item).pastureId
- this.getBatchChangePersonDownList()
- },
- getBatchChangePersonDownList() {
- GetDataByName(this.batchChange.getdataListParmPerson).then(response => {
- if (response.data.list !== null) {
- this.batchChange.personList = response.data.list
- } else {
- this.batchChange.personList = []
- }
- })
- },
- changeBatchPerson(item) {
- console.log(item)
- this.batchChange.temp.employeeId = item
- this.batchChange.temp.employeName = this.batchChange.personList.find(obj => obj.id == item).empname
- this.$forceUpdate()
- },
- changeData() {
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- this.$refs['batchChangeTemp'].validate(valid => {
- if (valid) {
- this.requestParam = {}
- var array = []
- for (let i = 0; i < this.selectionList.length; i++) {
- var obj = {}
- var parammaps = {}
- obj.name = 'updateEquipmentALL'
- obj.offset = 0
- obj.pagecount = 0
- parammaps.departmentId = this.batchChange.temp.departmentId
- parammaps.employeeId = this.batchChange.temp.employeeId
- parammaps.employeName = this.batchChange.temp.employeName
- parammaps.id = this.selectionList[i].id
- obj.parammaps = parammaps
- array.push(obj)
- }
- this.requestParam.array = array
- PostDataByNames(this.requestParam).then(response => {
- if (response.msg !== 'fail') {
- this.dialogFormVisible_change = false
- this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
- this.get_table_data()
- } else {
- failproccess(response, this.$notify)
- }
- })
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .el-autocomplete-suggestion li{
- padding:0 3px!important;
- }
- .el-table .warning-row {
- background: oldlace;
- }
- .el-table .success-row {
- background: #f0f9eb;
- }
- </style>
- <style lang="scss">
- .upkeepgrade .el-form-item__label{
- line-height: 20px;
- }
- .inputDatetime .el-range-separator{
- padding: 0;
- margin: 0 10px;
- }
- .el-radio__label{
- padding-left: 2px !important;
- }
- </style>
- <style>
- .el-table .goBeyond { background: #F47C7C ; }
- .el-table .warning { background: #989DF0; }
- .el-table .scrap { background: #D7D7D7; }
- </style>
|