Merge remote-tracking branch 'origin/dev_JLMY' into dev_JLMY
| | |
| | | |
| | | <script setup> |
| | | import useSettingsStore from '@/store/modules/settings' |
| | | import dictStore from '@/store/modules/dict' |
| | | import { handleThemeStyle } from '@/utils/theme' |
| | | |
| | | onMounted(() => { |
| | | dictStore().initDict() |
| | | nextTick(() => { |
| | | // åå§å䏻颿 ·å¼ |
| | | handleThemeStyle(useSettingsStore().theme) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | // æ·»å |
| | | export function addDuePayable(query) { |
| | | return request({ |
| | | url: '/duePayable/addDuePayable', |
| | | method: 'post', |
| | | data: query |
| | | }) |
| | | } |
| | | // å页æ¥è¯¢ |
| | | export function findPayablePage(query) { |
| | | return request({ |
| | | url: '/duePayable/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | export function ListAllData(){ |
| | | return request({ |
| | | url: '/system/dict/data/dictDataList', |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | |
| | | // æ¥è¯¢åå
¸æ°æ®å表 |
| | | export function listData(query) { |
| | | return request({ |
| | |
| | | import {ListAllData} from "@/api/system/dict/data" |
| | | |
| | | const useDictStore = defineStore( |
| | | 'dict', |
| | | { |
| | | state: () => ({ |
| | | dict: new Array() |
| | | dict: [] |
| | | }), |
| | | actions: { |
| | | async initDict() { |
| | | const response = await ListAllData() |
| | | this.dict = response.data |
| | | }, |
| | | |
| | | // æ ¹æ®åå
¸ç±»åè·ååå
¸ |
| | | getDictTypeList(_type) { |
| | | if (_type == null || _type === "") { |
| | | return null; |
| | | } |
| | | return this.dict.filter(item => item.type === _type); |
| | | }, |
| | | |
| | | getDictDataByTypeAndValue(_type,_value){ |
| | | if (_type == null || _value == null) { |
| | | return { |
| | | type:"", |
| | | value:"", |
| | | label:"" |
| | | }; |
| | | } |
| | | return this.dict.find(item => item.type == _type && item.value == _value ) || null; |
| | | |
| | | }, |
| | | |
| | | // è·ååå
¸ |
| | | getDict(_key) { |
| | | if (_key == null && _key == "") { |
| | | return null |
| | | } |
| | | // console.log(this.dict) |
| | | try { |
| | | for (let i = 0; i < this.dict.length; i++) { |
| | | if (this.dict[i].key == _key) { |
| | |
| | | cleanDict() { |
| | | this.dict = new Array() |
| | | }, |
| | | // åå§åå
¸ |
| | | initDict() { |
| | | } |
| | | |
| | | } |
| | | }) |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog |
| | | v-model="dialogPayableFormVisible" |
| | | :title="title" |
| | | width="600" |
| | | :close-on-click-modal="false" |
| | | @close="handleClose" |
| | | > |
| | | <el-form |
| | | ref="formRef" |
| | | :model="form" |
| | | :rules="rules" |
| | | label-width="auto" |
| | | class="production-form" |
| | | label-position="right" |
| | | style="max-width: 400px; margin: 0 auto" |
| | | > |
| | | <el-form-item label="å票å·" prop="ticketNo"> |
| | | <el-input |
| | | v-model.number="form.ticketNo" |
| | | placeholder="请è¾å
¥å票å·" |
| | | :disabled="isViewMode" |
| | | > |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="仿¬¾éé¢" prop="paymentAmount"> |
| | | <el-input |
| | | v-model.number="form.paymentAmount" |
| | | placeholder="请è¾å
¥ä»æ¬¾éé¢" |
| | | :disabled="isViewMode" |
| | | > |
| | | <template v-slot:suffix> |
| | | <i style="font-style: normal">å
</i> |
| | | </template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="仿¬¾ç±»å" prop="payableType"> |
| | | <el-select |
| | | v-model="form.payableType" |
| | | placeholder="è¯·éæ©ç±»å" |
| | | :disabled="isViewMode" |
| | | > |
| | | <el-option |
| | | v-for="item in payableTypeList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="Number(item.value)" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ä¸ä¼ éä»¶" prop="attachUpload"> |
| | | <el-upload |
| | | class="upload-demo" |
| | | drag |
| | | :fileList="form.fileList" |
| | | :action="uploadFileUrl" |
| | | :headers="headers" |
| | | :http-request="UploadImage" |
| | | :on-success="handleUploadSuccess" |
| | | :on-remove="handleUploadRemove" |
| | | :on-preview="handleUploadPreview" |
| | | multiple> |
| | | <i class="el-icon-upload"></i> |
| | | <div class="el-upload__text">å°æä»¶æå°æ¤å¤ï¼æ<em>ç¹å»ä¸ä¼ </em></div> |
| | | </el-upload> |
| | | </el-form-item> |
| | | <el-form-item label="ç»è®°äºº" prop="registrantId"> |
| | | <el-input |
| | | :value="match(form.registrantId)" |
| | | v-model.number="form.registrantId" |
| | | disabled |
| | | placeholder="请è¾å
¥" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="ç»è®°æ¥æ" prop="registrationDate"> |
| | | <el-date-picker |
| | | disabled |
| | | v-model="form.registrationDate" |
| | | type="date" |
| | | placeholder="YYYY-MM-DD" |
| | | style="width: 100%" |
| | | value-format="YYYY-MM-DD" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <!-- éç½®ååæ¶ --> |
| | | <el-button |
| | | @click="handleClose" |
| | | v-if="title.includes('æ°å¢') || title.includes('æ¥ç')" |
| | | >åæ¶ |
| | | </el-button> |
| | | <el-button @click="handleReset" v-if="title.includes('ç¼è¾')" |
| | | >éç½® |
| | | </el-button> |
| | | <el-button type="primary" v-if="!isViewMode" @click="handleSubmit" |
| | | >确认</el-button |
| | | > |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="ProductionDialog"> |
| | | import {ref, defineProps, watch, onMounted, nextTick, computed,reactive,defineEmits} from "vue"; |
| | | import axios from "axios"; |
| | | import {addDuePayable} from "@/api/payable/index.js" |
| | | import {ElMessage} from "element-plus"; |
| | | |
| | | import useUserStore from "@/store/modules/user.js"; |
| | | import useDictStore from "@/store/modules/dict.js" |
| | | import {getToken} from "@/utils/auth.js"; |
| | | const uploadFileUrl = computed(() => import.meta.env.VITE_APP_BASE_API + "/common/minioUploads"); |
| | | const headers = computed(() => ({ Authorization: "Bearer " + getToken() })); |
| | | |
| | | |
| | | |
| | | const props = defineProps({ |
| | | title: { |
| | | type: String, |
| | | default: "", |
| | | }, |
| | | statusType: { type: Number, default: 0 }, |
| | | dialogPayableFormVisible: { |
| | | type: Boolean, |
| | | required: true |
| | | }, |
| | | }); |
| | | |
| | | const handleUploadRemove = (it)=>{ |
| | | form.value.fileList = form.value.fileList.filter(f => f.uid !== it.uid); |
| | | |
| | | } |
| | | const handleUploadPreview = (it)=>{ |
| | | const link = document.createElement("a"); |
| | | if(it.url){ |
| | | link.href = it.url |
| | | }else { |
| | | link.href = form.value.fileList.value.find(fl=>fl.uid === it.uid).url; |
| | | } |
| | | link.download = it.name; |
| | | link.click(); |
| | | } |
| | | |
| | | const handleUploadSuccess = (res,file)=>{ |
| | | form.value.fileList.push(...res.data.map((it,index)=>{ |
| | | return { |
| | | id:it.id, |
| | | url:it.downloadUrl, |
| | | name:it.originalFilename, |
| | | status:"success", |
| | | uid:file.uid |
| | | } |
| | | })) |
| | | } |
| | | |
| | | // æä»¶ä¸ä¼ å¤ç |
| | | const UploadImage = (param) => { |
| | | const formData = new FormData(); |
| | | formData.append("files", param.file); |
| | | formData.append("type", props.statusType); |
| | | axios.post(uploadFileUrl.value, formData, { |
| | | headers: { |
| | | "Content-Type": "multipart/form-data", |
| | | ...headers.value, |
| | | }, |
| | | onUploadProgress: (progressEvent) => { |
| | | const percent = Math.round((progressEvent.loaded * 100) / progressEvent.total); |
| | | param.onProgress({ percent }); |
| | | }, |
| | | }) |
| | | .then((response) => { |
| | | if (response.data.code === 200) { |
| | | handleUploadSuccess(response.data, param.file); |
| | | ElMessage.success("ä¸ä¼ æå"); |
| | | } else { |
| | | param.onError(new Error(response.data.msg)); |
| | | ElMessage.error(response.data.msg); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | param.onError(error); |
| | | }); |
| | | }; |
| | | const emit = defineEmits(["update:dialogPayableFormVisible", "success"]); |
| | | const dialogPayableFormVisible = defineModel("dialogPayableFormVisible", { |
| | | required: true, |
| | | type: Boolean, |
| | | }); |
| | | const form = defineModel("form", { |
| | | required: true, |
| | | type: Object, |
| | | }); |
| | | |
| | | |
| | | const payableTypeList = ref([]) |
| | | const isViewMode = computed(() => props.title.includes("æ¥ç")); |
| | | |
| | | const userStore = useUserStore(); |
| | | const userInfo = ref({}); |
| | | const match = () => { |
| | | return userInfo.value.nickName || "æªç¥ç¨æ·"; |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | //### |
| | | |
| | | onMounted(async () => { |
| | | |
| | | payableTypeList.value = useDictStore().getDictTypeList("payable_type").map((item) => ({ |
| | | value: item.value, |
| | | label: item.label, |
| | | })) |
| | | |
| | | let res = await userStore.getInfo(); |
| | | userInfo.value = res.user; |
| | | |
| | | }); |
| | | const rules = { |
| | | |
| | | payableType: [ |
| | | {required: true, message: "è¯·éæ©ç±»å", trigger: "change"} |
| | | ], |
| | | paymentAmount: [ |
| | | {required: true, message: "请è¾å
¥éé¢", trigger: "blur"} |
| | | ], |
| | | ticketNo: [ |
| | | {required: true, message: "请è¾å
¥å票å·", trigger: "blur"} |
| | | ] |
| | | |
| | | }; |
| | | // å
³éå¼¹çª |
| | | const handleClose = () => { |
| | | dialogPayableFormVisible.value = false; |
| | | form.value.fileList.value = [] |
| | | }; |
| | | |
| | | const handleReset = async ()=>{ |
| | | |
| | | } |
| | | |
| | | const formRef = ref(null); |
| | | // æäº¤è¡¨å |
| | | const handleSubmit = async () => { |
| | | // æä»¶å¤çåªè·åid è¿è¡æ¼æ¥ |
| | | if (!formRef.value) return; |
| | | formRef.value.validate((valid) => { |
| | | if (valid) { |
| | | const obj = ref({}); |
| | | form.value.attachUpload = "" |
| | | if (form.value.fileList.length > 0){ |
| | | form.value.attachUpload = form.value.fileList.map(it => it.id).join(",") |
| | | } |
| | | |
| | | let result = addDuePayable({ |
| | | ...form.value |
| | | }) |
| | | |
| | | obj.value = { |
| | | ...form.value, |
| | | result |
| | | } |
| | | emit("success", obj.value); |
| | | } |
| | | }) |
| | | }; |
| | | |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | |
| | | |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :inline="true" :model="queryParams" class="search-form"> |
| | | <el-form-item v-if="shouldShowSearch" label="æç´¢"> |
| | | <el-input |
| | | v-model="queryParams.searchAll" |
| | | :placeholder="searchPlaceholder" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="handleQuery">æ¥è¯¢</el-button> |
| | | <!-- <el-button @click="resetQuery">éç½®</el-button>--> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-card> |
| | | |
| | | |
| | | <!-- æä½æé®åº --> |
| | | <!-- <el-row :gutter="24" class="table-toolbar">--> |
| | | <!-- <el-button--> |
| | | <!-- :icon="Plus"--> |
| | | <!-- type="primary"--> |
| | | <!-- v-show="activeTab === 'payable'"--> |
| | | <!-- @click="handleAdd"--> |
| | | <!-- >æ°å¢åºä»æ¬¾é¡¹</el-button>--> |
| | | |
| | | <!-- </el-row>--> |
| | | <!-- è¡¨æ ¼ç»ä»¶ --> |
| | | <div class="table-container"> |
| | | <!-- å è½½ç¶æ --> |
| | | <el-skeleton v-if="loading" animated> |
| | | <template #template> |
| | | <el-skeleton-item variant="h1" style="width: 40%"/> |
| | | <div style="padding: 14px;"> |
| | | <el-skeleton-item variant="text"/> |
| | | <el-skeleton-item variant="text"/> |
| | | <el-skeleton-item variant="text"/> |
| | | </div> |
| | | </template> |
| | | </el-skeleton> |
| | | |
| | | <!-- æ°æ®è¡¨æ ¼ --> |
| | | <data-table |
| | | v-else |
| | | :showOverflowTooltip="false" |
| | | :border="true" |
| | | @edit="handleEdit" |
| | | :columns="columns" |
| | | :loading="loading" |
| | | style="width: 100%; height: calc(100vh - 29em)" |
| | | :show-selection="activeTab === 'payable'" |
| | | :table-data="tableData" |
| | | > |
| | | <!-- ç©ºç¶æææ§½ --> |
| | | <template #empty> |
| | | <el-empty |
| | | :description="`ææ ${currentTabConfig?.label || ''}æ°æ®`" |
| | | :image-size="120" |
| | | > |
| | | <template #description> |
| | | <p>ææ {{ currentTabConfig?.label || '' }}æ°æ®</p> |
| | | </template> |
| | | </el-empty> |
| | | </template> |
| | | </data-table> |
| | | </div> |
| | | |
| | | |
| | | <pagination |
| | | v-if="total > 0" |
| | | :layout="'total, prev, pager, next, jumper'" |
| | | :limit="state.pageSize" |
| | | :current-page="state.current" |
| | | :total="total" |
| | | @pagination="handlePageChange" |
| | | /> |
| | | |
| | | <!-- æ¥ç详æ
å¼¹çª --> |
| | | <DilogTable |
| | | v-model="dialogTableVisible" |
| | | :title="dialogTableTitle" |
| | | :table-data="dialogTableData" |
| | | :columns="dialogTableColumns" |
| | | @submit="handleSubmit" |
| | | @success="payableHandleSuccess" |
| | | width="70%" |
| | | height="500px" |
| | | /> |
| | | </el-card> |
| | | <PayableDialog |
| | | v-model:dialogPayableFormVisible="dialogPayableFormVisible" |
| | | v-model:form="copyForm" |
| | | :title="title" |
| | | @submit="handleSubmit" |
| | | @success="payableHandleSuccess" |
| | | ref="productionDialogs"> |
| | | </PayableDialog>> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {computed, onMounted, reactive, ref, nextTick, toRefs} from "vue"; |
| | | import {ElMessage} from "element-plus"; |
| | | import {Delete, Plus} from "@element-plus/icons-vue"; |
| | | |
| | | // ç»ä»¶å¯¼å
¥ |
| | | import DataTable from "@/components/Table/ETable.vue"; |
| | | import Pagination from "@/components/PIMTable/Pagination.vue"; |
| | | import DilogTable from "@/components/dialog/DilogTable.vue"; |
| | | |
| | | // API æå¡å¯¼å
¥ |
| | | import {findPayablePage} from "@/api/payable/index" |
| | | |
| | | const userStore = useUserStore(); |
| | | const dictStore = useDictStore() |
| | | import useUserStore from "@/store/modules/user"; |
| | | import useDictStore from "@/store/modules/dict" |
| | | import PayableDialog from "@/views/payable/components/PayableDialog.vue"; |
| | | |
| | | let userList = ref([]); |
| | | userStore.getUserList().then((res) => { |
| | | userList.value = res; |
| | | }); |
| | | |
| | | |
| | | // ååºå¼ç¶æç®¡ç - 使ç¨è§£æåé»è®¤å¼ |
| | | const productionDialogs = ref(null); // æ·»å ref声æ |
| | | const initFormState = () => ({consumables: false}); |
| | | const dialogPayableFormVisible = ref(false); |
| | | const addOrEdit = ref("edit"); |
| | | const state = reactive({ |
| | | form: initFormState(), |
| | | title: "", |
| | | copyForm: {}, |
| | | loading: false, |
| | | activeTab: "payable", |
| | | selectedRows: [], |
| | | tableData: [], |
| | | // åé¡µç¶æ |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | current: 1, |
| | | total: 0, |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | searchAll: "", |
| | | }, |
| | | }); |
| | | const userInfo = ref({}); |
| | | |
| | | onMounted(() => { |
| | | let res = userStore.getInfo(); |
| | | userInfo.value = res.user; |
| | | getList() |
| | | }) |
| | | const handleEdit = (row) => { |
| | | form.value = JSON.parse(JSON.stringify(row)); |
| | | addOrEdit.value = "edit"; |
| | | handleAddEdit() |
| | | } |
| | | const handleAddEdit = () => { |
| | | addOrEdit.value == "add" ? (title.value = "æ°å¢") : addOrEdit.value == "viewRow" ? (title.value = "æ¥ç") : (title.value = "ç¼è¾"); |
| | | title.value = title.value + "åºä»ç®¡ç"; |
| | | openDialog(); |
| | | }; |
| | | |
| | | const openDialog = () => { |
| | | if (addOrEdit.value === "edit" || addOrEdit.value === "viewRow") { |
| | | // ç¡®ä¿å¤å¶ä¸ä»½æ°æ®ï¼é¿å
ç´æ¥å¼ç¨ |
| | | copyForm.value = JSON.parse(JSON.stringify(form.value)); |
| | | // console.log(copyForm.value) |
| | | copyForm.value.fileList = copyForm.value.attachFileList.map((item) => { |
| | | return { |
| | | id: item.id, |
| | | url: item.downloadUrl, |
| | | uid: item.id, |
| | | status: "success", |
| | | name: item.originalFilename |
| | | } |
| | | }) |
| | | dialogPayableFormVisible.value = true; |
| | | // 触åreféé¢çæ¹æ³ |
| | | return; |
| | | } |
| | | }; |
| | | |
| | | |
| | | const handleQuery = () => { |
| | | state.loading = true; |
| | | state.current = 1; |
| | | getList() |
| | | } |
| | | |
| | | const handlePageChange = (it) => { |
| | | state.current = it.page |
| | | getList(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | const getList = async () => { |
| | | loading.value = true; |
| | | try { |
| | | let resp = await findPayablePage( |
| | | { |
| | | current: state.current, |
| | | pageSize: state.current |
| | | , ...state.queryParams |
| | | }) |
| | | tableData.value = resp.data.records |
| | | total.value = resp.data.total || 0; |
| | | } finally { |
| | | loading.value = false; |
| | | } |
| | | } |
| | | |
| | | // 使ç¨è§£æç®åè®¿é® |
| | | const { |
| | | form, |
| | | title, |
| | | copyForm, |
| | | loading, |
| | | activeTab, |
| | | selectedRows, |
| | | current, |
| | | tableData, |
| | | pageNum, |
| | | pageSize, |
| | | total, |
| | | queryParams, |
| | | } = toRefs(state); |
| | | |
| | | // æ·»å 缺失çååºå¼åé |
| | | const dialogTableVisible = ref(false); |
| | | const dialogTableTitle = ref(''); |
| | | const dialogTableData = ref([]); |
| | | const dialogTableColumns = ref([]); |
| | | |
| | | |
| | | const payableHandleSuccess = (val) => { |
| | | ElMessage.success("æä½æå"); |
| | | dialogPayableFormVisible.value = false; |
| | | getList() |
| | | } |
| | | const handleSubmit = (val) => { |
| | | if (val.result.code !== 200) { |
| | | ElMessage.error("æä½å¤±è´¥ï¼" + val.result.msg); |
| | | return; |
| | | } |
| | | ElMessage.success(val.title + val.result.msg); |
| | | dialogPayableFormVisible.value = false; |
| | | getList(); |
| | | }; |
| | | |
| | | // æ ç¾é¡µé
ç½® - 便äºåç»æ©å± |
| | | const tabsConfig = { |
| | | payable: { |
| | | searchPlaceholder: "", |
| | | showSearch: true, |
| | | // deleteApi: , |
| | | columns: [ |
| | | /* ææ¶ä¸ç¥éæ¯å¦éè¦ {prop: "equipmentNo", label: "ä¾åºååç§°", minWidth: 100},*/ |
| | | {prop: "ticketNo", label: "å票å·", minWidth: 100}, |
| | | {prop: "paymentAmount", label: "仿¬¾éé¢(å
)", minWidth: 100}, |
| | | // {prop: "specification", label: "éä»¶", minWidth: 100}, |
| | | { |
| | | prop: "payableType", label: "仿¬¾ç±»å", minWidth: 100, |
| | | formatter: (row) => { |
| | | if (row.payableType == null) { |
| | | return "" |
| | | } |
| | | const dictItem = dictStore.getDictDataByTypeAndValue("payable_type", row.payableType); |
| | | return dictItem ? dictItem.label : ""; |
| | | } |
| | | }, |
| | | { |
| | | prop: "registrantId", label: "å½å
¥äºº", minWidth: 100, |
| | | formatter: (row) => { |
| | | // å¹é
ç¨æ·ä¿¡æ¯ |
| | | const user = userList.value.find((user) => user.userId === row.registrantId); |
| | | return user ? user.nickName : "æªç¥ç¨æ·"; |
| | | }, |
| | | }, |
| | | {prop: "registrationDate", label: "å½å
¥æ¥æ", minWidth: 100}, |
| | | ], |
| | | } |
| | | }; |
| | | |
| | | |
| | | // å½åæ ç¾é¡µé
ç½® |
| | | const currentTabConfig = computed(() => tabsConfig[activeTab.value]); |
| | | |
| | | // 计ç®å±æ§ |
| | | const searchPlaceholder = computed( |
| | | () => currentTabConfig.value?.searchPlaceholder || "请è¾å
¥æç´¢ä¿¡æ¯" |
| | | ); |
| | | const shouldShowSearch = computed( |
| | | () => currentTabConfig.value?.showSearch || false |
| | | ); |
| | | const columns = computed(() => currentTabConfig.value?.columns || []); |
| | | const selectedCount = computed(() => selectedRows.value.length); |
| | | |
| | | |
| | | // 卿è·åæä½å宽度 |
| | | const getOperationsWidth = () => { |
| | | if (activeTab.value === 'equipmentRequisition') { |
| | | return 250; // 为å½è¿æé®é¢çæ´å¤ç©ºé´ |
| | | } |
| | | return 200; // é»è®¤å®½åº¦ |
| | | }; |
| | | |
| | | |
| | | </script> |
| | | |
| | | <style scoped> |
| | | /* ååºå¼å¸å± */ |
| | | @media screen and (min-width: 768px) { |
| | | .search-form :deep(.el-form-item) { |
| | | width: 50%; |
| | | } |
| | | } |
| | | |
| | | @media screen and (min-width: 1200px) { |
| | | .search-form :deep(.el-form-item) { |
| | | width: 16%; |
| | | } |
| | | } |
| | | |
| | | .table-toolbar { |
| | | margin-bottom: 20px; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | gap: 10px; |
| | | } |
| | | |
| | | .app-container { |
| | | padding: 18px !important; |
| | | } |
| | | |
| | | /* ååºå¼è¡¨æ ¼ */ |
| | | @media screen and (max-width: 768px) { |
| | | .table-toolbar { |
| | | flex-direction: column; |
| | | } |
| | | |
| | | .table-toolbar .el-button { |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | /* è¡¨æ ¼å·¥å
·æ */ |
| | | .table-toolbar, |
| | | .table-toolbar > * { |
| | | margin: 0 0 0 0 !important; |
| | | } |
| | | |
| | | .table-toolbar { |
| | | margin-bottom: 20px !important; |
| | | } |
| | | |
| | | .el-form--inline .el-form-item { |
| | | margin-right: 25px; |
| | | } |
| | | |
| | | .main-container { |
| | | background: red !important; |
| | | } |
| | | |
| | | /* 设å¤ç¶ææ ·å¼ */ |
| | | .status-using { |
| | | color: #409eff; |
| | | font-weight: 500; |
| | | } |
| | | |
| | | .status-partial-return { |
| | | color: #e6a23c; |
| | | font-weight: 500; |
| | | } |
| | | |
| | | .status-returned { |
| | | color: #67c23a; |
| | | font-weight: 500; |
| | | } |
| | | |
| | | .status-unknown { |
| | | color: #909399; |
| | | font-weight: 500; |
| | | } |
| | | |
| | | /* ç¶ææ ç¾æ ·å¼ */ |
| | | :deep(.el-table .cell .status-tag) { |
| | | font-size: 12px; |
| | | padding: 2px 6px; |
| | | border-radius: 4px; |
| | | white-space: nowrap; |
| | | } |
| | | </style> |
| | |
| | | value-format="YYYY-MM-DD" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="ç±»å" prop="purchaseType"> |
| | | <el-select |
| | | v-model="form.purchaseType" |
| | | placeholder="è¯·éæ©ç±»å" |
| | | :disabled="isViewMode" |
| | | > |
| | | <el-option |
| | | v-for="item in purchaseTypeList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="Number(item.value)" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | |
| | | import { ElMessage } from "element-plus"; |
| | | import useUserStore from "@/store/modules/user"; |
| | | import { addOrEditPR, getSupplyList, getCoalInfoList } from "@/api/procureMent"; |
| | | import useDictStore from "@/store/modules/dict" |
| | | |
| | | const props = defineProps({ |
| | | title: { |
| | |
| | | }); |
| | | const supplyList = ref([]); |
| | | const coalList = ref([]); |
| | | const purchaseTypeList = ref([]) |
| | | const isViewMode = computed(() => props.title.includes("æ¥ç")); |
| | | // è·åä¾åºå䏿åç
¤ç§ä¸æ |
| | | // è·åä¾åºå䏿åç
¤ç§ä¸æ 以åç±»å |
| | | const getDropdownData = async () => { |
| | | try { |
| | | const [supplyRes, coalRes] = await Promise.all([ |
| | |
| | | value: item.id, |
| | | label: item.coal, |
| | | })); |
| | | |
| | | } catch (error) { |
| | | ElMessage.error("è·åä¸ææ°æ®å¤±è´¥ï¼è¯·ç¨åéè¯"); |
| | | } |
| | |
| | | }; |
| | | |
| | | onMounted(async () => { |
| | | |
| | | purchaseTypeList.value = useDictStore().getDictTypeList("purchase_type").map((item) => ({ |
| | | value: item.value, |
| | | label: item.label, |
| | | })) |
| | | |
| | | let res = await userStore.getInfo(); |
| | | userInfo.value = res.user; |
| | | await getDropdownData(); |
| | | // ç»ä»¶å è½½å®æå触å䏿¬¡è®¡ç® |
| | | calculatePrices(); |
| | | }); |
| | | |
| | | const rules = { |
| | | supplierName: [ |
| | | { required: true, message: "请è¾å
¥ä¾åºååç§°", trigger: "blur" }, |
| | |
| | | { required: true, message: "请è¾å
¥ç¨ç", trigger: "blur" }, |
| | | { type: "number", message: "ç¨çå¿
须为æ°å", trigger: "blur" }, |
| | | ], |
| | | purchaseType: [ |
| | | { required: true, message: "è¯·éæ©ç±»å", trigger: "change" } |
| | | ] |
| | | }; |
| | | // å
³éå¼¹çª |
| | | const handleClose = () => { |
| | |
| | | </el-form> |
| | | <el-card> |
| | | <!-- æä½æé®åº --> |
| | | <el-row :gutter="24" class="table-toolbar"> |
| | | <el-row :gutter="24" class="table-toolbar" justify="space-between"> |
| | | <el-button type="primary" :icon="Plus" @click="handleAdd" |
| | | >æ°å»º |
| | | </el-button> |
| | | <el-button type="primary" :icon="Plus" @click="handleAddPayable"> |
| | | æ·»å åºä»æ¬¾ |
| | | </el-button> |
| | | <!-- <el-button type="danger" :icon="Delete" @click="handleDelete" |
| | | >å é¤ |
| | |
| | | @success="handleSuccess" |
| | | ref="productionDialogs" |
| | | /> |
| | | <PayableDialog |
| | | v-model:dialogPayableFormVisible="dialogPayableFormVisible" |
| | | v-model:form="formPayable" |
| | | :title="title" |
| | | @submit="handleSubmit" |
| | | @success="payableHandleSuccess" |
| | | ref="productionDialogs"> |
| | | </PayableDialog>> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import DataTable from "@/components/Table/ETable.vue"; |
| | | import Pagination from "@/components/Pagination"; |
| | | import ProductionDialog from "./components/ProductionDialog.vue"; |
| | | import PayableDialog from "../payable/components/PayableDialog.vue"; |
| | | |
| | | import { |
| | | purchaseRegistration, |
| | | getSupplyList, |
| | |
| | | } from "@/api/procureMent"; |
| | | import { useDelete } from "@/hooks/useDelete"; |
| | | const userStore = useUserStore(); |
| | | const dictStore = useDictStore() |
| | | import useUserStore from "@/store/modules/user"; |
| | | import useDictStore from "@/store/modules/dict" |
| | | |
| | | let userList = ref([]); |
| | | userStore.getUserList().then((res) => { |
| | | userList.value = res; |
| | | }); |
| | | |
| | | // å¼å
¥åå
¸æ°æ® |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | const dialogFormVisible = ref(false); |
| | | const dialogPayableFormVisible = ref(false); |
| | | const form = ref({ |
| | | taxRate: 13, |
| | | freight: 20, |
| | |
| | | const pageSize = ref(10); |
| | | const selectedRows = ref([]); |
| | | const copyForm = ref({}); |
| | | const formPayable = ref({}); |
| | | // æ¥è¯¢åæ° |
| | | const queryParams = reactive({ |
| | | searchAll: "", |
| | |
| | | return user ? user.nickName : "æªç¥ç¨æ·"; |
| | | }, |
| | | }, |
| | | { prop: "purchaseType", label: "ç±»å", minWidth: 100 , |
| | | formatter: (row) => { |
| | | if (row.purchaseType == null) { |
| | | return "" |
| | | } |
| | | const dictItem = dictStore.getDictDataByTypeAndValue("purchase_type", row.purchaseType); |
| | | return dictItem ? dictItem.label : ""; } |
| | | }, |
| | | { prop: "registrationDate", label: "ç»è®°æ¥æ", minWidth: 100 }, |
| | | ]); |
| | | |
| | |
| | | addOrEdit.value = "add"; |
| | | handleAddEdit(); |
| | | }; |
| | | const handleAddPayable = () => { |
| | | // åªæéæ©ä¸è¡çæ¶åè¿è¡æä½ |
| | | |
| | | if (selectedRows.value.length !== 1) { |
| | | ElMessage.error("请éä¸ä¸è¡è¿è¡å¡«å") |
| | | return |
| | | } |
| | | |
| | | formPayable.value = { |
| | | purchaseRegistrationId: selectedRows.value[0].id, |
| | | registrantId: userInfo.value.userId, |
| | | ticketNo:"", |
| | | paymentAmount:"", |
| | | payableType:"", |
| | | attachUpload:"", |
| | | registrationDate: new Date().toISOString().split("T")[0], |
| | | fileList:[] |
| | | } |
| | | dialogPayableFormVisible.value = true |
| | | |
| | | }; |
| | | |
| | | // æ°å¢ç¼è¾ |
| | | const productionDialogs = ref(null); // æ·»å ref声æ |
| | | |
| | |
| | | // 触åreféé¢çæ¹æ³ |
| | | return; |
| | | } |
| | | console.log(userInfo.value) |
| | | // æ°å»ºæ¶åå§å表å |
| | | form.value = { |
| | | supplierName: "", |
| | |
| | | freight:20, |
| | | registrantId: userInfo.value.userId, |
| | | registrationDate: new Date().toISOString().split("T")[0], |
| | | purchaseType: "" |
| | | }; |
| | | // æ°å»ºæ¶ä¹éè¦è®¾ç½® copyForm ç¨äºéç½®åè½ |
| | | copyForm.value = JSON.parse(JSON.stringify(form.value)); |
| | |
| | | total.value = tableData.value.length; |
| | | ElMessage.success("æä½æå"); |
| | | }; |
| | | |
| | | const payableHandleSuccess = (val) => { |
| | | ElMessage.success("æä½æå"); |
| | | dialogPayableFormVisible.value = false; |
| | | } |
| | | |
| | | const getList = async () => { |
| | | loading.value = true; |
| | | try { |