| | |
| | | > |
| | | <div class="elForm"> |
| | | <el-form-item label="订单状态" style=" display: flex;"> |
| | | <el-select v-model="form.erporderstus" :popper-append-to-body="false" style="width: 200px" placeholder="请选择"> |
| | | <el-select |
| | | v-model="form.erporderstus" |
| | | :popper-append-to-body="false" |
| | | style="width: 200px" |
| | | placeholder="请选择" |
| | | > |
| | | <el-option |
| | | v-for="item in erporderstusArr" |
| | | :key="item.code" |
| | |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="组织名称" style=" display: flex;"> |
| | | <el-input v-model="form.OrgName" placeholder="请输入" style="width: 200px" /> |
| | | <el-form-item label="订单编号" style=" display: flex;"> |
| | | <el-input v-model="form.erpordercode" placeholder="请输入" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="组织类型" style=" display: flex;"> |
| | | <el-select v-model="form.OrgType" :popper-append-to-body="false" style="width: 200px" placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in OrgTypeArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | |
| | | <el-form-item label="产品编码" style=" display: flex;"> |
| | | <el-input v-model="form.partcode" style="width: 200px" placeholder="请输入" /> |
| | | </el-form-item> |
| | | <el-form-item label="产品名称" style=" display: flex;"> |
| | | <el-input v-model="form.partname" style="width: 200px" placeholder="请输入" /> |
| | | </el-form-item> |
| | | <el-form-item label="产品规格" style=" display: flex;"> |
| | | <el-input v-model="form.partspec" style="width: 200px" placeholder="请输入" /> |
| | | </el-form-item> |
| | | <el-form-item label="交付时间" style=" display: flex;"> |
| | | <el-date-picker |
| | | v-model="form.paydate" |
| | | type="date" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | style="width: 200px" |
| | | placeholder="选择日期" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="创建人员" style=" display: flex;"> |
| | | <el-input v-model="form.UserName" style="width: 200px" placeholder="请输入" /> |
| | | <el-input v-model="form.creatuser" style="width: 200px" placeholder="请输入" /> |
| | | </el-form-item> |
| | | <el-form-item label="创建时间" style=" display: flex;"> |
| | | <el-date-picker |
| | | v-model="form.createdate" |
| | | type="date" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | style="width: 200px" |
| | | placeholder="选择日期" |
| | | /> |
| | | </el-form-item> |
| | | </div> |
| | | <div style="display: flex;align-items: start;margin-top: 5px;z-index: 2"> |
| | |
| | | </div> |
| | | <el-divider /> |
| | | <div style="margin-left: 10px;display: flex"> |
| | | <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-button |
| | | type="primary" |
| | | icon="el-icon-refresh-right" |
| | | @click="reset('update')" |
| | | >同步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>--> |
| | | </div> |
| | | <el-divider /> |
| | | <div class="elTableDiv"> |
| | |
| | | <!-- width="50"--> |
| | | <!-- />--> |
| | | <el-table-column |
| | | width="50" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-radio |
| | | v-model="radioSelected" |
| | | :label="row.wo" |
| | | style="color: #fff;padding-left: 10px; margin-right: -25px;" |
| | | @change.native="getCurrentRow(row.wo)" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="RowNum" |
| | | width="50" |
| | | label="序号" |
| | | /> |
| | | <el-table-column |
| | | prop="org_code" |
| | | label="组织编码" |
| | | prop="status" |
| | | label="订单状态" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="org_name" |
| | | label="组织名称" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="description" |
| | | label="组织类型" |
| | | sortable="custom" |
| | | width="110" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.description==='F'">工厂</div> |
| | | <div v-if="row.description==='D'">部门</div> |
| | | <div v-if="row.description==='W'">车间</div> |
| | | <div v-if="row.description==='K'">科室</div> |
| | | <div v-if="row.description==='L'">生产线</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 |
| | | prop="parentorg_name" |
| | | label="上级单位" |
| | | prop="wo" |
| | | label="订单编号" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="lm_user" |
| | | prop="partcode" |
| | | label="产品编码" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="partname" |
| | | label="产品名称" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="partspec" |
| | | label="产品规格" |
| | | sortable="custom" |
| | | width="110" |
| | | /> |
| | | <el-table-column |
| | | prop="qty" |
| | | label="订单数量" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="wkshp_name" |
| | | label="生产车间" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="paydate" |
| | | label="要求交付时间" |
| | | sortable="custom" |
| | | width="160" |
| | | /> |
| | | <el-table-column |
| | | prop="createuser" |
| | | label="创建人员" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="lm_date" |
| | | prop="createdate" |
| | | label="创建时间" |
| | | 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%" |
| | | width="60%" |
| | | top="15vh" |
| | | :close-on-click-modal="false" |
| | | @closed="handleClose" |
| | | @close="handleClose" |
| | | > |
| | | <el-form ref="dialogForm" :rules="dialogFormRules" :model="dialogForm" label-width="80px"> |
| | | <el-form-item label="组织类型" prop="OrgType" /> |
| | | <el-form-item label="组织编码" prop="OrgCode"> |
| | | <el-input v-model="dialogForm.OrgCode" :disabled="operation!=='add'" style="width: 220px" /> |
| | | </el-form-item> |
| | | <el-form-item label="组织名称" prop="OrgName"> |
| | | <el-input v-model="dialogForm.OrgName" style="width: 220px" /> |
| | | </el-form-item> |
| | | <el-form-item prop="SupUnit" label="上级单位"> |
| | | <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px"> |
| | | <el-form-item label="订单状态" prop="erporderstus"> |
| | | <el-select |
| | | v-model="dialogForm.SupUnit" |
| | | style="width: 220px" |
| | | placeholder="请选择" |
| | | v-model="dialogForm.erporderstus" |
| | | disabled |
| | | :popper-append-to-body="false" |
| | | style="width: 200px" |
| | | placeholder="请选择" |
| | | > |
| | | <el-option |
| | | v-for="item in SupUnitArr" |
| | | v-for="item in erporderstusArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="订单编号" prop="erpordercode"> |
| | | <el-input v-model="dialogForm.erpordercode" disabled style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="产品编码" prop="partcode"> |
| | | <el-input v-model="dialogForm.partcode" disabled style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="产品名称" prop="partname"> |
| | | <el-input v-model="dialogForm.partname" disabled style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="订单数量" prop="erpqty"> |
| | | <el-input v-model="dialogForm.erpqty" disabled style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="产品规格" prop="partspec"> |
| | | <el-input v-model="dialogForm.partspec" disabled style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="生产车间" prop="wkshopname"> |
| | | <el-input v-model="dialogForm.wkshopname" disabled style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="所属仓库" prop="warehousename"> |
| | | <el-input v-model="dialogForm.warehousename" disabled style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="下单数量" prop="markqty"> |
| | | <el-input |
| | | v-model="dialogForm.markqty" |
| | | oninput="value=value.replace(/[^0-9.]/g,'')" |
| | | style="width: 200px" |
| | | /> |
| | | </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"> |
| | | <div class="footerButton"> |
| | | <el-button @click="dialogVisibleCancel">取 消</el-button> |
| | | <el-button type="primary" @click="dialogVisibleConfirm">确 定</el-button> |
| | | <el-button type="primary" @click="dialogVisibleConfirm">下 达</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | |
| | | |
| | | <script> |
| | | 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 { handleDatatime } from '@/utils/global' |
| | | |
| | | const SER_HZ = /^[\u4e00-\u9fa5]+$/ |
| | | export default { |
| | |
| | | rows: 20 // 每页多少条 |
| | | }, |
| | | erporderstusArr: [ |
| | | { code: 'CREATING', name: '进行中' }, |
| | | { code: 'CREATE', name: '未开始' } |
| | | { code: 'NEW', name: '新订单' }, |
| | | { code: 'CREATING', name: '创建中' }, |
| | | { code: 'CREATED', name: '已创建' }, |
| | | { code: 'CLOSED', name: '已关闭' } |
| | | ], |
| | | total: 10, |
| | | 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'] } |
| | | ] |
| | | |
| | | } |
| | |
| | | }, |
| | | created() { |
| | | this.getErpOrderSearch() |
| | | // this.getPartSelect()// 获取产品编码信息 |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.getHeight) |
| | |
| | | search() { |
| | | this.getErpOrderSearch() |
| | | }, |
| | | upload() { |
| | | |
| | | }, |
| | | // 重置 |
| | | reset() { |
| | | this.form.OrgCode = '' |
| | | this.form.OrgName = '' |
| | | this.form.OrgType = '' |
| | | this.form.UserName = '' |
| | | reset(val) { |
| | | this.form.erporderstus = '' |
| | | this.form.erpordercode = '' |
| | | this.form.partcode = '' |
| | | this.form.partname = '' |
| | | this.form.partspec = '' |
| | | this.form.paydate = '' |
| | | this.form.creatuser = '' |
| | | this.form.createdate = '' |
| | | this.getErpOrderSearch() |
| | | if (val.length > 0) { |
| | | this.$message.success('ERP已同步!') |
| | | } |
| | | }, |
| | | |
| | | // 单选框选中获取当前行信息 |
| | | getCurrentRow(wo) { |
| | | this.radioSelected = wo |
| | | }, |
| | | // 订单关闭 |
| | | async orderClose() { |
| | | if (this.radioSelected.length < 1) { |
| | | return this.$message.info('请先选择订单!') |
| | | } |
| | | this.tableData.find(item => { |
| | | if (item.wo === this.radioSelected) { |
| | | if (item.status !== 'NEW') { |
| | | return this.$message.info('此订单非新订单,无法关闭!') |
| | | } else { |
| | | this.$confirm('是否确认关闭订单?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | ClosedErpOrder({ erpordercode: this.radioSelected }).then(res => { |
| | | if (res.code === '200') { |
| | | this.$message.success('订单关闭成功!') |
| | | this.getErpOrderSearch() |
| | | // this.radioSelected = '' |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message.info('已取消关闭!') |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | // 新增按钮 |
| | | add(operation) { |
| | | this.operation = 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() |
| | | }, |
| | | // 对话框取消 |
| | |
| | | }, |
| | | // 对话框确认 |
| | | dialogVisibleConfirm() { |
| | | if (this.dialogForm.markqty < 1 || this.dialogForm.markqty > this.dialogForm.erpqty - this.dialogForm.relse_qty) { |
| | | return this.$message.info('下单数量超出可下单数的范围!') |
| | | } |
| | | if (this.dialogForm.ordernum < 1 || this.dialogForm.ordernum > this.dialogForm.markqty) { |
| | | return this.$message.info('下单单数超出可下单单数的范围!') |
| | | } |
| | | |
| | | 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('下达失败!') |
| | | } |
| | | }) |
| | | } |
| | |
| | | border: none; |
| | | padding: 0 20px; |
| | | } |
| | | |
| | | ::v-deep .el-button--primary:hover { |
| | | border: none; |
| | | } |
| | | |
| | | ::v-deep .el-button--info { |
| | | height: 30px; |
| | | display: flex; |
| | |
| | | height: 30px; |
| | | line-height: 30px; |
| | | } |
| | | |
| | | ::v-deep .el-input__inner:focus { |
| | | border-color: $main_color; |
| | | } |
| | |
| | | border-color: $main_color; |
| | | } |
| | | |
| | | ::v-deep .el-select .el-input__inner:focus{ |
| | | ::v-deep .el-select .el-input__inner:focus { |
| | | border-color: $main_color; |
| | | } |
| | | |
| | | ::v-deep .el-select-dropdown__item.selected{ |
| | | ::v-deep .el-select-dropdown__item.selected { |
| | | color: $main_color; |
| | | } |
| | | ::v-deep .el-checkbox__inner:hover{ |
| | | |
| | | ::v-deep .el-checkbox__inner:hover { |
| | | border-color: $main_color; |
| | | } |
| | | ::v-deep .el-textarea__inner:focus{ |
| | | |
| | | ::v-deep .el-textarea__inner:focus { |
| | | border-color: $main_color; |
| | | } |
| | | |
| | | .elTableDiv{ |
| | | ::v-deep .el-radio__label{ |
| | | display: none; |
| | | } |
| | | } |
| | | |
| | | </style> |