|
@@ -4,13 +4,9 @@
|
|
|
<el-row :gutter="10">
|
|
|
<el-col :span="1.5">
|
|
|
<el-form-item label="物料分类编码">
|
|
|
- <el-input
|
|
|
- v-model="basicForm.materialClassify"
|
|
|
- size="small"
|
|
|
- placeholder=""
|
|
|
- clearable
|
|
|
- style="width: 200px"
|
|
|
- />
|
|
|
+ <el-input :disabled="disable" size="small" style="width: 200px" readonly v-model="basicForm.materialClassify">
|
|
|
+ <el-button slot="append" icon="el-icon-more" @click="chooseFourClass"></el-button>
|
|
|
+ </el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
@@ -19,7 +15,7 @@
|
|
|
<el-input
|
|
|
v-model="basicForm.materialClassifyName"
|
|
|
size="small"
|
|
|
- placeholder=""
|
|
|
+ disabled
|
|
|
clearable
|
|
|
style="width: 200px"
|
|
|
/>
|
|
@@ -28,92 +24,81 @@
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
<el-form-item label="一级分类编码">
|
|
|
- <el-select v-model="basicForm.materialClassifyOne" size="small" style="width: 200px" clearable placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="item in options"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <el-input
|
|
|
+ v-model="basicForm.materialClassifyOne"
|
|
|
+ size="small"
|
|
|
+ disabled
|
|
|
+ clearable
|
|
|
+ style="width: 200px"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
<el-form-item label="一级分类名称">
|
|
|
- <el-select v-model="basicForm.materialClassifyOneName" size="small" style="width: 200px" clearable placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="item in options"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <el-input
|
|
|
+ v-model="basicForm.materialClassifyOneName"
|
|
|
+ size="small"
|
|
|
+ disabled
|
|
|
+ clearable
|
|
|
+ style="width: 200px"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
<el-form-item label="二级分类名称">
|
|
|
- <el-select v-model="basicForm.materialClassifyTwoName" size="small" style="width: 200px" clearable placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="item in options"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <el-input
|
|
|
+ v-model="basicForm.materialClassifyTwoName"
|
|
|
+ size="small"
|
|
|
+ disabled
|
|
|
+ clearable
|
|
|
+ style="width: 200px"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
<el-form-item label="三级分类名称">
|
|
|
- <el-select v-model="basicForm.materialClassifyThreeName" size="small" style="width: 200px" clearable placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="item in options"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <el-input
|
|
|
+ v-model="basicForm.materialClassifyThreeName"
|
|
|
+ size="small"
|
|
|
+ disabled
|
|
|
+ clearable
|
|
|
+ style="width: 200px"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
<el-form-item label="四级分类名称">
|
|
|
- <el-select v-model="basicForm.materialClassifyFourName" size="small" style="width: 200px" clearable placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="item in options"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <el-input
|
|
|
+ v-model="basicForm.materialClassifyFourName"
|
|
|
+ size="small"
|
|
|
+ disabled
|
|
|
+ clearable
|
|
|
+ style="width: 200px"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
- <el-col :span="1.5">
|
|
|
+ <el-col :span="1.5">
|
|
|
<el-form-item label="物料编码">
|
|
|
- <el-select v-model="basicForm.material" size="small" style="width: 200px" clearable placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="item in options"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <el-input :disabled="disable" style="width: 200px" size="small" readonly v-model="basicForm.material">
|
|
|
+ <el-button slot="append" icon="el-icon-more" @click="test01"></el-button>
|
|
|
+ </el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
<el-form-item label="物料名称">
|
|
|
- <el-select v-model="basicForm.materialName" size="small" style="width: 200px" clearable placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="item in options"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <el-input
|
|
|
+ v-model="basicForm.materialName"
|
|
|
+ size="small"
|
|
|
+ disabled
|
|
|
+ clearable
|
|
|
+ style="width: 200px"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
@@ -122,7 +107,7 @@
|
|
|
<el-input
|
|
|
v-model="basicForm.manufacturer"
|
|
|
size="small"
|
|
|
- placeholder=""
|
|
|
+ :disabled="disable"
|
|
|
clearable
|
|
|
style="width: 200px"
|
|
|
/>
|
|
@@ -131,50 +116,74 @@
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
<el-form-item label="所属组织">
|
|
|
- <el-input
|
|
|
- v-model="basicForm.org"
|
|
|
- size="small"
|
|
|
- placeholder=""
|
|
|
- clearable
|
|
|
- style="width: 200px"
|
|
|
- />
|
|
|
+ <el-select
|
|
|
+ ref="organizations"
|
|
|
+ v-model="basicForm.org"
|
|
|
+ size="small"
|
|
|
+ style="width: 200px"
|
|
|
+ :disabled="disable"
|
|
|
+ clearable
|
|
|
+ @focus="chooseOrganizations"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in organizationsOptions"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
<el-form-item label="订单员">
|
|
|
- <el-input
|
|
|
- v-model="basicForm.orderPersonal"
|
|
|
- size="small"
|
|
|
- placeholder=""
|
|
|
- clearable
|
|
|
- style="width: 200px"
|
|
|
- />
|
|
|
+ <el-select
|
|
|
+ ref="staffs"
|
|
|
+ size="small"
|
|
|
+ style="width: 200px"
|
|
|
+ :disabled="disable"
|
|
|
+ v-model="basicForm.orderPersonal"
|
|
|
+ clearable
|
|
|
+ @focus="chooseStaff"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in staffOptions"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.code"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
<el-form-item label="订单部门">
|
|
|
- <el-select v-model="basicForm.orderDept" size="small" style="width: 200px" clearable placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="item in options"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <el-input
|
|
|
+ v-model="basicForm.orderDept"
|
|
|
+ size="small"
|
|
|
+ disabled
|
|
|
+ style="width: 200px"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
<el-form-item label="采购员">
|
|
|
- <el-select v-model="basicForm.buyer" size="small" style="width: 200px" clearable placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="item in options"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value">
|
|
|
- </el-option>
|
|
|
+ <el-select
|
|
|
+ ref="staffs2"
|
|
|
+ size="small"
|
|
|
+ style="width: 200px"
|
|
|
+ :disabled="disable"
|
|
|
+ v-model="basicForm.buyer"
|
|
|
+ clearable
|
|
|
+ @focus="chooseStaff2"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in staff2Options"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.code"
|
|
|
+ />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -184,8 +193,7 @@
|
|
|
<el-input
|
|
|
v-model="basicForm.puDept"
|
|
|
size="small"
|
|
|
- placeholder=""
|
|
|
- clearable
|
|
|
+ disabled
|
|
|
style="width: 200px"
|
|
|
/>
|
|
|
</el-form-item>
|
|
@@ -196,8 +204,7 @@
|
|
|
<el-input
|
|
|
v-model="basicForm.sendStatus"
|
|
|
size="small"
|
|
|
- placeholder=""
|
|
|
- clearable
|
|
|
+ disabled
|
|
|
style="width: 200px"
|
|
|
/>
|
|
|
</el-form-item>
|
|
@@ -208,7 +215,7 @@
|
|
|
<el-input
|
|
|
v-model="basicForm.remark"
|
|
|
size="small"
|
|
|
- placeholder=""
|
|
|
+ :disabled="disable"
|
|
|
clearable
|
|
|
style="width: 200px"
|
|
|
/>
|
|
@@ -228,13 +235,63 @@
|
|
|
<el-button size="small" plain @click="back">返回</el-button>
|
|
|
</el-col>
|
|
|
</div>
|
|
|
+
|
|
|
+ <fourClass
|
|
|
+ ref="fourClass"
|
|
|
+ @doSubmit="acceptFourClass"
|
|
|
+ :single="true"
|
|
|
+ />
|
|
|
+
|
|
|
+ <popDialog
|
|
|
+ ref="contractSelect"
|
|
|
+ @doSubmit="selectionsToInput"
|
|
|
+ :single="true"
|
|
|
+ />
|
|
|
+
|
|
|
+ <orgs
|
|
|
+ ref="orgs"
|
|
|
+ @doSubmit="acceptOrgs"
|
|
|
+ :single="true"
|
|
|
+ />
|
|
|
+
|
|
|
+ <staff
|
|
|
+ ref="staff"
|
|
|
+ @doSubmit="acceptStaff"
|
|
|
+ :single="true"
|
|
|
+ />
|
|
|
+
|
|
|
+ <staff2
|
|
|
+ ref="staff2"
|
|
|
+ @doSubmit="acceptStaff2"
|
|
|
+ :single="true"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import {addDivision, getDivisions, editDivision} from '@/api/purchase/basic.js'
|
|
|
+// 物料分类
|
|
|
+import fourClass from '@/components/PopDialog/fourClass.vue'
|
|
|
+// 调用物料分类详情接口用于数据回显
|
|
|
+import { getDetail } from '@/api/classify/basic';
|
|
|
+// 物料编码
|
|
|
+import popDialog from '@/components/PopDialog/index.vue'
|
|
|
+// 公用一个树形(组织部门传值不同)
|
|
|
+import orgs from '@/components/PopDialog/organization.vue'
|
|
|
+import staff from '@/components/PopDialog/staff.vue'
|
|
|
+import staff2 from '@/components/PopDialog/staff.vue'
|
|
|
+// 所属组织,订单员用于回显
|
|
|
+import { getOrgs, getStaff} from '@/api/requisition/basic'
|
|
|
export default {
|
|
|
name: 'addDivision',
|
|
|
- props: ['pageStu'],
|
|
|
+ components: {
|
|
|
+ fourClass,
|
|
|
+ popDialog,
|
|
|
+ orgs,
|
|
|
+ staff,
|
|
|
+ staff2
|
|
|
+ },
|
|
|
+ props: ['pageStu','row', 'disable'],
|
|
|
model: {
|
|
|
prop: 'isList',
|
|
|
event: 'jugislist'
|
|
@@ -268,20 +325,148 @@ export default {
|
|
|
options: [{
|
|
|
value: 0, label: '仓库1'
|
|
|
}],
|
|
|
+ organizationsOptions: [],
|
|
|
+ staffOptions: [],
|
|
|
+ staff2Options: [],
|
|
|
basicRules: {}
|
|
|
}
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ if(this.pageStu == 'check') {
|
|
|
+ console.log('数据', this.row)
|
|
|
+ this.getDetails(this.row)
|
|
|
+ } else if(this.pageStu == 'edit') {
|
|
|
+ this.getDetails(this.row)
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
- save() {},
|
|
|
+ save() {
|
|
|
+ if(this.pageStu == 'add') {
|
|
|
+ addDivision(this.basicForm).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$modal.msgSuccess("保存成功");
|
|
|
+ this.back()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if(this.pageStu == 'edit') {
|
|
|
+ editDivision(this.basicForm).then(res => {
|
|
|
+ this.$modal.msgSuccess("编辑成功");
|
|
|
+ this.back()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
submit() {},
|
|
|
back() {
|
|
|
this.$emit('jugislist', true)
|
|
|
- // let queryParams = {
|
|
|
- // pageNum: 1,
|
|
|
- // pageSize: 10
|
|
|
- // }
|
|
|
- // this.$emit('refresh', queryParams)
|
|
|
- }
|
|
|
+ let queryParams = {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10
|
|
|
+ }
|
|
|
+ this.$emit('refresh', queryParams)
|
|
|
+ },
|
|
|
+ // 如果需要回显则调用详情接口
|
|
|
+ getDetails(row) {
|
|
|
+ getDivisions(row.id).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.basicForm = res.data
|
|
|
+ this.getOrgDetails(res.data.org)
|
|
|
+ this.getStaffDetails(res.data.orderPersonal)
|
|
|
+ this.getStaffDetails2(res.data.buyer)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 选择物料分类
|
|
|
+ acceptFourClass(selections) {
|
|
|
+ console.log('收到的四级分类',selections)
|
|
|
+ this.basicForm.materialClassify = selections.code
|
|
|
+ this.basicForm.materialClassifyName = selections.materialType
|
|
|
+ this.getTreeDetails(selections.id)
|
|
|
+ },
|
|
|
+ // 物料分类显示列表
|
|
|
+ chooseFourClass() {
|
|
|
+ this.$refs.fourClass.init()
|
|
|
+ },
|
|
|
+ // 选择物料分类后需要根据id再次查询一下123级分类
|
|
|
+ getTreeDetails(id) {
|
|
|
+ getDetail(id).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.basicForm.materialClassifyOneName = res.data.oneClass
|
|
|
+ this.basicForm.materialClassifyTwoName = res.data.twoClass
|
|
|
+ this.basicForm.materialClassifyThreeName = res.data.threeClass
|
|
|
+ this.basicForm.materialClassifyFourName = res.data.fourClass
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ selectionsToInput (selections) {
|
|
|
+ console.log('父组件拿到的:', selections)
|
|
|
+ this.selectData = selections
|
|
|
+ this.basicForm.material = selections[0].code
|
|
|
+ this.basicForm.materialName = selections[0].name
|
|
|
+ },
|
|
|
+ // 显示物料编码列表
|
|
|
+ test01() {
|
|
|
+ console.log('测试点击')
|
|
|
+ this.$refs.contractSelect.init()
|
|
|
+ },
|
|
|
+ // 选择默认采购组织
|
|
|
+ acceptOrgs (selections) {
|
|
|
+ console.log('接收的采购组织', selections)
|
|
|
+ this.basicForm.org = selections.id
|
|
|
+ this.getOrgDetails(selections.id)
|
|
|
+ },
|
|
|
+ // 默认采购组织显示列表
|
|
|
+ chooseOrganizations () {
|
|
|
+ this.$refs.organizations.blur()
|
|
|
+ this.$refs.orgs.init('1')
|
|
|
+ },
|
|
|
+ // 采购组织回显
|
|
|
+ getOrgDetails(id) {
|
|
|
+ getOrgs({deptId: id}).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.organizationsOptions = res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 选择订单员
|
|
|
+ acceptStaff (selections) {
|
|
|
+ this.staffOptions = selections
|
|
|
+ this.basicForm.orderPersonal = selections[0].code
|
|
|
+ this.getStaffDetails(selections[0].id)
|
|
|
+ },
|
|
|
+ // 订单员显示列表
|
|
|
+ chooseStaff () {
|
|
|
+ this.$refs.staffs.blur()
|
|
|
+ this.$refs.staff.init()
|
|
|
+ },
|
|
|
+ // 订单员回显
|
|
|
+ getStaffDetails(id) {
|
|
|
+ getStaff({id:id}).then(res => {
|
|
|
+ console.log('订单员', res)
|
|
|
+ if (res.code === 200 ) {
|
|
|
+ this.staffOptions = res.data.tableBody
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 选择采购员
|
|
|
+ acceptStaff2 (selections) {
|
|
|
+ this.staff2Options = selections
|
|
|
+ this.basicForm.buyer = selections[0].code
|
|
|
+ this.getStaffDetails2(selections[0].id)
|
|
|
+ },
|
|
|
+ // 采购员显示列表
|
|
|
+ chooseStaff2 () {
|
|
|
+ this.$refs.staffs2.blur()
|
|
|
+ this.$refs.staff2.init()
|
|
|
+ },
|
|
|
+ // 采购员回显
|
|
|
+ getStaffDetails2(id) {
|
|
|
+ getStaff({id:id}).then(res => {
|
|
|
+ console.log('采购员', res)
|
|
|
+ if (res.code === 200 ) {
|
|
|
+ this.staff2Options = res.data.tableBody
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|