| | |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-refresh-right" |
| | | @click="reset" |
| | | >同步ERP |
| | | </el-button> |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-switch-button" |
| | | @click="orderClose" |
| | | >订单关闭 |
| | | >关闭订单 |
| | | </el-button> |
| | | <!-- <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button>--> |
| | | <!-- <el-button type="primary" icon="el-icon-upload2" @click="upload">导入</el-button>--> |
| | |
| | | <el-table-column |
| | | width="50" |
| | | > |
| | | <template scope="scope"> |
| | | <template slot-scope="{row}"> |
| | | <el-radio |
| | | v-model="radioSelected" |
| | | :label="scope.$index" |
| | | :label="row.wo" |
| | | style="color: #fff;padding-left: 10px; margin-right: -25px;" |
| | | @change.native="getCurrentRow(scope.row)" |
| | | @change.native="getCurrentRow(row.wo)" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | width="110" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.status==='CREATING'">进行中</div> |
| | | <div v-if="row.status==='NEW'">未开始</div> |
| | | <div v-if="row.status==='NEW'">新订单</div> |
| | | <div v-if="row.status==='CREATING'">创建中</div> |
| | | <div v-if="row.status==='CREATED'">已创建</div> |
| | | <div v-if="row.status==='CLOSED'">已关闭</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | |
| | | /> |
| | | <el-table-column |
| | | prop="wkshp_name" |
| | | label="生成车间" |
| | | label="生产车间" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="paydate" |
| | | label="要求交付时间" |
| | | sortable="custom" |
| | | show-overflow-tooltip |
| | | width="160" |
| | | /> |
| | | <el-table-column |
| | | prop="createuser" |
| | |
| | | <el-table-column |
| | | prop="createdate" |
| | | label="创建时间" |
| | | show-overflow-tooltip |
| | | width="160" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <el-button type="text" @click="edit('edit',row)">编辑</el-button> |
| | | <!-- <el-button type="text" @click="del(row)">删除</el-button>--> |
| | | <el-button type="text" @click="edit('edit',row)">下达</el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | </div> |
| | | |
| | | <el-dialog |
| | | :title="operation==='add'?'新增':'编辑'" |
| | | :title="operation==='add'?'新增':'下达'" |
| | | :visible.sync="dialogVisible" |
| | | width="50%" |
| | | top="15vh" |
| | |
| | | @close="handleClose" |
| | | > |
| | | <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px"> |
| | | <el-form-item label="订单状态" prop="OrgCode"> |
| | | <el-form-item label="订单状态" prop="erporderstus"> |
| | | <el-select |
| | | v-model="form.partcode" |
| | | v-model="dialogForm.erporderstus" |
| | | disabled |
| | | :popper-append-to-body="false" |
| | | style="width: 220px" |
| | | style="width: 200px" |
| | | placeholder="请选择" |
| | | > |
| | | <el-option |
| | |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="订单编号" prop="OrgCode"> |
| | | <el-input v-model="dialogForm.OrgCode" disabled style="width: 220px" /> |
| | | <el-form-item label="订单编号" prop="erpordercode"> |
| | | <el-input v-model="dialogForm.erpordercode" disabled style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="产品编码" prop="OrgName"> |
| | | <el-input v-model="dialogForm.OrgName" disabled style="width: 220px" /> |
| | | <el-form-item label="产品编码" prop="partcode"> |
| | | <el-input v-model="dialogForm.partcode" disabled style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="产品名称" prop="OrgName"> |
| | | <el-input v-model="dialogForm.OrgName" disabled style="width: 220px" /> |
| | | <el-form-item label="产品名称" prop="partname"> |
| | | <el-input v-model="dialogForm.partname" disabled style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="订单数量" prop="OrgName"> |
| | | <el-input v-model="dialogForm.OrgName" disabled style="width: 220px" /> |
| | | <el-form-item label="订单数量" prop="erpqty"> |
| | | <el-input v-model="dialogForm.erpqty" disabled style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="产品规格" prop="OrgName"> |
| | | <el-input v-model="dialogForm.OrgName" disabled style="width: 220px" /> |
| | | <el-form-item label="产品规格" prop="partspec"> |
| | | <el-input v-model="dialogForm.partspec" disabled style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="下达数量" prop="OrgName"> |
| | | <el-input v-model="dialogForm.OrgName" style="width: 220px" /> |
| | | <el-form-item label="生产车间" prop="wkshopname"> |
| | | <el-input v-model="dialogForm.wkshopname" disabled style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="下单数量" prop="OrgName"> |
| | | <el-input v-model="dialogForm.OrgName" style="width: 220px" /> |
| | | <el-form-item label="所属仓库" prop="warehousename"> |
| | | <el-input v-model="dialogForm.warehousename" disabled style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="交付时间" prop="OrgName"> |
| | | <el-date-picker |
| | | v-model="dialogForm.OrgName" |
| | | type="date" |
| | | style="width: 220px" |
| | | placeholder="选择日期" |
| | | <el-form-item label="下单数量" prop="markqty"> |
| | | <el-input |
| | | v-model="dialogForm.markqty" |
| | | oninput="value=value.replace(/[^0-9.]/g,'')" |
| | | style="width: 200px" |
| | | /> |
| | | <!-- <el-input v-model="dialogForm.OrgName" style="width: 220px" />--> |
| | | </el-form-item> |
| | | <el-form-item label="下单单数" prop="ordernum"> |
| | | <el-input |
| | | v-model="dialogForm.ordernum" |
| | | oninput="value=value.replace(/[^0-9.]/g,'')" |
| | | style="width: 200px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="已下单数" prop="relse_qty"> |
| | | <el-input |
| | | v-model="dialogForm.relse_qty" |
| | | disabled |
| | | oninput="value=value.replace(/[^0-9.]/g,'')" |
| | | style="width: 200px" |
| | | /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="交付时间" prop="">--> |
| | | <!-- <el-date-picker--> |
| | | <!-- v-model="dialogForm.markqty"--> |
| | | <!-- type="date"--> |
| | | <!-- style="width: 200px"--> |
| | | <!-- placeholder="选择日期"--> |
| | | <!-- />--> |
| | | <!-- <el-input v-model="dialogForm.OrgName" style="width: 200px" />--> |
| | | <!-- </el-form-item>--> |
| | | |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | |
| | | import Pagination from '@/components/Pagination' |
| | | import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz' |
| | | import { getCookie } from '@/utils/auth' |
| | | import { ErpOrderSearch } from '@/api/scgl' |
| | | import { ClosedErpOrder, ErpOrderSearch, MarkSaveErpOrder } from '@/api/scgl' |
| | | import { PartSelect } from '@/api/zzmx' |
| | | |
| | | const SER_HZ = /^[\u4e00-\u9fa5]+$/ |
| | |
| | | }, |
| | | // partArr: [], |
| | | erporderstusArr: [ |
| | | { code: 'CREATING', name: '进行中' }, |
| | | { code: 'NEW', name: '未开始' } |
| | | { code: 'NEW', name: '新订单' }, |
| | | { code: 'CREATING', name: '创建中' }, |
| | | { code: 'CREATED', name: '已创建' }, |
| | | { code: 'CLOSED', name: '已关闭' } |
| | | ], |
| | | total: 10, |
| | | radioSelected: {}, |
| | | // radioSelected: {}, |
| | | radioSelected: '', |
| | | tableData: [], |
| | | dialogVisible: false, |
| | | dialogForm: { |
| | | OrgType: '', |
| | | OrgCode: '', |
| | | OrgName: '', |
| | | SupUnit: ''// 上级单位 |
| | | partname: '', // 产品名称 |
| | | partspec: '', // 产品规格 |
| | | paydate: '', // 交付时间 |
| | | wkshopname: '', // 车间名称 |
| | | warehousename: '', // 仓库名称 |
| | | |
| | | erporderstus: '', // 订单状态码 |
| | | erpordercode: '', // 订单编号 |
| | | partcode: '', // 产品编码 |
| | | wkshopcode: '', // 车间编码 |
| | | warehousecode: '', // 仓库编码 |
| | | |
| | | erpqty: '', // 订单数量 |
| | | markqty: '', // 下单数量 |
| | | ordernum: '', // 下单单数 |
| | | relse_qty: '' // 已下单数量 |
| | | }, |
| | | operation: '', |
| | | dialogFormRules: { |
| | | OrgType: [ |
| | | { required: true, message: '请输入选择类型', trigger: ['blur', 'change'] } |
| | | // OrgType: [ |
| | | // { required: true, message: '请输入选择类型', trigger: ['blur', 'change'] } |
| | | // ], |
| | | // OrgCode: [ |
| | | // { required: true, validator: validateName, trigger: ['blur', 'change'] } |
| | | // ], |
| | | markqty: [ |
| | | { required: true, message: '请输入下单数量', trigger: ['blur', 'change'] } |
| | | ], |
| | | OrgCode: [ |
| | | { required: true, validator: validateName, trigger: ['blur', 'change'] } |
| | | ], |
| | | OrgName: [ |
| | | { required: true, message: '请输入名称', trigger: ['blur', 'change'] } |
| | | ordernum: [ |
| | | { required: true, message: '请输入下单单数', trigger: ['blur', 'change'] } |
| | | ] |
| | | |
| | | } |
| | |
| | | this.tableData = res.data |
| | | this.total = res.count |
| | | }, |
| | | // syncGetErpOrderSearch() { |
| | | // this.getErpOrderSearch() |
| | | // }, |
| | | // async getPartSelect() { |
| | | // const { data: res } = await PartSelect() |
| | | // this.partArr = res |
| | |
| | | this.getErpOrderSearch() |
| | | }, |
| | | // 单选框选中获取当前行信息 |
| | | getCurrentRow(row) { |
| | | console.log(row, 1) |
| | | this.radioSelected = row |
| | | getCurrentRow(wo) { |
| | | this.radioSelected = wo |
| | | }, |
| | | // 订单关闭 |
| | | orderClose() { |
| | | async orderClose() { |
| | | console.log(this.radioSelected, 1) |
| | | |
| | | this.$confirm('是否确认关闭订单?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.tableData.forEach((item, index) => { |
| | | if (this.radioSelected === item.wo) { |
| | | if (item.status !== 'NEW') { |
| | | return this.$message.info('此订单非新订单,无法关闭!') |
| | | } |
| | | } |
| | | }) |
| | | |
| | | ClosedErpOrder({ erpordercode: this.radioSelected }).then(res => { |
| | | if (res.code === '200') { |
| | | this.$message.success('删除成功!') |
| | | this.getErpOrderSearch() |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message.info('已取消删除') |
| | | }) |
| | | }, |
| | | // 新增按钮 |
| | | add(operation) { |
| | |
| | | this.dialogVisible = true |
| | | |
| | | this.$nextTick(() => { |
| | | this.dialogForm.OrgCode = row.org_code |
| | | this.dialogForm.OrgName = row.org_name |
| | | this.dialogForm.SupUnit = row.parent_id |
| | | }) |
| | | }, |
| | | // 删除按钮 |
| | | async del(row) { |
| | | this.$confirm('是否确认删除?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | DeleteOrganization({ orgid: row.code }).then(res => { |
| | | if (res.code === '200') { |
| | | this.$message.success('删除成功!') |
| | | this.getErpOrderSearch() |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message.info('已取消删除') |
| | | this.dialogForm.erporderstus = row.status |
| | | this.dialogForm.erpordercode = row.wo |
| | | this.dialogForm.partcode = row.partcode |
| | | this.dialogForm.partname = row.partname |
| | | this.dialogForm.partspec = row.partspec |
| | | this.dialogForm.wkshopcode = row.wkshp_code |
| | | this.dialogForm.wkshopname = row.wkshp_name |
| | | this.dialogForm.warehousecode = row.stck_code |
| | | this.dialogForm.warehousename = row.stck_name |
| | | |
| | | this.dialogForm.erpqty = row.qty |
| | | this.dialogForm.markqty = parseFloat(row.qty) - parseFloat(row.relse_qty) |
| | | this.dialogForm.ordernum = 1 |
| | | this.dialogForm.relse_qty = row.relse_qty |
| | | }) |
| | | }, |
| | | // 对话框关闭事件 |
| | | handleClose() { |
| | | this.dialogForm.OrgType = '' |
| | | this.dialogForm.OrgCode = '' |
| | | this.dialogForm.OrgName = '' |
| | | this.dialogForm.SupUnit = '' |
| | | this.dialogForm.erporderstus = '' |
| | | this.dialogForm.erpordercode = '' |
| | | this.dialogForm.partcode = '' |
| | | this.dialogForm.partname = '' |
| | | this.dialogForm.partspec = '' |
| | | this.dialogForm.wkshopcode = '' |
| | | this.dialogForm.wkshopname = '' |
| | | this.dialogForm.warehousecode = '' |
| | | this.dialogForm.warehousename = '' |
| | | |
| | | this.dialogForm.erpqty = '' |
| | | this.dialogForm.markqty = '' |
| | | this.dialogForm.ordernum = '' |
| | | this.dialogForm.relse_qty = '' |
| | | this.$refs.dialogForm.clearValidate() |
| | | }, |
| | | // 对话框取消 |
| | |
| | | this.$refs.dialogForm.validate(valid => { |
| | | if (valid) { |
| | | const data = { |
| | | OrganCode: this.dialogForm.OrgCode, |
| | | OrganName: this.dialogForm.OrgName, |
| | | OperType: this.operation === 'add' ? 'Add' : 'Update', |
| | | Operator: getCookie('admin') |
| | | 'erporderstus': this.dialogForm.erporderstus, |
| | | 'erpordercode': this.dialogForm.erpordercode, |
| | | 'partcode': this.dialogForm.partcode, |
| | | 'wkshopcode': this.dialogForm.wkshopcode, |
| | | 'warehousecode': this.dialogForm.warehousecode, |
| | | 'erpqty': this.dialogForm.erpqty, |
| | | 'markqty': this.dialogForm.markqty, |
| | | 'ordernum': this.dialogForm.ordernum, |
| | | 'relse_qty': this.dialogForm.relse_qty |
| | | } |
| | | AddUpdateOrganization(data).then(res => { |
| | | console.log(data) |
| | | MarkSaveErpOrder(data).then(res => { |
| | | if (res.code === '200') { |
| | | this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') |
| | | this.$message.success('下达成功!') |
| | | this.dialogVisible = false |
| | | this.getErpOrderSearch() |
| | | } else { |
| | | this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!') |
| | | this.$message.error('下达失败!') |
| | | } |
| | | }) |
| | | } |