Browse Source

plm 工具具

master
ruanqi 1 year ago
parent
commit
d203834751
  1. 1
      src/api/tool/toolApply.js
  2. 180
      src/views/modules/tooling/searchToolApply.vue
  3. 73
      src/views/modules/tooling/toolingInfo.vue

1
src/api/tool/toolApply.js

@ -21,3 +21,4 @@ export const cancelProjectToolApply = data => createAPI(`/plm/projectToolingAppl
export const saveProjectHeaderMessage = data => createAPI(`/plm/projectToolingApplication/saveProjectHeaderMessage`,'post',data)
export const editToolApplication= data => createAPI(`/plm/projectToolingApplication/editToolApplication`,'post',data)

180
src/views/modules/tooling/searchToolApply.vue

@ -1,8 +1,8 @@
<template>
<div class="mod-config">
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
<el-form-item :label="'申请编码'">
<el-input v-model="searchData.applyId" style="width: 160px"></el-input>
<el-form-item :label="'申请单号'">
<el-input v-model="searchData.applyNo" style="width: 160px"></el-input>
</el-form-item>
<el-form-item label="申请日期">
<el-date-picker
@ -58,6 +58,7 @@
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.status=='审批中'" @click="editModal(scope.row)">审批</a>
<a type="text" size="small" v-if="scope.row.statusCode==='05'" @click="cancelApply(scope.row)">取消申请</a>
</template>
</el-table-column>
@ -221,6 +222,81 @@
</el-form>
</el-tab-pane>
</el-tabs>
<el-dialog
width="800px" v-drag
:title="'刀模申请审批'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :inline="true" label-position="top" label-width="100px" >
<el-form-item :label="'申请编号'">
<el-input v-model="dataForm.applyNo" style="width: 130px" disabled></el-input>
</el-form-item>
<el-form-item :label="'申请人'" required="required">
<el-input v-model="dataForm.applyBy" style="width: 130px" disabled></el-input>
</el-form-item>
<el-form-item :label="'申请日期'" required="required">
<el-date-picker
value-format="yyyy-MM-dd"
style="width: 100%"
v-model="dataForm.applyDate"
type="date"
disabled
placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item :label="'申请总数'">
<el-input v-model="dataForm.applySumQty" style="width: 130px" disabled></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" label-width="100px" >
<el-form-item :label="'申请原因'">
<el-input v-model="dataForm.applyReason" style="width: 770px" ></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" label-width="100px" >
<el-form-item :label="'备注'">
<el-input v-model="dataForm.remark" style="width: 770px" ></el-input>
</el-form-item>
</el-form>
<div class="rq">
<el-table
height="250"
:data="toolData"
border
ref="toolTable"
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnList2" :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">
<div v-if="item.columnProp !== 'applyQty' ">
<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>
</div>
<div v-else>
<el-input v-model="scope.row.applyQty" type="number" @change="changeSum(scope.row)" placeholder="请输入数量" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"
style="width:98%"></el-input>
</div>
</template>
</el-table-column>
</el-table>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="saveData()">{{'保存'}}</el-button>
<el-button type="primary" @click="visible = false">{{'取消'}}</el-button>
</span>
</el-dialog>
<el-dialog
width="600px" v-drag
:title="'处理信息'"
@ -287,6 +363,7 @@
comfirmProjectToolApply,
cancelProjectToolApply,
saveProjectHeaderMessage,
editToolApplication
} from "@/api/tool/toolApply.js"
import {
deleteProjectFile,
@ -313,16 +390,29 @@
name: "null",
data() {
return {
visible:false,
fileContentList: [],
activeName: 'detail',
searchData:{
page: 1,
limit: 100,
site:this.$store.state.user.site,
applyId:'',
applyNo:'',
startDate:'',
endDate:'',
},
toolData:[],
dataForm:{
site: '',
applyNo: '',
applyBy:'',
applyDate:'',
applySumQty:'',
applyReason:'',
remark:'',
createBy:'',
detailList:[],
},
modelData:{
site:'',
applyNo:'',
@ -613,7 +703,7 @@
sortLv: 0,
status: true,
fixed: '',
columnWidth: 70
columnWidth: 100
},
{
userId: this.$store.state.user.name,
@ -667,7 +757,7 @@
sortLv: 0,
status: true,
fixed: '',
columnWidth: 60
columnWidth: 80
},
{
userId: this.$store.state.user.name,
@ -687,24 +777,6 @@
fixed: '',
columnWidth: 60
},
{
userId: this.$store.state.user.name,
functionId: 106002,
serialNumber: '106002Table2Remark',
tableId: '106002Table2',
tableName: '工具申请明细',
columnProp: 'remark',
headerAlign: 'center',
align: 'center',
columnLabel: '备注',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 200
},
{
userId: this.$store.state.user.name,
functionId: 106002,
@ -1041,11 +1113,35 @@
},
searchToolApplyDetail(){
searchProjectToolApplyDetail(this.currentRow).then(({data}) => {
if(this.currentRow.applyNo){
searchProjectToolApplyDetail(this.currentRow).then(({data}) => {
if (data.code == 0) {
this.detailList = data.rows
}
})
}else {
this.detailList =[]
}
},
editModal(row){
this.dataForm={
site: row.site,
applyNo: row.applyNo,
applyBy:row.applyBy,
applyDate:row.applyDate,
applySumQty:row.applySumQty,
applyReason:row.applyReason,
remark:row.remark,
createBy:row.createBy,
detailList:[],
}
searchProjectToolApplyDetail({ site: row.site,
applyNo: row.applyNo,}).then(({data}) => {
if (data.code == 0) {
this.detailList = data.rows
this.toolData = data.rows
}
})
this.visible=true
},
comfirmApply (row) {
this.$confirm(`确定下达这个申请`, '提示', {
@ -1182,6 +1278,13 @@
}
this.modelFlag=true
},
changeSum() {
this.dataForm.applySumQty = 0
for (const item of this.toolData) {
// null undefined 0
this.dataForm.applySumQty += Number(item.applyQty != null && item.applyQty !== '' ? item.applyQty : 0);
}
},
saveHeaderMessage(){
this.$confirm('确定是否保存','提示',{
confirmButtonText:'确定',
@ -1219,7 +1322,34 @@
})
})
},
saveData(){
this.dataForm.detailList=this.toolData
editToolApplication(this.dataForm).then(({data}) => {
if (data && data.code == 0) {
for (let i = 0; i <this.dataList1.length ; i++) {
if(this.dataList1[i].applyNo===this.dataForm.applyNo){
this.dataList1[i].remark=this.dataForm.remark
this.dataList1[i].applySumQty=this.dataForm.applySumQty
this.dataList1[i].applyReason=this.dataForm.applyReason
}
}
this.visible=false;
this.refreshCurrentTabTable ()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
},
activated() {

73
src/views/modules/tooling/toolingInfo.vue

@ -150,6 +150,7 @@
<el-button type="primary" @click="visible = false">{{'取消'}}</el-button>
</span>
</el-dialog>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
@ -279,42 +280,42 @@
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 106001001,
serialNumber: '106001001Table1BuNo',
tableId: "106001001Table1",
tableName: "项目信息主表",
columnProp: "buNo",
headerAlign: "center",
align: "left",
columnLabel: "BU编码",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 106001001,
serialNumber: '106001001Table1BuDesc',
tableId: "106001001Table1",
tableName: "项目信息主表",
columnProp: "buDesc",
headerAlign: "center",
align: "left",
columnLabel: "BU名称",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
// {
// userId: this.$store.state.user.name,
// functionId: 106001001,
// serialNumber: '106001001Table1BuNo',
// tableId: "106001001Table1",
// tableName: "",
// columnProp: "buNo",
// headerAlign: "center",
// align: "left",
// columnLabel: "BU",
// columnHidden: false,
// columnImage: false,
// columnSortable: false,
// sortLv: 0,
// status: true,
// fixed: '',
// columnWidth: 100
// },
// {
// userId: this.$store.state.user.name,
// functionId: 106001001,
// serialNumber: '106001001Table1BuDesc',
// tableId: "106001001Table1",
// tableName: "",
// columnProp: "buDesc",
// headerAlign: "center",
// align: "left",
// columnLabel: "BU",
// columnHidden: false,
// columnImage: false,
// columnSortable: false,
// sortLv: 0,
// status: true,
// fixed: '',
// columnWidth: 100
// },
{
userId: this.$store.state.user.name,
functionId: 106001001,

Loading…
Cancel
Save