|
|
|
@ -124,7 +124,7 @@ |
|
|
|
|
|
|
|
<!-- 拣货出库通知新增/修改 --> |
|
|
|
<el-dialog title="拣货出库通知" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="545px"> |
|
|
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> |
|
|
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" ref="modalForm" style="margin-left: 7px;margin-top: -5px;"> |
|
|
|
<el-form-item label="BU" prop="bu"> |
|
|
|
<el-select v-model="modalData.bu" placeholder="请选择" :disabled="modalDisableFlag" style="width: 100px"> |
|
|
|
<el-option |
|
|
|
@ -153,8 +153,8 @@ |
|
|
|
value-format="yyyy-MM-dd"> |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="出库类别"> |
|
|
|
<el-select v-model="modalData.category" placeholder="请选择" clearable style="width: 140px"> |
|
|
|
<el-form-item label="出库类别" prop="category"> |
|
|
|
<el-select v-model="modalData.category" placeholder="请选择" style="width: 140px"> |
|
|
|
<el-option |
|
|
|
v-for="item in categoryList" |
|
|
|
:key="item.crdcode" |
|
|
|
@ -164,18 +164,28 @@ |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px"> |
|
|
|
<el-form :inline="true" label-position="top" :rules="rules" ref="modalForm" :model="modalData" style="margin-left: 7px"> |
|
|
|
<!-- 采购退货时显示供应商 --> |
|
|
|
<el-form-item v-if="modalData.orderType === '采购退货'"> |
|
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(506)"><a href="#">供应商</a></span> |
|
|
|
<el-input v-model="modalData.customerId" @change="customerBlur(506)" style="width: 120px"></el-input> |
|
|
|
<el-input v-model="modalData.customerName" disabled style="width: 380px"></el-input> |
|
|
|
<el-input v-model="modalData.customerName" disabled style="width: 223px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<!-- 其他出库时显示直接客户 --> |
|
|
|
<el-form-item v-else-if="modalData.orderType === '其他出库'"> |
|
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(507)"><a href="#">直接客户</a></span> |
|
|
|
<el-input v-model="modalData.customerId" @change="customerBlur(507)" style="width: 120px"></el-input> |
|
|
|
<el-input v-model="modalData.customerName" disabled style="width: 380px"></el-input> |
|
|
|
<el-input v-model="modalData.customerName" disabled style="width: 223px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="部门" prop="departmentNo"> |
|
|
|
<el-select v-model="modalData.departmentNo" placeholder="请选择" style="width: 140px"> |
|
|
|
<el-option |
|
|
|
v-for="item in departmentList" |
|
|
|
:key="item.departmentNo" |
|
|
|
:label="item.departmentNo + '-' + item.departmentDesc" |
|
|
|
:value="item.departmentNo"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top" style="margin-left: 7px"> |
|
|
|
@ -641,6 +651,7 @@ |
|
|
|
updateOutboundDetail, // 批量编辑明细 |
|
|
|
getOutboundDetail2, // 获取出库明细 |
|
|
|
getOutboundCategoryList, // 查询出库类别列表 |
|
|
|
getDepartmentList, // 查询部门列表 |
|
|
|
} from "@/api/qc/outbound_notification.js" |
|
|
|
import { |
|
|
|
getSiteAndBuByUserName, |
|
|
|
@ -721,6 +732,7 @@ |
|
|
|
category: '', // 出库类别 |
|
|
|
}, |
|
|
|
categoryList: [], // 出库类别列表 |
|
|
|
departmentList: [], // 部门列表 |
|
|
|
dataList: [], |
|
|
|
detailList: [], |
|
|
|
userBuList: [], |
|
|
|
@ -877,6 +889,24 @@ |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100, |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 620, |
|
|
|
serialNumber: '620Table1DepartmentName', |
|
|
|
tableId: "620Table1", |
|
|
|
tableName: "拣货出库任务表", |
|
|
|
columnProp: 'departmentName', |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
columnLabel: '部门', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 120, |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 620, |
|
|
|
@ -1092,6 +1122,20 @@ |
|
|
|
message: ' ', |
|
|
|
trigger: ['blur','change'] |
|
|
|
} |
|
|
|
], |
|
|
|
category: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: ['blur','change'] |
|
|
|
} |
|
|
|
], |
|
|
|
departmentNo: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: ['blur','change'] |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
|
searchLoading: false, |
|
|
|
@ -1214,16 +1258,24 @@ |
|
|
|
orderNo: '', |
|
|
|
orderType: '采购退货', // 默认为采购退货 |
|
|
|
orderStatus: '草稿', |
|
|
|
requiredOutboundDate: '', |
|
|
|
requiredOutboundDate: this.dayjs().format('YYYY-MM-DD'), // 默认为当天 |
|
|
|
customerId: '', |
|
|
|
customerName: '', |
|
|
|
remarks: '', |
|
|
|
createdBy: this.$store.state.user.name, |
|
|
|
category: '', // 出库类别 |
|
|
|
departmentNo: '', // 部门 |
|
|
|
} |
|
|
|
this.modalDisableFlag = false |
|
|
|
this.loadCategoryList() // 加载出库类别列表 |
|
|
|
this.loadDepartmentList() // 加载部门列表 |
|
|
|
this.modalFlag = true |
|
|
|
// 重置表单验证状态 |
|
|
|
this.$nextTick(() => { |
|
|
|
if (this.$refs.modalForm) { |
|
|
|
this.$refs.modalForm.clearValidate() |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
updateModal (row) { |
|
|
|
@ -1244,51 +1296,55 @@ |
|
|
|
remarks: row.remarks, |
|
|
|
updatedBy: this.$store.state.user.name, |
|
|
|
category: row.category || '', // 出库类别 |
|
|
|
departmentNo: row.departmentNo || '', // 部门 |
|
|
|
} |
|
|
|
this.modalDisableFlag = true |
|
|
|
this.loadCategoryList() // 加载出库类别列表 |
|
|
|
this.loadDepartmentList() // 加载部门列表 |
|
|
|
this.modalFlag = true |
|
|
|
// 重置表单验证状态 |
|
|
|
this.$nextTick(() => { |
|
|
|
if (this.$refs.modalForm) { |
|
|
|
this.$refs.modalForm.clearValidate() |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
saveData () { |
|
|
|
if (this.modalData.bu === '' || this.modalData.bu == null) { |
|
|
|
this.$message.warning('请选择BU!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.modalData.orderType === '' || this.modalData.orderType == null) { |
|
|
|
this.$message.warning('请选择单据类型!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.modalData.requiredOutboundDate === '' || this.modalData.requiredOutboundDate == null) { |
|
|
|
this.$message.warning('请选择要求出库日期!') |
|
|
|
return |
|
|
|
} |
|
|
|
this.saveLoading = true |
|
|
|
if (this.modalData.flag === '1') { // 新增 |
|
|
|
saveOutboundNotification(this.modalData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.getDataList() |
|
|
|
this.modalFlag = false |
|
|
|
this.$message.success('操作成功') |
|
|
|
} else { |
|
|
|
this.$message.error(data.msg) |
|
|
|
} |
|
|
|
}).finally(()=>{ |
|
|
|
this.saveLoading = false |
|
|
|
}) |
|
|
|
} else { // 修改 |
|
|
|
updateOutboundNotification(this.modalData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.getDataList() |
|
|
|
this.modalFlag = false |
|
|
|
this.$message.success('操作成功') |
|
|
|
} else { |
|
|
|
this.$message.error(data.msg) |
|
|
|
} |
|
|
|
}).finally(()=>{ |
|
|
|
this.saveLoading = false |
|
|
|
}) |
|
|
|
} |
|
|
|
// 使用表单验证 |
|
|
|
this.$refs.modalForm.validate((valid) => { |
|
|
|
if (!valid) { |
|
|
|
this.$message.warning('请填写完整的必填项!') |
|
|
|
return false |
|
|
|
} |
|
|
|
|
|
|
|
this.saveLoading = true |
|
|
|
if (this.modalData.flag === '1') { // 新增 |
|
|
|
saveOutboundNotification(this.modalData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.getDataList() |
|
|
|
this.modalFlag = false |
|
|
|
this.$message.success('操作成功') |
|
|
|
} else { |
|
|
|
this.$message.error(data.msg) |
|
|
|
} |
|
|
|
}).finally(()=>{ |
|
|
|
this.saveLoading = false |
|
|
|
}) |
|
|
|
} else { // 修改 |
|
|
|
updateOutboundNotification(this.modalData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.getDataList() |
|
|
|
this.modalFlag = false |
|
|
|
this.$message.success('操作成功') |
|
|
|
} else { |
|
|
|
this.$message.error(data.msg) |
|
|
|
} |
|
|
|
}).finally(()=>{ |
|
|
|
this.saveLoading = false |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 删除 |
|
|
|
@ -1919,6 +1975,15 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 加载部门列表 |
|
|
|
loadDepartmentList () { |
|
|
|
getDepartmentList({}).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.departmentList = data.rows || [] |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|