| | |
| | | <template> |
| | | <win-md class="stock-edit" :title="`${setting.title}采购入库`" @close="close" :width="'800px'"> |
| | | <win-md class="stock-edit" :title="`${setting.title}采购入库`" @close="close" :width="'800px'" :loading="loading"> |
| | | <el-form class="form" ref="ruleForm" :model="formData" :rules="rules" label-width="120px"> |
| | | <div class="main-w"> |
| | | <el-row :gutter="24" class="headerHeight"> |
| | |
| | | }; |
| | | // 金额校验 |
| | | var checkPrice = (rule, value, callback) => { |
| | | console.log(value); |
| | | if (!value) { |
| | | return callback(new Error('请输入')); |
| | | } |
| | |
| | | }; |
| | | // 数量校验 |
| | | var checkCounts = (rule, value, callback) => { |
| | | console.log(value); |
| | | if (!value) { |
| | | return callback(new Error('请输入')); |
| | | } |
| | |
| | | callback(); |
| | | }; |
| | | return { |
| | | loading: false, |
| | | loading: true, |
| | | buyTypeOptions: [ |
| | | { |
| | | label: '集采', |
| | |
| | | title: '上传', |
| | | max: 20, // 最大大小,单位M |
| | | num: 10, // 支持上传图片个数 |
| | | accept: '.jpg,.png', // 限制格式 |
| | | tip: '', // 提示 默认:`只能上传${this.defaultSettings.num}个${this.defaultSettings.accept}文件,且不超过${this.defaultSettings.max}kb` |
| | | uploadUrl: getUploadUrl(), // 上传路径 |
| | | multiple: true, // 是否支持批量上传 |
| | |
| | | return item; |
| | | }); |
| | | } |
| | | this.loading = false; |
| | | }, |
| | | |
| | | // 获取入库仓库列表 |
| | |
| | | handleSubmit() { |
| | | this.$refs['ruleForm'].validate((valid) => { |
| | | if (valid) { |
| | | console.log('formData', this.formData); |
| | | debugger; |
| | | this.loading = true; |
| | | if (!this.setting.id) { |
| | | procureAdd(this.formData) |
| | | .then((res) => { |
| | |
| | | this.$emit('search'); |
| | | }) |
| | | .catch((err) => { |
| | | console.log('create err', err); |
| | | this.loading = false; |
| | | this.$message.error('保存失败'); |
| | | }); |
| | | } else { |
| | |
| | | this.$emit('search'); |
| | | }) |
| | | .catch((err) => { |
| | | console.log('edit err', err); |
| | | this.loading = false; |
| | | this.$message.error('保存失败'); |
| | | }); |
| | | } |