生产任务单和汇报单

main
GaoF 2024-11-19 09:45:28 +08:00
parent 2594128248
commit ee684f737b
5 changed files with 294 additions and 28 deletions

View File

@ -0,0 +1,28 @@
import { baseRequest } from '@/utils/request'
const request = (url, ...arg) => baseRequest(`/pda/changelog/` + url, ...arg)
/**
* PDA更新日志Api接口管理器
*
* @author luojun
* @date 2024/11/15 21:55
**/
export default {
// 获取PDA更新日志分页
pdaChangelogPage(data) {
return request('page', data, 'get')
},
// 提交PDA更新日志表单 edit为true时为编辑默认为新增
pdaChangelogSubmitForm(data, edit = false) {
return request(edit ? 'edit' : 'add', data)
},
// 删除PDA更新日志
pdaChangelogDelete(data) {
return request('delete', data)
},
// 获取PDA更新日志详情
pdaChangelogDetail(data) {
return request('detail', data, 'get')
}
}

View File

@ -0,0 +1,79 @@
<template>
<xn-form-container
:title="formData.id ? '编辑PDA更新日志' : '增加PDA更新日志'"
:width="700"
:visible="visible"
:destroy-on-close="true"
@close="onClose"
>
<a-form ref="formRef" :model="formData" :rules="formRules" layout="vertical">
<a-form-item label="版本号:" name="versionNumber">
<a-input v-model:value="formData.versionNumber" placeholder="请输入版本号" allow-clear />
</a-form-item>
<a-form-item label="版本更新介绍:" name="versionIntroduction">
<a-input v-model:value="formData.versionIntroduction" placeholder="请输入版本更新介绍" allow-clear />
</a-form-item>
<a-form-item label="apk链接" name="apkLink">
<a-input v-model:value="formData.apkLink" placeholder="请输入apk链接" allow-clear />
</a-form-item>
<a-form-item label="状态:" name="state">
<a-input v-model:value="formData.state" placeholder="请输入状态" allow-clear />
</a-form-item>
</a-form>
<template #footer>
<a-button style="margin-right: 8px" @click="onClose"></a-button>
<a-button type="primary" @click="onSubmit" :loading="submitLoading">保存</a-button>
</template>
</xn-form-container>
</template>
<script setup name="pdaChangelogForm">
import { cloneDeep } from 'lodash-es'
import { required } from '@/utils/formRules'
import pdaChangelogApi from '@/api/biz/pdaChangelogApi'
//
const visible = ref(false)
const emit = defineEmits({ successful: null })
const formRef = ref()
//
const formData = ref({})
const submitLoading = ref(false)
//
const onOpen = (record) => {
visible.value = true
if (record) {
let recordData = cloneDeep(record)
formData.value = Object.assign({}, recordData)
}
}
//
const onClose = () => {
formRef.value.resetFields()
formData.value = {}
visible.value = false
}
//
const formRules = {
}
//
const onSubmit = () => {
formRef.value.validate().then(() => {
submitLoading.value = true
const formDataParam = cloneDeep(formData.value)
pdaChangelogApi
.pdaChangelogSubmitForm(formDataParam, formDataParam.id)
.then(() => {
onClose()
emit('successful')
})
.finally(() => {
submitLoading.value = false
})
})
}
//
defineExpose({
onOpen
})
</script>

View File

@ -0,0 +1,140 @@
<template>
<a-card :bordered="false">
<a-form ref="searchFormRef" name="advanced_search" :model="searchFormState" class="ant-advanced-search-form">
<a-row :gutter="24">
<a-col :span="6">
<a-form-item label="版本号" name="versionNumber">
<a-input v-model:value="searchFormState.versionNumber" placeholder="请输入版本号" />
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="状态" name="state">
<a-input v-model:value="searchFormState.state" placeholder="请输入状态" />
</a-form-item>
</a-col>
<a-col :span="6">
<a-button type="primary" @click="tableRef.refresh()"></a-button>
<a-button style="margin: 0 8px" @click="reset"></a-button>
</a-col>
</a-row>
</a-form>
<s-table
ref="tableRef"
:columns="columns"
:data="loadData"
:alert="options.alert.show"
bordered
:row-key="(record) => record.id"
:tool-config="toolConfig"
:row-selection="options.rowSelection"
>
<template #operator class="table-operator">
<a-space>
<a-button type="primary" @click="formRef.onOpen()">
<template #icon><plus-outlined /></template>
新增
</a-button>
<xn-batch-delete
v-if="hasPerm('pdaChangelogBatchDelete')"
:selectedRowKeys="selectedRowKeys"
@batchDelete="deleteBatchPdaChangelog"
/>
</a-space>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'action'">
<a-space>
<a @click="formRef.onOpen(record)" v-if="hasPerm('pdaChangelogEdit')"></a>
<a-divider type="vertical" v-if="hasPerm(['pdaChangelogEdit', 'pdaChangelogDelete'], 'and')" />
<a-popconfirm title="确定要删除吗?" @confirm="deletePdaChangelog(record)">
<a-button type="link" danger size="small" v-if="hasPerm('pdaChangelogDelete')"></a-button>
</a-popconfirm>
</a-space>
</template>
</template>
</s-table>
</a-card>
<Form ref="formRef" @successful="tableRef.refresh()" />
</template>
<script setup name="changelog">
import { cloneDeep } from 'lodash-es'
import Form from './detail/form.vue'
import pdaChangelogApi from '@/api/biz/pdaChangelogApi'
const searchFormState = ref({})
const searchFormRef = ref()
const tableRef = ref()
const formRef = ref()
const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
const columns = [
{
title: '版本号',
dataIndex: 'versionNumber'
},
{
title: '版本更新介绍',
dataIndex: 'versionIntroduction'
},
{
title: 'apk链接',
dataIndex: 'apkLink'
},
{
title: '状态',
dataIndex: 'state'
}
]
//
if (hasPerm(['pdaChangelogEdit', 'pdaChangelogDelete'])) {
columns.push({
title: '操作',
dataIndex: 'action',
align: 'center',
width: 150
})
}
const selectedRowKeys = ref([])
//
const options = {
// columns needTotal: true
alert: {
show: true,
clear: () => {
selectedRowKeys.value = ref([])
}
},
rowSelection: {
onChange: (selectedRowKey, selectedRows) => {
selectedRowKeys.value = selectedRowKey
}
}
}
const loadData = (parameter) => {
const searchFormParam = cloneDeep(searchFormState.value)
return pdaChangelogApi.pdaChangelogPage(Object.assign(parameter, searchFormParam)).then((data) => {
return data
})
}
//
const reset = () => {
searchFormRef.value.resetFields()
tableRef.value.refresh(true)
}
//
const deletePdaChangelog = (record) => {
let params = [
{
id: record.id
}
]
pdaChangelogApi.pdaChangelogDelete(params).then(() => {
tableRef.value.refresh(true)
})
}
//
const deleteBatchPdaChangelog = (params) => {
pdaChangelogApi.pdaChangelogDelete(params).then(() => {
tableRef.value.clearRefreshSelected()
})
}
</script>

View File

@ -72,9 +72,10 @@
</template>
<template v-if="column.dataIndex === 'unitName'">
<a-select
@change="handleSelectUnit($event, record)"
style="width: 100%"
:options="record.unitArr"
v-model:value="record['unitName']"
v-model:value="record['unitId']"
:fieldNames="{
label: 'name',
value: 'id'
@ -104,19 +105,20 @@
</template>
<script setup name="taskDetail">
import inventoryInvoiceApi from '@/api/inventory/inventoryInvoiceApi'
import sysStoreApi from '@/api/base/store/sysStoreApi'
import materialApi from '@/api/base/material/materialApi'
import useFormHandler from '@/hook/useFormHandler'
import {
basicInfoFormRules,
basicInfoFormItems,
productDetailFormItems
} from '@/views/productionBusiness/inventory/invoice/formFields/detailFields'
import { useRoute } from 'vue-router'
import MaterielSelectorPlus from '@/components/Selector/materielSelectorPlus.vue'
import ClientSelectorPlus from '@/components/Selector/clientSelectorPlus.vue'
const route = useRoute()
import inventoryInvoiceApi from '@/api/inventory/inventoryInvoiceApi'
import sysStoreApi from '@/api/base/store/sysStoreApi'
import materialApi from '@/api/base/material/materialApi'
import useFormHandler from '@/hook/useFormHandler'
import {
basicInfoFormItems,
basicInfoFormRules,
productDetailFormItems
} from '@/views/productionBusiness/inventory/invoice/formFields/detailFields'
import {useRoute} from 'vue-router'
import MaterielSelectorPlus from '@/components/Selector/materielSelectorPlus.vue'
import ClientSelectorPlus from '@/components/Selector/clientSelectorPlus.vue'
const route = useRoute()
const formRef1 = ref(null)
let extendData = ref([])
@ -134,6 +136,7 @@
fetchData(route.query.type).then((res) => {
if (res) {
formData.customerId = res.customerId // id
formData.customerName = res.customerName // id
formData.customerNumber = res.customerNumber //
formData.storeId = res.storeId // id
formData.storeName = res.storeName //
@ -141,12 +144,12 @@
}
})
//
const detailList = await inventoryInvoiceApi.inventoryInvoiceDetailList({
invoiceId: formRefs.value.id
})
productDetailData.value = detailList
if(route.query.type === 'EDIT') {
//
productDetailData.value = await inventoryInvoiceApi.inventoryInvoiceDetailList({
invoiceId: formRefs.value.id
})
}
//
const sysStoreTreeList = await sysStoreApi.sysStoreTree()
@ -167,6 +170,14 @@
})
}
const handleSelectUnit = (value, record) => {
record.unitName = record.unitArr.filter(item => item.id === value)[0].name
}
/*
* 根据单位计算发货数量基本计划数量基本发货数量
* */
/* 物料选择器 */
const materielSelectorPlusRef = ref(null)
let materialPackageData = {}
@ -180,12 +191,19 @@
//
const materielBackOk = async (event) => {
productDetailData.value[materielIndex].batchNumber = event.materielSelectedRows[0].batchNumber
//
productDetailData.value[materielIndex].productId = event.materielSelectedRows[0].id
productDetailData.value[materielIndex].productName = event.materielSelectedRows[0].name
productDetailData.value[materielIndex].productNumber = event.materielSelectedRows[0].number
productDetailData.value[materielIndex].specification = event.materielSelectedRows[0].specification
productDetailData.value[materielIndex].packageProportion = event.materielSelectedRows[0].packageProportion
productDetailData.value[materielIndex].baseUnitName = event.materielSelectedRows[0].baseUnitName
productDetailData.value[materielIndex].batchNumber = event.materielSelectedRows[0].batchNumber
productDetailData.value[materielIndex].planAmount = event.materielSelectedRows[0].planAmount
productDetailData.value[materielIndex].baseUnitId = event.materielSelectedRows[0].baseUnitId
productDetailData.value[materielIndex].batchNumber = event.materielSelectedRows[0].batchNumber //
// productDetailData.value[materielIndex].planAmount = event.materielSelectedRows[0].planAmount
//
productDetailData.value[materielIndex].unitArr = await handleMaterialPackageData(event.materielSelectedRows[0].id)
@ -217,6 +235,7 @@
const clientBackOk = (event) => {
formData.customerName = event.clientSelectedRows[0].name
formData.customerId = event.clientSelectedRows[0].id
formData.customerNumber = event.clientSelectedRows[0].number
}
/* =================================== 商品明细 ============================*/

View File

@ -67,9 +67,9 @@
<template v-if="column.dataIndex === 'billNumber'">
<span style="color: #0d84ff">{{ record.billNumber }}</span>
</template>
<template v-if="column.dataIndex === 'state'">
<a-tag :color="tagColorList[record.state - 1]">{{
$TOOL.dictTypeData('PRODUCE_TASK_STATE', record.state || '')
<template v-if="column.dataIndex === 'auditState'">
<a-tag :color="tagColorList[record.auditState - 1]">{{
$TOOL.dictTypeData('INVOICE_AUDIT_STATE', record.auditState || '')
}}</a-tag>
</template>
<template v-if="column.dataIndex === 'type'">
@ -94,9 +94,9 @@
<a-divider
type="vertical"
v-if="hasPerm(['inventoryInvoice:edit', 'inventoryInvoice:delete'], 'and') && record.state === '1'"
v-if="hasPerm(['inventoryInvoice:edit', 'inventoryInvoice:delete'], 'and') && record.auditState === '1'"
/>
<a-dropdown v-if="record.state === '1'">
<a-dropdown v-if="record.auditState === '1'">
<a class="ant-dropdown-link" @click.prevent>
更多
<DownOutlined />
@ -177,7 +177,7 @@
},
{
title: '状态',
dataIndex: 'state',
dataIndex: 'auditState',
align: 'center',
resizable: true,
width: 300,