This commit is contained in:
parent
2b4480c100
commit
5b3bce0741
|
|
@ -51,12 +51,12 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 工器具领料-出库
|
// 工器具领料-出库
|
||||||
// {
|
{
|
||||||
// "path": "pages/toolsLease/toolsLeaseOut",
|
"path": "pages/toolsLease/toolsLeaseOut",
|
||||||
// "style": {
|
"style": {
|
||||||
// "navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
// }
|
}
|
||||||
// },
|
},
|
||||||
// 工器具退料
|
// 工器具退料
|
||||||
{
|
{
|
||||||
"path": "pages/toolsBack/toolsBack",
|
"path": "pages/toolsBack/toolsBack",
|
||||||
|
|
|
||||||
|
|
@ -258,7 +258,6 @@ const onHandleOutbound = async () => {
|
||||||
// 组装出库参数
|
// 组装出库参数
|
||||||
const paramsList = []
|
const paramsList = []
|
||||||
codeDeviceList.value.map((e) => {
|
codeDeviceList.value.map((e) => {
|
||||||
if (e.checked) {
|
|
||||||
paramsList.push({
|
paramsList.push({
|
||||||
leaseType: 0,
|
leaseType: 0,
|
||||||
maId: e.maId,
|
maId: e.maId,
|
||||||
|
|
@ -269,7 +268,6 @@ const onHandleOutbound = async () => {
|
||||||
typeId,
|
typeId,
|
||||||
publishTask,
|
publishTask,
|
||||||
})
|
})
|
||||||
}
|
|
||||||
})
|
})
|
||||||
console.log('mmmmmmmmmmmmmmmm', paramsList)
|
console.log('mmmmmmmmmmmmmmmm', paramsList)
|
||||||
const res = await setOutboundNumAPI({ leaseOutDetailsList: paramsList })
|
const res = await setOutboundNumAPI({ leaseOutDetailsList: paramsList })
|
||||||
|
|
@ -278,7 +276,7 @@ const onHandleOutbound = async () => {
|
||||||
title: '出库成功!',
|
title: '出库成功!',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
})
|
})
|
||||||
getCodeDetailData(queryParams.value.id, queryParams.value.publishTask, queryParams.value.typeId) //获取详情
|
back()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -410,15 +408,9 @@ const onCodeIdentify = () => {
|
||||||
|
|
||||||
// 扫码识别按钮
|
// 扫码识别按钮
|
||||||
const scanStart = () => {
|
const scanStart = () => {
|
||||||
// if (scanQrCodeRef.value) {
|
if (scanQrCodeRef.value) {
|
||||||
// scanQrCodeRef.value.scanQrCode()
|
scanQrCodeRef.value.scanQrCode()
|
||||||
// }
|
}
|
||||||
// 扫码识别
|
|
||||||
uni.scanCodde({
|
|
||||||
success: (res) => {
|
|
||||||
console.log('🚀 ~ scanStart ~ res:', res)
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理扫描成功事件
|
// 处理扫描成功事件
|
||||||
|
|
|
||||||
|
|
@ -38,10 +38,10 @@
|
||||||
></eselect>
|
></eselect>
|
||||||
<uni-easyinput v-else v-model="formData.projectName" disabled></uni-easyinput>
|
<uni-easyinput v-else v-model="formData.projectName" disabled></uni-easyinput>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item label="领料人" required name="leasePerson">
|
<uni-forms-item label="领料人" required name="leasePerson" v-if="opts.isNew != 0">
|
||||||
<uni-easyinput v-model="formData.leasePerson" placeholder="请输入内容"></uni-easyinput>
|
<uni-easyinput v-model="formData.leasePerson" placeholder="请输入内容"></uni-easyinput>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item label="联系电话" required name="phone">
|
<uni-forms-item label="联系电话" required name="phone" v-if="opts.isNew != 0">
|
||||||
<uni-easyinput
|
<uni-easyinput
|
||||||
v-model="formData.phone"
|
v-model="formData.phone"
|
||||||
placeholder="请输入内容"
|
placeholder="请输入内容"
|
||||||
|
|
@ -65,7 +65,9 @@
|
||||||
<uni-th width="180" align="center">类型名称</uni-th>
|
<uni-th width="180" align="center">类型名称</uni-th>
|
||||||
<uni-th width="180" align="center">规格型号</uni-th>
|
<uni-th width="180" align="center">规格型号</uni-th>
|
||||||
<uni-th align="center">在库数</uni-th>
|
<uni-th align="center">在库数</uni-th>
|
||||||
<uni-th width="204" align="center">领用数</uni-th>
|
<uni-th width="204" align="center">{{
|
||||||
|
opts.value.isNew != 0 ? '领用数' : '出库数'
|
||||||
|
}}</uni-th>
|
||||||
<uni-th width="120" align="center">操作</uni-th>
|
<uni-th width="120" align="center">操作</uni-th>
|
||||||
</uni-tr>
|
</uni-tr>
|
||||||
<uni-tr v-for="(item, index) in tableData" :key="index">
|
<uni-tr v-for="(item, index) in tableData" :key="index">
|
||||||
|
|
@ -103,7 +105,7 @@
|
||||||
</uni-table>
|
</uni-table>
|
||||||
|
|
||||||
<button style="width: 100%; margin: 50px 0" size="mini" type="primary" @click="submit">
|
<button style="width: 100%; margin: 50px 0" size="mini" type="primary" @click="submit">
|
||||||
确定
|
{{ opts.isNew == 0 ? '出 库' : '确 定' }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -119,6 +121,7 @@ import {
|
||||||
addLeaseTask,
|
addLeaseTask,
|
||||||
editLeaseTask,
|
editLeaseTask,
|
||||||
detailsLeaseTask,
|
detailsLeaseTask,
|
||||||
|
leaseOutApi,
|
||||||
} from '@/services/back.js'
|
} from '@/services/back.js'
|
||||||
|
|
||||||
const title = ref('工器具领料申请')
|
const title = ref('工器具领料申请')
|
||||||
|
|
@ -134,7 +137,7 @@ const equipmentId = ref()
|
||||||
const teamRange = ref([]) // 班组
|
const teamRange = ref([]) // 班组
|
||||||
const prodRange = ref([]) // 工程
|
const prodRange = ref([]) // 工程
|
||||||
const equipmentList = ref([]) // 工器具
|
const equipmentList = ref([]) // 工器具
|
||||||
const rules = {
|
const rules = ref({
|
||||||
teamId: {
|
teamId: {
|
||||||
rules: [{ required: true, errorMessage: '请选择班组' }],
|
rules: [{ required: true, errorMessage: '请选择班组' }],
|
||||||
},
|
},
|
||||||
|
|
@ -147,7 +150,7 @@ const rules = {
|
||||||
phone: {
|
phone: {
|
||||||
rules: [{ required: true, errorMessage: '请填写联系电话' }],
|
rules: [{ required: true, errorMessage: '请填写联系电话' }],
|
||||||
},
|
},
|
||||||
}
|
})
|
||||||
const tableData = ref([])
|
const tableData = ref([])
|
||||||
|
|
||||||
// 编辑获取详情
|
// 编辑获取详情
|
||||||
|
|
@ -189,9 +192,10 @@ const getProjectListApi = async () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 获取工具器
|
// 获取工具器
|
||||||
const getEquipmentList = async () => {
|
const getEquipmentList = async (params) => {
|
||||||
|
console.log('🚀 ~ getEquipmentList ~ params:', params)
|
||||||
try {
|
try {
|
||||||
const res = await getTypeTreeList()
|
const res = await getTypeTreeList(params)
|
||||||
// machineList.value = res.data
|
// machineList.value = res.data
|
||||||
if (res.data.length > 0) {
|
if (res.data.length > 0) {
|
||||||
equipmentList.value = formatEquipmentTree(res.data)
|
equipmentList.value = formatEquipmentTree(res.data)
|
||||||
|
|
@ -257,6 +261,14 @@ const changeProd = (e) => {
|
||||||
// 选择工器具
|
// 选择工器具
|
||||||
const changeEquipment = (e) => {
|
const changeEquipment = (e) => {
|
||||||
console.log('🚀 ~ changeEquipment ~ e:', e)
|
console.log('🚀 ~ changeEquipment ~ e:', e)
|
||||||
|
if (e.manageType != 1 && opts.value.isNew == 0) {
|
||||||
|
// 提示
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '请选择数量设备',
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
// 从 equipmentList.value 中获取点击id的上一级的 typeName
|
// 从 equipmentList.value 中获取点击id的上一级的 typeName
|
||||||
const equipment = findEquipmentById(equipmentList.value, e.parentId)
|
const equipment = findEquipmentById(equipmentList.value, e.parentId)
|
||||||
tableData.value.push({
|
tableData.value.push({
|
||||||
|
|
@ -316,13 +328,22 @@ const submit = () => {
|
||||||
}
|
}
|
||||||
console.log('🚀 ~ .then ~ params:', params)
|
console.log('🚀 ~ .then ~ params:', params)
|
||||||
try {
|
try {
|
||||||
if (!opts.value.isEdit) {
|
if (!opts.value.isEdit && opts.value.isNew != 0) {
|
||||||
const res = await addLeaseTask(params)
|
const res = await addLeaseTask(params)
|
||||||
console.log('🚀 ~ .then ~ res:', res)
|
console.log('🚀 ~ .then ~ res:', res)
|
||||||
back()
|
back()
|
||||||
} else {
|
} else if (opts.value.isEdit && opts.value.isNew != 0) {
|
||||||
const res = await editLeaseTask(params)
|
const res = await editLeaseTask(params)
|
||||||
back()
|
back()
|
||||||
|
} else {
|
||||||
|
tableData.value.forEach((item) => {
|
||||||
|
item.isApp = '0'
|
||||||
|
item.isNew = '0'
|
||||||
|
item.parentId = opts.value.parentId
|
||||||
|
item.outNum = item.preNum
|
||||||
|
})
|
||||||
|
await leaseOutApi({ leaseOutDetailsList: tableData.value })
|
||||||
|
back()
|
||||||
}
|
}
|
||||||
// 提示
|
// 提示
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|
@ -346,11 +367,19 @@ const back = () => {
|
||||||
onLoad((opt) => {
|
onLoad((opt) => {
|
||||||
console.log('onLoad', opt)
|
console.log('onLoad', opt)
|
||||||
opts.value = opt.params ? JSON.parse(opt.params) : {}
|
opts.value = opt.params ? JSON.parse(opt.params) : {}
|
||||||
title.value = opts.value.isEdit ? '编辑工器具领料' : '新增工器具领料'
|
title.value = opts.value.isEdit && opts.value.isNew != 0 ? '编辑工器具领料' : '新增工器具领料'
|
||||||
|
if (opts.value.isNew == 0) {
|
||||||
|
console.log('🚀 ~ onLoad ~ opts.value.isNew:', opts.value.isNew)
|
||||||
|
formData.teamId = opts.value.teamId
|
||||||
|
formData.teamName = opts.value.teamName
|
||||||
|
formData.projectId = opts.value.projectId
|
||||||
|
formData.projectName = opts.value.projectName
|
||||||
|
rules.value = {}
|
||||||
|
}
|
||||||
getTeamList()
|
getTeamList()
|
||||||
getProjectListApi()
|
getProjectListApi()
|
||||||
getEquipmentList()
|
getEquipmentList()
|
||||||
if (opts.value.isEdit) {
|
if (opts.value.isEdit && opts.value.isNew != 0) {
|
||||||
getDetailsById()
|
getDetailsById()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="df-btn">
|
<div class="df-btn">
|
||||||
<button class="btn" size="mini" type="primary" @click="">新增数量出库</button>
|
<button class="btn" size="mini" type="primary" @click="addLeaseNum">新增数量出库</button>
|
||||||
<button class="btn" size="mini" type="primary" @click="">新增编码出库</button>
|
<button class="btn" size="mini" type="primary" @click="">新增编码出库</button>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
|
@ -98,6 +98,24 @@ const handleItem = (item) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 数量新增
|
||||||
|
const addLeaseNum = () => {
|
||||||
|
const params = {
|
||||||
|
manageType: 1,
|
||||||
|
isApp: 0,
|
||||||
|
isNew: 0,
|
||||||
|
teamId: opts.value.teamId,
|
||||||
|
teamName: opts.value.teamName,
|
||||||
|
projectId: opts.value.projectId,
|
||||||
|
projectName: opts.value.projectName,
|
||||||
|
parentId: tableList.value[0].parentId,
|
||||||
|
isEdit: true,
|
||||||
|
}
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/toolsLease/toolsLeaseAdd?params=' + JSON.stringify(params),
|
||||||
|
})
|
||||||
|
}
|
||||||
const back = () => {
|
const back = () => {
|
||||||
uni.navigateBack({
|
uni.navigateBack({
|
||||||
delta: 1,
|
delta: 1,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue