From 92ff846fb659c62037a32b1d8c15eae9df9d9b54 Mon Sep 17 00:00:00 2001 From: zenglf <18502938215@163.com> Date: 星期一, 18 九月 2023 13:24:30 +0800 Subject: [PATCH] Merge branch 'develop' of http://117.34.109.166:18448/r/vue_mdc_430 --- src/views/spare/modules/sparePartOutbound/SparePartOutboundDetail.vue | 249 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 249 insertions(+), 0 deletions(-) diff --git a/src/views/spare/modules/sparePartOutbound/SparePartOutboundDetail.vue b/src/views/spare/modules/sparePartOutbound/SparePartOutboundDetail.vue new file mode 100644 index 0000000..8248db4 --- /dev/null +++ b/src/views/spare/modules/sparePartOutbound/SparePartOutboundDetail.vue @@ -0,0 +1,249 @@ +<template> + <a-card + :bordered="false" + :class="'cust-erp-sub-tab'" + > + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form + layout="inline" + @keyup.enter.native="searchQuery" + > + <a-row :gutter="24"> + </a-row> + </a-form> + </div> + <div> + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :scroll="{ x: 'calc(1400px + 50%)', y: 900 }" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + @change="handleTableChange" + > + <span + slot="status" + slot-scope="text, record" + > + <span v-if="record.status == '0'">鏈嚭搴�</span> + <span + v-if="record.status == '1'" + style="color: red" + >宸插嚭搴�</span> + </span> + <span + slot='action' + slot-scope='text, record' + > + <a-popconfirm + title="鐐瑰嚮纭鍚庯紝灏嗙洿鎺ュ嚭搴撲慨鏀瑰簱瀛�?" + @confirm="() => handleOutbound(record)" + > + <a v-if="record.outboundStatus === '2' && record.status ==='0'">鍑哄簱</a> + </a-popconfirm> + + </span> + </a-table> + </div> + </a-card> +</template> + +<script> +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import { getAction, requestPut } from '@/api/manage' +import Tooltip from 'ant-design-vue/es/tooltip' +import { ACCESS_TOKEN } from '@/store/mutation-types' +import Vue from 'vue' +import { getFileAccessHttpUrl } from '@/api/manage'; + +export default { + name: "SparePartOutboundDetail", + mixins: [JeecgListMixin], + components: { + Tooltip, + }, + props: { + sparePartOutboundId: { + type: String, + default: '-1', + required: false + } + }, + watch: { + sparePartOutboundId: { + immediate: true, + handler(val) { + if (!this.sparePartOutboundId) { + this.clearList() + } else { + this.queryParam['sparePartOutboundId'] = val; + this.loadData(1); + } + } + } + }, + data() { + return { + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: "center", + customRender: function (t, r, index) { + return parseInt(index) + 1; + } + }, + { + title: '鐘舵��', + align: "center", + dataIndex: 'status', + scopedSlots: { customRender: 'status' }, + }, + { + title: '澶囦欢缂栫爜', + align: "center", + dataIndex: 'num', + }, + { + title: '澶囦欢鍚嶇О', + align: "center", + dataIndex: 'name', + }, + { + title: '鍨嬪彿', + align: "center", + dataIndex: 'model', + }, + { + title: '瑙勬牸', + align: "center", + dataIndex: 'specification', + + }, + { + title: '鎵规鍙�', + align: "center", + dataIndex: 'batchNum', + + }, + { + title: '鍑哄巶鏃ユ湡', + align: "center", + dataIndex: 'manufactureDate', + customRender: function (text) { + return !text ? "" : (text.length > 10 ? text.substr(0, 10) : text) + } + + }, + { + title: '渚涘簲鍟�', + align: "center", + dataIndex: 'supplierName', + }, + { + title: '鍗曚綅', + align: "center", + dataIndex: 'mainUnitName', + }, + { + title: '鍑哄簱鏁伴噺', + align: "center", + dataIndex: 'outboundMainQuantity', + }, + { + title: '搴撳尯', + align: "center", + dataIndex: 'warehouseAreaName', + }, + { + title: '搴撲綅', + align: "center", + dataIndex: 'warehouseLocationNum', + }, + // { + // title: '杈呭崟浣�', + // align: "center", + // dataIndex: 'auxiliaryUnitName', + // }, + // { + // title: '鍑哄簱杈呮暟閲�', + // align: "center", + // dataIndex: 'outboundAuxiliaryUnitName', + // }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + fixed: 'right', + scopedSlots: { customRender: 'action' }, + width: 150, + } + ], + url: { + list: "/spare/sparePartOutboundDetail/getSparePartOutboundDetailsById", + outbound: "/spare/sparePartOutboundDetail/sparePartOutbound", + }, + } + }, + created() { + }, + computed: { + }, + methods: { + clearList() { + this.dataSource = [] + this.selectedRowKeys = [] + this.ipagination.current = 1 + }, + handleOutbound(record) { + const that = this; + requestPut(that.url.outbound, record).then((res) => { + if (res.success) { + that.$message.success("鍑哄簱鎴愬姛!") + that.$bus.$emit('outboundSuccess', 1) + that.loadData() + } else { + that.$message.warning("鍑哄簱澶辫触!") + } + }) + }, + loadData(arg) { + if (!this.url.list) { + this.$message.error("璇疯缃畊rl.list灞炴��!") + return + } + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination.current = 1; + } + var params = this.getQueryParams();//鏌ヨ鏉′欢 + this.loading = true; + getAction(this.url.list, params).then((res) => { + if (res.success) { + this.dataSource = res.result.records || res.result; + if (res.result.total) { + this.ipagination.total = res.result.total; + } else { + this.ipagination.total = 0; + } + //update-end---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ + } else { + this.$message.warning(res.message) + } + }).finally(() => { + this.loading = false + }) + }, + } +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +</style> -- Gitblit v1.9.3