132 lines
3.7 KiB
Plaintext
132 lines
3.7 KiB
Plaintext
<template>
|
|
<!-- 简单form模板 -->
|
|
<div>
|
|
<div style="margin-top: 20px" v-loading="pictLoading" element-loading-text="正在加载中">
|
|
<el-row >
|
|
<el-form :model="form" align="left" label-width="80px">
|
|
|
|
<el-col :span="12">
|
|
<el-form-item label="订单编号" prop="number">
|
|
<el-input readonly style="width: 95%" v-model="form.number" placeholder="" :disabled="true"/>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="数量" prop="qty">
|
|
<el-input-number v-model="form.qty" style="width: 95%" placeholder="数量" :min="1"/>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="起始位" prop="snPrefix">
|
|
<el-input style="width: 95%" v-model="form.snPrefix" placeholder="请输入起始位" >
|
|
|
|
</el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="流水码" prop="snWaterCode">
|
|
<el-input style="width: 95%" v-model="form.snWaterCode" placeholder="请输入流水码" >
|
|
|
|
</el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="后缀" prop="snSuffix">
|
|
<el-input style="width: 95%" v-model="form.snSuffix" placeholder="请输入后缀" >
|
|
|
|
</el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
</el-form>
|
|
</el-row>
|
|
<el-row style="text-align:right;margin-top:20px;" >
|
|
|
|
<el-button type="primary" @click="submitForm" >确 定</el-button>
|
|
<el-button @click="close" style="margin-right:20px;">取 消</el-button>
|
|
</el-row>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
|
|
|
|
|
|
export default {
|
|
name: "generateSerial",
|
|
props: {
|
|
layerid: {
|
|
type: String,
|
|
default: ''
|
|
},
|
|
row: {
|
|
type: Object,
|
|
default: undefined
|
|
},
|
|
formType: {
|
|
type: Number,
|
|
default: 0
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
rules: {
|
|
|
|
},
|
|
pictLoading: false,
|
|
form:{
|
|
id: undefined,
|
|
number: '',
|
|
qty:0,
|
|
snPrefix:"",
|
|
snWaterCode:"",
|
|
snSuffix:""
|
|
}
|
|
|
|
};
|
|
},
|
|
mounted() {
|
|
this.__init()
|
|
},
|
|
|
|
methods: {
|
|
async __init() {
|
|
console.log(this.row,'0922')
|
|
this.form.orderProdId=this.row.id
|
|
this.form.qty=this.row.planQty
|
|
this.form.number=this.row.number
|
|
this.form=JSON.parse(JSON.stringify(this.form))
|
|
},
|
|
close()
|
|
{
|
|
this.$layer.close(this.layerid);
|
|
},
|
|
submitForm()
|
|
{
|
|
this.$plan.generateSerial(this.form).then(resp=>{
|
|
if(resp.data.code==200)
|
|
{
|
|
this.$message.success('成功生成序列号!')
|
|
this.$layer.close(this.layerid);
|
|
}
|
|
else
|
|
{
|
|
this.$message.error(resp.data.msg || '操作失败!')
|
|
}
|
|
|
|
})
|
|
}
|
|
},
|
|
components: {
|
|
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="stylus" scoped>
|
|
|
|
</style>
|