4 changed files with 1231 additions and 0 deletions
-
7src/api/tool/com_tool_info_add_update.js
-
7src/api/tool/tool_info.js
-
396src/views/modules/tooling/components/com_tool_info_add_update.vue
-
821src/views/modules/tooling/manuf_tool.vue
@ -0,0 +1,7 @@ |
|||
import { createAPI } from '@/utils/httpRequest.js' |
|||
|
|||
// 获取
|
|||
export const insertToolInfo = data => createAPI('plm/tool/insertToolInfo', 'POST', data) |
|||
|
|||
// 获取
|
|||
export const modifyToolInfo = data => createAPI('plm/tool/modifyToolInfo', 'POST', data) |
|||
@ -0,0 +1,7 @@ |
|||
import { createAPI } from '@/utils/httpRequest.js' |
|||
|
|||
// 获取
|
|||
export const getToolInfoList = data => createAPI('plm/tool/getToolInfoList', 'POST', data) |
|||
|
|||
// 获取
|
|||
export const getToolInstanceList = data => createAPI('plm/tool/getToolInstanceList', 'POST', data) |
|||
@ -0,0 +1,396 @@ |
|||
<template> |
|||
<div class="customer-css"> |
|||
<el-dialog :title="titleCon" v-drag :visible.sync="visible" |
|||
width="600px" style="height: 650px;" class="customer-dialog"> |
|||
<el-container style="height: 265px;"> |
|||
<el-form :inline="true" label-position="top" label-width="80px"> |
|||
<!-- 第一行 --> |
|||
<el-row class="customer-row"> |
|||
<el-col :span="6"> |
|||
<el-form-item :label=labels.toolId> |
|||
<el-input v-model="pageData.toolId" ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item :label=labels.toolDesc> |
|||
<el-input v-model="pageData.toolDesc" ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item :label=labels.site> |
|||
<span slot="label" style="" @click="getBaseList(1017)"><a herf="#">域:</a></span> |
|||
<el-input v-model="pageData.site" ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item :label=labels.state> |
|||
<el-input ref="toolInstanceId" v-model="pageData.state" disabled></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<!-- 第二行 --> |
|||
<el-row class="customer-row"> |
|||
<el-col :span="6"> |
|||
<el-form-item :label=labels.toolType> |
|||
<span slot="label" style="" @click="getBaseList(1016)"><a herf="#">工具类型:</a></span> |
|||
<el-input v-model="pageData.toolType" ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item :label=labels.toolTypeDesc> |
|||
<el-input v-model="pageData.toolTypeDesc" ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item :label=labels.calendarId> |
|||
<span slot="label" style="" @click="getBaseList(1018)"><a herf="#">日历标识:</a></span> |
|||
<el-input v-model="pageData.calendarId" ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item :label=labels.schedCapacity> |
|||
<el-input v-model="pageData.schedCapacity" ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<!-- 第三行 --> |
|||
<el-row class="customer-row"> |
|||
<el-col :span="6"> |
|||
<el-form-item :label=labels.calibrationControl> |
|||
<el-input v-model="pageData.calibrationControl" ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item :label=labels.calibrationTime> |
|||
<el-input v-model="pageData.calibrationTime" ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item :label=labels.lastUsed> |
|||
<el-input v-model="pageData.lastUsed" disabled></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-checkbox style="margin-left: 10px; margin-top: 18px;" v-model="pageData.enabledForControlPlanDb" true-label="true" false-label="false" |
|||
:label=labels.enabledForControlPlanDb name="type"></el-checkbox> |
|||
</el-col> |
|||
</el-row> |
|||
<!-- 第四行 --> |
|||
<el-row class="customer-row"> |
|||
<el-col :span="6"> |
|||
<el-form-item :label=labels.alternateToolId> |
|||
<span slot="label" style="" @click="getBaseList(1019)"><a herf="#">备选工具标识号:</a></span> |
|||
<el-input v-model="pageData.alternateToolId"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item :label=labels.alternateToolDesc> |
|||
<el-input v-model="pageData.alternateToolDesc" ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<!-- 第五行 --> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<el-form-item :label=labels.noteText class="auto"> |
|||
<el-input type="textarea" v-model="pageData.noteText" :rows="2" style="width: 480px;height: 20px"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
</el-container> |
|||
<span slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click="addToolInstanceIdFun">{{ buttons.confirmButton }}</el-button> |
|||
<el-button type="primary" @click="closeDialog">{{buttons.closeButton}}</el-button> |
|||
</span> |
|||
</el-dialog> |
|||
<!-- 选择 --> |
|||
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
insertToolInfo, |
|||
modifyToolInfo, |
|||
} from '@/api/tool/com_tool_info_add_update.js'; |
|||
|
|||
/*组件*/ |
|||
import Chooselist from '@/views/modules/common/Chooselist'; /*选择组件*/ |
|||
|
|||
|
|||
var functionId = 'C106003001'; |
|||
export default { |
|||
components: { |
|||
Chooselist,/*选择组件*/ |
|||
}, |
|||
data() { |
|||
return { |
|||
titleCon: '工具新增', |
|||
showDefault: false, |
|||
visible: false, |
|||
readonlyFlag: true, |
|||
pageData: { |
|||
site: this.$store.state.user.site, |
|||
username: this.$store.state.user.name, |
|||
toolId: '', |
|||
toolDesc: '', |
|||
toolType: '', |
|||
toolTypeDesc: '', |
|||
calendarId: '', |
|||
schedCapacity: '', |
|||
alternateToolId: '', |
|||
alternateToolDesc: '', |
|||
calibrationControl: '', |
|||
calibrationTime: '', |
|||
enabledForControlPlanDb: '', |
|||
lastUsed: '', |
|||
noteText: '', |
|||
ifsRowId: 0, |
|||
ifsRowVersion: '', |
|||
addFlag: false |
|||
}, |
|||
dataListLoading: false, |
|||
labels: { |
|||
site: '域:', |
|||
toolId: '工具标识号:', |
|||
toolDesc: '工具描述:', |
|||
state: '有效性:', |
|||
toolType: '工具类型:', |
|||
toolTypeDesc: '工具类型描述:', |
|||
calendarId: '日历标识:', |
|||
schedCapacity: '计划能力:', |
|||
calibrationControl: '校对控制:', |
|||
calibrationTime: '校准间隔时间:', |
|||
lastUsed: '上次使用:', |
|||
enabledForControlPlanDb: '为控制计划启用', |
|||
noteText: '备注:', |
|||
alternateToolId: '备选工具标识号:', |
|||
alternateToolDesc: '备选工具说明:', |
|||
}, |
|||
buttons: { |
|||
confirmButton: '确定', |
|||
closeButton: '关闭', |
|||
}, |
|||
buttonList: [ |
|||
{ |
|||
functionId: functionId, |
|||
languageValue: '确定', |
|||
objectId: 'confirmButton', |
|||
objectType: 'button', |
|||
tableId: '*' |
|||
}, { |
|||
functionId: functionId, |
|||
languageValue: '关闭', |
|||
objectId: 'closeButton', |
|||
objectType: 'button', |
|||
tableId: '*' |
|||
}, |
|||
], |
|||
queryButton: { |
|||
functionId: functionId, |
|||
table_id: '*', |
|||
languageCode: this.$i18n.locale, |
|||
objectType: 'button' |
|||
}, |
|||
labelsList: [ |
|||
{ |
|||
functionId: functionId, |
|||
languageValue: '刀模板', |
|||
objectId: 'titleCon', |
|||
objectType: 'label', |
|||
tableId: '*' |
|||
}, { |
|||
functionId: functionId, |
|||
languageValue: '换刀模', |
|||
objectId: 'replaceToolTitle', |
|||
objectType: 'label', |
|||
tableId: '*' |
|||
}, { |
|||
functionId: functionId, |
|||
languageValue: '换刀模', |
|||
objectId: 'replaceTool', |
|||
objectType: 'label', |
|||
tableId: '*' |
|||
}, { |
|||
functionId: functionId, |
|||
languageValue: '原工具实例编码:', |
|||
objectId: 'oriToolInstanceId', |
|||
objectType: 'label', |
|||
tableId: '*' |
|||
}, { |
|||
functionId: functionId, |
|||
languageValue: '本卷生产数量:', |
|||
objectId: 'currentRollProdQty', |
|||
objectType: 'label', |
|||
tableId: '*' |
|||
}, { |
|||
functionId: functionId, |
|||
languageValue: '之前卷生产数量:', |
|||
objectId: 'oriRollProdQty', |
|||
objectType: 'label', |
|||
tableId: '*' |
|||
}, { |
|||
functionId: functionId, |
|||
languageValue: '累积生产数量:', |
|||
objectId: 'totalRollProdQty', |
|||
objectType: 'label', |
|||
tableId: '*' |
|||
}, { |
|||
functionId: functionId, |
|||
languageValue: '请扫描工具实例!', |
|||
objectId: 'pleaseScanToolInstanceId', |
|||
objectType: 'label', |
|||
tableId: '*' |
|||
}, { |
|||
functionId: functionId, |
|||
languageValue: '确认', |
|||
objectId: 'confirmLabel', |
|||
objectType: 'label', |
|||
tableId: '*' |
|||
}, { |
|||
functionId: functionId, |
|||
languageValue: '取消', |
|||
objectId: 'cancelLabel', |
|||
objectType: 'label', |
|||
tableId: '*' |
|||
}, |
|||
], |
|||
queryLabel: { |
|||
functionId: functionId, |
|||
table_id: '*', |
|||
languageCode: this.$i18n.locale, |
|||
objectType: 'label' |
|||
}, |
|||
} |
|||
}, |
|||
methods: { |
|||
|
|||
//初始化组件的参数 |
|||
init(toolInfo, addFlag) { |
|||
this.visible = true; |
|||
//判断是否是新增 |
|||
if(addFlag){ |
|||
this.titleCon = '工具新增'; |
|||
this.pageData.toolId = ''; |
|||
this.pageData.toolType = ''; |
|||
this.pageData.toolDesc = ''; |
|||
this.pageData.toolType = ''; |
|||
this.pageData.toolTypeDesc = ''; |
|||
this.pageData.calendarId = ''; |
|||
this.pageData.schedCapacity = ''; |
|||
this.pageData.alternateToolId = ''; |
|||
this.pageData.alternateToolDesc = ''; |
|||
this.pageData.calibrationControl = ''; |
|||
this.pageData.calibrationTime = ''; |
|||
this.pageData.enabledForControlPlanDb = ''; |
|||
this.pageData.lastUsed = ''; |
|||
this.pageData.noteText = ''; |
|||
}else{ |
|||
this.titleCon = '工具修改'; |
|||
this.pageData = JSON.parse(JSON.stringify(toolInfo)); |
|||
} |
|||
this.pageData.addFlag = addFlag; |
|||
}, |
|||
|
|||
/*关闭modal*/ |
|||
closeDialog(){ |
|||
//刷新原页面的数据 |
|||
this.$emit('refreshTooInfoData'); |
|||
//关闭当前的页面 |
|||
this.visible = false; |
|||
//this.$emit('update:visible', false); |
|||
}, |
|||
|
|||
// 获取基础数据列表S |
|||
getBaseList (val, type) { |
|||
this.tagNo = val |
|||
this.$nextTick(() => { |
|||
let strVal = '' |
|||
if(val === 1019){ |
|||
let strCon = ' AND site = \''+ this.pageData.site+'\''; |
|||
this.$refs.baseList.init(val, strVal, strCon) |
|||
}else{ |
|||
this.$refs.baseList.init(val, strVal) |
|||
} |
|||
|
|||
}) |
|||
}, |
|||
/* 列表方法的回调 */ |
|||
getBaseData (val) { |
|||
if (this.tagNo === 1017) { |
|||
this.pageData.site = val.SiteID; |
|||
}else if (this.tagNo === 1016) { |
|||
this.pageData.toolType = val.tool_type; |
|||
this.pageData.toolTypeDesc = val.tool_type_desc; |
|||
}else if (this.tagNo === 1018) { |
|||
this.pageData.calendarId = val.calendar_id; |
|||
}else if (this.tagNo === 1019) { |
|||
this.pageData.alternateToolId = val.tool_id; |
|||
this.pageData.alternateToolDesc = val.tool_description; |
|||
} |
|||
}, |
|||
|
|||
|
|||
|
|||
|
|||
/*检查新的工具实例信息*/ |
|||
checkToolInstanceIdFun(){ |
|||
if(this.pageData.toolInstanceId == null || this.pageData.toolInstanceId == ''){ |
|||
this.$message.error(this.labels.pleaseScanToolInstanceId); |
|||
return false; |
|||
} |
|||
checkToolInstanceId(this.pageData).then(({data}) => { |
|||
//判断是否存在异常 |
|||
if(data.code == 500){ |
|||
this.$message.error(data.msg); |
|||
}else if (data.resultMap.resultCode == 201){ |
|||
let msg = data.resultMap.resultMsg; |
|||
this.$confirm(msg, '提示', { |
|||
confirmButtonText: this.labels.confirmLabel, |
|||
cancelButtonText: this.labels.cancelLabel, |
|||
type: "warning" |
|||
}).then(() => { |
|||
this.pageData.checkFlag = true; |
|||
}).catch(() => { |
|||
this.pageData.checkFlag = false; |
|||
}); |
|||
}else{ |
|||
this.pageData.checkFlag = true; |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
/*添加刀模记录*/ |
|||
addToolInstanceIdFun(){ |
|||
/*添加工具的实例*/ |
|||
addToolInstanceId(this.pageData).then(({data}) => { |
|||
if(data.code == 500){ |
|||
this.$message.error(data.msg); |
|||
}else{ |
|||
//清空数据再次准备 |
|||
this.pageData.toolInstanceId = ''; |
|||
this.pageData.oriToolInstanceId = ''; |
|||
this.pageData.consumeQty = ''; |
|||
this.pageData.oriConsumeQty = ''; |
|||
this.pageData.totalConsumeQty = ''; |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
}, |
|||
created() { |
|||
// this.factoryList() |
|||
// this.getLanguageList() |
|||
} |
|||
} |
|||
|
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
.customer-row .el-input--medium { |
|||
width: 135px !important; |
|||
} |
|||
|
|||
</style> |
|||
@ -0,0 +1,821 @@ |
|||
<template> |
|||
<div class="mod-config customer-tab"> |
|||
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;"> |
|||
<el-form-item label="工厂"> |
|||
<el-input v-model="searchData.site" style="width: 160px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="工具编码"> |
|||
<el-input v-model="searchData.toolId" style="width: 160px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="工具类型:"> |
|||
<span slot="label" style="" @click="getBaseList(1016)"><a herf="#">工具类型:</a></span> |
|||
<el-input v-model="searchData.toolType" style="width: 160px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label=" "> |
|||
<el-button @click="search()" type="primary" style="margin-left: 2px;margin-top:0px">查询</el-button> |
|||
<el-button type="primary" @click="addToolInfoModal()">新增</el-button> |
|||
<!-- <el-button @click="addOrUpdateHandle('save')" type="primary" style="margin-left: 2px;margin-top: 0px">新增</el-button>--> |
|||
<download-excel |
|||
:fields="fields()" |
|||
:data="exportData" |
|||
type="xls" |
|||
:name="exportName" |
|||
:header="exportHeader" |
|||
:footer="exportFooter" |
|||
:fetch="createExportData" |
|||
:before-generate="startDownload" |
|||
:before-finish="finishDownload" |
|||
worksheet="导出信息" |
|||
class="el-button el-button--primary el-button--medium"> |
|||
{{ '导出' }} |
|||
</download-excel> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-table |
|||
:height="height" |
|||
:data="dataList" |
|||
border |
|||
ref="mainTable" |
|||
@row-click="changeData" |
|||
highlight-current-row |
|||
v-loading="dataListLoading" |
|||
style="width: 100%;"> |
|||
<el-table-column |
|||
header-align="center" |
|||
align="center" |
|||
width="150" |
|||
fixed="right" |
|||
label="操作"> |
|||
<template slot-scope="scope"> |
|||
<a type="text" size="small" v-if="scope.row.statusCode==='05'" @click="comfirmApply(scope.row)">下达</a> |
|||
<a type="text" size="small" v-if="scope.row.statusCode==='05'" @click="cancelApply(scope.row)">取消申请</a> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
v-for="(item,index) in columnList" :key="index" |
|||
:sortable="item.columnSortable" |
|||
:prop="item.columnProp" |
|||
:header-align="item.headerAlign" |
|||
:show-overflow-tooltip="item.showOverflowTooltip" |
|||
:align="item.align" |
|||
:fixed="item.fixed==''?false:item.fixed" |
|||
:min-width="item.columnWidth" |
|||
:label="item.columnLabel"> |
|||
<template slot-scope="scope"> |
|||
<span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span> |
|||
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" |
|||
style="width: 100px; height: 80px"/></span> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
</el-table> |
|||
<el-pagination |
|||
@size-change="sizeChangeHandle" |
|||
@current-change="currentChangeHandle" |
|||
:current-page="pageIndex" |
|||
:page-sizes="[20, 50, 100, 1000]" |
|||
:page-size="pageSize" |
|||
:total="totalPage" |
|||
layout="total, sizes, prev, pager, next, jumper"> |
|||
</el-pagination> |
|||
<el-tabs style="font-size: 12px;min-height: 330px" class="customer-tab" v-model="activeName" type="border-card" @tab-click="tabClick"> |
|||
<el-tab-pane label="工具实例" name="detail" style="margin-left: -10px;"> |
|||
<el-form label-position="top" style="margin-top: -15px; margin-left: 2px;"> |
|||
<el-button type="primary" >新增</el-button> |
|||
</el-form> |
|||
<el-table |
|||
:data="detailList" |
|||
height="240" |
|||
border |
|||
v-loading="dataListLoading" |
|||
style="width: 100%; "> |
|||
<el-table-column |
|||
v-for="(item,index) in columnDetailList" :key="index" |
|||
:sortable="item.columnSortable" |
|||
:prop="item.columnProp" |
|||
:header-align="item.headerAlign" |
|||
:show-overflow-tooltip="item.showOverflowTooltip" |
|||
:align="item.align" |
|||
:fixed="item.fixed==''?false:item.fixed" |
|||
:min-width="item.columnWidth" |
|||
:label="item.columnLabel"> |
|||
<template slot-scope="scope"> |
|||
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span> |
|||
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" |
|||
style="width: 100px; height: 80px"/></span> |
|||
</template> |
|||
</el-table-column> |
|||
<!-- <el-table-column--> |
|||
<!-- fixed="right"--> |
|||
<!-- header-align="center"--> |
|||
<!-- align="center"--> |
|||
<!-- width="100"--> |
|||
<!-- label="操作">--> |
|||
<!-- <template slot-scope="scope">--> |
|||
<!-- <!– <a :href="'http://192.168.1.130:80/file/'+scope.row.url" :download="scope.row.fileName">下载</a>–>--> |
|||
<!-- <a @click="downloadFile(scope.row)" >下载</a>--> |
|||
<!-- <a type="text" size="small" @click="deleteFile(scope.row)">删除</a>--> |
|||
<!-- </template>--> |
|||
<!-- </el-table-column>--> |
|||
</el-table> |
|||
|
|||
</el-tab-pane> |
|||
</el-tabs> |
|||
<!-- 选择组件 --> |
|||
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|||
<!-- 工具信息 --> |
|||
<toolInfoAddUpdate ref="toolInfoAddUpdate" :close-on-click-modal="false" @refreshTooInfoData="refreshTooInfoData"> |
|||
</toolInfoAddUpdate> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
getToolInfoList, // 工具信息查询 |
|||
getToolInstanceList, //工具实例信息查询 |
|||
} from '@/api/tool/tool_info.js' |
|||
|
|||
/*组件*/ |
|||
import Chooselist from '@/views/modules/common/Chooselist'; /*选择组件*/ |
|||
import toolInfoAddUpdate from "./components/com_tool_info_add_update"; /*工具新增和修改组件*/ |
|||
import { |
|||
deleteProjectFile, |
|||
getFileContentList, |
|||
downLoadProjectFile, |
|||
getProjectUserRole, |
|||
} from "@/api/project/project.js" |
|||
|
|||
/*組件*/ |
|||
export default { |
|||
components: { |
|||
Chooselist,/*选择组件*/ |
|||
toolInfoAddUpdate,/*工具新增和修改组件*/ |
|||
}, |
|||
name: "null", |
|||
data() { |
|||
return { |
|||
fileContentList: [], |
|||
activeName: 'detail', |
|||
searchData:{ |
|||
pageIndex: 1, |
|||
pageSize: 100, |
|||
site:this.$store.state.user.site, |
|||
toolId:'', |
|||
toolType:'', |
|||
startDate:'', |
|||
endDate:'', |
|||
}, |
|||
modelData:{ |
|||
site:'', |
|||
applyNo:'', |
|||
prNo:'', |
|||
remark1:'', |
|||
poNo:'', |
|||
supplierName:'', |
|||
allCost:'', |
|||
remark2:'', |
|||
}, |
|||
modelFlag:false, |
|||
currentRow:{}, |
|||
height: 200, |
|||
dataList:[], |
|||
detailList:[], |
|||
dataListLoading: false, |
|||
// 导出 start |
|||
exportData: [], |
|||
exportName: "工具信息" + this.dayjs().format('YYYYMMDDHHmmss'), |
|||
exportHeader: ["工具信息"], |
|||
exportFooter: [], |
|||
exportList:[], |
|||
tagNo:'', |
|||
pageIndex: 1, |
|||
pageSize: 100, |
|||
totalPage: 0, |
|||
// 导出 end |
|||
columnList: [ |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 106003, |
|||
serialNumber: '106003Table1Site', |
|||
tableId: "106003Table1", |
|||
tableName: "刀具信息主表", |
|||
columnProp: "site", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "工厂编码", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 106003, |
|||
serialNumber: '106003Table1ToolId', |
|||
tableId: "106003Table1", |
|||
tableName: "刀具信息主表", |
|||
columnProp: "toolId", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "工具编码", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 106003, |
|||
serialNumber: '106003Table1ToolDesc', |
|||
tableId: "106003Table1", |
|||
tableName: "刀具信息主表", |
|||
columnProp: "toolDesc", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "工具描述", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 160 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 106003, |
|||
serialNumber: '106003TableToolType', |
|||
tableId: "106003Table1", |
|||
tableName: "刀具信息主表", |
|||
columnProp: "toolType", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "工具类型", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 106003, |
|||
serialNumber: '106003TableCalendarId', |
|||
tableId: "106003Table1", |
|||
tableName: "刀具信息主表", |
|||
columnProp: "calendarId", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "日历标识", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 106003, |
|||
serialNumber: '106003TableSchedCapacity', |
|||
tableId: "106003Table1", |
|||
tableName: "刀具信息主表", |
|||
columnProp: "schedCapacity", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "计划能力", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 106003, |
|||
serialNumber: '106003TableCalibrationControl', |
|||
tableId: "106003Table1", |
|||
tableName: "刀具信息主表", |
|||
columnProp: "calibrationControl", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "校对控制", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 106003, |
|||
serialNumber: '106003TableCalibrationTime', |
|||
tableId: "106003Table1", |
|||
tableName: "刀具信息主表", |
|||
columnProp: "calibrationTime", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "校对间隔时间", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 106003, |
|||
serialNumber: '106003TableLastUsed', |
|||
tableId: "106003Table1", |
|||
tableName: "刀具信息主表", |
|||
columnProp: "lastUsed", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "上次使用", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 106003, |
|||
serialNumber: '106003TableAlternateToolId', |
|||
tableId: "106003Table1", |
|||
tableName: "刀具信息主表", |
|||
columnProp: "alternateToolId", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "备选工具标识号", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 106003, |
|||
serialNumber: '106003TableEnabledForControlPlanDb', |
|||
tableId: "106003Table1", |
|||
tableName: "刀具信息主表", |
|||
columnProp: "enabledForControlPlanDb", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "为控制计划启用", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 106003, |
|||
serialNumber: '106003TableNoteText', |
|||
tableId: "106003Table1", |
|||
tableName: "刀具信息主表", |
|||
columnProp: "noteText", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "备注", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 180 |
|||
}, |
|||
], |
|||
columnDetailList: [ |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 106003, |
|||
serialNumber: '106003Table2SeqNo', |
|||
tableId: '106003Table2', |
|||
tableName: '工具申请明细', |
|||
columnProp: 'seqNo', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '序号', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 40 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 106003, |
|||
serialNumber: '106003Table2QuotationNo', |
|||
tableId: '106003Table2', |
|||
tableName: '工具申请明细', |
|||
columnProp: 'quotationNo', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '所属报价单', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 70 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 106003, |
|||
serialNumber: '106003Table2ToolNo', |
|||
tableId: '106003Table2', |
|||
tableName: '工具申请明细', |
|||
columnProp: 'toolNo', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '工具编码', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 70 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 106003, |
|||
serialNumber: '106003Table2ToolDescription', |
|||
tableId: '106003Table2', |
|||
tableName: '工具申请明细', |
|||
columnProp: 'toolDescription', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '工具描述', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 120 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 106003, |
|||
serialNumber: '106003Table2ToolSpec', |
|||
tableId: '106003Table2', |
|||
tableName: '工具申请明细', |
|||
columnProp: 'toolSpec', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '工具规格', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 120 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 106003, |
|||
serialNumber: '106003Table2ApplyQty', |
|||
tableId: '106003Table2', |
|||
tableName: '工具申请明细', |
|||
columnProp: 'applyQty', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '申请数量', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 60 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 106003, |
|||
serialNumber: '106003Table2ExpectedServiceLife', |
|||
tableId: '106003Table2', |
|||
tableName: '工具申请明细', |
|||
columnProp: 'expectedServiceLife', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '预计寿命', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 50 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 106003, |
|||
serialNumber: '106003Table2UnitCost', |
|||
tableId: '106003Table2', |
|||
tableName: '工具申请明细', |
|||
columnProp: 'unitCost', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '单位成本', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 60 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 106003, |
|||
serialNumber: '106003Table2quotationUnitCost', |
|||
tableId: '106003Table2', |
|||
tableName: '工具申请明细', |
|||
columnProp: 'quotationUnitCost', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '单位报价成本', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 60 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 106003, |
|||
serialNumber: '106003Table2Remark', |
|||
tableId: '106003Table2', |
|||
tableName: '工具申请明细', |
|||
columnProp: 'remark', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '备注', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 200 |
|||
}, |
|||
|
|||
], |
|||
} |
|||
}, |
|||
watch: { |
|||
// columnList: { |
|||
// deep: true, |
|||
// handler: function (newV, oldV) { |
|||
// debugger |
|||
// |
|||
// } |
|||
// } |
|||
}, |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
this.height = window.innerHeight - 520; |
|||
}) |
|||
}, |
|||
methods: { |
|||
// 获取基础数据列表S |
|||
getBaseList (val, type) { |
|||
this.tagNo = val |
|||
this.$nextTick(() => { |
|||
let strVal = '' |
|||
this.$refs.baseList.init(val, strVal) |
|||
}) |
|||
}, |
|||
/* 列表方法的回调 */ |
|||
getBaseData (val) { |
|||
debugger; |
|||
if (this.tagNo === 1016) { |
|||
this.searchData.toolType = val.tool_type; |
|||
} |
|||
}, |
|||
|
|||
//导出excel |
|||
async createExportData() { |
|||
this.searchData.limit = -1 |
|||
this.searchData.page = 1 |
|||
await getToolInfoList(this.searchData).then(({data}) => { |
|||
this.exportList= data.page.list; |
|||
}) |
|||
|
|||
return this.exportList; |
|||
}, |
|||
startDownload() { |
|||
// this.exportData = this.dataList |
|||
|
|||
}, |
|||
finishDownload() { |
|||
|
|||
}, |
|||
fields() { |
|||
let json = "{" |
|||
this.columnList.forEach((item, index) => { |
|||
if (index == this.columnList.length - 1) { |
|||
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" |
|||
} else { |
|||
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + "," |
|||
} |
|||
}) |
|||
json += "}" |
|||
let s = eval("(" + json + ")") |
|||
|
|||
return s |
|||
}, |
|||
|
|||
refreshTooInfoData() { |
|||
this.searchData.pageSize = this.pageSize |
|||
this.searchData.pageIndex = this.pageIndex |
|||
getToolInfoList(this.searchData).then(({data}) => { |
|||
if (data.code == 200) { |
|||
this.dataList = data.rows; |
|||
this.totalPage = data.total; |
|||
} |
|||
this.dataListLoading = false |
|||
}) |
|||
}, |
|||
|
|||
/*新增工具的modal*/ |
|||
addToolInfoModal(){ |
|||
//1.设置相关的参数 |
|||
|
|||
//打开modal的页面 |
|||
this.$nextTick(() => { |
|||
this.$refs.toolInfoAddUpdate.init(null, true) |
|||
}); |
|||
}, |
|||
|
|||
|
|||
//切换工具触发 |
|||
changeData(row) { |
|||
this.currentRow = JSON.parse(JSON.stringify(row)); |
|||
this.currentRow2 = row; |
|||
this.refreshCurrentTabTable (); |
|||
}, |
|||
|
|||
// 获取数据列表 |
|||
search () { |
|||
this.searchData.pageSize = this.pageSize |
|||
this.searchData.pageIndex = this.pageIndex |
|||
getToolInfoList(this.searchData).then(({data}) => { |
|||
debugger; |
|||
if (data.code == 200) { |
|||
this.dataList = data.rows; |
|||
this.totalPage = data.total; |
|||
if(this.dataList.length > 0){ |
|||
this.$refs.mainTable.setCurrentRow(this.dataList[0]); |
|||
this.currentRow = JSON.parse(JSON.stringify(this.dataList[0])); |
|||
}else { |
|||
this.currentRow ={} |
|||
} |
|||
this.refreshCurrentTabTable () |
|||
} |
|||
this.dataListLoading = false |
|||
}) |
|||
}, |
|||
|
|||
tabClick (tab, event) { |
|||
// 刷新列表数据 |
|||
this.refreshCurrentTabTable() |
|||
}, |
|||
// 刷新页签的table数据 |
|||
refreshCurrentTabTable () { |
|||
if (this.activeName == 'detail') { |
|||
this.getToolInstanceList(); |
|||
} |
|||
if (this.activeName == 'down') { |
|||
this.getFileContentData(); |
|||
} |
|||
|
|||
}, |
|||
|
|||
|
|||
// 下载 |
|||
downloadFile(row){ |
|||
// let inData={ |
|||
// site:this.currentRow.site, |
|||
// username:this.$store.state.user.name, |
|||
// projectId:this.currentRow.projectId |
|||
// } |
|||
// getProjectUserRole(inData).then(({data}) => { |
|||
// if(this.$store.state.user.name=='admin'||data.row.downFlag=='Y') { |
|||
downLoadProjectFile(row) |
|||
.then(({data}) => { |
|||
// 不限制文件下载类型 |
|||
const blob = new Blob([data], {type:'application/octet-stream;charset=utf-8'}) |
|||
// 下载文件名称 |
|||
const fileName = row.fileName |
|||
// a标签下载 |
|||
const linkNode = document.createElement('a') |
|||
linkNode.download = fileName // a标签的download属性规定下载文件的名称 |
|||
linkNode.style.display = 'none' |
|||
linkNode.href = URL.createObjectURL(blob) // 生成一个Blob URL |
|||
console.log(linkNode) |
|||
// if(val == 'Y'){ |
|||
// this.pdfVisible = true |
|||
// this.pdfUrl = linkNode.href |
|||
// }else { |
|||
document.body.appendChild(linkNode) |
|||
linkNode.click() // 模拟在按钮上的一次鼠标单击 |
|||
URL.revokeObjectURL(linkNode.href) // 释放URL 对象 |
|||
document.body.removeChild(linkNode) |
|||
// } |
|||
}) |
|||
// }else { |
|||
// this.$alert('没有权限下载这个项目的文件!', '错误', { |
|||
// confirmButtonText: '确定' |
|||
// }) |
|||
// } |
|||
// }) |
|||
}, |
|||
// 每页数 |
|||
sizeChangeHandle (val) { |
|||
this.pageSize = val |
|||
this.pageIndex = 1 |
|||
this.search() |
|||
}, |
|||
// 当前页 |
|||
currentChangeHandle (val) { |
|||
this.pageIndex = val |
|||
this.search() |
|||
}, |
|||
|
|||
}, |
|||
activated() { |
|||
|
|||
}, |
|||
} |
|||
</script> |
|||
|
|||
<style > |
|||
/deep/ .customer-tab .el-tabs__content { |
|||
padding: 0px !important; |
|||
} |
|||
.el-transfer-panel { |
|||
border: 2px solid #17b3a3; |
|||
border-radius: 4px; |
|||
overflow: hidden; |
|||
background: #fff; |
|||
display: inline-block; |
|||
vertical-align: middle; |
|||
width: 200px; |
|||
max-height: 100%; |
|||
-webkit-box-sizing: border-box; |
|||
box-sizing: border-box; |
|||
position: relative; |
|||
} |
|||
|
|||
.el-transfer-panel .el-transfer-panel__header { |
|||
height: 40px; |
|||
line-height: 40px; |
|||
background: #17b3a3; |
|||
margin: 0; |
|||
padding-left: 15px; |
|||
border-bottom: 1px solid #17b3a3; |
|||
-webkit-box-sizing: border-box; |
|||
box-sizing: border-box; |
|||
color: #000; |
|||
} |
|||
|
|||
.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label { |
|||
font-size: 14px; |
|||
color: #303133; |
|||
font-weight: 400; |
|||
} |
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue