feat(pages): 优化1、出差审批增加出差开始时间和出差结束时间2、开放一些新增修改功能3、销售报价去掉数量
已修改6个文件
187 ■■■■ 文件已修改
src/pages/cooperativeOffice/collaborativeApproval/approve.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/cooperativeOffice/collaborativeApproval/detail.vue 109 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/procurementManagement/procurementLedger/index.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/sales/salesAccount/index.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/sales/salesQuotation/detail.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/sales/salesQuotation/edit.vue 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/cooperativeOffice/collaborativeApproval/approve.vue
@@ -36,11 +36,20 @@
          </view>
        </template>
        <!-- approveType=3 出差相关字段 -->
        <view v-if="approvalData.approveType === 3"
              class="info-row">
        <template v-if="approvalData.approveType === 3">
          <view class="info-row">
          <text class="info-label">出差地点</text>
          <text class="info-value">{{ approvalData.location || '-' }}</text>
        </view>
          <view class="info-row">
            <text class="info-label">出差开始时间</text>
            <text class="info-value">{{ approvalData.startDateTime || '-' }}</text>
          </view>
          <view class="info-row">
            <text class="info-label">出差结束时间</text>
            <text class="info-value">{{ approvalData.endDateTime || '-' }}</text>
          </view>
        </template>
        <!-- approveType=4 报销相关字段 -->
        <view v-if="approvalData.approveType === 4"
              class="info-row">
src/pages/cooperativeOffice/collaborativeApproval/detail.vue
@@ -87,14 +87,39 @@
          </u-form-item>
        </template>
        <!-- approveType=3 出差相关字段 -->
        <u-form-item v-if="approveType === 3"
                     prop="location"
        <template v-if="approveType === 3">
          <u-form-item prop="location"
                     label="出差地点"
                     required>
          <u-input v-model="form.location"
                   placeholder="请输入出差地点"
                   clearable />
        </u-form-item>
          <u-form-item prop="startDateTime"
                       label="出差开始时间"
                       required>
            <u-input v-model="form.startDateTime"
                     readonly
                     placeholder="请选择出差开始时间"
                     @click="showTripStartDateTimePicker" />
            <template #right>
              <up-icon name="arrow-right"
                       @click="showTripStartDateTimePicker"></up-icon>
            </template>
          </u-form-item>
          <u-form-item prop="endDateTime"
                       label="出差结束时间"
                       required>
            <u-input v-model="form.endDateTime"
                     readonly
                     placeholder="请选择出差结束时间"
                     @click="showTripEndDateTimePicker" />
            <template #right>
              <up-icon name="arrow-right"
                       @click="showTripEndDateTimePicker"></up-icon>
            </template>
          </u-form-item>
        </template>
        <!-- approveType=4 报销相关字段 -->
        <u-form-item v-if="approveType === 4"
                     prop="price"
@@ -325,6 +350,26 @@
                            @cancel="showEndDate = false"
                            mode="date" />
      </up-popup>
      <!-- 出差开始时间选择器 -->
      <up-popup :show="showTripStartDateTime"
                mode="bottom"
                @close="showTripStartDateTime = false">
        <up-datetime-picker :show="true"
                            v-model="tripStartDateTimeValue"
                            @confirm="onTripStartDateTimeConfirm"
                            @cancel="showTripStartDateTime = false"
                            mode="datetime" />
      </up-popup>
      <!-- 出差结束时间选择器 -->
      <up-popup :show="showTripEndDateTime"
                mode="bottom"
                @close="showTripEndDateTime = false">
        <up-datetime-picker :show="true"
                            v-model="tripEndDateTimeValue"
                            @confirm="onTripEndDateTimeConfirm"
                            @cancel="showTripEndDateTime = false"
                            mode="datetime" />
      </up-popup>
    </template>
    <!-- 底部按钮 -->
    <view class="footer-btns"
@@ -350,7 +395,7 @@
  import PageHeader from "@/components/PageHeader.vue";
  import CommonUpload from "@/components/CommonUpload.vue";
  import useUserStore from "@/store/modules/user";
  import { formatDateToYMD } from "@/utils/ruoyi";
  import { formatDateToYMD, parseTime } from "@/utils/ruoyi";
  import {
    getDept,
    approveProcessGetInfo,
@@ -380,6 +425,8 @@
      storageBlobDTOS: [],
      startDate: "",
      endDate: "",
      startDateTime: "",
      endDateTime: "",
      location: "",
      price: "",
    },
@@ -394,6 +441,12 @@
      ],
      endDate: [
        { required: false, message: "请选择结束时间", trigger: "change" },
      ],
      startDateTime: [
        { required: false, message: "请选择出差开始时间", trigger: "change" },
      ],
      endDateTime: [
        { required: false, message: "请选择出差结束时间", trigger: "change" },
      ],
      location: [{ required: false, message: "请输入出差地点", trigger: "blur" }],
      price: [{ required: false, message: "请输入报销金额", trigger: "blur" }],
@@ -413,6 +466,10 @@
  const startDateValue = ref(Date.now());
  const showEndDate = ref(false);
  const endDateValue = ref(Date.now());
  const showTripStartDateTime = ref(false);
  const tripStartDateTimeValue = ref(Date.now());
  const showTripEndDateTime = ref(false);
  const tripEndDateTimeValue = ref(Date.now());
  const userStore = useUserStore();
  const approveType = ref(0);
  const isInitialLoading = ref(false);
@@ -475,6 +532,24 @@
  const onEndDateConfirm = e => {
    form.value.endDate = formatDateToYMD(e.value);
    showEndDate.value = false;
  };
  const showTripStartDateTimePicker = () => {
    showTripStartDateTime.value = true;
  };
  const onTripStartDateTimeConfirm = e => {
    form.value.startDateTime = parseTime(e.value, "{y}-{m}-{d} {h}:{i}");
    showTripStartDateTime.value = false;
  };
  const showTripEndDateTimePicker = () => {
    showTripEndDateTime.value = true;
  };
  const onTripEndDateTimeConfirm = e => {
    form.value.endDateTime = parseTime(e.value, "{y}-{m}-{d} {h}:{i}");
    showTripEndDateTime.value = false;
  };
  const fetchDetailData = async row => {
@@ -647,6 +722,34 @@
      return;
    }
    if (Number(approveType.value) === 3) {
      if (!form.value.location || !String(form.value.location).trim()) {
        showToast("请输入出差地点");
        return;
      }
      if (!form.value.startDateTime) {
        showToast("请选择出差开始时间");
        return;
      }
      if (!form.value.endDateTime) {
        showToast("请选择出差结束时间");
        return;
      }
      const start = new Date(String(form.value.startDateTime).replace(/-/g, "/"));
      const end = new Date(String(form.value.endDateTime).replace(/-/g, "/"));
      if (
        Number.isFinite(start.getTime()) &&
        Number.isFinite(end.getTime()) &&
        end < start
      ) {
        showToast("出差结束时间不能早于开始时间");
        return;
      }
    }
    formRef.value
      .validate()
      .then(valid => {
src/pages/procurementManagement/procurementLedger/index.vue
@@ -77,7 +77,7 @@
              </view>
            </view>
            <!-- 仅非“审批通过”的台账展示删除按钮 -->
            <!-- <view class="detail-row"
            <view class="detail-row"
                  v-if="item.approvalStatus !== 3"
                  style="justify-content: flex-end; margin-top: 8px;">
              <up-button type="error"
@@ -86,7 +86,7 @@
                         @click.stop="handleDelete(item)">
                删除
              </up-button>
            </view> -->
            </view>
          </view>
        </view>
      </view>
@@ -96,12 +96,12 @@
      <text>暂无采购台账数据</text>
    </view>
    <!-- 浮动操作按钮 -->
    <!-- <view class="fab-button"
    <view class="fab-button"
          @click="handleInfo('add')">
      <up-icon name="plus"
               size="24"
               color="#ffffff"></up-icon>
    </view> -->
    </view>
  </view>
</template>
src/pages/sales/salesAccount/index.vue
@@ -79,14 +79,14 @@
            </view>
            <up-divider></up-divider>
            <view class="detail-buttons">
              <u-button class="detail-button"
              <!-- <u-button class="detail-button"
                        size="small"
                        type="primary"
                        plain
                        @click.stop="openOut(item)">
                发货状态
              </u-button>
              <!-- <u-button class="detail-button"
              </u-button> -->
              <u-button class="detail-button"
                        size="small"
                        type="primary"
                        @click.stop="handleInfo('edit', item)">
@@ -98,14 +98,14 @@
                        plain
                        @click.stop="openOut(item)">
                发货状态
              </u-button> -->
              <!-- <u-button class="detail-button"
              </u-button>
              <u-button class="detail-button"
                        size="small"
                        type="error"
                        plain
                        @click.stop="handleDelete(item)">
                删除
              </u-button> -->
              </u-button>
            </view>
          </view>
        </view>
@@ -116,12 +116,12 @@
      <text>暂无销售台账数据</text>
    </view>
    <!-- 浮动操作按钮 -->
    <!-- <view class="fab-button"
    <view class="fab-button"
          @click="handleInfo('add')">
      <up-icon name="plus"
               size="24"
               color="#ffffff"></up-icon>
    </view> -->
    </view>
  </view>
</template>
src/pages/sales/salesQuotation/detail.vue
@@ -65,16 +65,8 @@
              <text class="info-value">{{ item.unit || "-" }}</text>
            </view>
            <view class="info-item">
              <text class="info-label">数量</text>
              <text class="info-value">{{ item.quantity || "-" }}</text>
            </view>
            <view class="info-item">
              <text class="info-label">单价</text>
              <text class="info-value">{{ formatAmount(item.unitPrice) }}</text>
            </view>
            <view class="info-item">
              <text class="info-label">金额</text>
              <text class="info-value highlight">{{ formatAmount(item.amount) }}</text>
            </view>
          </view>
        </view>
@@ -115,7 +107,11 @@
  const loadDetailFromStorage = () => {
    const cachedData = uni.getStorageSync("salesQuotationDetail");
    if (cachedData && (cachedData.id === quotationId.value || cachedData.id === Number(quotationId.value))) {
    if (
      cachedData &&
      (cachedData.id === quotationId.value ||
        cachedData.id === Number(quotationId.value))
    ) {
      detailData.value = cachedData;
    } else {
      detailData.value = cachedData || {};
src/pages/sales/salesQuotation/edit.vue
@@ -124,24 +124,12 @@
                            placeholder="请输入单位"
                            clearable />
                </up-form-item>
                <up-form-item label="数量">
                  <up-input v-model="product.quantity"
                            type="number"
                            placeholder="请输入数量"
                            clearable
                            @blur="calculateAmount(product)" />
                </up-form-item>
                <up-form-item label="单价">
                  <up-input v-model="product.unitPrice"
                            type="number"
                            placeholder="请输入单价"
                            clearable
                            @blur="calculateAmount(product)" />
                </up-form-item>
                <up-form-item label="金额">
                  <up-input :model-value="formatAmount(product.amount)"
                            disabled
                            placeholder="自动计算" />
                </up-form-item>
              </view>
            </view>
@@ -263,7 +251,7 @@
  const totalAmount = computed(() =>
    Number(
      (form.value.products || [])
        .reduce((sum, item) => sum + Number(item.amount || 0), 0)
        .reduce((sum, item) => sum + Number(item.unitPrice || 0), 0)
        .toFixed(2)
    )
  );
@@ -294,9 +282,7 @@
    productModelId: "",
    ProductModel: "",
    unit: "",
    quantity: 1,
    unitPrice: 0,
    amount: 0,
    modelOptions: [],
  });
@@ -322,9 +308,7 @@
  const goBack = () => uni.navigateBack();
  const calculateAmount = product => {
    product.amount = Number(
      (Number(product.quantity || 0) * Number(product.unitPrice || 0)).toFixed(2)
    );
    product.unitPrice = Number(Number(product.unitPrice || 0).toFixed(2));
    form.value.totalAmount = totalAmount.value;
  };
@@ -451,9 +435,7 @@
          productModelId: item.productModelId || "",
          ProductModel: item.ProductModel || item.specification || "",
          unit: item.unit || "",
          quantity: Number(item.quantity || 1),
          unitPrice: Number(item.unitPrice || 0),
          amount: Number(item.amount || 0),
          modelOptions: [],
        };
@@ -528,7 +510,6 @@
        !item.productId ||
        !item.productModelId ||
        !item.unit ||
        !Number(item.quantity) ||
        !Number(item.unitPrice)
    );
    if (invalid) {
@@ -554,10 +535,10 @@
        product: item.product,
        productModelId: item.productModelId,
        ProductModel: item.ProductModel,
        quantity: Number(item.quantity || 0),
        quantity: 1,
        unit: item.unit,
        unitPrice: Number(item.unitPrice || 0),
        amount: Number(item.amount || 0),
        amount: Number(item.unitPrice || 0),
      })),
    };
    const action = quotationId.value ? updateQuotation : addQuotation;