Explorar o código

优化表格列宽显示,添加出库时间字段并默认填充当前时间

yusheng hai 9 meses
pai
achega
332759bb11

+ 2 - 2
src/views/bpm/handleTask/components/saleOrder/invoice/detailDialog.vue

@@ -228,7 +228,7 @@
         detailData: {},
         childrenColumns: [
           {
-            width: 65,
+            width: 80,
             type: 'index',
             columnKey: 'index',
             align: 'center',
@@ -261,7 +261,7 @@
         let columnsVersion = this.columnsVersion;
         return [
           {
-            width: 45,
+            width: 65,
             type: 'index',
             columnKey: 'index',
             align: 'center',

+ 5 - 0
src/views/bpm/outgoingManagement/details.vue

@@ -53,6 +53,11 @@
                   <span>{{ infoData.fromUserPhone }}</span>
                 </el-form-item>
               </el-col>
+              <el-col :span="8">
+                <el-form-item label="出库时间">
+                  <span>{{ infoData.storageTime||infoData.createTime }}</span>
+                </el-form-item>
+              </el-col>
               <el-col :span="8">
                 <el-form-item label="出库登记人">
                   <span>{{ infoData.extInfo?.createUserName }}</span>

+ 38 - 0
src/views/bpm/outgoingManagement/outbound.vue

@@ -87,6 +87,16 @@
               </el-select> -->
             </el-form-item>
           </el-col>
+          <el-col :span="6">
+            <el-form-item label="出库时间">
+              <el-date-picker
+                v-model="formData.storageTime"
+                type="datetime"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                placeholder="选择日期时间"
+              >
+              </el-date-picker></el-form-item
+          ></el-col>
           <el-col :span="6">
             <el-form-item label="出库登记人">
               <el-input
@@ -571,6 +581,7 @@
         qualityResults, // 质检结果
         treeList: [],
         formData: {
+          storageTime:"",
           extInfo: {
             assetType: [], //物品类型id
             assetTypeName: '', //物品类型名称
@@ -633,9 +644,36 @@
       this.getListItems();
       this.initDeptData().then(() => {
         this.initFormData();
+        this.getNowFormatDate()
+
       });
     },
     methods: {
+      // 获取当前时间函数
+      getNowDate() {
+        let date = new Date(),
+          obj = {
+            year: date.getFullYear(), //获取当前月份(0-11,0代表1月)
+            month: date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
+            strDate: date.getDate(), // 获取当前日(1-31)
+            hour: date.getHours(), //获取当前小时(0 ~ 23)
+            minute: date.getMinutes(), //获取当前分钟(0 ~ 59)
+            second: date.getSeconds() //获取当前秒数(0 ~ 59)
+          };
+        Object.keys(obj).forEach((key) => {
+          if (obj[key] < 10) obj[key] = `0${obj[key]}`;
+        });
+        return obj;
+      },
+      // 赋值入库时间
+      getNowFormatDate() {
+        const obj = this.getNowDate();
+        const defaultTime = '00:00:00';
+        const currentTime = `${obj.hour}:${obj.minute}:${obj.second}`;
+
+        this.formData.storageTime = `${obj.year}-${obj.month}-${obj.strDate} ${currentTime}`;
+      },
+
       // 获取动态表头
       getFieldModel() {
         storageApi.fieldModel({ fieldModel: 't_main_category' }).then((res) => {