Jelajahi Sumber

修改储运工作台样式;
装运单列表,类型、目的地、车牌号可以编辑;

zhangafei 1 bulan lalu
induk
melakukan
e18cd07281

+ 75 - 0
src/App.vue

@@ -715,6 +715,81 @@
       }
     }
 
+    // 储运工作台
+    .storage-transportation-workbenches {
+      .ant-tabs.ant-tabs-top .ant-tabs-nav {
+        background-color: #01284c;
+        color: var(--fn-color);
+
+        .ant-tabs-tab {
+          .ant-tabs-tab-btn {
+            color: var(--fn-color);
+          }
+
+          svg {
+            fill: var(--fn-color);
+          }
+        }
+
+        .ant-tabs-tab-active {
+        }
+      }
+
+      .head-center-container .statistic-wrap .ant-statistic .ant-statistic-title {
+        color: var(--fn-color);
+      }
+
+      .car-center-container,
+      .heat-container {
+        color: var(--fn-color);
+
+        .ant-divider-horizontal.ant-divider-with-text {
+          margin-left: 0;
+          color: var(--fn-color);
+
+          &::before,
+          &::after {
+            border-block-start-color: var(--fn-color);
+          }
+        }
+
+        .ant-card {
+          background-color: #052d51;
+          color: var(--fn-color);
+
+          .ant-card-head,
+          .heat-s-top,
+          .heat-s-top span,
+          .ant-descriptions .ant-descriptions-item-container .ant-descriptions-item-label {
+            color: var(--fn-color);
+          }
+
+          .ant-statistic .ant-statistic-content {
+            color: var(--fn-color);
+          }
+
+          .ant-statistic .ant-statistic-content-value-int,
+          .ant-statistic .ant-statistic-content-value-decimal,
+          .legend-text,
+          .chart .chart-content .chart-item .chart-item-title,
+          .chart .chart-content .chart-item-divider .chart-item-title,
+          .chart .chart-content .chart-item-divider .chart-divider .chart-divider-text {
+            color: var(--fn-color);
+          }
+
+          .ant-table {
+            background-color: #15436d;
+
+            .ant-table-thead > tr > th,
+            .ant-table-thead > tr > td {
+              background-color: #15436d;
+              color: var(--fn-color);
+            }
+          }
+        }
+      }
+    }
+
     // 打印
     #printContent {
       .ant-descriptions .ant-descriptions-item-content {

+ 6 - 6
src/views/billet/hotDelivery/hotDelivery.data.ts

@@ -233,6 +233,12 @@ export const rodLineSearchFormSchema: FormSchema[] = [
     component: 'Input',
     colProps: { span: 6 },
   },
+  {
+    field: 'assemblyNumber',
+    label: '组坯号',
+    component: 'Input',
+    colProps: { span: 6 },
+  },
   {
     field: 'length',
     label: '定尺',
@@ -243,12 +249,6 @@ export const rodLineSearchFormSchema: FormSchema[] = [
       dict: 'lg_dcgg',
     },
   },
-  {
-    field: 'assemblyNumber',
-    label: '组坯号',
-    component: 'Input',
-    colProps: { span: 6 },
-  },
 ];
 
 // 棒线选中的钢坯

+ 13 - 0
src/views/billet/shippingBill/components/editForm.vue

@@ -131,6 +131,9 @@
   import { carPosition5, carPosition6 } from '../shippingBill.data';
   import { getDictItemsByCode } from '/@/utils/dict/index';
   import dayjs from 'dayjs';
+  import { useMessage } from '/@/hooks/web/useMessage';
+
+  const { createMessage } = useMessage();
 
   const props = defineProps({
     rowData: {
@@ -250,6 +253,16 @@
         },
         { isTransformResponse: false }
       )
+      .then((res) => {
+        if (res && res.success) {
+          createMessage.success(res.message);
+        } else {
+          createMessage.error(res.message);
+        }
+      })
+      .catch((err) => {
+        createMessage.error('编辑装运单失败');
+      })
       .finally(() => {
         confirmLoading.value = false;
       });

+ 2 - 2
src/views/billet/shippingBill/components/editModal.vue

@@ -32,8 +32,8 @@
     });
   }
 
-  function handleOk() {
-    realForm.value.submitForm();
+  async function handleOk() {
+    await realForm.value.submitForm();
     visible.value = false;
     setTimeout(() => {
       emit('ok');

+ 160 - 4
src/views/billet/shippingBill/index.vue

@@ -99,10 +99,45 @@
       <template #billXuhao="{ record }">{{ record.uniqueCode || '' }}</template>
       <template #licensePlate="{ record }">
         <a-badge-ribbon style="top: -20px" v-if="record.licensePlateStatus === 1" color="red" text="错误">
-          <div>{{ record.licensePlate }}</div>
+          <JSearchSelect
+            type="list"
+            v-model:value="record.licensePlate"
+            dict="lg_car"
+            :getPopupContainer="
+              () => {
+                return documentBody;
+              }
+            "
+            @change="(v) => handleLicensePlateChange(v, record)"
+            placeholder="请选择"
+            allowClear
+          />
         </a-badge-ribbon>
         <div v-else>{{ record.licensePlate }}</div>
       </template>
+      <template #btype="{ record }">
+        <a-switch
+          v-model:checked="record.btype"
+          checked-value="0"
+          @change="(checked) => handleBtypeChange(checked, record)"
+          checked-children="热坯"
+          un-checked-value="1"
+          un-checked-children="冷坯"
+        />
+      </template>
+      <template #destination="{ record }">
+        <JSearchSelect
+          v-if="Number(record.typeConfigId) === 1024"
+          type="list"
+          v-model:value="record.destinationId"
+          :disabled="Number(record.typeConfigId) !== 1024"
+          :options="destinationOptions[record.ccmNo]"
+          placeholder="请选择"
+          allowClear
+          @change="(v) => handleDestinationIdChange(v, record)"
+        />
+        <div v-else>{{ record.destination }}</div>
+      </template>
     </BasicTable>
     <!-- 表单区域 -->
     <!-- 编辑 -->
@@ -131,9 +166,9 @@
   import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue';
   import { useListPage } from '/@/hooks/system/useListPage';
   import { columns, initDictConfig, queryParam, searchFormSchema, carPosition6, carPosition5 } from './shippingBill.data';
-  import { deleteOne, batchDelete } from './shippingBill.api';
+  import { deleteOne, batchDelete, edit } from './shippingBill.api';
   import { defHttp } from '/@/utils/http/axios';
-  import { onMounted, ref, reactive } from 'vue';
+  import { onMounted, ref, reactive, h } from 'vue';
   // import hotDeliveryModal from './components/hotDeliveryModal.vue';
   import editModal from './components/editModal.vue';
   import logModel from './components/logModel.vue';
@@ -144,9 +179,13 @@
   import { destinationOptions, getMachineConfig, MachineConfigType, getMachineNum } from '../hotDelivery/common.data';
   import rodLine from './components/hotCharging/rodLine.vue';
   import stack from './components/hotCharging/stack.vue';
+  import { useMessage } from '/@/hooks/web/useMessage';
+
+  const { createConfirm } = useMessage();
 
   const sandCarLoading = ref(false);
   const logRef = ref();
+  const documentBody = document.body;
   const labelCol = reactive({
     xs: { span: 24 },
     sm: { span: 6 },
@@ -321,6 +360,15 @@
           ccmNo: Number(queryParam.value.ccmNo),
         });
       },
+      afterFetch: (data) => {
+        return data.map((item) => {
+          return {
+            ...item,
+            licensePlateOrg: item.licensePlate,
+            destinationId: item.typeConfigId === '1024' ? undefined : item.typeConfigId,
+          };
+        });
+      },
       columns,
       canResize: false,
       showActionColumn: false,
@@ -419,6 +467,102 @@
       });
   }
 
+  // 修改类型
+  function handleBtypeChange(v, record) {
+    createConfirm({
+      iconType: 'warning',
+      title: '确认修改',
+      width: '460px',
+      content: () => {
+        return h('div', { style: { fontSize: '16px' } }, [
+          h('span', null, `是否将车牌为`),
+          h('span', { style: { fontSize: '18px', color: '#d48806' } }, `${record.licensePlate}`),
+          h('span', null, `的`),
+          h('span', { style: { fontSize: '18px', color: v === '1' ? '#cd201f' : '#3b5999' } }, `${v === '1' ? ' 热坯 ' : ' 冷坯 '}`),
+          h('span', null, `改为`),
+          h('span', { style: { fontSize: '18px', color: v === '1' ? '#3b5999' : '#cd201f' } }, `${v === '1' ? ' 冷坯 ' : ' 热坯 '}`),
+          h('span', null, `?`),
+        ]);
+      },
+      okText: '确认',
+      cancelText: '取消',
+      onOk: () => {
+        return edit({ id: record.id, btype: v }).then(() => {
+          handleSuccess();
+        });
+      },
+      onCancel: () => {
+        record.btype = v === '1' ? '0' : '1';
+      },
+    });
+  }
+
+  // 修改目的地
+  function handleDestinationIdChange(v, record) {
+    if (!v) return;
+    const destinationInfo = destinationOptions[record.ccmNo].find((item) => item.value === v);
+    createConfirm({
+      iconType: 'warning',
+      title: '确认修改',
+      width: '460px',
+      content: () => {
+        return h('div', { style: { fontSize: '16px' } }, [
+          h('span', null, `是否修改目的地为:`),
+          h('span', { style: { fontSize: '18px', color: '#d48806' } }, ` ${destinationInfo.label} `),
+          h('span', null, `?`),
+        ]);
+      },
+      okText: '确认',
+      cancelText: '取消',
+      onOk: () => {
+        return edit({
+          id: record.id,
+          typeConfigId: v,
+          destination: destinationInfo.label,
+          btype: record.btype,
+          licensePlate: record.licensePlate,
+        }).then(() => {
+          handleSuccess();
+        });
+      },
+      onCancel: () => {
+        record.destinationId = record.typeConfigId === '1024' ? undefined : v;
+      },
+    });
+  }
+
+  // 修改车号
+  function handleLicensePlateChange(v, record) {
+    if (!v) return;
+    createConfirm({
+      iconType: 'warning',
+      title: '确认修改',
+      width: '460px',
+      content: () => {
+        return h('div', { style: { fontSize: '16px' } }, [
+          h('span', null, `是否修改车辆为:`),
+          h('span', { style: { fontSize: '18px', color: '#d48806' } }, ` ${v} `),
+          h('span', null, `?`),
+        ]);
+      },
+      okText: '确认',
+      cancelText: '取消',
+      onOk: () => {
+        return edit({
+          id: record.id,
+          btype: record.btype,
+          licensePlate: record.licensePlate,
+          licensePlateStatus: 0,
+        }).then(() => {
+          handleSuccess();
+        });
+      },
+      onCancel: () => {
+        record.licensePlate = record.licensePlateOrg;
+      },
+    });
+  }
+
   onMounted(() => {
     initDictConfig();
     // initWebSocket();
@@ -484,6 +628,18 @@
     .jeecg-basic-table-action {
       justify-content: flex-end;
     }
+
+    .ant-switch {
+      background-color: #3b5999;
+    }
+
+    .ant-switch.ant-switch-checked {
+      background-color: #cd201f;
+    }
+
+    .ant-select-disabled.ant-select:not(.ant-select-customize-input) .ant-select-selector {
+      background-color: #e7e7e7;
+    }
   }
   .form-row {
     .ant-form-item {
@@ -527,7 +683,7 @@
         // animation-iteration-count: infinite;
         // animation-timing-function: ease-in-out;
         content: '';
-        z-index: 3;
+        z-index: -1;
         // box-shadow: inset 5px -1px 0 var(--vxe-danger-color, #f56c6c);
       }
     }

+ 6 - 0
src/views/billet/shippingBill/shippingBill.api.ts

@@ -4,6 +4,7 @@ import { useMessage } from '/@/hooks/web/useMessage';
 const { createConfirm } = useMessage();
 enum Api {
   list = '/storageBill/list',
+  edit = '/storageBill/edit',
   editCell = '/billetHotsendBase/billetHotsendBase/editDesc',
   deleteOne = '/storageBill/delete',
   deleteBatch = '/storageBill/deleteBatch',
@@ -115,3 +116,8 @@ export const listShippingBillDetails = (params) => defHttp.get({ url: Api.listSh
 
 // 移除钢坯
 export const removeBillets = (params) => defHttp.delete({ url: Api.removeBillets, params }, { joinParamsToUrl: true });
+
+// 编辑
+export const edit = (params) => {
+  return defHttp.put({ url: Api.edit, params }, { joinParamsToUrl: true });
+};

+ 16 - 14
src/views/billet/shippingBill/shippingBill.data.ts

@@ -43,7 +43,7 @@ export const columns: BasicColumn[] = computed(() => [
   {
     title: '车牌号',
     align: 'center',
-    width: 100,
+    width: 140,
     dataIndex: 'licensePlate',
     fixed: true,
     slots: { customRender: 'licensePlate' },
@@ -70,17 +70,16 @@ export const columns: BasicColumn[] = computed(() => [
   {
     title: '目的地',
     align: 'center',
-    width: 80,
+    width: 120,
     dataIndex: 'destination',
+    slots: { customRender: 'destination' },
   },
   {
-    title: '到达轧钢时间',
+    title: '类型',
     align: 'center',
-    width: 160,
-    dataIndex: 'steelReachTime',
-    customRender(opt) {
-      return render.renderTag(opt.record.steelReachTime, '#f50');
-    },
+    width: 80,
+    dataIndex: 'btype_dictText',
+    slots: { customRender: 'btype' },
   },
   {
     title: '班组',
@@ -123,19 +122,22 @@ export const columns: BasicColumn[] = computed(() => [
     // fixed: true
   },
   {
-    title: '牌号',
+    title: '到达轧钢时间',
     align: 'center',
-    width: 80,
-    dataIndex: 'brandNum',
+    width: 160,
+    dataIndex: 'steelReachTime',
     customRender(opt) {
-      return render.renderDict(opt.record.brandNum, 'billet_spec');
+      return render.renderTag(opt.record.steelReachTime, '#f50');
     },
   },
   {
-    title: '类型',
+    title: '牌号',
     align: 'center',
     width: 80,
-    dataIndex: 'btype_dictText',
+    dataIndex: 'brandNum',
+    customRender(opt) {
+      return render.renderDict(opt.record.brandNum, 'billet_spec');
+    },
   },
   {
     title: '定尺',

+ 1 - 1
src/views/billet/storageAndTransportation/components/car.vue

@@ -120,7 +120,7 @@
 
     .ant-divider {
       :deep(.ant-divider-inner-text) {
-        margin-left: -50px;
+        // margin-left: -50px;
       }
     }
 

+ 1 - 1
src/views/billet/storageAndTransportation/components/heat.vue

@@ -175,7 +175,7 @@
   .heat-container {
     .ant-divider {
       :deep(.ant-divider-inner-text) {
-        margin-left: -50px;
+        // margin-left: -50px;
       }
     }
 

+ 4 - 0
src/views/billet/storageAndTransportation/workbenches.vue

@@ -280,6 +280,10 @@
     }
 
     filterList.value = cloneList;
+    if (!current) {
+      return;
+    }
+
     changeId(current);
   };