|
@@ -91,16 +91,44 @@
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="计量单位" prop="unitId">
|
|
|
- <el-input :disabled="disable" v-model="basicForm.unitId">
|
|
|
- <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test02"></el-button>
|
|
|
- </el-input>
|
|
|
+ <el-select
|
|
|
+ ref="units"
|
|
|
+ v-model="basicForm.unitId"
|
|
|
+ placeholder="计量单位"
|
|
|
+ :disabled="disable"
|
|
|
+ @focus="chooseUnit"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in unitOptions"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ <!-- <el-input :disabled="disable" v-model="basicForm.unitId">
|
|
|
+ <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="chooseUnit"></el-button>
|
|
|
+ </el-input> -->
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="生产厂家/代理人" prop="manufacturerId">
|
|
|
- <el-input :disabled="disable" v-model="basicForm.manufacturerId">
|
|
|
- <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test02"></el-button>
|
|
|
- </el-input>
|
|
|
+ <el-select
|
|
|
+ ref="factoryOrman"
|
|
|
+ v-model="basicForm.manufacturerId"
|
|
|
+ placeholder="生产厂家/代理人"
|
|
|
+ :disabled="disable"
|
|
|
+ @focus="chooseFactory"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in factoryOptions"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.manufactureName"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ <!-- <el-input :disabled="disable" v-model="basicForm.manufacturerId">
|
|
|
+ <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="chooseFactory"></el-button>
|
|
|
+ </el-input> -->
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -112,9 +140,23 @@
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="产地" prop="originPlace">
|
|
|
- <el-input :disabled="disable" v-model="basicForm.originPlace">
|
|
|
- <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test02"></el-button>
|
|
|
- </el-input>
|
|
|
+ <el-select
|
|
|
+ ref="places"
|
|
|
+ v-model="basicForm.originPlace"
|
|
|
+ placeholder="产地"
|
|
|
+ :disabled="disable"
|
|
|
+ @focus="choosePlace"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in placeOptions"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ <!-- <el-input :disabled="disable" v-model="basicForm.originPlace">
|
|
|
+ <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test01"></el-button>
|
|
|
+ </el-input> -->
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
@@ -307,9 +349,23 @@
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="物料税类" prop="materialRate">
|
|
|
- <el-input :disabled="disable" v-model="basicForm.materialRate">
|
|
|
- <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test02"></el-button>
|
|
|
- </el-input>
|
|
|
+ <el-select
|
|
|
+ ref="taxs"
|
|
|
+ v-model="basicForm.materialRate"
|
|
|
+ placeholder="物料税类"
|
|
|
+ :disabled="disable"
|
|
|
+ @focus="chooseTax"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in taxOptions"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ <!-- <el-input :disabled="disable" v-model="basicForm.materialRate">
|
|
|
+ <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test01"></el-button>
|
|
|
+ </el-input> -->
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -333,9 +389,23 @@
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="采购员" prop="puPersonnelId">
|
|
|
- <el-input :disabled="disable" v-model="basicForm.puPersonnelId">
|
|
|
- <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test02"></el-button>
|
|
|
- </el-input>
|
|
|
+ <el-select
|
|
|
+ ref="staffs"
|
|
|
+ v-model="basicForm.puPersonnelId"
|
|
|
+ placeholder="采购员"
|
|
|
+ :disabled="disable"
|
|
|
+ @focus="chooseStaff"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in staffOptions"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.code"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ <!-- <el-input :disabled="disable" v-model="basicForm.puPersonnelId">
|
|
|
+ <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test01"></el-button>
|
|
|
+ </el-input> -->
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
@@ -380,7 +450,7 @@
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="业务线" prop="businessLine">
|
|
|
<el-input :disabled="disable" v-model="basicForm.businessLine">
|
|
|
- <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test02"></el-button>
|
|
|
+ <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test01"></el-button>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -509,7 +579,7 @@
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="剂型" prop="dosageFrom">
|
|
|
<el-input :disabled="disable" v-model="basicForm2.dosageFrom">
|
|
|
- <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test02"></el-button>
|
|
|
+ <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test01"></el-button>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -663,8 +733,8 @@
|
|
|
/>
|
|
|
|
|
|
<factory
|
|
|
- ref="contractSelect2"
|
|
|
- @doSubmit="selectionsToInput2"
|
|
|
+ ref="factory"
|
|
|
+ @doSubmit="acceptFactory"
|
|
|
:selectData="selectData2"
|
|
|
:single="true"
|
|
|
/>
|
|
@@ -676,7 +746,33 @@
|
|
|
:single="true"
|
|
|
/>
|
|
|
|
|
|
+ <unit
|
|
|
+ ref="unit"
|
|
|
+ @doSubmit="acceptUnit"
|
|
|
+ :selectData="selectData4"
|
|
|
+ :single="true"
|
|
|
+ />
|
|
|
|
|
|
+ <place
|
|
|
+ ref="place"
|
|
|
+ @doSubmit="acceptPlace"
|
|
|
+ :selectData="selectData5"
|
|
|
+ :single="true"
|
|
|
+ />
|
|
|
+
|
|
|
+ <tax
|
|
|
+ ref="tax"
|
|
|
+ @doSubmit="acceptTax"
|
|
|
+ :selectData="selectData6"
|
|
|
+ :single="true"
|
|
|
+ />
|
|
|
+
|
|
|
+ <staff
|
|
|
+ ref="staff"
|
|
|
+ @doSubmit="acceptStaff"
|
|
|
+ :selectData="selectData7"
|
|
|
+ :single="true"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -684,16 +780,29 @@
|
|
|
import popDialog from '@/components/PopDialog/index.vue'
|
|
|
import factory from '@/components/PopDialog/productFactory.vue'
|
|
|
import fourClass from '@/components/PopDialog/fourClass.vue'
|
|
|
+import unit from '@/components/PopDialog/unit.vue'
|
|
|
+import place from '@/components/PopDialog/place.vue'
|
|
|
+import tax from '@/components/PopDialog/tax.vue'
|
|
|
+import staff from '@/components/PopDialog/staff.vue'
|
|
|
import { addReq, getReqDetail, editReq } from '@/api/requisition/basic'
|
|
|
// 调用物料分类详情接口用于数据回显
|
|
|
import { getDetail } from '@/api/classify/basic';
|
|
|
+// 生产厂商/代理人调用用于回显
|
|
|
+import { getProductFactory } from '@/api/changeApply/basic'
|
|
|
+// 计量单位,产地调用用于回显
|
|
|
+import { getUnit, getPlace, getTax, getStaff} from '@/api/requisition/basic'
|
|
|
+
|
|
|
export default {
|
|
|
name: 'requisition_add',
|
|
|
dicts: ['sys_storage_condition', 'sys_conditions_carriage', 'sys_medicine', 'medical_instruments', 'curing_type'],
|
|
|
components: {
|
|
|
popDialog,
|
|
|
factory,
|
|
|
- fourClass
|
|
|
+ fourClass,
|
|
|
+ unit,
|
|
|
+ place,
|
|
|
+ tax,
|
|
|
+ staff
|
|
|
},
|
|
|
props: ['pageStu', 'row', 'disable'],
|
|
|
model: {
|
|
@@ -703,6 +812,11 @@ export default {
|
|
|
data() {
|
|
|
return{
|
|
|
testOptions: [],
|
|
|
+ factoryOptions: [],
|
|
|
+ unitOptions: [],
|
|
|
+ placeOptions: [],
|
|
|
+ taxOptions: [],
|
|
|
+ staffOptions: [],
|
|
|
tabValue: 'first',
|
|
|
basicForm: {
|
|
|
billCode: '',
|
|
@@ -802,6 +916,10 @@ export default {
|
|
|
selectData: [],
|
|
|
selectData2: [],
|
|
|
selectData3: [],
|
|
|
+ selectData4: [],
|
|
|
+ selectData5: [],
|
|
|
+ selectData6: [],
|
|
|
+ selectData7: []
|
|
|
}
|
|
|
},
|
|
|
// watch: {
|
|
@@ -838,14 +956,58 @@ export default {
|
|
|
console.log('数据', this.row)
|
|
|
this.getDetails(this.row)
|
|
|
// 获取树形详情
|
|
|
- this.getTreeDetails(this.row.classifyId)
|
|
|
+ if (this.row.classifyId) {
|
|
|
+ this.getTreeDetails(this.row.classifyId)
|
|
|
+ }
|
|
|
+ // 生产厂家代理人用于回显
|
|
|
+ if (this.row.manufacturerId) {
|
|
|
+ this.getFactoryDetails(this.row.manufacturerId)
|
|
|
+ }
|
|
|
+ // 计量单位回显
|
|
|
+ if (this.row.unitId) {
|
|
|
+ this.getUnitDetails(this.row.unitId)
|
|
|
+ }
|
|
|
+ // 产地回显
|
|
|
+ if (this.row.originPlace) {
|
|
|
+ this.getPlaceDetails(this.row.originPlace)
|
|
|
+ }
|
|
|
+ // 物料税类回显
|
|
|
+ if (this.row.materialRate) {
|
|
|
+ this.getTaxDetails(this.row.materialRate)
|
|
|
+ }
|
|
|
+ // 物料税类回显
|
|
|
+ if (this.row.puPersonnelId) {
|
|
|
+ this.getStaffDetails(this.row.puPersonnelId)
|
|
|
+ }
|
|
|
} else if (this.pageStu == 'edit') {
|
|
|
// alert('修改页面')
|
|
|
console.log('页面状态',this.pageStu)
|
|
|
console.log('数据', this.row)
|
|
|
this.getDetails(this.row)
|
|
|
// 获取树形详情
|
|
|
- this.getTreeDetails(this.row.classifyId)
|
|
|
+ if (this.row.classifyId) {
|
|
|
+ this.getTreeDetails(this.row.classifyId)
|
|
|
+ }
|
|
|
+ // 生产厂家代理人用于回显
|
|
|
+ if (this.row.manufacturerId) {
|
|
|
+ this.getFactoryDetails(this.row.manufacturerId)
|
|
|
+ }
|
|
|
+ // 计量单位回显
|
|
|
+ if (this.row.unitId) {
|
|
|
+ this.getUnitDetails(this.row.unitId)
|
|
|
+ }
|
|
|
+ // 产地回显
|
|
|
+ if (this.row.originPlace) {
|
|
|
+ this.getPlaceDetails(this.row.originPlace)
|
|
|
+ }
|
|
|
+ // 物料税类回显
|
|
|
+ if (this.row.materialRate) {
|
|
|
+ this.getTaxDetails(this.row.materialRate)
|
|
|
+ }
|
|
|
+ // 物料税类回显
|
|
|
+ if (this.row.puPersonnelId) {
|
|
|
+ this.getStaffDetails(this.row.puPersonnelId)
|
|
|
+ }
|
|
|
} else if(this.pageStu == 'add') {
|
|
|
// alert('新增页面')
|
|
|
console.log('页面状态',this.pageStu)
|
|
@@ -868,12 +1030,61 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 生产厂家/代理人用于回显
|
|
|
+ getFactoryDetails(id) {
|
|
|
+ getProductFactory({id:id}).then(res => {
|
|
|
+ if(res.code === 200) {
|
|
|
+ this.factoryOptions = res.data.tableBody
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 计量单位回显
|
|
|
+ getUnitDetails(id) {
|
|
|
+ getUnit({id:id}).then(res => {
|
|
|
+ console.log('计量单位回显', res)
|
|
|
+ if (res.code === 200 ) {
|
|
|
+ this.unitOptions = res.data.tableBody
|
|
|
+ console.log('1111',this.unitOptions)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 产地回显
|
|
|
+ getPlaceDetails(id) {
|
|
|
+ getPlace({id:id}).then(res => {
|
|
|
+ console.log('产地', res)
|
|
|
+ if (res.code === 200 ) {
|
|
|
+ this.placeOptions = res.data.tableBody
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 物料税类回显
|
|
|
+ getTaxDetails(id) {
|
|
|
+ getTax({id:id}).then(res => {
|
|
|
+ console.log('物料税类', res)
|
|
|
+ if (res.code === 200 ) {
|
|
|
+ this.taxOptions = res.data.tableBody
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 采购员回显
|
|
|
+ getStaffDetails(id) {
|
|
|
+ getStaff({id:id}).then(res => {
|
|
|
+ console.log('采购员', res)
|
|
|
+ if (res.code === 200 ) {
|
|
|
+ this.staffOptions = res.data.tableBody
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 如果是详情进入,则调用详情接口
|
|
|
getDetails(row) {
|
|
|
getReqDetail(row.id).then(res => {
|
|
|
console.log('res',res)
|
|
|
if(res.code === 200) {
|
|
|
this.basicForm = res.data
|
|
|
+ if(res.data.unitId) {
|
|
|
+ this.basicForm.unitId = res.data.unitId.toString()
|
|
|
+ this.basicForm.manufacturerId = res.data.manufacturerId.toString()
|
|
|
+ }
|
|
|
if(res.data.sysMaterialMedcineApply) {
|
|
|
this.basicForm2 = res.data.sysMaterialMedcineApply
|
|
|
}
|
|
@@ -1002,10 +1213,23 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- selectionsToInput2 (selections) {
|
|
|
+ test01() {
|
|
|
+ console.log('测试点击')
|
|
|
+ this.$refs.contractSelect.init()
|
|
|
+ },
|
|
|
+ // 选择生产厂家/代理人
|
|
|
+ acceptFactory (selections) {
|
|
|
console.log('选择的数据',selections)
|
|
|
- this.basicForm.manufacturerId = selections[0].code
|
|
|
+ this.factoryOptions = selections
|
|
|
+ this.basicForm.manufacturerId = selections[0].id
|
|
|
+ this.getFactoryDetails(selections[0].id)
|
|
|
},
|
|
|
+ // 生产厂家/代理人显示列表
|
|
|
+ chooseFactory() {
|
|
|
+ this.$refs.factoryOrman.blur()
|
|
|
+ this.$refs.factory.init()
|
|
|
+ },
|
|
|
+ // 选择四级分类
|
|
|
acceptFourClass (selections) {
|
|
|
console.log('父组件收到的数据',selections)
|
|
|
this.testOptions.push(selections)
|
|
@@ -1013,20 +1237,57 @@ export default {
|
|
|
this.basicForm.classifyId = selections.id
|
|
|
this.getTreeDetails(selections.id)
|
|
|
},
|
|
|
+ // 四级分类显示列表
|
|
|
chooseFourClass() {
|
|
|
- console.log('1111')
|
|
|
this.$refs.fourTag.blur()
|
|
|
this.$refs.fourClass.init()
|
|
|
},
|
|
|
- // 显示列表
|
|
|
- test01() {
|
|
|
- console.log('测试点击')
|
|
|
- this.$refs.contractSelect.init()
|
|
|
+ // 选择计量单位
|
|
|
+ acceptUnit (selections) {
|
|
|
+ console.log('父组件收到的数据',selections)
|
|
|
+ this.unitOptions = selections
|
|
|
+ console.log('绑定的数组',this.unitOptions)
|
|
|
+ this.basicForm.unitId = selections[0].id
|
|
|
+ this.getUnitDetails(selections[0].id)
|
|
|
+ },
|
|
|
+ // 计量单位显示列表
|
|
|
+ chooseUnit () {
|
|
|
+ this.$refs.units.blur()
|
|
|
+ this.$refs.unit.init()
|
|
|
+ },
|
|
|
+ // 选择产地
|
|
|
+ acceptPlace (selections) {
|
|
|
+ this.placeOptions = selections
|
|
|
+ this.basicForm.originPlace = selections[0].id
|
|
|
+ this.getPlaceDetails(selections[0].id)
|
|
|
+ },
|
|
|
+ // 产地显示列表
|
|
|
+ choosePlace () {
|
|
|
+ this.$refs.places.blur()
|
|
|
+ this.$refs.place.init()
|
|
|
+ },
|
|
|
+ // 选择物料税类
|
|
|
+ acceptTax (selections) {
|
|
|
+ this.taxOptions = selections
|
|
|
+ this.basicForm.materialRate = selections[0].id
|
|
|
+ this.getTaxDetails(selections[0].id)
|
|
|
+ },
|
|
|
+ // 物料税类显示列表
|
|
|
+ chooseTax () {
|
|
|
+ this.$refs.taxs.blur()
|
|
|
+ this.$refs.tax.init()
|
|
|
+ },
|
|
|
+ // 选择采购员
|
|
|
+ acceptStaff (selections) {
|
|
|
+ this.staffOptions = selections
|
|
|
+ this.basicForm.puPersonnelId = selections[0].code
|
|
|
+ this.getStaffDetails(selections[0].id)
|
|
|
+ },
|
|
|
+ // 采购员显示列表
|
|
|
+ chooseStaff () {
|
|
|
+ this.$refs.staffs.blur()
|
|
|
+ this.$refs.staff.init()
|
|
|
},
|
|
|
- test02() {
|
|
|
- console.log('测试弹窗2');
|
|
|
- this.$refs.contractSelect2.init()
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
</script>
|