生产任务单和汇报单
parent
2594128248
commit
ee684f737b
|
@ -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')
|
||||
}
|
||||
}
|
|
@ -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>
|
|
@ -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>
|
|
@ -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
|
||||
}
|
||||
|
||||
/* =================================== 商品明细 ============================*/
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue