Commit 979de0f9 authored by 15008242619's avatar 15008242619

退库单退库新增申请人选人功能(暂不部署正式)

parent bd99c880
......@@ -5,16 +5,33 @@
class="list-table"
:basic-data="{ selectData,selectionRows }"
:lay-config="{ typeName: 'InStorageBack', layKey: 'InStorageBackApplyList' }"
@backApply="backApply"
@tableToolHandler="tableToolHandler"
@selectionChange="selectionChange"
/>
<dee-dialog
title="发起退库申请"
:dialog-visible="dialogVisible"
>
<div>确认提交吗?</div>
<el-button @click="confirm">确 定</el-button>
<div style="margin-bottom: 20px;font-size: 14px;font-weight: bolder;">确认提交吗?</div>
<div style="text-align: center;">
<el-button type="primary" @click="confirm">确 定</el-button>
<el-button @click="cancle">取 消</el-button>
</div>
</dee-dialog>
<dee-dialog
title="选择工艺员"
:dialog-visible="setPersonVisible"
>
<dee-form
ref="form"
label-width="100"
:form="form"
:form-data="formData"
:rules="rules"
>
<el-button type="primary" @click="setPersonConfirm">确 定</el-button>
<el-button @click="setPersonCancle">取 消</el-button>
</dee-form>
</dee-dialog>
</div>
</template>
......@@ -35,33 +52,141 @@ export default {
data() {
return {
dialogVisible: false,
selectionRows: []
setPersonVisible: false,
selectionRows: [],
form: {},
formData: [{
split: 1,
data: [
{
title: '设置工艺员',
key: 'userIds',
component: {
clearable: true,
name: 'el-select',
placeholder: '请选择',
multiple: true,
options: []
}
}]
}],
rules: {
userIds: [
{
required: true,
message: '请填写工艺员',
trigger: ['blur', 'change']
}
]
}
}
},
created() {
let httpParams = {
"pageFrom": 1,
"pageSize": 9999,
"searchItems": {
"children": [],
"items": [
{
"fieldName": "source.name",
"operator": "EQ",
"value": "工艺员"
}
],
"operator": "AND"
},
"openProps": [
{
"name": "source",
"pageFrom": 1,
"pageSize": 9999
},
{
"name": "target",
"pageFrom": 1,
"pageSize": 9999
}
],
"sortItem": [
{
"fieldName": "modifyTime",
"sortOrder": "desc"
}
]
}
post('/DxGroupMemberLink/search', httpParams).then(res => {
this.formData[0].data.forEach(item => {
item.key === 'userIds' && (item.component.options = res.items.content.map(row => {
return {
value: row.target.id,
label: row.target.name + '/' + row.target.number
}
}
))
})
}).catch((err) => {
console.log(err)
})
},
methods: {
tableToolHandler(e) {
console.log(e.key.btnValue)
if (e.key.btnValue === 'backApply') {
this.backApply()
}
},
backApply() {
this.dialogVisible = true
},
confirm() {
console.log(this.selectionRows)
let isTkdBack = 0
this.selectionRows.forEach(item => {
if (item.remarks !== '退库单退库'){
if (item.remark !== '退库单退库'){
isTkdBack++
}
})
if (isTkdBack === 0) {
// post('').then()
this.$utils.showMessageSuccess('提交成功')
//退库单退库选人
this.dialogVisible = false
this.setPersonVisible = true
} else if (isTkdBack === this.selectionRows.length) {
post('/InventoryRequest/purchaseApply/submit?applyIds=' + this.selectionRows.map(item => Number(item.id))).then(res => {
this.$utils.showMessageSuccess('提交成功')
}).catch(err => {
this.$utils.showMessageWarning('出现异常,提交失败')
}).finally(()=>{
this.dialogVisible = false
})
} else {
this.$utils.showMessageWarning('退库原因为退库单退库的不能与其他退库类型一起提交')
}
console.log(this.selectionRows)
},
cancle() {
this.dialogVisible = false
},
setPersonConfirm() {
let ids = []
console.log(this.selectionRows)
if (this.selectionRows && this.selectionRows.length) {
ids = this.selectionRows.map(item => item.id)
}
post('/InStorageRequestItem/creator/apply?userIds=' + this.form.userIds, ids).then(res => {
this.$utils.showMessageSuccess('提交成功')
}).catch(err => {
this.$utils.showMessageWrong('出现异常,提交失败')
}).finally(() => {
this.dialogVisible = false
this.setPersonVisible = false
this.$set(this.form, 'userIds', '')
})
},
setPersonCancle() {
this.setPersonVisible = false
this.$set(this.form, 'userIds', '')
},
selectionChange(val) {
this.selectionRows = val
}
......
......@@ -8,16 +8,44 @@
<dee-as-com
ref="applyTable"
class="list-table"
:basic-data=" { selectData: selectData }"
:lay-config="{ typeName: 'InStorageBackItem', layKey: 'batchSign_InStorageMatchBackApply'}"
:basic-data="{ selectData,selectionRows }"
:lay-config="{ typeName: 'InStorageBackItem', layKey: 'batchSign_InStorageMatchBackApply' }"
@tableToolHandler="tableToolHandler"
@selectionChange="selectionChange"
/>
<dee-dialog
title="发起退库申请"
:dialog-visible="dialogVisible"
>
<div style="margin-bottom: 20px;font-size: 14px;font-weight: bolder;">确认提交吗?</div>
<div style="text-align: center;">
<el-button type="primary" @click="confirm">确 定</el-button>
<el-button @click="cancle">取 消</el-button>
</div>
</dee-dialog>
<dee-dialog
title="选择工艺员"
:dialog-visible="setPersonVisible"
>
<dee-form
ref="form"
label-width="100"
:form="form"
:form-data="formData"
:rules="rules"
>
<el-button type="primary" @click="setPersonConfirm">确 定</el-button>
<el-button @click="setPersonCancle">取 消</el-button>
</dee-form>
</dee-dialog>
</div>
</template>
<script>
import { post } from '@/utils/http'
export default {
name: 'InStorageUseOutBackApply',
components: {},
props: {
selectData: {
type: Object,
......@@ -25,14 +53,151 @@ export default {
}
},
data() {
return {}
return {
dialogVisible: false,
setPersonVisible: false,
selectionRows: [],
form: {},
formData: [{
split: 1,
data: [
{
title: '设置工艺员',
key: 'userIds',
component: {
clearable: true,
name: 'el-select',
placeholder: '请选择',
multiple: true,
options: []
}
}]
}],
rules: {
userIds: [
{
required: true,
message: '请填写工艺员',
trigger: ['blur', 'change']
}
]
}
}
},
created() {
let httpParams = {
"pageFrom": 1,
"pageSize": 9999,
"searchItems": {
"children": [],
"items": [
{
"fieldName": "source.name",
"operator": "EQ",
"value": "工艺员"
}
],
"operator": "AND"
},
"openProps": [
{
"name": "source",
"pageFrom": 1,
"pageSize": 9999
},
{
"name": "target",
"pageFrom": 1,
"pageSize": 9999
}
],
"sortItem": [
{
"fieldName": "modifyTime",
"sortOrder": "desc"
}
]
}
post('/DxGroupMemberLink/search', httpParams).then(res => {
this.formData[0].data.forEach(item => {
item.key === 'userIds' && (item.component.options = res.items.content.map(row => {
return {
value: row.target.id,
label: row.target.name + '/' + row.target.number
}
}
))
})
}).catch((err) => {
console.log(err)
})
},
computed: {},
watch: {},
created() {},
mounted() {},
mounted() { },
// 组件方法
methods: {}
methods: {
tableToolHandler(e) {
console.log(e.key.btnValue)
if (e.key.btnValue === 'backApply') {
this.backApply()
}
},
backApply() {
this.dialogVisible = true
},
confirm() {
console.log(this.selectionRows)
let isTkdBack = 0
this.selectionRows.forEach(item => {
if (item.inventoryReq.remark !== '退库单退库') {
isTkdBack++
}
})
if (isTkdBack === 0) {
//退库单退库选人
this.dialogVisible = false
this.setPersonVisible = true
} else if (isTkdBack === this.selectionRows.length) {
post('/DxWorkflowTask/apply/pass', this.selectionRows.map(item => item.processTaskId)).then(res => {
this.$utils.showMessageSuccess('提交成功')
}).catch(err => {
this.$utils.showMessageWarning('出现异常,提交失败')
}).finally(()=>{
this.dialogVisible = false
})
} else {
this.$utils.showMessageWarning('退库原因为退库单退库的不能与其他退库类型一起提交')
}
},
cancle() {
this.dialogVisible = false
},
setPersonConfirm() {
let ids = []
console.log(this.selectionRows)
if (this.selectionRows && this.selectionRows.length) {
ids = this.selectionRows.map(item => item.processTaskId)
}
post('/InStorageRequestItem/creator/applyByItems?userIds=' + this.form.userIds, ids).then(res => {
this.$utils.showMessageSuccess('提交成功')
}).catch(err => {
this.$utils.showMessageWarning('出现异常,提交失败')
}).finally(()=>{
this.dialogVisible = false
this.setPersonVisible = false
this.$set(this.form, 'userIds', '')
})
},
setPersonCancle() {
this.setPersonVisible = false
this.$set(this.form, 'userIds', '')
},
selectionChange(val) {
this.selectionRows = val
}
}
}
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment