5 changed files with 388 additions and 43 deletions
-
2src/api/production/dailyPlan.js
-
9src/api/production/pallet.js
-
262src/views/modules/base/location.vue
-
35src/views/modules/pallet/pallet.vue
-
123src/views/modules/production/dailyPlan.vue
@ -0,0 +1,262 @@ |
|||||
|
<template> |
||||
|
<div class="mod-config"> |
||||
|
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 3px;margin-left: 2px" > |
||||
|
<el-form-item label="位置ID"> |
||||
|
<el-input v-model="searchData.locationID" style="width: 120px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="是否在用"> |
||||
|
<el-select filterable v-model="searchData.active" style="width: 120px"> |
||||
|
<el-option label="是" value="Y"></el-option> |
||||
|
<el-option label="否" value="N"></el-option> |
||||
|
<el-option label="全部" value=""></el-option> |
||||
|
</el-select> |
||||
|
<el-button type="primary" @click="getLocationData()">查询</el-button> |
||||
|
<el-button type="primary" @click="newLocation()">新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<el-table |
||||
|
:height="height" |
||||
|
:data="dataList" |
||||
|
border |
||||
|
style="width: 100%"> |
||||
|
<el-table-column |
||||
|
prop="" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
width="60" |
||||
|
label="操作"> |
||||
|
<template slot-scope="scope" class="foo_container"> |
||||
|
<a type="text" size="small" @click="editLocation(scope.row)">编辑</a> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
prop="site" |
||||
|
header-align="center" |
||||
|
align="left" |
||||
|
min-width="80" |
||||
|
label="工厂编号"> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
prop="locationID" |
||||
|
header-align="center" |
||||
|
align="left" |
||||
|
min-width="80" |
||||
|
label="位置ID"> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
prop="locationName" |
||||
|
header-align="center" |
||||
|
align="left" |
||||
|
min-width="120" |
||||
|
label="位置名称"> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
prop="active" |
||||
|
header-align="center" |
||||
|
align="left" |
||||
|
min-width="80" |
||||
|
label="是否在用"> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
prop="wareHouseID" |
||||
|
header-align="center" |
||||
|
align="left" |
||||
|
min-width="80" |
||||
|
label="所在仓库ID"> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
prop="wareHouseName" |
||||
|
header-align="center" |
||||
|
align="left" |
||||
|
min-width="120" |
||||
|
label="仓库名称"> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<el-dialog title="维护位置" :close-on-click-modal="false" v-drag :visible.sync="locationModalFlag" width="300px"> |
||||
|
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;"> |
||||
|
<el-form-item label="位置ID"> |
||||
|
<el-input v-model="locationData.locationID" :disabled="disabledFlag" style="width: 120px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="位置名称"> |
||||
|
<el-input v-model="locationData.locationName" style="width: 120px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="是否在用"> |
||||
|
<el-select filterable v-model="locationData.active" :disabled="selectFlag" style="width: 120px"> |
||||
|
<el-option label="是" value="Y"></el-option> |
||||
|
<el-option label="否" value="N"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item > |
||||
|
<span slot="label" style="" @click="getBaseList(20)"><a herf="#">所在仓库ID:</a></span> |
||||
|
<el-input v-model="locationData.wareHouseID" style="width: 120px"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<el-footer style="height:40px;margin-top: 10px;text-align:center"> |
||||
|
<el-button type="primary" @click="saveLocation">保存</el-button> |
||||
|
<el-button type="primary" @click="locationModalFlag = false">关闭</el-button> |
||||
|
</el-footer> |
||||
|
</el-dialog> |
||||
|
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getLocationData, |
||||
|
saveLocationData, |
||||
|
deleteLocationData, |
||||
|
} from '@/api/production/pallet.js' |
||||
|
import Chooselist from '@/views/modules/common/Chooselist' |
||||
|
export default { |
||||
|
name: 'location', |
||||
|
components: { |
||||
|
Chooselist |
||||
|
}, |
||||
|
watch: { |
||||
|
locationData: { |
||||
|
deep: true, |
||||
|
handler: function (newV, oldV) { |
||||
|
this.locationData.locationID = this.locationData.locationID.toUpperCase() |
||||
|
this.locationData.wareHouseID = this.locationData.wareHouseID.toUpperCase() |
||||
|
} |
||||
|
}, |
||||
|
searchData: { |
||||
|
deep: true, |
||||
|
handler: function (newV, oldV) { |
||||
|
this.searchData.locationID = this.searchData.locationID.toUpperCase() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
tagNo:'', |
||||
|
locationModalFlag:false, |
||||
|
height:200, |
||||
|
searchData:{ |
||||
|
locationID:'', |
||||
|
active:'', |
||||
|
}, |
||||
|
dataList:[], |
||||
|
disabledFlag:false, |
||||
|
selectFlag:false, |
||||
|
locationData:{ |
||||
|
wareHouseID:'', |
||||
|
locationName:'', |
||||
|
locationID:'', |
||||
|
site:'', |
||||
|
user:'', |
||||
|
add:'', |
||||
|
active:'', |
||||
|
}, |
||||
|
} |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.$nextTick(() => { |
||||
|
this.height = window.innerHeight - 240; |
||||
|
}) |
||||
|
}, |
||||
|
methods: { |
||||
|
getBaseData(val){ |
||||
|
if (this.tagNo === 20){ |
||||
|
this.locationData.wareHouseID = val.WareHouseID |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
// 获取基础数据列表 |
||||
|
getBaseList(val){ |
||||
|
this.tagNo = val |
||||
|
this.$nextTick(() => { |
||||
|
let strVal = ""; |
||||
|
if (val === 20){ |
||||
|
strVal = this.locationData.wareHouseID |
||||
|
} |
||||
|
|
||||
|
this.$refs.baseList.init(val,strVal) |
||||
|
}) |
||||
|
}, |
||||
|
getLocationData(){ |
||||
|
getLocationData(this.searchData).then(({data}) => { |
||||
|
if(data.code===0){ |
||||
|
this.dataList=data.rows; |
||||
|
}else { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
newLocation(){ |
||||
|
this.locationData={ |
||||
|
wareHouseID:'', |
||||
|
locationName:'', |
||||
|
locationID:'', |
||||
|
site:this.$store.state.user.site, |
||||
|
user:this.$store.state.user.name, |
||||
|
add:0, |
||||
|
active:'Y', |
||||
|
}; |
||||
|
this.disabledFlag=false; |
||||
|
this.selectFlag=true; |
||||
|
this.locationModalFlag=true; |
||||
|
}, |
||||
|
editLocation(row){ |
||||
|
this.locationData={ |
||||
|
wareHouseID:row.wareHouseID, |
||||
|
locationName:row.locationName, |
||||
|
locationID:row.locationID, |
||||
|
site:row.site, |
||||
|
user:this.$store.state.user.name, |
||||
|
add:1, |
||||
|
active:row.active, |
||||
|
}; |
||||
|
this.disabledFlag=true; |
||||
|
this.selectFlag=false; |
||||
|
this.locationModalFlag=true; |
||||
|
}, |
||||
|
saveLocation(){ |
||||
|
if(this.locationData.locationID==""||this.locationData.locationID==null){ |
||||
|
this.$alert('位置ID不能为空!', '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
return false |
||||
|
} |
||||
|
if(this.locationData.locationName==""||this.locationData.locationName==null){ |
||||
|
this.$alert('位置名称不能为空!', '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
return false |
||||
|
} |
||||
|
if(this.locationData.wareHouseID==""||this.locationData.wareHouseID==null){ |
||||
|
this.$alert('仓库ID不能为空!', '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
return false |
||||
|
} |
||||
|
saveLocationData(this.locationData).then(({data}) => { |
||||
|
if(data.code===0){ |
||||
|
this.getLocationData(); |
||||
|
this.locationModalFlag=false; |
||||
|
this.$message({ |
||||
|
message: '保存成功', |
||||
|
type: 'success', |
||||
|
duration: 1500, |
||||
|
onClose: () => { |
||||
|
} |
||||
|
}) |
||||
|
}else { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
}, |
||||
|
created() { |
||||
|
this.getLocationData(); |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
|
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue