| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353 |
- <template>
- <div class="ele-body">
- <el-card shadow="never" v-loading="loading">
- <order-search
- ref="searchRefs"
- @search="reload"
- :selection="selection"
- :activeName="activeName"
- >
- </order-search>
- <el-tabs v-model="activeName" type="card">
- <el-tab-pane label="待排产" name="first"></el-tab-pane>
- <el-tab-pane label="已排产" name="second"></el-tab-pane>
- </el-tabs>
- <!-- 数据表格 -->
- <ele-pro-table
- ref="table"
- :columns="columns"
- :initLoad="false"
- :datasource="datasource"
- :selection.sync="selection"
- cache-key="systemRoleTable1"
- row-key="id"
- >
- <template v-slot:code="{ row }">
- <el-link :underline="false" @click="openDetails(row)">
- {{ row.code }}
- </el-link>
-
- </template>
- <template v-slot:productSumWeight="{ row }">
- {{ row.productSumWeight }}
- </template>
- <!-- 操作列 -->
- <template v-slot:action="{ row }">
- <template v-if="row.orderSource != 1">
- <el-link
- type="primary"
- :underline="false"
- icon="el-icon-edit"
- @click="toUpdate(row)"
- >
- 修改
- </el-link>
- <el-popconfirm
- class="ele-action"
- title="确定要删除此销售订单吗?"
- @confirm="remove(row)"
- >
- <template v-slot:reference>
- <el-link type="danger" :underline="false" icon="el-icon-delete">
- 删除
- </el-link>
- </template>
- </el-popconfirm>
- </template>
- </template>
- </ele-pro-table>
- </el-card>
- <!-- 详情弹窗 -->
- <order-detail @refresh="reload" ref="detailDialog"> </order-detail>
- <!-- 创建订单 -->
- <create-order ref="createDialog" @refresh="reload"> </create-order>
- </div>
- </template>
- <script>
- import OrderSearch from './components/order-search.vue';
- import OrderDetail from './components/order-detail.vue';
- import CreateOrder from './components/create-order.vue';
- import { getPageList, deleteOrder } from '@/api/saleOrder';
- import dictMixins from '@/mixins/dictMixins';
- export default {
- name: 'saleOrder',
- mixins: [dictMixins],
- components: {
- OrderSearch,
- OrderDetail,
- CreateOrder
- },
- data () {
- return {
- // 加载状态
- loading: false,
- activeName: 'first',
- selection: []
- };
- },
- computed: {
- // 表格列配置
- columns () {
- const privateColumn = [];
- if (this.activeName == 'first') {
- privateColumn.push({
- columnKey: 'action',
- label: '操作',
- width: 150,
- align: 'center',
- resizable: false,
- slot: 'action',
- showOverflowTooltip: true,
- fixed: 'right'
- });
- }
- return [
- {
- width: 45,
- type: 'selection',
- columnKey: 'selection',
- align: 'center'
- },
- {
- columnKey: 'index',
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center',
- showOverflowTooltip: true,
- fixed: 'left'
- },
- {
- prop: 'code',
- label: '销售订单号',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 150,
- slot: 'code',
-
- },
- {
- prop: 'lineNumber',
- label: '行号',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'productCode',
- label: '产品编码',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 140,
- sortable: true
- },
- {
- prop: 'productName',
- label: '产品名称',
- align: 'center',
- minWidth: 120
- },
- {
- prop: 'produceRoutingName',
- label: '工艺路线',
- align: 'center',
- minWidth: 120
- },
- {
- prop: 'brandNo',
- label: '牌号',
- align: 'center'
- },
- {
- prop: 'model',
- label: '型号',
- align: 'center',
- minWidth: 120,
- sortable: true
- },
- {
- prop: 'specification',
- label: '规格',
- align: 'center',
- minWidth: 120,
- },
- {
- prop: 'productSumWeight',
- label: '合同重量',
- align: 'center',
- slot: 'productSumWeight'
- },
- {
- prop: 'contractNum',
- label: '合同数量(方)',
- minWidth: 120,
- align: 'center'
-
- },
- {
- prop: 'lackNum',
- label: '欠交数量(方)',
- minWidth: 120,
- align: 'center'
- },
- {
- prop: 'moCount',
- label: '模数',
- align: 'center'
- },
- {
- prop: 'blockCount',
- label: '块数',
- align: 'center'
- },
- {
- prop: 'orderLibraryType',
- label: '按单按库',
- align: 'center',
- showOverflowTooltip: true,
- formatter: (_row, _column, cellValue) => {
- return this.getDictValue('按单按库', _row.orderLibraryType);
- }
- },
- {
- prop: 'deliveryRequirements',
- label: '交付要求',
- align: 'center',
- showOverflowTooltip: true,
- formatter: (_row, _column, cellValue) => {
- return this.getDictValue('交付要求', _row.deliveryRequirements);
- }
- },
- {
- prop: 'orderType',
- label: '订单类型',
- align: 'center',
- showOverflowTooltip: true,
- formatter: (_row, _column, cellValue) => {
- return this.getDictValue('订单类型', _row.orderType);
- }
- },
- {
- prop: 'orderSource',
- label: '订单来源',
- align: 'center',
- showOverflowTooltip: true,
- formatter: (_row, _column, cellValue) => {
- return this.getDictValue('订单来源', _row.orderSource);
- }
- },
- {
- prop: 'status',
- label: '生产状态',
- align: 'center',
- showOverflowTooltip: true,
- formatter: (_row, _column, cellValue) => {
- return this.getDictValue('生产状态', _row.status);
- }
- },
- {
- prop: 'releaseTime',
- label: '下达时间',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'deliveryTime',
- label: '交付日期',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'customerName',
- label: '客户名称',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'serialNo',
- label: '客户代号',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'simpleName',
- label: '客户简称',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'salesman',
- label: '业务员',
- align: 'center',
- showOverflowTooltip: true
- },
- ...privateColumn
- ];
- }
- },
- created () {
- this.requestDict('按单按库');
- this.requestDict('交付要求');
- this.requestDict('订单类型');
- this.requestDict('订单来源');
- this.requestDict('生产状态');
- },
- methods: {
- /* 表格数据源 */
- async datasource ({ page, limit, where, order }) {
- if (this.activeName == 'first') {
- where.status = [1];
- } else {
- if (where.proStu) {
- where.status = [where.proStu];
- } else {
- where.status = [2, 3, 4, 5, 6, 7];
- }
- }
- const params = {
- size: limit,
- pageNum: page,
- ...where
- };
- const data = await getPageList(params);
- return data;
- },
- /* 刷新表格 */
- reload (where) {
- this.$nextTick(() =>
- this.$refs.table.reload({ page: 1, limit: 10, where })
- );
- },
- openDetails (row) {
- this.$refs.detailDialog.open(row);
- },
- toUpdate (row) {
- this.$refs.createDialog.open(row);
- },
- remove (row) {
- deleteOrder([row.id]).then((res) => {
- this.$message.success(res);
- this.reload();
- });
- }
- }
- };
- </script>
- <style lang="scss" scoped></style>
|