|
@@ -1,28 +1,34 @@
|
|
|
<template>
|
|
|
<el-dialog
|
|
|
- title="查看模板出库"
|
|
|
+ :title="!id ? '新增': display ? '查看' : '出库'"
|
|
|
width="70%"
|
|
|
:close-on-click-modal="false"
|
|
|
:visible.sync="visible">
|
|
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="auto">
|
|
|
<el-row class="my-row">
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="编码">
|
|
|
- <el-input v-model="dataForm.code" placeholder="编码"></el-input>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="模板出库编码" prop="recordCode">
|
|
|
+ <el-input v-model="dataForm.recordCode" :disabled="true" placeholder="模板出库编码"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12" style="padding-left: 20px">
|
|
|
- <el-form-item label="模板">
|
|
|
- <el-input v-model="dataForm.code" placeholder="模板"></el-input>
|
|
|
+ <el-col :span="8" style="padding-left: 20px">
|
|
|
+ <el-form-item label="产品编号" prop="recordNumber">
|
|
|
+ <el-input v-model="dataForm.recordNumber" :disabled="true" placeholder="产品编号"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8" style="padding-left: 20px">
|
|
|
+ <el-form-item label="模板名称" prop="templateName">
|
|
|
+ <el-input v-model="dataForm.templateName" :disabled="true" placeholder="模板名称"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row class="my-row">
|
|
|
- <el-form-item label="备注">
|
|
|
- <el-input v-model="dataForm.code" placeholder="备注"></el-input>
|
|
|
+ <el-form-item label="备注说明" prop="notes">
|
|
|
+ <el-input v-model="dataForm.notes" :disabled="true" placeholder="备注说明"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
+ <div class="title"><span style="color: red">*</span> 模板对应的零件</div>
|
|
|
<el-table
|
|
|
:data="dataList"
|
|
|
border
|
|
@@ -34,49 +40,69 @@
|
|
|
align="center">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="-"
|
|
|
+ prop="materialName"
|
|
|
header-align="center"
|
|
|
align="center"
|
|
|
label="物品名称">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="recordType"
|
|
|
+ prop="specifications"
|
|
|
header-align="center"
|
|
|
align="center"
|
|
|
label="规格">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="state"
|
|
|
+ prop="planCnt"
|
|
|
header-align="center"
|
|
|
align="center"
|
|
|
- label="数量">
|
|
|
+ label="计划数量">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="approver"
|
|
|
+ prop="unitName"
|
|
|
header-align="center"
|
|
|
align="center"
|
|
|
label="单位">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="-"
|
|
|
+ prop="cnt"
|
|
|
header-align="center"
|
|
|
align="center"
|
|
|
label="仓库库存数量">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="-"
|
|
|
+ v-if="display"
|
|
|
+ prop="deliveredCnt"
|
|
|
+ header-align="center"
|
|
|
+ align="center"
|
|
|
+ label="已出库">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ v-if="!display"
|
|
|
+ :key="display"
|
|
|
+ prop="planCntUser"
|
|
|
header-align="center"
|
|
|
align="center"
|
|
|
label="请选择数量">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input-number v-model="scope.row.planCntUser" :min="1" style="width: 140px;"/>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="-"
|
|
|
+ v-if="!display"
|
|
|
+ prop="undeliveredCnt"
|
|
|
header-align="center"
|
|
|
align="center"
|
|
|
label="未出库数量">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="-"
|
|
|
+ v-if="display"
|
|
|
+ prop="batchName"
|
|
|
+ header-align="center"
|
|
|
+ align="center"
|
|
|
+ label="选择零件的批次和数量">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="notes"
|
|
|
header-align="center"
|
|
|
align="center"
|
|
|
label="备注">
|
|
@@ -85,65 +111,56 @@
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="visible = false">取消</el-button>
|
|
|
- <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
|
|
+ <el-button v-if="!display" @click="visible = false">取消</el-button>
|
|
|
+ <el-button v-if="!display" type="primary" @click="dataFormSubmit()">确定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import UserComponent from '../common/user-component'
|
|
|
- import DictSelect from '../sys/dict-select'
|
|
|
- import {getUUID} from '../../../utils'
|
|
|
+ import {getDeliveryDetail, templateOut} from '@/api/warehouse'
|
|
|
export default {
|
|
|
- name: 'stock-order-inbound',
|
|
|
- components: {DictSelect, UserComponent},
|
|
|
+ name: 'template-delivery-detail',
|
|
|
data () {
|
|
|
return {
|
|
|
visible: false,
|
|
|
- dictType: 'material_type',
|
|
|
+ display: false,
|
|
|
dataList: [],
|
|
|
- dataForm: {
|
|
|
- id: '',
|
|
|
- amount: 0,
|
|
|
- applicant: ''
|
|
|
- },
|
|
|
+ id: 0,
|
|
|
+ dataForm: { },
|
|
|
dataRule: {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- init () {
|
|
|
+ async init (id, display) {
|
|
|
this.visible = true
|
|
|
- this.dataForm.code = getUUID()
|
|
|
+ this.id = id || 0
|
|
|
+ this.display = display
|
|
|
+ this.dataForm = {}
|
|
|
+ this.dataList = []
|
|
|
+ if (!id) return
|
|
|
+ // 获取详情
|
|
|
+ await getDeliveryDetail(this.id).then(({data}) => {
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.dataForm = data.data
|
|
|
+ if (data.data.whTemplateItemPlanList) {
|
|
|
+ data.data.whTemplateItemPlanList.forEach((item) => {
|
|
|
+ this.dataList.push(item)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
// 表单提交
|
|
|
dataFormSubmit () {
|
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- this.$http({
|
|
|
- url: this.$http.adornUrl(`/biz-service/in-out-bound-ctl/inbound`),
|
|
|
- method: 'post',
|
|
|
- data: this.$http.adornData({
|
|
|
- 'amount': this.dataForm.amount,
|
|
|
- 'applicant': this.dataForm.applicant,
|
|
|
- 'approver': this.dataForm.approver,
|
|
|
- 'batchNumber': this.dataForm.batchNumber,
|
|
|
- 'cnt': this.dataForm.cnt,
|
|
|
- 'materialId': this.dataForm.materialId,
|
|
|
- 'materialName': this.dataForm.materialName,
|
|
|
- 'notes': this.dataForm.notes,
|
|
|
- 'price': this.dataForm.price,
|
|
|
- 'orgId': this.dataForm.orgId,
|
|
|
- 'recordType': this.dataForm.recordType,
|
|
|
- 'source': this.dataForm.source,
|
|
|
- 'state': this.dataForm.state,
|
|
|
- 'templateItemPlanId': this.dataForm.templateItemPlanId,
|
|
|
- 'usage': this.dataForm.usage,
|
|
|
- 'userId': this.dataForm.userId,
|
|
|
- 'creatorId': this.$store.state.user.id
|
|
|
- })
|
|
|
- }).then(({data}) => {
|
|
|
+ let params = {
|
|
|
+ 'recordId': this.id,
|
|
|
+ 'whTemplateItemPlanList': this.dataList
|
|
|
+ }
|
|
|
+ templateOut(params).then(({data}) => {
|
|
|
if (data && data.code === '200') {
|
|
|
this.$message({
|
|
|
message: '操作成功',
|
|
@@ -163,19 +180,6 @@
|
|
|
},
|
|
|
validateField (type) {
|
|
|
this.$refs.dataForm.validateField(type)
|
|
|
- },
|
|
|
- userChanged (userId) {
|
|
|
- this.$http({
|
|
|
- url: this.$http.adornUrl('/user-service/user/info/' + userId),
|
|
|
- method: 'get'
|
|
|
- }).then(({data}) => {
|
|
|
- if (data && data.code === '200') {
|
|
|
- this.dataForm.orgId = data.data.orgId
|
|
|
- this.dataForm.orgName = data.data.orgName
|
|
|
- } else {
|
|
|
- this.$message.error(data.msg)
|
|
|
- }
|
|
|
- })
|
|
|
}
|
|
|
}
|
|
|
}
|