| | |
| | | </el-form-item> |
| | | <el-form-item label="规格型号:" prop="specificationsNumber"> |
| | | <el-cascader v-model="insertData.specificationsNumber" :options="childrenOptions" |
| | | :props="{label: 'Name', value: 'Name'}" separator="-"></el-cascader> |
| | | :props="{label: 'Name', value: 'Id'}" separator="-"></el-cascader> |
| | | </el-form-item> |
| | | <el-form-item label="单位:" prop="unit"> |
| | | <el-input type="text" v-model="insertData.unit" /> |
| | |
| | | getChooseVersion, |
| | | lookProByVer |
| | | } from '@/api/inspection/rawmaterial' |
| | | import ItemVue from '@/layout/components/Sidebar/Item.vue' |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | insert() { |
| | | this.$refs['addMaterialForm'].validate((valid) => { |
| | | if (valid) { |
| | | console.log(this.childrenOptions); |
| | | console.log(this.insertData); |
| | | let f=this.childrenOptions.filter(item=>{ |
| | | return item.Id===this.insertData.specificationsNumber[0] |
| | | })[0] |
| | | console.log(f); |
| | | let fatherName=f.Name; |
| | | let c=f.children.filter(item=>{ |
| | | return item.Id===this.insertData.specificationsNumber[1] |
| | | })[0] |
| | | let sonName=c.Name |
| | | let specificationsId=c.Id; |
| | | var str = { |
| | | "dateSurvey": this.insertData.fromDate, |
| | | "materialCoding": this.insertData.mCode, |
| | | "materialName": this.insertData.mName, |
| | | "quantity": this.insertData.num, |
| | | "specificationsModels": this.insertData.specificationsNumber[0] + '-' + this.insertData |
| | | .specificationsNumber[1], |
| | | "specificationsModels": fatherName+ '-' + sonName, |
| | | "specificationsId": specificationsId, |
| | | "supplierName": this.insertData.supplierName, |
| | | "type": 0, |
| | | "unit": this.insertData.unit |