| | |
| | | }) |
| | | } |
| | | |
| | | // 往来单位类型基础资料 |
| | | export function CustomerTypePermissions(data) { |
| | | return request({ |
| | | url: 'GeneralBasicData/CustomerTypePermissions', |
| | | method: 'get', |
| | | params: data |
| | | }) |
| | | } |
| | | |
| | | // 往来单位类型查找往来单位基础资料 |
| | | export function CustomerTypeSearchPermission(data) { |
| | | return request({ |
| | | url: 'GeneralBasicData/CustomerTypeSearchPermissions', |
| | | method: 'get', |
| | | params: data |
| | | }) |
| | | } |
| | | |
| | | // 存货树型基础资料 |
| | | export function InventoryTreePermissions(data) { |
| | | return request({ |
| | |
| | | :title="operation==='add'?'新增':'编辑'" |
| | | :visible.sync="dialogVisible" |
| | | width="1100px" |
| | | top="15vh" |
| | | top="5vh" |
| | | :close-on-click-modal="false" |
| | | @closed="handleClose" |
| | | @close="handleClose" |
| | |
| | | </el-form-item> |
| | | </div> |
| | | </el-form> |
| | | |
| | | <!-- :expand-row-keys="expandRowKeys"--> |
| | | <!-- row-key="code"--> |
| | | <el-table |
| | | :data="stepDialogArr" |
| | | style="width: 100%" |
| | | height="300" |
| | | height="600" |
| | | |
| | | border |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | :row-class-name="tableRowClassName" |
| | | > |
| | | <el-table-column type="expand"> |
| | | <template slot-scope="props"> |
| | | <el-table |
| | | :data="props.row.children" |
| | | style="width: 96%;margin: auto;" |
| | | border |
| | | :row-class-name="tableRowClassName" |
| | | > |
| | | <el-table-column |
| | | prop="eqp_code" |
| | | label="设备/往来编码" |
| | | min-width="120" |
| | | /> |
| | | <el-table-column |
| | | prop="eqp_name" |
| | | label="设备/往来名称" |
| | | min-width="120" |
| | | /> |
| | | <el-table-column |
| | | prop="eqp_value" |
| | | label="设备节拍" |
| | | min-width="150" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div style="display: flex"> |
| | | <el-input |
| | | v-model="row.eqp_value" |
| | | placeholder="请输入" |
| | | oninput="value=value.replace(/[^0-9.]/g,'')" |
| | | @change="val=>eqpValueChange(val,row)" |
| | | /> |
| | | <div style="margin-left: 5px">秒</div> |
| | | </div> |
| | | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="stand_value" |
| | | label="生产节拍" |
| | | min-width="120" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div>{{ row.stand_value + ' ' + '秒' }}</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="cavity_qty" |
| | | label="腔型数" |
| | | min-width="120" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-input |
| | | v-model="row.cavity_qty" |
| | | placeholder="请输入" |
| | | oninput="value=value.replace(/[^0-9.]/g,'')" |
| | | @change="val=>cavityQtyChange(val,row)" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="unprice" |
| | | label="工序工价" |
| | | min-width="120" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-input v-model="row.unprice" oninput="value=value.replace(/[^0-9.]/g,'')" /> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="step_seq" |
| | | prop="seq" |
| | | label="工序顺序" |
| | | width="100" |
| | | /> |
| | | <el-table-column |
| | | prop="step_code" |
| | | prop="code" |
| | | label="工序编码" |
| | | width="200" |
| | | /> |
| | | <el-table-column |
| | | prop="step_name" |
| | | prop="name" |
| | | label="工序名称" |
| | | width="200" |
| | | /> |
| | |
| | | editPartName: '', // 编辑时产品名称 |
| | | editRouteName: '', // 编辑时工艺路线名称 |
| | | editStepName: '', // 编辑时加工工序名称 |
| | | operation: '' |
| | | operation: '', |
| | | |
| | | expandRowKeys: []// 默认展开 |
| | | } |
| | | }, |
| | | |
| | |
| | | async routeDialogChange(val) { |
| | | const { data: res } = await RouteSelectStep({ partcode: this.dialogForm.partcode, routecode: val }) |
| | | this.stepDialogArr = res |
| | | |
| | | this.expandRowKeys = this.stepDialogArr.map(i => { |
| | | if (i.children.length > 0) { |
| | | return i.code |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // 新增按钮 |
| | |
| | | this.$refs.dialogForm.validate(valid => { |
| | | if (valid) { |
| | | const children = [] |
| | | this.stepDialogArr.forEach(i => { |
| | | children.push({ |
| | | 'code': i.step_code, |
| | | 'name': i.step_name, |
| | | 'seq': i.step_seq, |
| | | 'isbott': i.isbott, |
| | | 'isend': i.isend, |
| | | 'unprice': i.unprice |
| | | }) |
| | | }) |
| | | // this.stepDialogArr.forEach(i => { |
| | | // children.push({ |
| | | // 'code': i.step_code, |
| | | // 'name': i.step_name, |
| | | // 'seq': i.step_seq, |
| | | // 'isbott': i.isbott, |
| | | // 'isend': i.isend, |
| | | // 'unprice': i.unprice |
| | | // }) |
| | | // }) |
| | | |
| | | const data = [ |
| | | { |
| | | 'partcode': this.dialogForm.partcode, |
| | | 'defaultroute_code': this.dialogForm.routecode, |
| | | 'children': children |
| | | 'children': this.stepDialogArr |
| | | } |
| | | ] |
| | | SaveBeatRate(data).then(res => { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // 设备节拍值改变 |
| | | eqpValueChange(val, row) { |
| | | console.log(val, row) |
| | | if (parseFloat(row.cavity_qty) !== 0) { |
| | | row.stand_value = parseFloat((parseFloat(val) / parseFloat(row.cavity_qty)).toFixed(2)) |
| | | } else { |
| | | row.stand_value = 0 |
| | | } |
| | | }, |
| | | // 腔型数值改变 |
| | | cavityQtyChange(val, row) { |
| | | if (parseFloat(val) !== 0) { |
| | | row.stand_value = parseFloat((parseFloat(row.eqp_value) / parseFloat(val)).toFixed(2)) |
| | | } else { |
| | | row.stand_value = 0 |
| | | } |
| | | }, |
| | | // 获取页面高度 |
| | | getHeight() { |
| | | this.$nextTick(() => { |
| | |
| | | > |
| | | <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 { // 自制 |
| | | this.dialogForm.Wkshop = [] |
| | | this.dialogTreeArr = [] |
| | | } |
| | | // 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() |
| | | }, |