Merge branch 'dev_pro2.0' of http://114.132.189.42:9002/r/mom-pro2-before into dev_pro2.0
| | |
| | | return requestClient.put('/mes/md/item/update', data); |
| | | } |
| | | |
| | | /** 修改物料产品状态 */ |
| | | export function updateItemStatus(id: number, status: number) { |
| | | return requestClient.put('/mes/md/item/update-status', undefined, { |
| | | params: { id, status }, |
| | | }); |
| | | } |
| | | |
| | | /** 删除物料产品 */ |
| | | export function deleteItem(id: number) { |
| | | return requestClient.delete(`/mes/md/item/delete?id=${id}`); |
| | |
| | | component: 'RadioGroup', |
| | | componentProps: { |
| | | buttonStyle: 'solid', |
| | | disabled: false, |
| | | disabled: true, |
| | | optionType: 'button', |
| | | options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), |
| | | }, |
| | |
| | | } |
| | | |
| | | /** 列表的字段 */ |
| | | export function useGridColumns( |
| | | onStatusChange?: ( |
| | | newStatus: number, |
| | | row: MesMdItemApi.Item, |
| | | ) => PromiseLike<boolean | undefined>, |
| | | ): VxeTableGridOptions<MesMdItemApi.Item>['columns'] { |
| | | export function useGridColumns(): VxeTableGridOptions<MesMdItemApi.Item>['columns'] { |
| | | return [ |
| | | { |
| | | field: 'code', |
| | |
| | | { |
| | | field: 'status', |
| | | title: '状态', |
| | | width: 120, |
| | | width: 100, |
| | | align: 'center', |
| | | cellRender: { |
| | | attrs: { beforeChange: onStatusChange }, |
| | | name: 'CellSwitch', |
| | | props: { |
| | | checkedValue: CommonStatusEnum.ENABLE, |
| | | unCheckedValue: CommonStatusEnum.DISABLE, |
| | | }, |
| | | name: 'CellDict', |
| | | props: { type: DICT_TYPE.COMMON_STATUS }, |
| | | }, |
| | | }, |
| | | { |
| | |
| | | import { ref } from "vue"; |
| | | |
| | | import { |
| | | confirm, |
| | | Page, |
| | | useVbenModal, |
| | | } from "@vben/common-ui"; |
| | | import { DICT_TYPE } from "@vben/constants"; |
| | | import { getDictLabel } from "@vben/hooks"; |
| | | import { downloadFileFromBlobPart } from "@vben/utils"; |
| | | |
| | | import { Button, Card, message } from "ant-design-vue"; |
| | |
| | | deleteItem, |
| | | exportItem, |
| | | getItemPage, |
| | | updateItemStatus, |
| | | } from "#/api/mes/md/item"; |
| | | import { $t } from "#/locales"; |
| | | import { MdItemTypeTree } from "#/views/mes/md/item/type/components"; |
| | |
| | | handleRefresh(); |
| | | } |
| | | |
| | | /** 更新物料状态 */ |
| | | async function handleStatusChange( |
| | | newStatus: number, |
| | | row: MesMdItemApi.Item |
| | | ): Promise<boolean | undefined> { |
| | | try { |
| | | await confirm( |
| | | `确认要将"${row.name}"物料切换为【${getDictLabel( |
| | | DICT_TYPE.COMMON_STATUS, |
| | | newStatus |
| | | )}】吗?` |
| | | ); |
| | | } catch { |
| | | return false; |
| | | } |
| | | await updateItemStatus(row.id!, newStatus); |
| | | message.success($t("ui.actionMessage.operationSuccess")); |
| | | return true; |
| | | } |
| | | |
| | | const [Grid, gridApi] = useVbenVxeGrid({ |
| | | formOptions: { |
| | | schema: useGridFormSchema(), |
| | | }, |
| | | gridOptions: { |
| | | columns: useGridColumns(handleStatusChange), |
| | | columns: useGridColumns(), |
| | | height: "auto", |
| | | keepSource: true, |
| | | proxyConfig: { |
| | |
| | | const bidColumns = [ |
| | | { title: '投标编号', dataIndex: 'bidNo', width: 140 }, |
| | | { title: '供应商', dataIndex: 'supplierName', width: 200 }, |
| | | { title: '投标金额', dataIndex: 'bidTotalAmount', width: 120 }, |
| | | { title: '投标总金额', dataIndex: 'bidTotalAmount', width: 120 }, |
| | | { title: '投标时间', dataIndex: 'bidTime', width: 160 }, |
| | | { title: '状态', dataIndex: 'bidStatus', width: 100, customRender: ({ text }: any) => BID_STATUS_MAP[text] || text }, |
| | | { title: '操作', key: 'actions', width: 240 }, |
| | |
| | | |
| | | const quoteColumns = [ |
| | | { title: '物料', dataIndex: 'materialName', width: 120 }, |
| | | { title: '报价价格', dataIndex: 'quotePrice', width: 100 }, |
| | | { title: '报价单价', dataIndex: 'quotePrice', width: 100 }, |
| | | { title: '税率(%)', dataIndex: 'taxRate', width: 80 }, |
| | | { title: '交期(天)', dataIndex: 'deliveryCycle', width: 80 }, |
| | | { title: '付款条件', dataIndex: 'paymentTerms', width: 120 }, |
| | |
| | | </a-form-item> |
| | | <a-row :gutter="12"> |
| | | <a-col :span="8"> |
| | | <a-form-item label="报价价格" required><a-input-number v-model:value="quoteForm.quotePrice" :min="0" class="!w-full" placeholder="报价"><template #addonAfter>元</template></a-input-number></a-form-item> |
| | | <a-form-item label="报价单价" required><a-input-number v-model:value="quoteForm.quotePrice" :min="0" class="!w-full" placeholder="报价"><template #addonAfter>元</template></a-input-number></a-form-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-item label="税率(%)"><a-input-number v-model:value="quoteForm.taxRate" :min="0" :max="100" class="!w-full" placeholder="如 13" /></a-form-item> |