|
@@ -68,19 +68,16 @@
|
|
|
<wd-button block type="primary" @click="formSubmit">提交</wd-button>
|
|
|
</view>
|
|
|
</wd-cell-group>
|
|
|
+ <wd-toast />
|
|
|
</view>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
import { onLoad } from '@dcloudio/uni-app';
|
|
|
import dataService from '@/api/procure';
|
|
|
-import { defineProps, ref, toRefs } from 'vue';
|
|
|
+import { useToast } from 'wot-design-uni';
|
|
|
+import { ref } from 'vue';
|
|
|
import moment from 'moment';
|
|
|
-const props = defineProps({
|
|
|
- id: {
|
|
|
- type: String,
|
|
|
- default: '',
|
|
|
- },
|
|
|
-});
|
|
|
+const toast = useToast();
|
|
|
const detail = ref({});
|
|
|
const columns = ref([]);
|
|
|
const payList = ref([
|
|
@@ -95,7 +92,6 @@ const payList = ref([
|
|
|
]);
|
|
|
const formId = ref('');
|
|
|
const oldValues = ref({});
|
|
|
-const { id } = toRefs(props);
|
|
|
onLoad((options) => {
|
|
|
const item = JSON.parse(options.item);
|
|
|
formId.value = options.formId;
|
|
@@ -104,9 +100,8 @@ onLoad((options) => {
|
|
|
obj[child.text] = child.value;
|
|
|
});
|
|
|
detail.value = obj;
|
|
|
- console.log(detail.value);
|
|
|
+
|
|
|
oldValues.value = JSON.parse(options.item);
|
|
|
- // console.log(oldValues.value);
|
|
|
projectList();
|
|
|
});
|
|
|
|
|
@@ -123,9 +118,9 @@ function projectList() {
|
|
|
|
|
|
function handleConfirm(e, num) {
|
|
|
if (num === 1) {
|
|
|
- detail.value['收款日期'] = moment(e.value).format('YYYY-MM-DD');
|
|
|
+ detail.value['收款日期'] = e.value;
|
|
|
} else {
|
|
|
- detail.value['付款日期'] = moment(e.value).format('YYYY-MM-DD');
|
|
|
+ detail.value['付款日期'] = e.value;
|
|
|
}
|
|
|
}
|
|
|
function formSubmit() {
|
|
@@ -139,6 +134,13 @@ function formSubmit() {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ old['564'] = moment(old['564']).valueOf();
|
|
|
+ old['563'] = moment(old['563']).valueOf();
|
|
|
+ old['554'] = moment(old['554']).valueOf();
|
|
|
+ dataObj['554'] = moment(dataObj['554']).valueOf();
|
|
|
+ dataObj['563'] = moment(dataObj['563']).valueOf();
|
|
|
+ dataObj['564'] = moment(dataObj['564']).valueOf();
|
|
|
const data = [
|
|
|
{
|
|
|
data: JSON.stringify(dataObj),
|
|
@@ -154,9 +156,12 @@ function formSubmit() {
|
|
|
dataService.editData(params).then((res) => {
|
|
|
if (res.code === 200) {
|
|
|
toast.success('更新成功');
|
|
|
- uni.navigateBack({
|
|
|
- delta: 1,
|
|
|
- });
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.$emit('refresh', { refresh: true });
|
|
|
+ uni.navigateBack({
|
|
|
+ delta: 1,
|
|
|
+ });
|
|
|
+ }, 1000);
|
|
|
} else {
|
|
|
toast.error('提交失败');
|
|
|
}
|