ysy 2 лет назад
Родитель
Сommit
4854467387

+ 62 - 18
src/views/materialPlan/components/plan-edit-dialog.vue

@@ -40,7 +40,7 @@
 
         <template v-slot:productionPlanId="{ row }">
           <el-link type="primary" v-if="!row.productionPlanId" :underline="false"
-            @click.native="openVersion(row)">获取物料</el-link>
+            @click.native="openVersion(row)">选择</el-link>
         </template>
 
 
@@ -68,7 +68,9 @@
               :datasource="row.materialList" :columns="columns2" row-key="id">
 
 
-
+              <template v-slot:sort="{ $index }">
+                {{ $index }}
+              </template>
 
               <template v-slot:demandQuantity="{ row }">
                 <el-input v-model="row.demandQuantity" placeholder="请输入" @input="(value) =>
@@ -89,6 +91,15 @@
                   "></el-input>
               </template>
 
+              <template v-slot:requireDeliveryTime="{ row }">
+                <el-date-picker style="width: 100%" clearable v-model="row.requireDeliveryTime" type="date"
+                  value-format="yyyy-MM-dd" placeholder="请选择日期">
+                </el-date-picker>
+              </template>
+
+
+
+
               <template v-slot:action="{ row }">
                 <el-popconfirm class="ele-action" title="确定要删除当前物料吗?" @confirm="remove2(row)">
                   <template v-slot:reference>
@@ -161,6 +172,14 @@ export default {
           slot: 'expand'
         },
 
+        {
+          width: 50,
+          label: '序号',
+          type: 'index',
+          align: 'center',
+          slot: 'index'
+        },
+
         {
           prop: 'code',
           label: '销售订单号',
@@ -236,7 +255,7 @@ export default {
 
         {
           prop: 'productionPlanId',
-          label: '工艺路线物料',
+          label: '工艺路线',
           slot: 'productionPlanId',
 
           align: 'center',
@@ -258,57 +277,74 @@ export default {
 
       columns2: [
 
+
+        {
+          width: 92,
+          label: '',
+          prop: 'sort',
+          slot: 'sort',
+          align: 'center',
+        },
+
         {
           label: '物料名称',
           prop: 'name',
+          align: 'center',
         },
 
         {
           label: '物料编码',
-          prop: 'code'
+          prop: 'code',
+          align: 'center',
         },
         {
           label: '牌号',
-          prop: 'brandNum'
+          prop: 'brandNum',
+          align: 'center',
         },
         {
           label: '型号',
-          prop: 'modelType'
+          prop: 'modelType',
+          align: 'center',
         },
 
-        {
-          prop: 'availableCountBase',
-          label: '包装库存',
-          sortable: 'custom',
-        },
-        {
-          label: '单位',
-          prop: 'weightUnit'
-        },
+
 
         {
           prop: 'packingCountBase',
           label: '计量库存',
           sortable: 'custom',
+          align: 'center',
         },
 
         {
           label: '计量单位',
-          prop: 'unit'
+          prop: 'unit',
+          align: 'center',
         },
 
         {
           label: '需求数量',
           slot: 'demandQuantity',
-          action: 'demandQuantity'
+          action: 'demandQuantity',
+          align: 'center',
         },
 
         {
           label: '采购数量',
           slot: 'purchaseQuantity',
-          action: 'purchaseQuantity'
+          action: 'purchaseQuantity',
+          align: 'center',
         },
 
+        {
+          label: '要求到货时间',
+          slot: 'requireDeliveryTime',
+          action: ' requireDeliveryTime',
+          align: 'center',
+        },
+
+
         {
           columnKey: 'action',
           label: '操作',
@@ -540,3 +576,11 @@ export default {
   }
 };
 </script>
+
+
+<style lang="scss" scoped>
+:deep(.el-table__expanded-cell) {
+
+  padding-bottom: 120px !important;
+}
+</style>

+ 6 - 0
src/views/materialPlan/components/produce-edit-dialog.vue

@@ -540,3 +540,9 @@ export default {
   }
 };
 </script>
+
+<style lang="scss" scoped>
+:deep(.el-table__expanded-cell){
+  border-bottom: 4px solid #1890ff !important;
+}
+</style>

+ 0 - 0
src/views/materialPlan/components/workOrder-search.vue


+ 190 - 0
src/views/materialPlan/components/workOrderPop.vue

@@ -0,0 +1,190 @@
+<template>
+    <el-dialog :title="title" v-if="visible" :visible.sync="visible" :before-close="handleClose"
+        :close-on-click-modal="false" :close-on-press-escape="false" append-to-body width="70%">
+
+        <el-card shadow="never">
+            <saleOrderSearch @search="reload" />
+
+            <!-- 数据表格 -->
+            <ele-pro-table ref="table" :columns="columns" :datasource="datasource" :selection.sync="selection" row-key="id">
+
+            </ele-pro-table>
+
+
+        </el-card>
+
+        <div class="btns">
+            <el-button type="primary" size="small" @click="selected">选择</el-button>
+            <el-button size="small" @click="handleClose">关闭</el-button>
+        </div>
+    </el-dialog>
+</template>
+  
+<script>
+import saleOrderSearch from './saleOrder-search'
+import { getPageList } from '@/api/saleOrder';
+import dictMixins from '@/mixins/dictMixins';
+export default {
+    components: { saleOrderSearch },
+    mixins: [dictMixins],
+    data() {
+        return {
+            visible: false,
+            title: '销售订单',
+
+            // 表格列配置
+            columns: [
+                {
+                    columnKey: 'selection',
+                    type: 'selection',
+                    width: 45,
+                    align: 'center',
+                    selectable: (row, index) => {
+                        return !this.tableData.some((it) => it.id == row.id ||  it.salesOrderId == row.id);
+                    },
+                    reserveSelection: 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
+                },
+
+                {
+                    prop: 'productName',
+                    label: '产品名称',
+                    align: 'center',
+                    minWidth: 120
+                },
+            
+                {
+                    prop: 'brandNo',
+                    label: '牌号',
+                    align: 'center'
+                },
+                {
+                    prop: 'model',
+                    label: '型号',
+                    align: 'center',
+                    minWidth: 120
+                },
+                {
+                    prop: 'productSumWeight',
+                    label: '合同重量',
+                    align: 'center'
+                },
+                {
+                    prop: 'contractNum',
+                    label: '合同数量',
+                    align: 'center'
+                },
+
+                {
+                    prop: 'status',
+                    label: '生产状态',
+                    align: 'center',
+                    showOverflowTooltip: true,
+                    formatter: (_row, _column, cellValue) => {
+                        return this.getDictValue('生产状态', _row.status);
+                    }
+                },
+
+
+            ],
+
+            // 表格选中数据
+            selection: [],
+
+            tableData: [],
+            current: null
+
+        }
+    },
+
+    watch: {
+
+    },
+    created() {
+        this.requestDict('生产状态');
+    },
+    methods: {
+
+        open(item) {
+            if (item) {
+                this.tableData = item
+            }
+
+            this.visible = true
+
+
+
+        },
+
+
+        /* 表格数据源 */
+        async datasource({ page, limit, where }) {
+            where.status = [1, 2,  3, 4, 7,8]
+            const data = await getPageList({
+                ...where,
+                pageNum: page,
+                size: limit
+            });
+
+
+
+            return data;
+        },
+
+        /* 刷新表格 */
+        reload(where) {
+            this.$refs.table.reload({ page: 1, where: where });
+        },
+
+
+
+
+
+
+        handleClose() {
+            this.visible = false
+            this.$refs.table.setSelectedRows([]);
+            this.selection = []
+
+        },
+        selected() {
+
+            if (!this.selection.length) {
+                this.$message.error('请至少选择一条数据');
+                return;
+            }
+            this.$emit('chooseOrder', this.selection)
+            this.handleClose()
+        },
+    }
+}
+</script>
+  
+<style lang="scss" scoped>
+.btns {
+    text-align: center;
+    padding: 10px 0;
+}
+</style>
+