|
@@ -1,86 +1,102 @@
|
|
|
<template>
|
|
|
<el-dialog
|
|
|
- title="入库"
|
|
|
+ title="入库申请"
|
|
|
+ width="80%"
|
|
|
:close-on-click-modal="false"
|
|
|
:visible.sync="visible">
|
|
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="auto">
|
|
|
<el-row class="my-row">
|
|
|
- <el-form-item label="编码" prop="code">
|
|
|
- <el-input v-model="dataForm.code" placeholder="缺字段"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-row>
|
|
|
- <el-row class="my-row">
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="名称" prop="materialName">
|
|
|
- <el-input v-model="dataForm.materialName" placeholder="请填写名称"></el-input>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="编码" prop="code">
|
|
|
+ <el-input v-model="dataForm.code" placeholder="缺字段"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8" style="padding-left: 20px">
|
|
|
+ <el-col :span="6" style="padding-left: 20px">
|
|
|
<el-form-item label="入库申请人" prop="userId">
|
|
|
<user-component v-model="dataForm.userId" @userSelected="userChanged"></user-component>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8" style="padding-left: 20px">
|
|
|
+ <el-col :span="6" style="padding-left: 20px">
|
|
|
<el-form-item label="申请人部门" prop="orgId">
|
|
|
<el-input :disabled="true" v-model="dataForm.orgName" placeholder="请选择入库申请人"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-row class="my-row">
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="单位" prop="unitName">
|
|
|
- <el-input v-model="dataForm.unitName" placeholder="缺字段"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8" style="padding-left: 20px">
|
|
|
- <el-form-item label="类别" prop="cateId">
|
|
|
- <dict-select v-model:dict-id="dataForm.cateId" v-bind:dict-type="dictType"/>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8" style="padding-left: 20px">
|
|
|
- <el-form-item label="规格" prop="specifications">
|
|
|
- <el-input v-model="dataForm.specifications" placeholder="缺字段"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row class="my-row">
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="单价" prop="price">
|
|
|
- <el-input-number v-model="dataForm.price" :precision="2" :min="0.00" :step="0.1"></el-input-number>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8" style="padding-left: 20px">
|
|
|
- <el-form-item label="数量" prop="cnt">
|
|
|
- <el-input-number v-model="dataForm.cnt" :min="0"></el-input-number>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8" style="padding-left: 20px">
|
|
|
- <el-form-item label="金额" prop="amount">
|
|
|
- <el-input :disabled="true" v-model="dataForm.price * dataForm.cnt"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row class="my-row">
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="批次号" prop="batchNumber">
|
|
|
- <el-input v-model="dataForm.batchNumber" placeholder="请填写入库物品(零件)批次"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8" style="padding-left: 20px">
|
|
|
- <el-form-item label="来源" prop="source">
|
|
|
- <el-input v-model="dataForm.source" placeholder="来源"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8" style="padding-left: 20px">
|
|
|
- <el-form-item label="是否换算" prop="transfer">
|
|
|
- <el-input v-model="dataForm.transfer" placeholder="缺字段"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-form-item label="备注" prop="notes">
|
|
|
- <el-input v-model="dataForm.notes" placeholder="备注"></el-input>
|
|
|
- </el-form-item>
|
|
|
+ <template v-for="(item, index) in dataForm">
|
|
|
+ <div :key="index" class="my-line">
|
|
|
+ <el-row class="my-row">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="名称" prop="materialName">
|
|
|
+ <el-input v-model="item.materialName" placeholder="请填写名称"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8" style="padding-left: 20px">
|
|
|
+ <el-form-item label="批次号" prop="batchNumber">
|
|
|
+ <el-input v-model="item.batchNumber" placeholder="请填写入库物品(零件)批次"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8" style="text-align: right;">
|
|
|
+ <el-button @click="removeOne(index)" type="danger" icon="el-icon-delete" circle style="padding: 6px"></el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="my-row">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="单位" prop="unitName">
|
|
|
+ <el-input v-model="item.unitName" placeholder="缺字段"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8" style="padding-left: 20px">
|
|
|
+ <el-form-item label="类别" prop="cateId">
|
|
|
+ <dict-select :dict-id="item.cateId" v-bind:dict-type="dictType"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8" style="padding-left: 20px">
|
|
|
+ <el-form-item label="规格" prop="specifications">
|
|
|
+ <el-input v-model="item.specifications" placeholder="缺字段"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="my-row">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="单价" prop="price">
|
|
|
+ <el-input-number v-model="item.price" :precision="2" :min="0.00" :step="0.1"></el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8" style="padding-left: 20px">
|
|
|
+ <el-form-item label="数量" prop="cnt">
|
|
|
+ <el-input-number v-model="item.cnt" :min="0"></el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8" style="padding-left: 20px">
|
|
|
+ <el-form-item label="金额" prop="amount">
|
|
|
+ <span>{{ item.price * item.cnt }}</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="my-row">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="来源" prop="source">
|
|
|
+ <el-input v-model="item.source" placeholder="来源"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8" style="padding-left: 20px">
|
|
|
+ <el-form-item label="是否换算" prop="transfer">
|
|
|
+ <el-select v-model="item.transfer">
|
|
|
+ <el-option label="是" value="1"></el-option>
|
|
|
+ <el-option label="否" value="0"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-form-item label="备注" prop="notes">
|
|
|
+ <el-input v-model="item.notes" placeholder="备注"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <el-row style="text-align: center;">
|
|
|
+ <el-button type="primary" icon="el-icon-plus" @click="addOne"></el-button>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
@@ -101,7 +117,7 @@
|
|
|
return {
|
|
|
visible: false,
|
|
|
dictType: 'material_type',
|
|
|
- dataForm: {
|
|
|
+ dataForm: [{
|
|
|
id: '',
|
|
|
amount: 0,
|
|
|
applicant: '',
|
|
@@ -120,7 +136,7 @@
|
|
|
usage: '',
|
|
|
userId: '',
|
|
|
orgName: ''
|
|
|
- },
|
|
|
+ }],
|
|
|
dataRule: {
|
|
|
}
|
|
|
}
|
|
@@ -128,7 +144,37 @@
|
|
|
methods: {
|
|
|
init () {
|
|
|
this.visible = true
|
|
|
- this.dataForm.code = getUUID()
|
|
|
+ this.dataForm = []
|
|
|
+ this.addOne()
|
|
|
+ },
|
|
|
+ addOne () {
|
|
|
+ this.dataForm.push({
|
|
|
+ id: '',
|
|
|
+ code: getUUID(),
|
|
|
+ amount: 0,
|
|
|
+ applicant: '',
|
|
|
+ approver: '',
|
|
|
+ batchNumber: '',
|
|
|
+ cnt: '',
|
|
|
+ materialId: '',
|
|
|
+ materialName: '',
|
|
|
+ notes: '',
|
|
|
+ orgId: '',
|
|
|
+ price: '',
|
|
|
+ recordType: '',
|
|
|
+ source: '',
|
|
|
+ state: 0,
|
|
|
+ templateItemPlanId: '',
|
|
|
+ usage: '',
|
|
|
+ userId: '',
|
|
|
+ orgName: ''
|
|
|
+ })
|
|
|
+ },
|
|
|
+ removeOne (index) {
|
|
|
+ this.dataForm.splice(index, 1)
|
|
|
+ if (this.dataForm.length === 0) {
|
|
|
+ this.addOne()
|
|
|
+ }
|
|
|
},
|
|
|
// 表单提交
|
|
|
dataFormSubmit () {
|
|
@@ -195,5 +241,8 @@
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
-
|
|
|
+.my-line{
|
|
|
+ border-bottom: 1px solid #c0c4cc;
|
|
|
+ margin-bottom: 10px;
|
|
|
+}
|
|
|
</style>
|