基础资料优化处理
							parent
							
								
									6740a79d17
								
							
						
					
					
						commit
						af997e65b1
					
				| 
						 | 
				
			
			@ -0,0 +1,32 @@
 | 
			
		|||
import { baseRequest } from '@/utils/request'
 | 
			
		||||
 | 
			
		||||
const request = (url, ...arg) => baseRequest(`/produce/tag/` + url, ...arg)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 生产标签Api接口管理器
 | 
			
		||||
 *
 | 
			
		||||
 * @author Luck
 | 
			
		||||
 * @date  2024/08/07 22:07
 | 
			
		||||
 **/
 | 
			
		||||
export default {
 | 
			
		||||
	// 获取生产标签分页
 | 
			
		||||
	produceTagPage(data) {
 | 
			
		||||
		return request('page', data, 'get')
 | 
			
		||||
	},
 | 
			
		||||
	// 获取生产标签 列表
 | 
			
		||||
	produceTagList(data) {
 | 
			
		||||
		return request('list', data, 'get')
 | 
			
		||||
	},
 | 
			
		||||
	// 提交生产标签表单 edit为true时为编辑,默认为新增
 | 
			
		||||
	produceTagSubmitForm(data, edit = false) {
 | 
			
		||||
		return request(edit ? 'edit' : 'add', data)
 | 
			
		||||
	},
 | 
			
		||||
	// 删除生产标签
 | 
			
		||||
	produceTagDelete(data) {
 | 
			
		||||
		return request('delete', data)
 | 
			
		||||
	},
 | 
			
		||||
	// 获取生产标签详情
 | 
			
		||||
	produceTagDetail(data) {
 | 
			
		||||
		return request('detail', data, 'get')
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -86,8 +86,8 @@
 | 
			
		|||
						<template v-if="column.dataIndex === 'name'">
 | 
			
		||||
							<a-input :disabled="route.query.type === 'SEARCH'" v-model:value="record.name" />
 | 
			
		||||
						</template>
 | 
			
		||||
						<template v-if="column.dataIndex === 'rate'">
 | 
			
		||||
							<a-input disabled v-model:value="record.rate" />
 | 
			
		||||
						<template v-if="column.dataIndex === 'unitRate'">
 | 
			
		||||
							<a-input disabled v-model:value="record.unitRate" />
 | 
			
		||||
						</template>
 | 
			
		||||
					</template>
 | 
			
		||||
				</a-table>
 | 
			
		||||
| 
						 | 
				
			
			@ -138,7 +138,7 @@
 | 
			
		|||
			<a-tab-pane key="7" tab="操作信息" v-if="route.query.type !== 'ADD'">
 | 
			
		||||
				<OperationalInformation :detailData="inform" :colSpan="6"></OperationalInformation>
 | 
			
		||||
			</a-tab-pane>
 | 
			
		||||
			<template #rightExtra v-if="activeKey === '3'">
 | 
			
		||||
			<template #rightExtra v-if="activeKey === '4'">
 | 
			
		||||
				<a-button @click="handleCompute">包装比例转换</a-button>
 | 
			
		||||
			</template>
 | 
			
		||||
		</a-tabs>
 | 
			
		||||
| 
						 | 
				
			
			@ -196,7 +196,6 @@
 | 
			
		|||
				unitOptions = unitList
 | 
			
		||||
 | 
			
		||||
				dataSource.value = packageData
 | 
			
		||||
				console.log(dataSource.value, 'dataSource.value')
 | 
			
		||||
			}
 | 
			
		||||
		})
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -234,7 +233,7 @@
 | 
			
		|||
		materialCategoryList &&
 | 
			
		||||
			baseFormItems.forEach((item) => {
 | 
			
		||||
				if (item.name === 'categoryId') {
 | 
			
		||||
					item.attrs.options = materialCategoryList
 | 
			
		||||
					item.attrs.treeData = materialCategoryList
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -275,13 +274,20 @@
 | 
			
		|||
				})
 | 
			
		||||
 | 
			
		||||
				unitOptions = res
 | 
			
		||||
				formData.packageProportion = null
 | 
			
		||||
				const resFilter = res.filter((item) => item.isBase === 'YES')
 | 
			
		||||
				if (resFilter.length > 0) formData.baseUnitId = resFilter[0].id
 | 
			
		||||
 | 
			
		||||
				dataSource.value.forEach((item) => {
 | 
			
		||||
					item.unitId = null
 | 
			
		||||
					item.productQty = null
 | 
			
		||||
					item.unitRate = null
 | 
			
		||||
				})
 | 
			
		||||
 | 
			
		||||
				// 修改包装关系的默认单位
 | 
			
		||||
				dataSource.value[0].unitId = resFilter[0].id
 | 
			
		||||
				dataSource.value[0].productQty = null
 | 
			
		||||
				dataSource.value[0].rate = resFilter[0].rate
 | 
			
		||||
				dataSource.value[0].unitRate = resFilter[0].rate
 | 
			
		||||
			})
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -430,12 +436,12 @@
 | 
			
		|||
		{
 | 
			
		||||
			label: '物料类型:',
 | 
			
		||||
			name: 'categoryId',
 | 
			
		||||
			type: 'a-select',
 | 
			
		||||
			type: 'a-tree-select',
 | 
			
		||||
			span: 6,
 | 
			
		||||
			rules: [required('请选择物料类型')],
 | 
			
		||||
			attrs: {
 | 
			
		||||
				placeholder: '请选择物料类型',
 | 
			
		||||
				options: tool.dictList('OFFICIAL_ACCOUNT_TYPE'),
 | 
			
		||||
				treeData: [],
 | 
			
		||||
				fieldNames: {
 | 
			
		||||
					label: 'name',
 | 
			
		||||
					value: 'id'
 | 
			
		||||
| 
						 | 
				
			
			@ -447,7 +453,6 @@
 | 
			
		|||
			name: 'brandId',
 | 
			
		||||
			type: 'a-select',
 | 
			
		||||
			span: 6,
 | 
			
		||||
			rules: [required('请选择品牌')],
 | 
			
		||||
			attrs: {
 | 
			
		||||
				placeholder: '请选择品牌',
 | 
			
		||||
				options: [],
 | 
			
		||||
| 
						 | 
				
			
			@ -731,7 +736,7 @@
 | 
			
		|||
		},
 | 
			
		||||
		{
 | 
			
		||||
			title: '换算率',
 | 
			
		||||
			dataIndex: 'rate',
 | 
			
		||||
			dataIndex: 'unitRate',
 | 
			
		||||
			editable: true,
 | 
			
		||||
			align: 'center',
 | 
			
		||||
			width: 200
 | 
			
		||||
| 
						 | 
				
			
			@ -745,9 +750,8 @@
 | 
			
		|||
		}
 | 
			
		||||
	]
 | 
			
		||||
 | 
			
		||||
	const [api, contextHolder] = notification.useNotification()
 | 
			
		||||
	const onChangeUnit = (value, options, record) => {
 | 
			
		||||
		record.rate = options.rate
 | 
			
		||||
		record.unitRate = options.rate
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	const handleCompute = () => {
 | 
			
		||||
| 
						 | 
				
			
			@ -770,7 +774,7 @@
 | 
			
		|||
			// 验证换算率 是否按照 从大到小排序
 | 
			
		||||
			for (let i = 0; i < enabledStateFilter.length - 1; i++) {
 | 
			
		||||
				// 减一以避免越界
 | 
			
		||||
				if (enabledStateFilter[i].rate > enabledStateFilter[i + 1].rate) {
 | 
			
		||||
				if (enabledStateFilter[i].unitRate > enabledStateFilter[i + 1].unitRate) {
 | 
			
		||||
					// 如果当前元素小于下一个元素
 | 
			
		||||
					return notification.error({
 | 
			
		||||
						message: `包装比例转换提示`,
 | 
			
		||||
| 
						 | 
				
			
			@ -783,7 +787,7 @@
 | 
			
		|||
 | 
			
		||||
			let packageProportionCount = []
 | 
			
		||||
			enabledStateFilter.forEach((item) => {
 | 
			
		||||
				packageProportionCount.push(item.productQty * item.rate)
 | 
			
		||||
				packageProportionCount.push(item.productQty * item.unitRate)
 | 
			
		||||
			})
 | 
			
		||||
 | 
			
		||||
			formData.packageProportion = calculateRatios(packageProportionCount).join(':')
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,145 @@
 | 
			
		|||
<template>
 | 
			
		||||
	<xn-form-container title="新增员工" :width="700" :visible="visible" :destroy-on-close="true" @close="onClose">
 | 
			
		||||
		<a-form ref="formRef" :model="formData" :rules="formRules" layout="vertical">
 | 
			
		||||
			<a-row :gutter="16">
 | 
			
		||||
				<a-col :span="24">
 | 
			
		||||
					<a-form-item label="姓名:" name="employeeName">
 | 
			
		||||
						<a-input v-model:value="formData.employeeName" placeholder="请输入姓名" allow-clear disabled />
 | 
			
		||||
					</a-form-item>
 | 
			
		||||
				</a-col>
 | 
			
		||||
				<a-col :span="24">
 | 
			
		||||
					<a-form-item label="手机号码:" name="employeePhone">
 | 
			
		||||
						<a-input v-model:value="formData.employeePhone" placeholder="请输入手机号码" allow-clear disabled />
 | 
			
		||||
					</a-form-item>
 | 
			
		||||
				</a-col>
 | 
			
		||||
				<a-col :span="24">
 | 
			
		||||
					<a-form-item label="是否合适:" name="isFit">
 | 
			
		||||
						<a-select
 | 
			
		||||
							:disabled="pageType === 'SEARCH'"
 | 
			
		||||
							v-model:value="formData.isFit"
 | 
			
		||||
							placeholder="请选择是否合适"
 | 
			
		||||
							:options="tool.dictList('FIT_STATE')"
 | 
			
		||||
							allow-clear
 | 
			
		||||
						/>
 | 
			
		||||
					</a-form-item>
 | 
			
		||||
				</a-col>
 | 
			
		||||
				<a-col :span="24">
 | 
			
		||||
					<a-form-item label="支付方式:" name="payMode">
 | 
			
		||||
						<a-select
 | 
			
		||||
							style="width: 100%"
 | 
			
		||||
							placeholder="请选择支付方式"
 | 
			
		||||
							v-model:value="formData.payMode"
 | 
			
		||||
							:options="tool.dictList('MANUAL_TASK_PAY_MODE')"
 | 
			
		||||
							allowClear
 | 
			
		||||
						/>
 | 
			
		||||
					</a-form-item>
 | 
			
		||||
				</a-col>
 | 
			
		||||
				<a-col :span="24">
 | 
			
		||||
					<a-form-item label="生产数量:" name="amount">
 | 
			
		||||
						<a-input-number
 | 
			
		||||
							style="width: 100%"
 | 
			
		||||
							v-model:value="formData.amount"
 | 
			
		||||
							:min="0.01"
 | 
			
		||||
							@change="amountChange()"
 | 
			
		||||
							:precision="2"
 | 
			
		||||
						/>
 | 
			
		||||
					</a-form-item>
 | 
			
		||||
				</a-col>
 | 
			
		||||
				<a-col :span="24">
 | 
			
		||||
					<a-form-item label="金额:" name="money">
 | 
			
		||||
						<a-input-number style="width: 100%" disabled v-model:value="formData.money" :precision="2" />
 | 
			
		||||
					</a-form-item>
 | 
			
		||||
				</a-col>
 | 
			
		||||
			</a-row>
 | 
			
		||||
		</a-form>
 | 
			
		||||
		<template #footer>
 | 
			
		||||
			<a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
 | 
			
		||||
			<a-button v-if="pageType !== 'SEARCH'" type="primary" @click="onSubmit" :loading="submitLoading">保存</a-button>
 | 
			
		||||
		</template>
 | 
			
		||||
	</xn-form-container>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script setup>
 | 
			
		||||
	import { cloneDeep } from 'lodash-es'
 | 
			
		||||
	import { required } from '@/utils/formRules'
 | 
			
		||||
	import employeeCategoryApi from '@/api/base/employee/employeeCategoryApi'
 | 
			
		||||
	import employeeApi from '@/api/base/employee/employeeApi'
 | 
			
		||||
	import tool from '@/utils/tool'
 | 
			
		||||
	import manualTaskDetailApi from '@/api/base/manual-task/manualTaskDetailApi'
 | 
			
		||||
 | 
			
		||||
	// 抽屉状态
 | 
			
		||||
	const visible = ref(false)
 | 
			
		||||
	const emit = defineEmits({ successful: null })
 | 
			
		||||
	const formRef = ref()
 | 
			
		||||
	const formData = ref({
 | 
			
		||||
		manualTaskId: '',
 | 
			
		||||
		employeeId: '',
 | 
			
		||||
		employeeName: '',
 | 
			
		||||
		employeePhone: '',
 | 
			
		||||
		employeeNumber: '',
 | 
			
		||||
		isFit: '',
 | 
			
		||||
		payMode: '',
 | 
			
		||||
		amount: '',
 | 
			
		||||
		money: ''
 | 
			
		||||
	})
 | 
			
		||||
	let materialProducePrice = 0
 | 
			
		||||
	const submitLoading = ref(false)
 | 
			
		||||
	let pageType = ref('ADD')
 | 
			
		||||
 | 
			
		||||
	// 打开抽屉
 | 
			
		||||
	const onOpen = (record) => {
 | 
			
		||||
		visible.value = true
 | 
			
		||||
 | 
			
		||||
		formData.value.manualTaskId = record.manualTaskId
 | 
			
		||||
		formData.value.employeeId = record.id
 | 
			
		||||
		formData.value.employeeGender = record.gender
 | 
			
		||||
		formData.value.employeeName = record.name
 | 
			
		||||
		formData.value.employeePhone = record.phone
 | 
			
		||||
		formData.value.employeeNumber = record.number
 | 
			
		||||
		formData.value.isFit = record.isFit
 | 
			
		||||
 | 
			
		||||
		materialProducePrice = record.materialProducePrice
 | 
			
		||||
	}
 | 
			
		||||
	// 关闭抽屉
 | 
			
		||||
	const onClose = () => {
 | 
			
		||||
		formRef.value.resetFields()
 | 
			
		||||
		visible.value = false
 | 
			
		||||
		formRef.value = {}
 | 
			
		||||
	}
 | 
			
		||||
	// 默认要校验的refresh
 | 
			
		||||
	const formRules = {
 | 
			
		||||
		name: [required('请输入姓名')],
 | 
			
		||||
		isFit: [required('请选择是否合适')],
 | 
			
		||||
		amount: [required('请输入生产数量')],
 | 
			
		||||
		payMode: [required('请选择支付方式')],
 | 
			
		||||
		money: [required('请输入金额')]
 | 
			
		||||
	}
 | 
			
		||||
	// 验证并提交数据
 | 
			
		||||
	const onSubmit = () => {
 | 
			
		||||
		formRef.value.validate().then(() => {
 | 
			
		||||
			submitLoading.value = true
 | 
			
		||||
			const formDataParam = cloneDeep(formData.value)
 | 
			
		||||
 | 
			
		||||
			manualTaskDetailApi
 | 
			
		||||
				.manualTaskDetailSubmitForm(formDataParam, formDataParam.id)
 | 
			
		||||
				.then((res) => {
 | 
			
		||||
					emit('successful', formData.value)
 | 
			
		||||
					onClose()
 | 
			
		||||
				})
 | 
			
		||||
				.finally(() => {
 | 
			
		||||
					submitLoading.value = false
 | 
			
		||||
				})
 | 
			
		||||
		})
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// 计算每个人员的金额
 | 
			
		||||
	const amountChange = () => {
 | 
			
		||||
		formData.value.money = formData.value.amount * materialProducePrice
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	let treeData = ref([])
 | 
			
		||||
	// 抛出函数
 | 
			
		||||
	defineExpose({
 | 
			
		||||
		onOpen
 | 
			
		||||
	})
 | 
			
		||||
</script>
 | 
			
		||||
| 
						 | 
				
			
			@ -43,38 +43,44 @@
 | 
			
		|||
						</template>
 | 
			
		||||
						<template v-if="column.dataIndex === 'isFit'">
 | 
			
		||||
							<a-select
 | 
			
		||||
								:disabled="route.query.type === 'SEARCH'"
 | 
			
		||||
								v-if="route.query.type === 'ADD'"
 | 
			
		||||
								style="width: 100%"
 | 
			
		||||
								placeholder="请选择是否合适"
 | 
			
		||||
								v-model:value="record.isFit"
 | 
			
		||||
								:options="tool.dictList('FIT_STATE')"
 | 
			
		||||
								allowClear
 | 
			
		||||
							/>
 | 
			
		||||
							<span v-else>{{ $TOOL.dictTypeData('FIT_STATE', record.isFit) }}</span>
 | 
			
		||||
						</template>
 | 
			
		||||
 | 
			
		||||
						<template v-if="column.dataIndex === 'payMode'">
 | 
			
		||||
							<a-select
 | 
			
		||||
								:disabled="route.query.type === 'SEARCH'"
 | 
			
		||||
								v-if="route.query.type === 'ADD'"
 | 
			
		||||
								style="width: 100%"
 | 
			
		||||
								placeholder="请选择支付方式"
 | 
			
		||||
								v-model:value="record.payMode"
 | 
			
		||||
								:options="tool.dictList('MANUAL_TASK_PAY_MODE')"
 | 
			
		||||
								allowClear
 | 
			
		||||
								:disabled="route.query.type !== 'ADD'"
 | 
			
		||||
							/>
 | 
			
		||||
							<span v-else>{{ $TOOL.dictTypeData('MANUAL_TASK_PAY_MODE', record.payMode) }}</span>
 | 
			
		||||
						</template>
 | 
			
		||||
 | 
			
		||||
						<template v-if="column.dataIndex === 'amount'">
 | 
			
		||||
							<a-input-number
 | 
			
		||||
								v-if="route.query.type === 'ADD'"
 | 
			
		||||
								v-model:value="record.amount"
 | 
			
		||||
								:min="0.01"
 | 
			
		||||
								@change="amountChange($event, record)"
 | 
			
		||||
								:precision="2"
 | 
			
		||||
								:disabled="route.query.type === 'SEARCH'"
 | 
			
		||||
								:disabled="route.query.type !== 'ADD'"
 | 
			
		||||
							/>
 | 
			
		||||
							<span v-else>{{ record.amount.toFixed(2) }}</span>
 | 
			
		||||
						</template>
 | 
			
		||||
 | 
			
		||||
						<template v-if="column.dataIndex === 'money'">
 | 
			
		||||
							<a-input-number disabled v-model:value="record.money" :precision="2" />
 | 
			
		||||
							<a-input-number v-if="route.query.type === 'ADD'" disabled v-model:value="record.money" :precision="2" />
 | 
			
		||||
							<span v-else>{{ record.money.toFixed(2) }}</span>
 | 
			
		||||
						</template>
 | 
			
		||||
						<template v-if="column.dataIndex === 'action'">
 | 
			
		||||
							<a-button type="link" @click="handleDelete(record)">删除</a-button>
 | 
			
		||||
| 
						 | 
				
			
			@ -104,15 +110,19 @@
 | 
			
		|||
		:user-page-api="selectorApiFunction.userPageApi"
 | 
			
		||||
		:checkedUserListApi="selectorApiFunction.userListByIdListApi"
 | 
			
		||||
		@onBack="userSelectorOnBack"
 | 
			
		||||
		:radioModel="route.query.type === 'EDIT'"
 | 
			
		||||
	></employee-selector-plus>
 | 
			
		||||
 | 
			
		||||
	<personnel-form ref="personnelFormRef" @successful="successful"></personnel-form>
 | 
			
		||||
 | 
			
		||||
	<add-personnel-item ref="addPersonnelItemRef" @successful="addSuccessful"></add-personnel-item>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script setup name="personnelReportDetail">
 | 
			
		||||
	import employeeApi from '@/api/base/employee/employeeApi'
 | 
			
		||||
	import employeeCategoryApi from '@/api/base/employee/employeeCategoryApi'
 | 
			
		||||
	import manualTaskApi from '@/api/base/manual-task/manualTaskApi'
 | 
			
		||||
	import manualTaskDetailApi from '@/api/base/manual-task/manualTaskDetailApi'
 | 
			
		||||
 | 
			
		||||
	import MaterielSelectorPlus from '@/components/Selector/materielSelectorPlus.vue'
 | 
			
		||||
	import LineSelectorPlus from '@/components/Selector/lineSelectorPlus.vue'
 | 
			
		||||
| 
						 | 
				
			
			@ -124,7 +134,7 @@
 | 
			
		|||
	import { required } from '@/utils/formRules'
 | 
			
		||||
	import { useRoute } from 'vue-router'
 | 
			
		||||
	import { message } from 'ant-design-vue'
 | 
			
		||||
	import manualTaskDetailApi from "@/api/base/manual-task/manualTaskDetailApi";
 | 
			
		||||
	import AddPersonnelItem from '@/views/productionBusiness/employee/personnelReport/detail/addPersonnelItem.vue'
 | 
			
		||||
 | 
			
		||||
	const route = useRoute()
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -167,7 +177,16 @@
 | 
			
		|||
			type: 'a-input',
 | 
			
		||||
			attrs: {
 | 
			
		||||
				disabled: true,
 | 
			
		||||
				placeholder: '请输入基本单位',
 | 
			
		||||
				placeholder: '请输入基本单位'
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			label: '生产价格:',
 | 
			
		||||
			name: 'materialProducePrice',
 | 
			
		||||
			type: 'a-input',
 | 
			
		||||
			attrs: {
 | 
			
		||||
				disabled: true,
 | 
			
		||||
				placeholder: '请输入生产价格'
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
| 
						 | 
				
			
			@ -195,6 +214,7 @@
 | 
			
		|||
	]
 | 
			
		||||
 | 
			
		||||
	const formRef1 = ref(null)
 | 
			
		||||
	const addPersonnelItemRef = ref(null)
 | 
			
		||||
	const formRules = {
 | 
			
		||||
		materialName: [required('请输入物料')],
 | 
			
		||||
		productionLineName: [required('请输入生产线')]
 | 
			
		||||
| 
						 | 
				
			
			@ -233,7 +253,7 @@
 | 
			
		|||
				formData.baseUnitId = res.baseUnitId // 生产单位id
 | 
			
		||||
 | 
			
		||||
				// 获取物料的生产价格
 | 
			
		||||
				materielMoney = res.producePrice
 | 
			
		||||
				formData.materialProducePrice = res.materialProducePrice
 | 
			
		||||
 | 
			
		||||
				manualTaskDetailApi
 | 
			
		||||
					.manualTaskDetailPage({
 | 
			
		||||
| 
						 | 
				
			
			@ -258,7 +278,6 @@
 | 
			
		|||
 | 
			
		||||
	// 单位选择列表
 | 
			
		||||
	let unitList = ref([])
 | 
			
		||||
	let materielMoney = 0
 | 
			
		||||
	// 物料选择器返回操作
 | 
			
		||||
	const materielBackOk = (event) => {
 | 
			
		||||
		formData.materialName = event.materielSelectedRows[0].name // 物料名称
 | 
			
		||||
| 
						 | 
				
			
			@ -269,7 +288,7 @@
 | 
			
		|||
		formData.baseUnitId = event.materielSelectedRows[0].baseUnitId // 生产单位id
 | 
			
		||||
 | 
			
		||||
		// 获取物料的生产价格
 | 
			
		||||
		materielMoney = event.materielSelectedRows[0].producePrice
 | 
			
		||||
		formData.materialProducePrice = event.materielSelectedRows[0].producePrice
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
| 
						 | 
				
			
			@ -291,7 +310,7 @@
 | 
			
		|||
	 * */
 | 
			
		||||
	const userSelectorPlusProRef = ref(null)
 | 
			
		||||
	const handleOpenUser = () => {
 | 
			
		||||
		if (materielMoney === 0) return message.error('请选择物料,当前生产价格为0')
 | 
			
		||||
		if (formData.materialProducePrice === null) return message.error('请选择物料,当前生产价格为0')
 | 
			
		||||
		userSelectorPlusProRef.value.showUserPlusModal()
 | 
			
		||||
	}
 | 
			
		||||
	// 传递设计器需要的API
 | 
			
		||||
| 
						 | 
				
			
			@ -316,6 +335,17 @@
 | 
			
		|||
	// 用户选择器返回
 | 
			
		||||
	const userSelectorOnBack = (data) => {
 | 
			
		||||
		if (data.length > 0) {
 | 
			
		||||
			if (route.query.type === 'EDIT') {
 | 
			
		||||
				const exists = dataSource.value.find((item) => item.employeeId === data[0].id)
 | 
			
		||||
				if (exists) return message.warning(`员工 ${data[0].name} 已经存在,未重复添加。`)
 | 
			
		||||
 | 
			
		||||
				return addPersonnelItemRef.value.onOpen({
 | 
			
		||||
					...data[0],
 | 
			
		||||
					manualTaskId: route.query.id,
 | 
			
		||||
					materialProducePrice: formData.materialProducePrice
 | 
			
		||||
				})
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			data.forEach((i) => {
 | 
			
		||||
				// 检查是否已经存在相同的 employeeId
 | 
			
		||||
				const exists = dataSource.value.find((item) => item.employeeId === i.id)
 | 
			
		||||
| 
						 | 
				
			
			@ -326,6 +356,8 @@
 | 
			
		|||
						employeeName: i.name,
 | 
			
		||||
						employeeIdNumber: i.idNumber,
 | 
			
		||||
						employeeNumber: i.number,
 | 
			
		||||
						employeePhone: i.phone,
 | 
			
		||||
						employeeGender: i.gender,
 | 
			
		||||
						isFit: i.isFit,
 | 
			
		||||
						payMode: null,
 | 
			
		||||
						amount: null,
 | 
			
		||||
| 
						 | 
				
			
			@ -364,7 +396,7 @@
 | 
			
		|||
		},
 | 
			
		||||
		{
 | 
			
		||||
			title: '员工性别',
 | 
			
		||||
			dataIndex: 'employeeSex',
 | 
			
		||||
			dataIndex: 'employeeGender',
 | 
			
		||||
			editable: true,
 | 
			
		||||
			align: 'center',
 | 
			
		||||
			width: 200
 | 
			
		||||
| 
						 | 
				
			
			@ -417,10 +449,12 @@
 | 
			
		|||
	// 表格删除
 | 
			
		||||
	const handleDelete = (record) => {
 | 
			
		||||
		if (route.query.type === 'EDIT') {
 | 
			
		||||
			manualTaskDetailApi.manualTaskDetailDelete({
 | 
			
		||||
			manualTaskDetailApi
 | 
			
		||||
				.manualTaskDetailDelete({
 | 
			
		||||
					manualTaskId: route.query.id,
 | 
			
		||||
					detailIdParamList: [{ id: record.id }]
 | 
			
		||||
			}).then(res => {
 | 
			
		||||
				})
 | 
			
		||||
				.then((res) => {
 | 
			
		||||
					console.log(res)
 | 
			
		||||
				})
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			@ -430,7 +464,7 @@
 | 
			
		|||
 | 
			
		||||
	// 计算每个人员的金额
 | 
			
		||||
	const amountChange = (event, record) => {
 | 
			
		||||
		record.money = event * materielMoney
 | 
			
		||||
		record.money = event * formData.materialProducePrice
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
| 
						 | 
				
			
			@ -438,17 +472,17 @@
 | 
			
		|||
	 * */
 | 
			
		||||
	const personnelFormRef = ref(null)
 | 
			
		||||
	const handleOpenAddUser = () => {
 | 
			
		||||
		if (materielMoney === 0) return message.error('请选择物料,当前生产价格为0')
 | 
			
		||||
		if (formData.materialProducePrice === 0) return message.error('请选择物料,当前生产价格为0')
 | 
			
		||||
		personnelFormRef.value.onOpen()
 | 
			
		||||
	}
 | 
			
		||||
	const successful = (data) => {
 | 
			
		||||
		if (route.query.type === 'EDIT') {
 | 
			
		||||
			// manualTaskDetailApi.manualTaskDetailSubmitForm({
 | 
			
		||||
			// 	manualTaskId: route.query.id,
 | 
			
		||||
			// 	detailIdParamList: [{id: record.id}]
 | 
			
		||||
			// }).then(res => {
 | 
			
		||||
			// 	console.log(res)
 | 
			
		||||
			// })
 | 
			
		||||
			addPersonnelItemRef.value.onOpen({
 | 
			
		||||
				...data,
 | 
			
		||||
				manualTaskId: route.query.id,
 | 
			
		||||
				materialProducePrice: formData.materialProducePrice
 | 
			
		||||
			})
 | 
			
		||||
			return
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		dataSource.value.push({
 | 
			
		||||
| 
						 | 
				
			
			@ -456,12 +490,30 @@
 | 
			
		|||
			employeeName: data.name,
 | 
			
		||||
			employeeIdNumber: data.idNumber,
 | 
			
		||||
			employeeNumber: data.number,
 | 
			
		||||
			employeePhone: data.phone,
 | 
			
		||||
			employeeGender: data.employeeGender,
 | 
			
		||||
			isFit: data.isFit,
 | 
			
		||||
			payMode: null,
 | 
			
		||||
			amount: null,
 | 
			
		||||
			money: null
 | 
			
		||||
		})
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// 添加人员新增
 | 
			
		||||
	const addSuccessful = (data) => {
 | 
			
		||||
		dataSource.value.push({
 | 
			
		||||
			employeeId: data.employeeId,
 | 
			
		||||
			employeeName: data.employeeName,
 | 
			
		||||
			employeeIdNumber: data.employeeIdNumber,
 | 
			
		||||
			employeeNumber: data.employeeNumber,
 | 
			
		||||
			employeePhone: data.employeePhone,
 | 
			
		||||
			employeeGender: data.employeeGender,
 | 
			
		||||
			isFit: data.isFit,
 | 
			
		||||
			payMode: data.payMode,
 | 
			
		||||
			amount: data.amount,
 | 
			
		||||
			money: data.money
 | 
			
		||||
		})
 | 
			
		||||
	}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped></style>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,6 +2,11 @@
 | 
			
		|||
	<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="number">
 | 
			
		||||
						<a-input v-model:value="searchFormState.number" placeholder="请输入编码" />
 | 
			
		||||
					</a-form-item>
 | 
			
		||||
				</a-col>
 | 
			
		||||
				<a-col :span="6">
 | 
			
		||||
					<a-form-item label="编码" name="number">
 | 
			
		||||
						<a-input v-model:value="searchFormState.number" placeholder="请输入编码" />
 | 
			
		||||
| 
						 | 
				
			
			@ -100,9 +105,15 @@
 | 
			
		|||
								v-if="hasPerm('customerEdit')"
 | 
			
		||||
							>
 | 
			
		||||
								<FormOutlined />
 | 
			
		||||
								<!--									编辑-->
 | 
			
		||||
							</a>
 | 
			
		||||
						</a-tooltip>
 | 
			
		||||
						<!--						<a-divider type="vertical" v-if="hasPerm(['customerEdit', 'customerDelete'], 'and')" />
 | 
			
		||||
						<a-popconfirm title="确定要删除吗?" @confirm="deleteRecord(record)">
 | 
			
		||||
							<a-button type="link" danger size="small" v-if="hasPerm('customerDelete')">
 | 
			
		||||
								<DeleteOutlined />
 | 
			
		||||
								<!–										删除–>
 | 
			
		||||
							</a-button>
 | 
			
		||||
						</a-popconfirm>-->
 | 
			
		||||
 | 
			
		||||
						<a-divider type="vertical"></a-divider>
 | 
			
		||||
						<a-tooltip title="添加标签">
 | 
			
		||||
| 
						 | 
				
			
			@ -195,7 +206,8 @@
 | 
			
		|||
		deleteBatchRecords,
 | 
			
		||||
		options,
 | 
			
		||||
		searchFormRef,
 | 
			
		||||
		navigateTo
 | 
			
		||||
		navigateTo,
 | 
			
		||||
		deleteRecord
 | 
			
		||||
	} = useTableManagement(
 | 
			
		||||
		{
 | 
			
		||||
			page: manualTaskApi.manualTaskPage,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue