|
@@ -2,44 +2,25 @@
|
|
<div>
|
|
<div>
|
|
<el-dialog
|
|
<el-dialog
|
|
title="标签打印"
|
|
title="标签打印"
|
|
- width="70%"
|
|
|
|
|
|
+ width="50%"
|
|
:close-on-click-modal="false"
|
|
:close-on-click-modal="false"
|
|
:visible.sync="visible">
|
|
:visible.sync="visible">
|
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="auto">
|
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="auto">
|
|
- <el-row class="my-row">
|
|
|
|
- <el-col :span="8">
|
|
|
|
- <el-form-item label="物料名称" prop="productName">
|
|
|
|
- <el-input v-model="dataForm.productName" placeholder="物料名称"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="8" style="padding-left: 10px">
|
|
|
|
- <el-form-item label="税率" prop="rate">
|
|
|
|
- <el-input-number style="width: 160px" v-model="dataForm.rate" :step="1" :precision="1"/> %
|
|
|
|
- </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="1" :step="1" :min="1"></el-input-number>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="8" style="padding-left: 10px">
|
|
|
|
- <el-form-item label="数量" prop="cnt">
|
|
|
|
- <el-input-number v-model="dataForm.cnt" :min="1" :step="1"></el-input-number>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="8" style="padding-left: 10px">
|
|
|
|
- <el-form-item label="含税总价" prop="amount">
|
|
|
|
- <span>{{ (dataForm.cnt * dataForm.price).toFixed(1) }}</span>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
- <el-row>
|
|
|
|
- <el-form-item label="备注" prop="notes">
|
|
|
|
- <el-input type="textarea" v-model="dataForm.notes"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-row>
|
|
|
|
|
|
+ <el-form-item label="名称" prop="materialName">
|
|
|
|
+ <el-input v-model="dataForm.materialName" placeholder="名称"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="图号" prop="mapNumber">
|
|
|
|
+ <el-input v-model="dataForm.mapNumber" placeholder="图号"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="规格" prop="productSpec">
|
|
|
|
+ <el-input v-model="dataForm.productSpec" placeholder="规格"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="批次" prop="materialName">
|
|
|
|
+ <el-input v-model="dataForm.materialName" placeholder="批次"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="数量" prop="cnt">
|
|
|
|
+ <el-input-number v-model="dataForm.cnt" :min="1" label="数量"></el-input-number>
|
|
|
|
+ </el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<span slot="footer">
|
|
<span slot="footer">
|
|
<el-button @click="onChose">取消</el-button>
|
|
<el-button @click="onChose">取消</el-button>
|
|
@@ -55,27 +36,14 @@ export default {
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
visible: false,
|
|
visible: false,
|
|
- isAdd: false,
|
|
|
|
- dataForm: {
|
|
|
|
- cnt: 1,
|
|
|
|
- price: 1,
|
|
|
|
- rate: 1
|
|
|
|
- },
|
|
|
|
- dataRule: {
|
|
|
|
- productName: [{ required: true, message: '物料名称不能为空', trigger: 'blur' }],
|
|
|
|
- cnt: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
|
|
|
|
- price: [{ required: true, message: '含税单价不能为空', trigger: 'blur' }],
|
|
|
|
- rate: [{ required: true, message: '税率不能为空', trigger: 'blur' }]
|
|
|
|
- }
|
|
|
|
|
|
+ dataForm: { },
|
|
|
|
+ dataRule: { }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
async init (row) {
|
|
async init (row) {
|
|
|
|
+ console.log(JSON.stringify(row))
|
|
this.visible = true
|
|
this.visible = true
|
|
- if (!row) {
|
|
|
|
- this.isAdd = true
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
this.dataForm = row
|
|
this.dataForm = row
|
|
},
|
|
},
|
|
validateField (type) {
|
|
validateField (type) {
|
|
@@ -88,14 +56,9 @@ export default {
|
|
dataFormSubmit () {
|
|
dataFormSubmit () {
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- if (this.isAdd === true) {
|
|
|
|
- // console.log('1')
|
|
|
|
- this.dataForm.productId = Math.round(Math.random() * 1000000)
|
|
|
|
- }
|
|
|
|
- // 计算含税总价
|
|
|
|
- this.dataForm.amount = (this.dataForm.cnt * this.dataForm.price).toFixed(1)
|
|
|
|
|
|
+ // 打印
|
|
|
|
+ // todo
|
|
this.onChose()
|
|
this.onChose()
|
|
- this.$emit('changeItem', this.dataForm)
|
|
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|