Explorar o código

工时报表 工时审批

XuZinan %!s(int64=2) %!d(string=hai) anos
pai
achega
b4897174ca
Modificáronse 3 ficheiros con 238 adicións e 220 borrados
  1. 48 46
      pages/WorkingHours/add.vue
  2. 84 76
      pages/WorkingHours/audit.vue
  3. 106 98
      pages/WorkingHours/index.vue

+ 48 - 46
pages/WorkingHours/add.vue

@@ -1,29 +1,30 @@
 <template>
-  <view class="content">
-    <view class="popup-content">
-      <uni-forms ref="baseForm" :modelValue="formData">
-        <uni-forms-item label="分类">
-          <ld-select
-            :list="typeList"
-            placeholder="请选择分类"
-            class="select"
-            v-model="formData.typeId"
-            labelKey="name"
-            valueKey="id"
-            @change="onChangeType"
-          />
-        </uni-forms-item>
-        <uni-forms-item v-show="currentType.type == 0" label="项目">
-          <comboxSearch
-            emptyTips="无匹配项"
-            placeholder="请选择项目"
-            keyName="fullName"
-            :value="projectName"
-            :isJSON="true"
-            :candidates="projectList"
-            @getValue="onChangeProject"
-          />
-          <!-- <ld-select
+  <view class="page">
+    <view class="content">
+      <view class="popup-content">
+        <uni-forms ref="baseForm" :modelValue="formData">
+          <uni-forms-item label="分类">
+            <ld-select
+              :list="typeList"
+              placeholder="请选择分类"
+              class="select"
+              v-model="formData.typeId"
+              labelKey="name"
+              valueKey="id"
+              @change="onChangeType"
+            />
+          </uni-forms-item>
+          <uni-forms-item v-show="currentType.type == 0" label="项目">
+            <comboxSearch
+              emptyTips="无匹配项"
+              placeholder="请选择项目"
+              keyName="fullName"
+              :value="projectName"
+              :isJSON="true"
+              :candidates="projectList"
+              @getValue="onChangeProject"
+            />
+            <!-- <ld-select
             :list="projectList"
             placeholder="请选择项目"
             class="select"
@@ -32,27 +33,28 @@
             valueKey="ID"
             @change="onChangeProject"
           /> -->
-        </uni-forms-item>
-        <uni-forms-item label="子类">
-          <ld-select
-            :list="subTypeList"
-            placeholder="请选择子类"
-            class="select"
-            v-model="formData.subTypeId"
-            labelKey="fullName"
-            valueKey="id"
-            :disabled="currentType.id == 2"
-            @change="onChangeSubType"
-          />
-        </uni-forms-item>
-        <uni-forms-item label="日期">
-          <view class="date">{{ this.day }}</view>
-        </uni-forms-item>
-      </uni-forms>
-    </view>
-    <view class="group">
-      <button @click="close" class="button">取消</button>
-      <button @click="submit" type="primary">保存</button>
+          </uni-forms-item>
+          <uni-forms-item label="子类">
+            <ld-select
+              :list="subTypeList"
+              placeholder="请选择子类"
+              class="select"
+              v-model="formData.subTypeId"
+              labelKey="fullName"
+              valueKey="id"
+              :disabled="currentType.id == 2"
+              @change="onChangeSubType"
+            />
+          </uni-forms-item>
+          <uni-forms-item label="日期">
+            <view class="date">{{ this.day }}</view>
+          </uni-forms-item>
+        </uni-forms>
+      </view>
+      <view class="group">
+        <button @click="close" class="button">取消</button>
+        <button @click="submit" type="primary">保存</button>
+      </view>
     </view>
   </view>
 </template>

+ 84 - 76
pages/WorkingHours/audit.vue

@@ -1,87 +1,89 @@
 <template>
-  <view class="content">
-    <uni-calendar
-      class="uni-calendar--hook"
-      :selected="info.selected"
-      :showMonth="false"
-      @change="change"
-    />
-    <uni-collapse ref="collapse">
-      <uni-collapse-item
-        v-for="collapse in collapseList"
-        :key="collapse.name"
-        :title="collapse.name"
-      >
-        <view class="content">
-          <template v-for="(item, index) in collapse.children">
-            <uni-card
-              :key="index"
-              :title="allType[item.type_id] && allType[item.type_id].name"
-            >
-              <view class="uni-body">
-                <view class="detail-item">
-                  <view class="detail-label">提交人</view>
-                  <view class="detail-value">
-                    {{ item.User.CName }}
+  <view class="page">
+    <view class="content">
+      <uni-calendar
+        class="uni-calendar--hook"
+        :selected="info.selected"
+        :showMonth="false"
+        @change="change"
+      />
+      <uni-collapse ref="collapse">
+        <uni-collapse-item
+          v-for="collapse in collapseList"
+          :key="collapse.name"
+          :title="collapse.name"
+        >
+          <view class="content">
+            <template v-for="(item, index) in collapse.children">
+              <uni-card
+                :key="index"
+                :title="allType[item.type_id] && allType[item.type_id].name"
+              >
+                <view class="uni-body">
+                  <view class="detail-item">
+                    <view class="detail-label">提交人</view>
+                    <view class="detail-value">
+                      {{ item.User.CName }}
+                    </view>
                   </view>
-                </view>
-                <view class="detail-item">
-                  <view class="detail-label">审核状态</view>
-                  <view
-                    class="detail-value"
-                    :style="{ color: stateColor[item.audit_state] }"
-                  >
-                    {{ auditState[item.audit_state] }}
+                  <view class="detail-item">
+                    <view class="detail-label">审核状态</view>
+                    <view
+                      class="detail-value"
+                      :style="{ color: stateColor[item.audit_state] }"
+                    >
+                      {{ auditState[item.audit_state] }}
+                    </view>
                   </view>
-                </view>
-                <view class="detail-item" v-if="item.audit_state == 3">
-                  <view class="detail-label">拒绝原因</view>
-                  <view class="detail-value">
-                    {{ item.audit_desc }}
+                  <view class="detail-item" v-if="item.audit_state == 3">
+                    <view class="detail-label">拒绝原因</view>
+                    <view class="detail-value">
+                      {{ item.audit_desc }}
+                    </view>
                   </view>
-                </view>
-                <view class="detail-item">
-                  <view class="detail-label">工时</view>
-                  <view class="detail-value">
-                    {{ item.workload }}
+                  <view class="detail-item">
+                    <view class="detail-label">工时</view>
+                    <view class="detail-value">
+                      {{ item.workload }}
+                    </view>
                   </view>
                 </view>
-              </view>
-              <view
-                v-if="item.audit_state == 1"
-                slot="actions"
-                class="card-actions"
-              >
-                <view class="card-actions-item" @click="onHandleAudit(item)">
-                  <text class="card-actions-item-text">通过</text>
-                </view>
-                <view class="card-actions-item" @click="onHandleReject(item)">
-                  <text class="card-actions-item-text">拒绝</text>
+                <view
+                  v-if="item.audit_state == 1"
+                  slot="actions"
+                  class="card-actions"
+                >
+                  <view class="card-actions-item" @click="onHandleAudit(item)">
+                    <text class="card-actions-item-text">通过</text>
+                  </view>
+                  <view class="card-actions-item" @click="onHandleReject(item)">
+                    <text class="card-actions-item-text">拒绝</text>
+                  </view>
                 </view>
-              </view>
-            </uni-card>
-          </template>
-        </view>
-      </uni-collapse-item>
-    </uni-collapse>
+              </uni-card>
+            </template>
+          </view>
+        </uni-collapse-item>
+      </uni-collapse>
 
-    <uni-popup ref="inputDialog" type="dialog">
-      <uni-popup-dialog
-        ref="inputClose"
-        mode="input"
-        title="拒绝原因"
-        :value="auditDesc"
-        @confirm="dialogInputConfirm"
-      ></uni-popup-dialog>
-    </uni-popup>
-    <uni-popup ref="auditDialog" type="dialog">
-      <uni-popup-dialog
-        type="info"
-        title="提示"
-        content="是否确认通过审批"
-        @confirm="auditConfirm"
-      ></uni-popup-dialog>
-    </uni-popup>
+      <uni-popup ref="inputDialog" type="dialog">
+        <uni-popup-dialog
+          ref="inputClose"
+          mode="input"
+          title="拒绝原因"
+          :value="auditDesc"
+          @confirm="dialogInputConfirm"
+        ></uni-popup-dialog>
+      </uni-popup>
+      <uni-popup ref="auditDialog" type="dialog">
+        <uni-popup-dialog
+          type="info"
+          title="提示"
+          content="是否确认通过审批"
+          @confirm="auditConfirm"
+        ></uni-popup-dialog>
+      </uni-popup>
+    </view>
   </view>
 </template>
 
@@ -329,4 +331,10 @@ export default {
     text-align: right;
   }
 }
+
+::v-deep {
+  .uni-calendar-item__weeks-box-item {
+    width: 90rpx;
+  }
+}
 </style>

+ 106 - 98
pages/WorkingHours/index.vue

@@ -1,116 +1,118 @@
 <template>
-  <view class="content">
-    <!-- <button class="btn-add" @click="toAdd" type="primary">新增</button> -->
-    <uni-calendar
-      class="uni-calendar--hook"
-      :selected="info.selected"
-      :showMonth="false"
-      :date="day"
-      @change="change"
-      @monthSwitch="monthSwitch"
-    >
-      <text @click="toAdd">新增工时</text>
-    </uni-calendar>
-    <!-- <button @click="showModal" type="primary">新增</button> -->
-    <uni-collapse ref="collapse">
-      <uni-collapse-item
-        v-for="collapse in collapseList"
-        :key="collapse.name"
-        :title="collapse.name"
+  <view class="page">
+    <view class="content">
+      <!-- <button class="btn-add" @click="toAdd" type="primary">新增</button> -->
+      <uni-calendar
+        class="uni-calendar--hook"
+        :selected="info.selected"
+        :showMonth="false"
+        :date="day"
+        @change="change"
+        @monthSwitch="monthSwitch"
       >
-        <view class="content">
-          <uni-card
-            v-for="(item, index) in collapse.children"
-            :key="index"
-            :title="allType[item.type_id] && allType[item.type_id].name"
-          >
-            <view class="uni-body">
-              <view class="detail-item" v-if="item.project_id != '0'">
-                <view class="detail-label">所属项目</view>
-                <view class="detail-value">
-                  {{ getProject(item.project_id) }}
+        <text @click="toAdd">新增工时</text>
+      </uni-calendar>
+      <!-- <button @click="showModal" type="primary">新增</button> -->
+      <uni-collapse ref="collapse">
+        <uni-collapse-item
+          v-for="collapse in collapseList"
+          :key="collapse.name"
+          :title="collapse.name"
+        >
+          <view class="content">
+            <uni-card
+              v-for="(item, index) in collapse.children"
+              :key="index"
+              :title="allType[item.type_id] && allType[item.type_id].name"
+            >
+              <view class="uni-body">
+                <view class="detail-item" v-if="item.project_id != '0'">
+                  <view class="detail-label">所属项目</view>
+                  <view class="detail-value">
+                    {{ getProject(item.project_id) }}
+                  </view>
                 </view>
-              </view>
-              <view class="detail-item">
-                <view class="detail-label">审核状态</view>
-                <view
-                  class="detail-value"
-                  :style="{ color: stateColor[item.audit_state] }"
-                >
-                  {{ auditState[item.audit_state] }}
+                <view class="detail-item">
+                  <view class="detail-label">审核状态</view>
+                  <view
+                    class="detail-value"
+                    :style="{ color: stateColor[item.audit_state] }"
+                  >
+                    {{ auditState[item.audit_state] }}
+                  </view>
                 </view>
-              </view>
-              <view class="detail-item" v-if="item.audit_state == 3">
-                <view class="detail-label">拒绝原因</view>
-                <view class="detail-value">
-                  {{ item.audit_desc }}
+                <view class="detail-item" v-if="item.audit_state == 3">
+                  <view class="detail-label">拒绝原因</view>
+                  <view class="detail-value">
+                    {{ item.audit_desc }}
+                  </view>
                 </view>
-              </view>
-              <view class="detail-item">
-                <view class="detail-label">工时</view>
-                <view class="detail-value">
-                  {{ item.workload }}
+                <view class="detail-item">
+                  <view class="detail-label">工时</view>
+                  <view class="detail-value">
+                    {{ item.workload }}
+                  </view>
                 </view>
               </view>
-            </view>
-            <view
-              v-if="item.audit_state == 0 || item.audit_state == 3"
-              slot="actions"
-              class="card-actions"
-            >
-              <view class="card-actions-item" @click="onHandleSave(item)">
-                <text class="card-actions-item-text">修改工时</text>
-              </view>
-              <view class="card-actions-item" @click="onHandleAudit(item, 0)">
-                <text class="card-actions-item-text">上报审批</text>
+              <view
+                v-if="item.audit_state == 0 || item.audit_state == 3"
+                slot="actions"
+                class="card-actions"
+              >
+                <view class="card-actions-item" @click="onHandleSave(item)">
+                  <text class="card-actions-item-text">修改工时</text>
+                </view>
+                <view class="card-actions-item" @click="onHandleAudit(item, 0)">
+                  <text class="card-actions-item-text">上报审批</text>
+                </view>
               </view>
-            </view>
-          </uni-card>
-        </view>
-      </uni-collapse-item>
-    </uni-collapse>
+            </uni-card>
+          </view>
+        </uni-collapse-item>
+      </uni-collapse>
 
-    <uni-popup ref="inputDialog" type="dialog">
-      <uni-popup-dialog
-        ref="inputClose"
-        mode="input"
-        title="填入工时"
-        :value="currentItem.workload === 0 ? '' : currentItem.workload"
-        @confirm="dialogInputConfirm"
-      ></uni-popup-dialog>
-    </uni-popup>
-    <uni-popup ref="auditDialog" type="dialog">
-      <uni-popup-dialog
-        type="info"
-        title="提示"
-        content="是否确认提交审批"
-        @confirm="auditConfirm"
-      ></uni-popup-dialog>
-    </uni-popup>
-    <view class="group">
-      <!-- <button
+      <uni-popup ref="inputDialog" type="dialog">
+        <uni-popup-dialog
+          ref="inputClose"
+          mode="input"
+          title="填入工时"
+          :value="currentItem.workload === 0 ? '' : currentItem.workload"
+          @confirm="dialogInputConfirm"
+        ></uni-popup-dialog>
+      </uni-popup>
+      <uni-popup ref="auditDialog" type="dialog">
+        <uni-popup-dialog
+          type="info"
+          title="提示"
+          content="是否确认提交审批"
+          @confirm="auditConfirm"
+        ></uni-popup-dialog>
+      </uni-popup>
+      <view class="group">
+        <!-- <button
         class="approval"
         v-if="permission['func-05-mobile-works-approval']"
         @click="onHandleApproval()"
       >
         审批工时
       </button> -->
-      <button
-        v-if="permission['func-05-mobile-works-commit']"
-        @click="onHandleAudit({}, 2)"
-        type="primary"
-        class="commit"
-      >
-        上报本月工时
-      </button>
-      <button
-        v-if="permission['func-05-mobile-works-commit']"
-        v-show="collapseList.length > 0"
-        @click="onHandleAudit({}, 1)"
-        class="commit"
-      >
-        上报今日工时
-      </button>
+        <button
+          v-if="permission['func-05-mobile-works-commit']"
+          @click="onHandleAudit({}, 2)"
+          type="primary"
+          class="commit"
+        >
+          上报本月工时
+        </button>
+        <button
+          v-if="permission['func-05-mobile-works-commit']"
+          v-show="collapseList.length > 0"
+          @click="onHandleAudit({}, 1)"
+          class="commit"
+        >
+          上报今日工时
+        </button>
+      </view>
     </view>
   </view>
 </template>
@@ -438,4 +440,10 @@ export default {
     margin: inherit;
   }
 }
+
+::v-deep {
+  .uni-calendar-item__weeks-box-item {
+    width: 90rpx;
+  }
+}
 </style>