|
@@ -1,22 +1,36 @@
|
|
|
// 新增内转钢坯需求
|
|
|
<template>
|
|
|
<div class="inwardRequirement">
|
|
|
- <page-title>新增需求</page-title>
|
|
|
<div>
|
|
|
<!-- 用车单位 -->
|
|
|
<div class="requireUnit form">
|
|
|
- <el-form class="demo-form-inline" label-width="80px">
|
|
|
- <el-form-item label="用车单位">
|
|
|
+ <el-form class="demo-form-inline" label-width="80px" :inline="true">
|
|
|
+ <el-form-item label="用车单位" v-show="false">
|
|
|
<el-input class="inline-input" v-model="requireUnitName" disabled>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="炉号">
|
|
|
- <el-input class="inline-input" v-model="heatNo"> </el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="需求类型">
|
|
|
+ <el-form-item label="需求类型" v-show="false">
|
|
|
<el-input class="inline-input" v-model="requirementType" disabled>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="炉号">
|
|
|
+ <el-input class="inline-input" v-model.number="heatNo"> </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="支数">
|
|
|
+ <el-input class="inline-input" v-model="count"> </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <!-- 车辆我设为多选了,我觉得会省事,他们应该不希望每台车都做一次 -->
|
|
|
+ <el-form-item label="选择车辆">
|
|
|
+ <el-select class="inline-select" v-model="capacityIds" multiple>
|
|
|
+ <el-option
|
|
|
+ v-for="item in optionsCapacity"
|
|
|
+ :label="item.capacityNumber"
|
|
|
+ :value="item.capacityId"
|
|
|
+ :key="item.capacityId"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="选择班别">
|
|
|
<el-select class="inline-select" v-model="clazz">
|
|
|
<el-option
|
|
@@ -29,7 +43,7 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="选择钢种">
|
|
|
- <el-select class="inline-select" v-model="type">
|
|
|
+ <el-select class="inline-select" v-model="type" filterable>
|
|
|
<el-option
|
|
|
v-for="(item, index) in options1"
|
|
|
:key="index"
|
|
@@ -40,7 +54,7 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="选择规格">
|
|
|
- <el-select class="inline-select" v-model="model">
|
|
|
+ <el-select class="inline-select" v-model="model" filterable>
|
|
|
<el-option
|
|
|
v-for="(item, index) in options2"
|
|
|
:key="index"
|
|
@@ -50,7 +64,7 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="选择装货点">
|
|
|
+ <el-form-item label="选择装货点" v-show="false">
|
|
|
<el-select class="inline-select" v-model="loadPoint">
|
|
|
<el-option
|
|
|
v-for="item in optionsLoad"
|
|
@@ -74,47 +88,12 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
- <div>
|
|
|
- <el-button type="primary" @click="resetCapacity">
|
|
|
- 重置车辆信息
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
- <div class="selectionTable from">
|
|
|
- <el-table
|
|
|
- :data="selectionList"
|
|
|
- border
|
|
|
- style="width: 100%"
|
|
|
- highlight-current-row
|
|
|
- >
|
|
|
- <el-table-column type="index" label="序号" width="50">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- v-for="(item, i) in tableTop"
|
|
|
- :key="i"
|
|
|
- :prop="item.prop"
|
|
|
- :label="item.label"
|
|
|
- :width="item.width"
|
|
|
- align="center"
|
|
|
- show-overflow-tooltip
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <!-- 操作列 -->
|
|
|
- <el-table-column fixed="right" label="操作" width="100">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- @click="deleteRow(scope.$index)"
|
|
|
- type="text"
|
|
|
- icon="el-icon-close"
|
|
|
- size="big"
|
|
|
- ></el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </div>
|
|
|
</div>
|
|
|
<div class="button-box">
|
|
|
- <el-button type="primary" @click="makeSure">确认新增</el-button>
|
|
|
- <el-button type="primary" @click="cancel">返回</el-button>
|
|
|
+ <el-button type="primary" @click="makeSure">保存</el-button>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <mergeRowTable v-bind.sync="first" ref="table"> </mergeRowTable>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -123,6 +102,7 @@
|
|
|
import PageTitle from '@/components/Page/Title'
|
|
|
import { sjTime } from '@/utils/sharedJsFile'
|
|
|
import { getCookie } from '@/utils/util.js'
|
|
|
+import { isNumber } from '../../../ADMINISTRATORS/app'
|
|
|
export default {
|
|
|
components: { PageTitle },
|
|
|
data() {
|
|
@@ -135,8 +115,10 @@ export default {
|
|
|
type: null,
|
|
|
model: null,
|
|
|
capacityId: null,
|
|
|
+ capacityNumber: null,
|
|
|
loadPoint: null,
|
|
|
unloadPoint: null,
|
|
|
+ count: null,
|
|
|
options: [
|
|
|
{
|
|
|
value: '甲'
|
|
@@ -146,6 +128,9 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
value: '丙'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: '丁'
|
|
|
}
|
|
|
],
|
|
|
options1: [
|
|
@@ -203,15 +188,14 @@ export default {
|
|
|
value: 'Φ40'
|
|
|
}
|
|
|
],
|
|
|
- tableTop: [
|
|
|
- {
|
|
|
- prop: 'capacityNumber',
|
|
|
- label: '车牌号'
|
|
|
- }
|
|
|
- ],
|
|
|
- selectionList: [],
|
|
|
+ optionsCapacity: [],
|
|
|
optionsLoad: [],
|
|
|
- optionsUnload: []
|
|
|
+ optionsUnload: [],
|
|
|
+ capacityIds: [],
|
|
|
+ first: {
|
|
|
+ // first请求数据的地址
|
|
|
+ requestUrl: ''
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -220,6 +204,18 @@ export default {
|
|
|
this.getUnloadPoint()
|
|
|
this.getCapacity()
|
|
|
},
|
|
|
+ created() {
|
|
|
+ if (
|
|
|
+ getCookie('orgCode') == 'dagangadmin' ||
|
|
|
+ getCookie('orgCode') == 'zidonghuabu'
|
|
|
+ ) {
|
|
|
+ this.first.requestUrl = '/api/v1/ams/getBilletRequirementList?apiId=518'
|
|
|
+ } else {
|
|
|
+ this.first.requestUrl =
|
|
|
+ '/api/v1/ams/getBilletRequirementList?apiId=518&orgCode=' +
|
|
|
+ getCookie('orgCode')
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
resetCapacity() {
|
|
|
this.getCapacity()
|
|
@@ -270,42 +266,69 @@ export default {
|
|
|
.then(res => {
|
|
|
if (res.data.code == '200') {
|
|
|
//过滤
|
|
|
- this.selectionList = res.data.data.list
|
|
|
+ let arr = []
|
|
|
+ // this.selectionList = res.data.data.list
|
|
|
+ res.data.data.list.forEach(e => {
|
|
|
+ let map = {}
|
|
|
+ map.capacityNumber = e.capacityNumber
|
|
|
+ map.capacityId = e.capacityId
|
|
|
+ arr.push(map)
|
|
|
+ })
|
|
|
+ this.optionsCapacity = Array.from(arr)
|
|
|
+ console.log(this.optionsCapacity)
|
|
|
+ // console.log(Array.from(this.optionsCapacity))
|
|
|
// console.log(res.data.data.list)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
// 新增
|
|
|
makeSure() {
|
|
|
+ let capacityList = []
|
|
|
+ this.capacityIds.forEach(e => {
|
|
|
+ let map = {}
|
|
|
+ map.capacityId = e
|
|
|
+ capacityList.push(map)
|
|
|
+ })
|
|
|
let map = {
|
|
|
requirementShipperId: this.requireUnitId,
|
|
|
heatNo: this.heatNo,
|
|
|
requirementType: '计重',
|
|
|
clazz: this.clazz,
|
|
|
- requirementType: this.type,
|
|
|
+ type: this.type,
|
|
|
model: this.model,
|
|
|
requirementPlatformId: this.loadPoint,
|
|
|
requirementUnloadUnitId: this.unloadPoint,
|
|
|
- capacityList: this.selectionList
|
|
|
+ capacityList: capacityList,
|
|
|
+ count: this.count,
|
|
|
+ orgCode: getCookie('orgCode')
|
|
|
}
|
|
|
console.log('map:', map)
|
|
|
if (
|
|
|
- !map.requireUnitId ||
|
|
|
+ !map.requirementShipperId ||
|
|
|
!map.heatNo ||
|
|
|
!map.requirementType ||
|
|
|
!map.clazz ||
|
|
|
!map.type ||
|
|
|
!map.model ||
|
|
|
- !map.loadPoint ||
|
|
|
- !map.unloadPoint ||
|
|
|
+ !map.requirementPlatformId ||
|
|
|
+ !map.requirementUnloadUnitId ||
|
|
|
+ !map.count ||
|
|
|
map.capacityList.length <= 0
|
|
|
) {
|
|
|
this.$message.warning('每项都为必填!')
|
|
|
return
|
|
|
}
|
|
|
+ if (!isNumber(map.count)) {
|
|
|
+ this.$message.error('支数不为整数!')
|
|
|
+ return
|
|
|
+ } else if (map.count > 25) {
|
|
|
+ this.$message.error('支数必须小于等于25支')
|
|
|
+ return
|
|
|
+ }
|
|
|
//提交
|
|
|
- this.axios.post('', map).then(res => {
|
|
|
+ this.axios.post('/api/v1/ams/addBilletRequirement', map).then(res => {
|
|
|
if (res.data.code == '200') {
|
|
|
+ this.$message.success('派发成功!')
|
|
|
}
|
|
|
})
|
|
|
},
|