| | |
| | | > |
| | | <el-divider content-position="left">基本信息</el-divider> |
| | | |
| | | <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px"> |
| | | <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="110px"> |
| | | <el-form-item label="工序编码" prop="stepcode"> |
| | | <el-input v-model="dialogForm.stepcode" :disabled="operation!=='add'" style="width: 200px" /> |
| | | </el-form-item> |
| | |
| | | :popper-append-to-body="false" |
| | | @change="steptypecodeChange" |
| | | > |
| | | |
| | | <el-option |
| | | v-for="item in steptypeArr" |
| | | :key="item.code" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item v-if="dialogForm.steptypecode==='Z'" label="所属车间" required> |
| | | <el-form-item v-if="dialogForm.steptypecode==='Z'" label="所属车间"> |
| | | <el-select |
| | | |
| | | v-model="dialogForm.Wkshop" |
| | | style="width:200px" |
| | | placeholder="请选择" |
| | |
| | | :key="item.torg_code" |
| | | :label="item.torg_name" |
| | | :value="item.torg_code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item v-if="dialogForm.steptypecode==='W'" label="往来单位类型"> |
| | | <el-select |
| | | v-model="dialogForm.CustomerType" |
| | | style="width:200px" |
| | | placeholder="请选择" |
| | | multiple |
| | | collapse-tags |
| | | :popper-append-to-body="false" |
| | | @change="CustomerTypeChange" |
| | | > |
| | | <el-option |
| | | v-for="item in CustomerTypeArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | import elDragDialog from '@/directive/el-drag-dialog' |
| | | import waves from '@/directive/waves' |
| | | import $ from 'jquery' |
| | | import { CustomerPermissions, TorgWkshop, WkshopEqpPermissions } from '@/api/GeneralBasicData' |
| | | import { |
| | | CustomerPermissions, |
| | | CustomerTypePermissions, |
| | | CustomerTypeSearchPermission, |
| | | TorgWkshop, |
| | | WkshopEqpPermissions |
| | | } from '@/api/GeneralBasicData' |
| | | |
| | | export default { |
| | | name: 'Zzjg', |
| | |
| | | stepname: '', // |
| | | enable: '', // |
| | | steptypecode: '', // 工序类型 |
| | | prop: 'stepcode', // 排序字段 |
| | | order: 'asc', // 排序字段 |
| | | prop: 'lm_date', // 排序字段 |
| | | order: 'desc', // 排序字段 |
| | | page: 1, // 第几页 |
| | | rows: 20 // 每页多少条 |
| | | }, |
| | |
| | | { code: 'N', name: '停用' } |
| | | ], |
| | | WkshopArr: [], // 车间下拉数组 |
| | | CustomerTypeArr: [], // 往来单位下拉数组 |
| | | dialogVisible: false, |
| | | dialogForm: { |
| | | id: '', |
| | | stepcode: '', // |
| | | stepname: '', // |
| | | Wkshop: '', // |
| | | CustomerType: '', // |
| | | steptypecode: 'Z', |
| | | description: '', // 描述 |
| | | enable: 'Y'// 状态 |
| | |
| | | created() { |
| | | this.getStepSearch() |
| | | this.getTorgWkshop() |
| | | this.getCustomerTypePermissions() |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.getHeight) |
| | |
| | | const { data: res } = await TorgWkshop() |
| | | this.WkshopArr = res |
| | | }, |
| | | // 往来单位类型 |
| | | async getCustomerTypePermissions() { |
| | | const { data: res } = await CustomerTypePermissions() |
| | | this.CustomerTypeArr = res |
| | | }, |
| | | // 查看往来资料 |
| | | async getCustomerPermissions() { |
| | | const { data: res } = await CustomerPermissions() |
| | |
| | | }, |
| | | |
| | | async steptypecodeChange(val) { |
| | | if (val === 'W') { // 外协 |
| | | await this.getCustomerPermissions() |
| | | } else { // 自制 |
| | | // if (val === 'W') { // 外协 |
| | | // this.dialogForm.CustomerType = [] |
| | | // // await this.getCustomerPermissions() |
| | | // } else { // 自制 |
| | | // this.dialogForm.Wkshop = [] |
| | | // } |
| | | this.dialogForm.CustomerType = [] |
| | | this.dialogForm.Wkshop = [] |
| | | this.dialogTreeArr = [] |
| | | } |
| | | }, |
| | | |
| | | // 车间值改变时触发 |
| | | async WkshopChange(val) { |
| | | if (val.length === 0) { |
| | | this.dialogTreeArr = [] |
| | | return |
| | | } |
| | | |
| | | const { data: res } = await WkshopEqpPermissions({ wkshopcode: val.join(',') }) |
| | | this.dialogTreeArr = [ |
| | | { code: '', |
| | | name: '全部', |
| | | children: res |
| | | } |
| | | ] |
| | | }, |
| | | |
| | | // 往来单位类型值改变时 |
| | | async CustomerTypeChange(val) { |
| | | if (val.length === 0) { |
| | | this.dialogTreeArr = [] |
| | | return |
| | | } |
| | | const { data: res } = await CustomerTypeSearchPermission({ customertypecode: val.join(',') }) |
| | | this.dialogTreeArr = [ |
| | | { code: '', |
| | | name: '全部', |
| | |
| | | }) |
| | | await this.WkshopChange(this.dialogForm.Wkshop) |
| | | } else if (row.flwtype === 'W') { |
| | | await this.steptypecodeChange(row.flwtype) |
| | | this.dialogForm.CustomerType = [] |
| | | // await this.steptypecodeChange(row.flwtype) |
| | | res.filter(i => i.type === 'W' && i.flag === 'Y').forEach(i => { |
| | | this.dialogForm.CustomerType.push(i.code) |
| | | i.children.forEach(j => { |
| | | if (j.flag === 'Y') { |
| | | this.dialogTreeSelectedArr.push(j.code) |
| | | } |
| | | }) |
| | | }) |
| | | await this.CustomerTypeChange(this.dialogForm.CustomerType) |
| | | } |
| | | |
| | | this.$nextTick(() => { |
| | |
| | | this.dialogForm.steptypecode = 'Z' |
| | | this.dialogTreeArr = [] |
| | | this.dialogForm.Wkshop = [] |
| | | |
| | | this.dialogForm.CustomerType = [] |
| | | this.dialogTreeSelectedArr = [] |
| | | this.$refs.dialogForm.clearValidate() |
| | | }, |