|
@@ -1,76 +1,131 @@
|
|
<template>
|
|
<template>
|
|
<a-modal
|
|
<a-modal
|
|
title="新增"
|
|
title="新增"
|
|
- :width="800"
|
|
|
|
|
|
+ :width="1400"
|
|
:visible="visible"
|
|
:visible="visible"
|
|
:confirmLoading="confirmLoading"
|
|
:confirmLoading="confirmLoading"
|
|
@cancel="handleCancel"
|
|
@cancel="handleCancel"
|
|
>
|
|
>
|
|
- <a-form :form="form">
|
|
|
|
- <row-list :col="1" v-show="false">
|
|
|
|
- <row-item>
|
|
|
|
- <a-form-item>
|
|
|
|
- <a-input v-decorator="['id']" type="hidden"/>
|
|
|
|
- <a-input v-decorator="['sbId']" type="hidden"/>
|
|
|
|
- </a-form-item>
|
|
|
|
- </row-item>
|
|
|
|
- </row-list>
|
|
|
|
- <a-row type="flex">
|
|
|
|
- <a-col :sm="20" >
|
|
|
|
- <a-form-item
|
|
|
|
- label="采购计划名称"
|
|
|
|
- :labelCol="BaseTool.Constant.labelCol"
|
|
|
|
- :wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
|
- >
|
|
|
|
- <a-input v-decorator="['name', {rules: [{required: true, message: '采购计划名称不能为空'}]}]" />
|
|
|
|
- </a-form-item>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col :sm="20" >
|
|
|
|
- <a-form-item
|
|
|
|
- label="采购计划类型"
|
|
|
|
- :labelCol="BaseTool.Constant.labelCol"
|
|
|
|
- :wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
|
- >
|
|
|
|
- <a-select v-decorator="['type', { rules: [{required: true, message: '任务等级不能为空'}]}]" placeholder="请选择">
|
|
|
|
- <a-select-option
|
|
|
|
- v-for="(label,value) in typeMap"
|
|
|
|
- :key="value"
|
|
|
|
- :label="label"
|
|
|
|
- :value="label">{{ label }}
|
|
|
|
- </a-select-option>
|
|
|
|
- </a-select>
|
|
|
|
- </a-form-item>
|
|
|
|
- </a-col>
|
|
|
|
-
|
|
|
|
- <a-col :sm="20" >
|
|
|
|
- <a-form-item
|
|
|
|
- label="设备名称"
|
|
|
|
- :labelCol="BaseTool.Constant.labelCol"
|
|
|
|
- :wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
|
- >
|
|
|
|
- <a-input
|
|
|
|
- style="width: 70%"
|
|
|
|
- disabled
|
|
|
|
- v-decorator="['sbName', {rules: [{required: true, message: '设备名称不能为空'}]}]" />
|
|
|
|
- <a-button style="width: 30%" type="primary" @click="handleSbSelect">选择</a-button>
|
|
|
|
- </a-form-item>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col :sm="20" >
|
|
|
|
- <a-form-item
|
|
|
|
- label="备注"
|
|
|
|
- :labelCol="BaseTool.Constant.labelCol"
|
|
|
|
- :wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
|
- >
|
|
|
|
- <a-input
|
|
|
|
- v-decorator="['remark']"/>
|
|
|
|
- </a-form-item>
|
|
|
|
- </a-col>
|
|
|
|
- </a-row>
|
|
|
|
- </a-form>
|
|
|
|
|
|
+ <a-steps :current="current" style="width:400px;margin:20px auto;">
|
|
|
|
+ <a-step title="基本信息" />
|
|
|
|
+ <a-step title="物料明细" />
|
|
|
|
+ </a-steps>
|
|
|
|
+ <a-card v-show="current===0">
|
|
|
|
+ <a-form :form="form">
|
|
|
|
+ <row-list :col="1" v-show="false">
|
|
|
|
+ <row-item>
|
|
|
|
+ <a-form-item>
|
|
|
|
+ <!-- <a-input v-decorator="['id']" type="hidden"/> -->
|
|
|
|
+ <a-input v-decorator="['sbId']" type="hidden"/>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </row-item>
|
|
|
|
+ </row-list>
|
|
|
|
+ <a-row type="flex">
|
|
|
|
+ <a-col :sm="20" >
|
|
|
|
+ <a-form-item
|
|
|
|
+ label="采购计划名称"
|
|
|
|
+ :labelCol="BaseTool.Constant.labelCol"
|
|
|
|
+ :wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
|
+ >
|
|
|
|
+ <a-input v-decorator="['name', {rules: [{required: true, message: '采购计划名称不能为空'}]}]" />
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :sm="20" >
|
|
|
|
+ <a-form-item
|
|
|
|
+ label="采购计划类型"
|
|
|
|
+ :labelCol="BaseTool.Constant.labelCol"
|
|
|
|
+ :wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
|
+ >
|
|
|
|
+ <a-select v-decorator="['type', { rules: [{required: true, message: '任务等级不能为空'}]}]" placeholder="请选择">
|
|
|
|
+ <a-select-option
|
|
|
|
+ v-for="(label,value) in typeMap"
|
|
|
|
+ :key="value"
|
|
|
|
+ :label="label"
|
|
|
|
+ :value="parseInt(value)">{{ label }}
|
|
|
|
+ </a-select-option>
|
|
|
|
+ </a-select>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :sm="20" >
|
|
|
|
+ <a-form-item
|
|
|
|
+ label="厂区"
|
|
|
|
+ :labelCol="BaseTool.Constant.labelCol"
|
|
|
|
+ :wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
|
+ >
|
|
|
|
+ <a-select v-decorator="['oldOrNew', {rules: [{required: true, message: '厂区不能为空'}]}]" >
|
|
|
|
+ <a-select-option
|
|
|
|
+ v-for="(label,value) in flagMap"
|
|
|
|
+ :key="value"
|
|
|
|
+ :label="label"
|
|
|
|
+ :value="parseInt(value)">{{ label }}
|
|
|
|
+ </a-select-option>
|
|
|
|
+ </a-select>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :sm="20" >
|
|
|
|
+ <a-form-item
|
|
|
|
+ label="设备位号"
|
|
|
|
+ :labelCol="BaseTool.Constant.labelCol"
|
|
|
|
+ :wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
|
+ >
|
|
|
|
+ <a-input
|
|
|
|
+ style="width: 70%"
|
|
|
|
+ disabled
|
|
|
|
+ v-decorator="['positionNo', {rules: [{required: true, message: '设备名称不能为空'}]}]" />
|
|
|
|
+ <a-button style="width: 30%" type="primary" @click="handleSbSelect">选择</a-button>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :sm="20" >
|
|
|
|
+ <a-form-item
|
|
|
|
+ label="备注"
|
|
|
|
+ :labelCol="BaseTool.Constant.labelCol"
|
|
|
|
+ :wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
|
+ >
|
|
|
|
+ <a-input
|
|
|
|
+ v-decorator="['remark']"/>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ </a-row>
|
|
|
|
+ </a-form>
|
|
|
|
+ </a-card>
|
|
|
|
+ <a-card v-show="current===1">
|
|
|
|
+ <div class="table-operator" style="margin-bottom: 8px;">
|
|
|
|
+ <a-button size="small" type="primary" @click="handleSpareStoreSelect">
|
|
|
|
+ <a-icon type="plus"/>
|
|
|
|
+ 物料库添加
|
|
|
|
+ </a-button>
|
|
|
|
+ <a-button size="small" style="margin-left:20px;" type="primary" @click="handleBomSpareStoreSelect">
|
|
|
|
+ <a-icon type="plus"/>
|
|
|
|
+ BOM添加
|
|
|
|
+ </a-button>
|
|
|
|
+ </div>
|
|
|
|
+ <a-table
|
|
|
|
+ bordered
|
|
|
|
+ :data-source="data"
|
|
|
|
+ :columns="columns"
|
|
|
|
+ tableLayout="auto"
|
|
|
|
+ rowKey="id"
|
|
|
|
+ >
|
|
|
|
+ <template slot="num" slot-scope="text, record">
|
|
|
|
+ <a-input v-model="record.num" />
|
|
|
|
+ </template>
|
|
|
|
+ <span slot="action" slot-scope="record">
|
|
|
|
+ <template>
|
|
|
|
+ <a-popconfirm title="是否要删除该条数据?" @confirm="handleDelOne(record)">
|
|
|
|
+ <a>删除</a>
|
|
|
|
+ </a-popconfirm>
|
|
|
|
+ </template>
|
|
|
|
+ </span>
|
|
|
|
+ </a-table>
|
|
|
|
+ </a-card>
|
|
<template slot="footer">
|
|
<template slot="footer">
|
|
- <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
|
|
|
|
|
|
+ <a-button v-show="current===0" type="primary" @click="next()">下一步</a-button>
|
|
|
|
+ <a-button v-show="current===1" type="primary" @click="back()">上一步</a-button>
|
|
|
|
+ <a-button v-show="current===1" :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
|
|
</template>
|
|
</template>
|
|
<sb-info-select-modal ref="sbInfoSelectModal" @selected="handleSbSelectd"/>
|
|
<sb-info-select-modal ref="sbInfoSelectModal" @selected="handleSbSelectd"/>
|
|
|
|
+ <spare-store-select-modal ref="spareStoreSelectModal" @selected="handleSpareStoreSelected"/>
|
|
|
|
+ <BomSpareStoreSelectModal ref="bomSpareStoreSelectModal" @selected="handleSpareStoreSelected"/>
|
|
|
|
|
|
</a-modal>
|
|
</a-modal>
|
|
</template>
|
|
</template>
|
|
@@ -79,28 +134,87 @@
|
|
import { addPurchaseOrder2 } from '@/api/purchase/purchase-order'
|
|
import { addPurchaseOrder2 } from '@/api/purchase/purchase-order'
|
|
|
|
|
|
import SbInfoSelectModal from './SbInfoSelectModal'
|
|
import SbInfoSelectModal from './SbInfoSelectModal'
|
|
|
|
+import SpareStoreSelectModal from '@/views/store/sparestore/modules/SpareStoreSelectModalYY.vue'
|
|
|
|
+import BomSpareStoreSelectModal from './SpareStoreSelectModalYY.vue'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: 'BaseFillGather',
|
|
name: 'BaseFillGather',
|
|
|
|
+ components: {
|
|
|
|
+ SpareStoreSelectModal,
|
|
|
|
+ SbInfoSelectModal,
|
|
|
|
+ BomSpareStoreSelectModal
|
|
|
|
+
|
|
|
|
+ },
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
form: this.$form.createForm(this),
|
|
form: this.$form.createForm(this),
|
|
visible: false,
|
|
visible: false,
|
|
|
|
+ current: 0,
|
|
|
|
+ data: [],
|
|
|
|
+ columns: [
|
|
|
|
+ {
|
|
|
|
+ title: '序号',
|
|
|
|
+ dataIndex: 'index',
|
|
|
|
+ customRender: (text, record, index) => {
|
|
|
|
+ return index + 1
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '名称',
|
|
|
|
+ dataIndex: 'spareName'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '编号',
|
|
|
|
+ dataIndex: 'no'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '规格',
|
|
|
|
+ dataIndex: 'ggxh'
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ {
|
|
|
|
+ title: '采购数量',
|
|
|
|
+ dataIndex: 'num',
|
|
|
|
+ width: 150,
|
|
|
|
+ scopedSlots: { customRender: 'num' }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '库存',
|
|
|
|
+ dataIndex: 'storeNum',
|
|
|
|
+ width: 150
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ {
|
|
|
|
+ title: '仓库',
|
|
|
|
+ dataIndex: 'storeName'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '货架号',
|
|
|
|
+ dataIndex: 'storePosition'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '操作',
|
|
|
|
+ key: 'action',
|
|
|
|
+ align: 'center',
|
|
|
|
+ scopedSlots: { customRender: 'action' }
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
typeMap: {},
|
|
typeMap: {},
|
|
ipqcMap: [],
|
|
ipqcMap: [],
|
|
|
|
+ flagMap: {},
|
|
model: {},
|
|
model: {},
|
|
sbIds: [],
|
|
sbIds: [],
|
|
rows: [],
|
|
rows: [],
|
|
sortNums: [],
|
|
sortNums: [],
|
|
|
|
+ params: {},
|
|
directorMap: [],
|
|
directorMap: [],
|
|
infoNum: 0,
|
|
infoNum: 0,
|
|
confirmLoading: false
|
|
confirmLoading: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- components: {
|
|
|
|
- SbInfoSelectModal
|
|
|
|
- },
|
|
|
|
|
|
+
|
|
created () {
|
|
created () {
|
|
|
|
+ this.flagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PROJECT_NEW_AND_OLD)
|
|
this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.LONG_YAN_PURCHASE_TYPE)
|
|
this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.LONG_YAN_PURCHASE_TYPE)
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -122,11 +236,22 @@ export default {
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
setFieldsValue(Object.assign({
|
|
setFieldsValue(Object.assign({
|
|
'sbId': key,
|
|
'sbId': key,
|
|
- 'sbName': row.name
|
|
|
|
|
|
+ 'positionNo': row.positionNo
|
|
}))
|
|
}))
|
|
})
|
|
})
|
|
},
|
|
},
|
|
save () {
|
|
save () {
|
|
|
|
+ const params = {
|
|
|
|
+ ...this.params,
|
|
|
|
+ detailDTOS: this.data
|
|
|
|
+ }
|
|
|
|
+ console.log(params)
|
|
|
|
+ addPurchaseOrder2(params).then(res => {
|
|
|
|
+ this.$message.success('创建成功!')
|
|
|
|
+ this.handleCancel()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ next () {
|
|
const { form: { validateFieldsAndScroll } } = this
|
|
const { form: { validateFieldsAndScroll } } = this
|
|
// this.confirmLoading = true
|
|
// this.confirmLoading = true
|
|
validateFieldsAndScroll((errors, values) => {
|
|
validateFieldsAndScroll((errors, values) => {
|
|
@@ -135,14 +260,49 @@ export default {
|
|
this.$message.error(item.errors[0].message)
|
|
this.$message.error(item.errors[0].message)
|
|
})
|
|
})
|
|
this.confirmLoading = false
|
|
this.confirmLoading = false
|
|
|
|
+ return
|
|
}
|
|
}
|
|
- addPurchaseOrder2(values).then(res => {
|
|
|
|
- this.$message.success('创建成功!')
|
|
|
|
- })
|
|
|
|
|
|
+ this.params = values
|
|
|
|
+ this.current = 1
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ back () {
|
|
|
|
+ this.current = 0
|
|
|
|
+ },
|
|
|
|
+ handleSpareStoreSelect () {
|
|
|
|
+ this.$refs.spareStoreSelectModal.base({ tokenType: this.params.oldOrNew })
|
|
|
|
+ },
|
|
|
|
+ handleBomSpareStoreSelect () {
|
|
|
|
+ this.$refs.bomSpareStoreSelectModal.base({ tokenType: this.params.oldOrNew, sbId: this.params.sbId })
|
|
|
|
+ },
|
|
|
|
+ handleSpareStoreSelected (record, keys, rows) {
|
|
|
|
+ console.log(rows)
|
|
|
|
+ const { data } = this
|
|
|
|
+ for (let i = 0; i < rows.length; i++) {
|
|
|
|
+ let find = false
|
|
|
|
+ for (let j = 0; j < data.length; j++) {
|
|
|
|
+ if (rows[i].autoId === data[j].autoId) {
|
|
|
|
+ find = true
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (!find) {
|
|
|
|
+ const selectData = rows[i]
|
|
|
|
+ selectData.storeNum = selectData.num
|
|
|
|
+ selectData.num = 1
|
|
|
|
+ data.push(selectData)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ handleDelOne (record) {
|
|
|
|
+ const data = [...this.data]
|
|
|
|
+ this.data = data.filter(item => record.autoId !== item.autoId)
|
|
|
|
+ },
|
|
handleCancel (values) {
|
|
handleCancel (values) {
|
|
this.visible = false
|
|
this.visible = false
|
|
|
|
+ this.current = 0
|
|
|
|
+ this.data = []
|
|
|
|
+ this.params = {}
|
|
this.form.resetFields()
|
|
this.form.resetFields()
|
|
this.sbIds = []
|
|
this.sbIds = []
|
|
this.$emit('ok', values)
|
|
this.$emit('ok', values)
|