|
@@ -0,0 +1,551 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <formComponent
|
|
|
+ :formOption="formOption"
|
|
|
+ :dataList="dataList"
|
|
|
+ :inDex="inDex"
|
|
|
+ ref="avatar"
|
|
|
+ @submitForm="submitForm"
|
|
|
+ @returnToForm="returnToForm"
|
|
|
+ />
|
|
|
+ <listComponent
|
|
|
+ :tableData="tableData"
|
|
|
+ @modify="modification"
|
|
|
+ @deletion="deletion"
|
|
|
+ @buttonList="buttonList"
|
|
|
+ @showSearch="showSearch"
|
|
|
+ @feedback="feedback"
|
|
|
+ @getList="getList"
|
|
|
+ @handleAvatarSuccess="handleAvatarSuccess"
|
|
|
+ @see="viewMethod"
|
|
|
+ :hasPermi="hasPermi"
|
|
|
+ :isItHidden="isItHidden"
|
|
|
+ :customButton="customButton"
|
|
|
+ :listStyle="listStyle"
|
|
|
+ :queryList="queryList"
|
|
|
+ :setRowList="setRowList"
|
|
|
+ :tatolLabel="tatolLabel"
|
|
|
+ />
|
|
|
+ <div style="float: right;margin-bottom: 10px">
|
|
|
+ <pagination
|
|
|
+ v-show="total > 0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="formDataList.pageNum"
|
|
|
+ :limit.sync="formDataList.pageSize"
|
|
|
+ :page-sizes="[10,100,200,500,1000]"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <el-dialog
|
|
|
+ title="资产明细"
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
+ width="80%"
|
|
|
+ :before-close="handleClose">
|
|
|
+ <el-form :model="numberValidateForm" ref="numberValidateForm" label-width="100px" class="demo-ruleForm">
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item
|
|
|
+ prop="email"
|
|
|
+ label-width="100px"
|
|
|
+ label="资产存放部门">
|
|
|
+ <el-input style="width: 170px;" v-model="numberValidateForm.fDept"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item
|
|
|
+ prop="email"
|
|
|
+ label-width="80px"
|
|
|
+ label="资产名称">
|
|
|
+ <el-input style="width: 200px;" v-model="numberValidateForm.fName"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item
|
|
|
+ prop="email"
|
|
|
+ label-width="80px"
|
|
|
+ label="规格型号">
|
|
|
+ <el-input style="width: 200px;" v-model="numberValidateForm.fSpec"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item
|
|
|
+ prop="email"
|
|
|
+ label-width="100px"
|
|
|
+ label="单位台/套/张">
|
|
|
+ <el-input style="width: 170px;" v-model="numberValidateForm.fUnit"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item
|
|
|
+ prop="email"
|
|
|
+ label-width="80px"
|
|
|
+ label="数量">
|
|
|
+ <el-input style="width: 200px;" v-model="numberValidateForm.fNumber"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item
|
|
|
+ prop="email"
|
|
|
+ label-width="80px"
|
|
|
+ label="金额">
|
|
|
+ <el-input style="width: 200px;" v-model="numberValidateForm.fAmount"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-col :span="16">
|
|
|
+ <el-form-item
|
|
|
+ prop="email"
|
|
|
+ label-width="100px"
|
|
|
+ label="备注">
|
|
|
+ <el-input style="width: 470px;" v-model="numberValidateForm.remark"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item
|
|
|
+ prop="email"
|
|
|
+ label-width="80px"
|
|
|
+ label="资产编码">
|
|
|
+ <el-input style="width: 200px;" v-model="numberValidateForm.fCode"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-form-item
|
|
|
+ prop="email"
|
|
|
+ label="图片">
|
|
|
+ <el-upload
|
|
|
+ :action="action"
|
|
|
+ :headers="headers"
|
|
|
+ list-type="picture-card"
|
|
|
+ :on-success="onSuccess"
|
|
|
+ :file-list="fileList"
|
|
|
+ :on-preview="handlePictureCardPreview"
|
|
|
+ :on-remove="handleRemove">
|
|
|
+ <i class="el-icon-plus"></i>
|
|
|
+ </el-upload>
|
|
|
+ <el-dialog :visible.sync="dialogVisibleTwo" append-to-body>
|
|
|
+ <img width="100%" :src="dialogImageUrl" alt="">
|
|
|
+ </el-dialog>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitQForm('numberValidateForm')">修 改</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { deletionee, listExport, modifyData, productName, queryData, queryDetails } from '@/api/assetsManagement'
|
|
|
+import { company } from '@/api/purchaseRequest'
|
|
|
+import Cookies from 'js-cookie'
|
|
|
+import { select } from '@/api/system/set'
|
|
|
+import moment from 'moment'
|
|
|
+import { getName } from '@/api/purchaseIssue'
|
|
|
+import { getToken } from '@/utils/auth'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'index',
|
|
|
+ data(){
|
|
|
+ return{
|
|
|
+ tableData:[],
|
|
|
+ action:process.env.VUE_APP_BASE_API + "/common/upload",
|
|
|
+ headers: {
|
|
|
+ Authorization: "Bearer " + getToken()
|
|
|
+ },
|
|
|
+ dialogImageUrl:'',
|
|
|
+ dialogVisible:false,
|
|
|
+ dialogVisibleTwo:false,
|
|
|
+ numberValidateForm:{
|
|
|
+ fImage:[]
|
|
|
+ },
|
|
|
+ fileList:[],
|
|
|
+ total:0,
|
|
|
+ hasPermi: {
|
|
|
+ lookup: ["anpin:stockControl:query"],
|
|
|
+ disappear: ["anpin:stockControl:remove"],
|
|
|
+ },
|
|
|
+ isItHidden: true,
|
|
|
+ formDataList:{
|
|
|
+ pageSize:10,
|
|
|
+ pageNum:1,
|
|
|
+ },
|
|
|
+ listStyle: [{
|
|
|
+ surface: '1',
|
|
|
+ label: 'serialNumber',
|
|
|
+ name: '序号',
|
|
|
+ checked: 0,
|
|
|
+ width: 130,
|
|
|
+ onabort: ''
|
|
|
+ },{
|
|
|
+ surface: '2',
|
|
|
+ label: 'fDept',
|
|
|
+ name: '资产存放部门',
|
|
|
+ checked: 0,
|
|
|
+ width: 130,
|
|
|
+ onabort: ''
|
|
|
+ },{
|
|
|
+ surface: '3',
|
|
|
+ label: 'fName',
|
|
|
+ name: '资产名称',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '4',
|
|
|
+ label: 'fSpec',
|
|
|
+ name: '规格型号',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },{
|
|
|
+ surface: '5',
|
|
|
+ label: 'fUnit',
|
|
|
+ name: '单位台/套/张',
|
|
|
+ checked: 0,
|
|
|
+ width: 120,
|
|
|
+ onabort: ''
|
|
|
+ },{
|
|
|
+ surface: '6',
|
|
|
+ label: 'fNumber',
|
|
|
+ name: '数量',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },{
|
|
|
+ surface: '7',
|
|
|
+ label: 'fAmount',
|
|
|
+ name: '金额',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // surface: '8',
|
|
|
+ // label: 'fImage',
|
|
|
+ // name: '图片',
|
|
|
+ // checked: 0,
|
|
|
+ // width: 100,
|
|
|
+ // onabort: ''
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ surface: '9',
|
|
|
+ label: 'remark',
|
|
|
+ name: '备注',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },{
|
|
|
+ surface: '10',
|
|
|
+ label: 'fCode',
|
|
|
+ name: '资产编码',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },{
|
|
|
+ surface: "11",
|
|
|
+ label: "operation",
|
|
|
+ name: "操作",
|
|
|
+ checked: 0,
|
|
|
+ width: 160,
|
|
|
+ fixed: "right",
|
|
|
+ operation: "1",
|
|
|
+ onabort: "",
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ setRowList:[],
|
|
|
+ tatolLabel:['数量','金额'],
|
|
|
+ queryList: {
|
|
|
+ tableName: '资产管理',
|
|
|
+ columnList: []
|
|
|
+ },
|
|
|
+ customButton: [
|
|
|
+ {
|
|
|
+ type: 'primary',
|
|
|
+ upload:true,
|
|
|
+ action:process.env.VUE_APP_BASE_API + '/anpin/assets/import',
|
|
|
+ size: 'mini',
|
|
|
+ icon: 'el-icon-edit',
|
|
|
+ name: '导入',
|
|
|
+ disabled: false,
|
|
|
+ hasPermi:['warehouse:assets:add']
|
|
|
+ },{
|
|
|
+ type: 'primary',
|
|
|
+ size: 'mini',
|
|
|
+ icon: 'el-icon-edit',
|
|
|
+ name: '下载模板',
|
|
|
+ disabled: false,
|
|
|
+ }],
|
|
|
+ inDex: 4,
|
|
|
+ dataList:{
|
|
|
+ },
|
|
|
+ formOption:[
|
|
|
+ {
|
|
|
+ span: 6,
|
|
|
+ label: 'fDept',
|
|
|
+ name: '资产存放部门',
|
|
|
+ inputType: 2,
|
|
|
+ width: 200,
|
|
|
+ labelSize: '100',
|
|
|
+ rules: [{ required: false, message: ' ' }]
|
|
|
+ },{
|
|
|
+ span: 6,
|
|
|
+ label: 'fName',
|
|
|
+ name: '资产名称',
|
|
|
+ inputType: 2,
|
|
|
+ width: 200,
|
|
|
+ labelSize: '80',
|
|
|
+ multiple:true,
|
|
|
+ rules: [{ required: false, message: ' ' }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ span: 6,
|
|
|
+ label: 'fCode',
|
|
|
+ name: '资产编码',
|
|
|
+ inputType: 2,
|
|
|
+ width: 200,
|
|
|
+ labelSize: '80',
|
|
|
+ rules: [{ required: false, message: ' ' }]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.queryList.columnList = this.listStyle
|
|
|
+ this.setRowList = this.listStyle
|
|
|
+ // company(1).then(res => {
|
|
|
+ // for (let item in res.data) {
|
|
|
+ // this.dataList.fDept.push({
|
|
|
+ // label: res.data[item].fName,
|
|
|
+ // value: res.data[item].fId
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // this.getDicts("data_cost_attribute").then((response) => {
|
|
|
+ // for(let item in response.data){
|
|
|
+ // this.dataList.fFeeTypeList.push({
|
|
|
+ // value: response.data[item].dictValue,
|
|
|
+ // label:response.data[item].dictLabel
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // productName().then(res => {
|
|
|
+ // console.log(res)
|
|
|
+ // if (res.code === 200) {
|
|
|
+ // for (let item in res.rows) {
|
|
|
+ // this.dataList.fFeeid.push({
|
|
|
+ // label: res.rows[item].fName,
|
|
|
+ // value: res.rows[item].fId,
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ this.getList()
|
|
|
+ let data = {
|
|
|
+ tableName: this.queryList.tableName,
|
|
|
+ userId: Cookies.get('userName')
|
|
|
+ }
|
|
|
+ // company(2).then(res => {
|
|
|
+ // console.log(res)
|
|
|
+ // this.dataList.fSbu = []
|
|
|
+ // for (let item in res.data) {
|
|
|
+ // this.dataList.fSbu.push({
|
|
|
+ // label: res.data[item].fName,
|
|
|
+ // value: res.data[item].fId
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ this.getRow(data,'S')
|
|
|
+
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ handleRemove(file, fileList) {
|
|
|
+ this.numberValidateForm.fImage = []
|
|
|
+ for (let item in fileList){
|
|
|
+ this.numberValidateForm.fImage.push({
|
|
|
+ name:fileList[item].name,
|
|
|
+ url:fileList[item].url
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handlePictureCardPreview(file) {
|
|
|
+ this.dialogImageUrl = file.url;
|
|
|
+ this.dialogVisibleTwo = true;
|
|
|
+ },
|
|
|
+ onSuccess(response, file, fileList){
|
|
|
+ console.log(fileList)
|
|
|
+ this.numberValidateForm.fImage = []
|
|
|
+ for (let item in fileList){
|
|
|
+ if(fileList[item].response){
|
|
|
+ this.numberValidateForm.fImage.push({
|
|
|
+ name:fileList[item].response.fileName,
|
|
|
+ url:fileList[item].response.url
|
|
|
+ })
|
|
|
+ }else {
|
|
|
+ this.numberValidateForm.fImage.push({
|
|
|
+ name:fileList[item].name,
|
|
|
+ url:fileList[item].url
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //修改确认触发
|
|
|
+ submitQForm(formName){
|
|
|
+ // this.numberValidateForm.fImage = JSON.stringify(this.numberValidateForm.fImage)
|
|
|
+ let data = this.numberValidateForm
|
|
|
+ data.fImage = JSON.stringify(data.fImage)
|
|
|
+ modifyData(data).then(res=>{
|
|
|
+ this.dialogVisible = false
|
|
|
+ this.$message.success('修改成功');
|
|
|
+ })
|
|
|
+ // this.$refs[formName].validate((valid) => {
|
|
|
+ // if (valid) {
|
|
|
+ // alert('submit!');
|
|
|
+ // } else {
|
|
|
+ // console.log('error submit!!');
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ },
|
|
|
+ //弹窗X关闭时触发
|
|
|
+ handleClose(done) {
|
|
|
+ this.$confirm('确认关闭?')
|
|
|
+ .then(_ => {
|
|
|
+ done();
|
|
|
+ })
|
|
|
+ .catch(_ => {});
|
|
|
+ },
|
|
|
+ //列查询
|
|
|
+ getRow(data,list) {
|
|
|
+ select(data).then((res) => {
|
|
|
+ if (res.data.length != 0) {
|
|
|
+ this.queryList.columnList = res.data.filter((e) => e.checked == 0)
|
|
|
+ this.queryList.columnList = res.data
|
|
|
+ this.setRowList = res.data
|
|
|
+ this.queryList.columnList = this.queryList.columnList.filter((e) => e.checked == 0)
|
|
|
+ // this.waitFor = true
|
|
|
+ } else {
|
|
|
+ this.$set(this.queryList, 'columnList', this.$options.data().listStyle)
|
|
|
+ this.setRowList = this.$options.data().listStyle
|
|
|
+ }
|
|
|
+ this.isItHidden = true
|
|
|
+ // this.inDex = this.formOption.length
|
|
|
+ this.inDex = 4
|
|
|
+ if (list == 'S'){
|
|
|
+ this.$set(this.$refs.avatar.form,'groupDate',1)
|
|
|
+ }
|
|
|
+ this.$refs.avatar.form = this.formDataList
|
|
|
+ this.$set(this.$refs.avatar.form,'groupDate',0)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ submitForm(res) {
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ returnToForm(row) {
|
|
|
+ console.log(row, 111)
|
|
|
+ },
|
|
|
+ //修改
|
|
|
+ modification(scope) {
|
|
|
+ console.log(scope)
|
|
|
+ },
|
|
|
+ //删除
|
|
|
+ deletion(scope){
|
|
|
+ deletionee(scope.row.fId).then(res=>{
|
|
|
+ if(res.code == 200){
|
|
|
+ this.$message.success('删除成功');
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //查看
|
|
|
+ viewMethod(scope, res, i){
|
|
|
+ this.numberValidateForm = {}
|
|
|
+ this.fileList = []
|
|
|
+ queryDetails(scope.row.fId).then(res=>{
|
|
|
+ this.numberValidateForm = res.data
|
|
|
+ if (!this.numberValidateForm.fImage){
|
|
|
+ this.numberValidateForm.fImage = []
|
|
|
+ }else {
|
|
|
+ this.numberValidateForm.fImage = JSON.parse(this.numberValidateForm.fImage)
|
|
|
+ this.fileList = this.numberValidateForm.fImage
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ // numberValidateForm
|
|
|
+ this.dialogVisible = true
|
|
|
+ },
|
|
|
+ // 显示搜索条件、点击后会调用此方法
|
|
|
+ showSearch() {
|
|
|
+ // console.log('到我了')
|
|
|
+ this.searchWhether = !this.searchWhether
|
|
|
+ },
|
|
|
+ //点击刷新会调用此方法
|
|
|
+ getList() {
|
|
|
+ queryData(this.formDataList).then(res=>{
|
|
|
+ this.tableData = res.rows
|
|
|
+ this.total = res.total
|
|
|
+ })
|
|
|
+ console.log(this.formDataList.pageSize)
|
|
|
+ },
|
|
|
+ handleAvatarSuccess(){
|
|
|
+ this.formDataList = {
|
|
|
+ pageSize:10,
|
|
|
+ pageNum:1,
|
|
|
+ }
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ //搜索、重置、展开
|
|
|
+ feedback(res) {
|
|
|
+ console.log(res)
|
|
|
+ if (res == '展开') {
|
|
|
+ if (this.inDex == 4) {
|
|
|
+ this.inDex = this.formOption.length
|
|
|
+ } else {
|
|
|
+ this.inDex = 4
|
|
|
+ }
|
|
|
+ } else if (res == '搜索') {
|
|
|
+ this.formDataList = this.$refs.avatar.form
|
|
|
+ this.formDataList.pageNum = 1
|
|
|
+ this.formDataList.pageSize = 10
|
|
|
+ this.$refs.avatar.submitForm(1)
|
|
|
+ } else if (res == '重置') {
|
|
|
+ let list ={
|
|
|
+ pageNum:this.formDataList.pageNum,
|
|
|
+ pageSize:this.formDataList.pageSize
|
|
|
+ }
|
|
|
+ this.$refs.avatar.form = {}
|
|
|
+ this.$refs.avatar.form = this.formDataList = list
|
|
|
+ console.log(this.formDataList,this.$refs.avatar.form)
|
|
|
+ this.$refs.avatar.submitForm(2)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //所有按钮
|
|
|
+ buttonList(row){
|
|
|
+ console.log(row)
|
|
|
+ switch (row.name){
|
|
|
+ case '下载模板':
|
|
|
+ const queryParams = this.formDataList;
|
|
|
+ this.$confirm("是否确认下载模板?", "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(function () {
|
|
|
+ return listExport(queryParams);
|
|
|
+ }).then((response) => {
|
|
|
+ this.download(response.msg);
|
|
|
+ });
|
|
|
+ break
|
|
|
+ case '导入':
|
|
|
+ break
|
|
|
+ }
|
|
|
+ },
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+</style>
|