|
@@ -28,19 +28,27 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div class="form-group">
|
|
<div class="form-group">
|
|
|
<label for="exampleInputEmail2">负责人</label>
|
|
<label for="exampleInputEmail2">负责人</label>
|
|
|
- <select
|
|
|
|
|
- id="userName"
|
|
|
|
|
|
|
+ <a-select
|
|
|
|
|
+ v-model:value="traceTimeLine.userName"
|
|
|
style="width: 100%; height: 30px"
|
|
style="width: 100%; height: 30px"
|
|
|
- class="form-control js-data-example-ajax"
|
|
|
|
|
|
|
+ :options="allUsers"
|
|
|
|
|
+ @change="getUser"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
<div class="form-group">
|
|
|
<label for="exampleInputEmail2">截止时间</label>
|
|
<label for="exampleInputEmail2">截止时间</label>
|
|
|
- <Date
|
|
|
|
|
- v-model="traceTimeLine.endDate"
|
|
|
|
|
- style="width: 100%"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <a-config-provider :locale="locale">
|
|
|
|
|
+ <a-date-picker
|
|
|
|
|
+ v-model:value="planFinishedDate"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ show-time
|
|
|
|
|
+ format="YYYY-MM-DD HH:mm:ss"
|
|
|
|
|
+ :show-now="false"
|
|
|
|
|
+ placeholder="请选择日期"
|
|
|
|
|
+ />
|
|
|
|
|
+ </a-config-provider>
|
|
|
|
|
+ <!-- <Date v-model="traceTimeLine.endDate" style="width: 100%" /> -->
|
|
|
</div>
|
|
</div>
|
|
|
<div style="margin-top: 10px">
|
|
<div style="margin-top: 10px">
|
|
|
<button
|
|
<button
|
|
@@ -64,22 +72,19 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
import { Notify } from 'pc-component-v3';
|
|
import { Notify } from 'pc-component-v3';
|
|
|
import Common from '../common/Common.js';
|
|
import Common from '../common/Common.js';
|
|
|
-
|
|
|
|
|
|
|
+import zhCN from 'ant-design-vue/es/locale/zh_CN';
|
|
|
|
|
+import dayjs from 'dayjs';
|
|
|
|
|
+import 'dayjs/locale/zh-cn';
|
|
|
|
|
+import weekday from 'dayjs/plugin/weekday';
|
|
|
|
|
+import localeData from 'dayjs/plugin/localeData';
|
|
|
|
|
+
|
|
|
|
|
+dayjs.extend(weekday);
|
|
|
|
|
+dayjs.extend(localeData);
|
|
|
|
|
+dayjs.locale('zh-cn');
|
|
|
export default {
|
|
export default {
|
|
|
- components: {
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ components: {},
|
|
|
data: function () {
|
|
data: function () {
|
|
|
return {
|
|
return {
|
|
|
traceTimeLineId: '', // 追踪单(输入参数)
|
|
traceTimeLineId: '', // 追踪单(输入参数)
|
|
@@ -92,6 +97,9 @@ export default {
|
|
|
endDate: undefined,
|
|
endDate: undefined,
|
|
|
}, // 追踪单时间节点(输入参数)
|
|
}, // 追踪单时间节点(输入参数)
|
|
|
loading: false,
|
|
loading: false,
|
|
|
|
|
+ allUsers: [],
|
|
|
|
|
+ locale: zhCN,
|
|
|
|
|
+ planFinishedDate: '',
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -112,7 +120,11 @@ export default {
|
|
|
this.projectId = Number(this.$route.query.projectId);
|
|
this.projectId = Number(this.$route.query.projectId);
|
|
|
this.loadTraceTimeLine();
|
|
this.loadTraceTimeLine();
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
|
|
+ // 获取负责人信息
|
|
|
|
|
+ getUser: function (_, val) {
|
|
|
|
|
+ this.traceTimeLine.userId = val.userId;
|
|
|
|
|
+ this.traceTimeLine.userName = val.userName;
|
|
|
|
|
+ },
|
|
|
/**
|
|
/**
|
|
|
* 加载时间节点Id
|
|
* 加载时间节点Id
|
|
|
*/
|
|
*/
|
|
@@ -130,11 +142,14 @@ export default {
|
|
|
},
|
|
},
|
|
|
success: function (data) {
|
|
success: function (data) {
|
|
|
_self.traceTimeLine = data;
|
|
_self.traceTimeLine = data;
|
|
|
|
|
+ if(data.endDate !== '' && data.endDate){
|
|
|
|
|
+ _self.planFinishedDate = dayjs(data.endDate,'YYYY-MM-DD HH:mm:ss');
|
|
|
|
|
+ }
|
|
|
_self.loadSelectUserName();
|
|
_self.loadSelectUserName();
|
|
|
- _self.loading=false;
|
|
|
|
|
|
|
+ _self.loading = false;
|
|
|
},
|
|
},
|
|
|
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
|
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
|
|
- _self.loading=false;
|
|
|
|
|
|
|
+ _self.loading = false;
|
|
|
Common.processException(XMLHttpRequest, textStatus, errorThrown);
|
|
Common.processException(XMLHttpRequest, textStatus, errorThrown);
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
@@ -147,8 +162,8 @@ export default {
|
|
|
var _self = this;
|
|
var _self = this;
|
|
|
_self.traceTimeLine.traceId = _self.traceId;
|
|
_self.traceTimeLine.traceId = _self.traceId;
|
|
|
var content = _self.traceTimeLine.content;
|
|
var content = _self.traceTimeLine.content;
|
|
|
|
|
+ _self.traceTimeLine.endDate = _self.dateConvert(_self.planFinishedDate);
|
|
|
var dates = _self.traceTimeLine.endDate;
|
|
var dates = _self.traceTimeLine.endDate;
|
|
|
-
|
|
|
|
|
if (
|
|
if (
|
|
|
content != null &&
|
|
content != null &&
|
|
|
content != '' &&
|
|
content != '' &&
|
|
@@ -156,7 +171,7 @@ export default {
|
|
|
dates != undefined &&
|
|
dates != undefined &&
|
|
|
dates != ''
|
|
dates != ''
|
|
|
) {
|
|
) {
|
|
|
- _self.loading=true;
|
|
|
|
|
|
|
+ _self.loading = true;
|
|
|
$.ajax({
|
|
$.ajax({
|
|
|
url: Common.getApiURL('TraceTimeLineResource/saveTraceTimeLine'),
|
|
url: Common.getApiURL('TraceTimeLineResource/saveTraceTimeLine'),
|
|
|
type: 'post',
|
|
type: 'post',
|
|
@@ -166,16 +181,16 @@ export default {
|
|
|
},
|
|
},
|
|
|
data: JSON.stringify(_self.traceTimeLine),
|
|
data: JSON.stringify(_self.traceTimeLine),
|
|
|
success: function (data) {
|
|
success: function (data) {
|
|
|
- _self.loading=false;
|
|
|
|
|
|
|
+ _self.loading = false;
|
|
|
_self.returnBack();
|
|
_self.returnBack();
|
|
|
},
|
|
},
|
|
|
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
|
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
|
|
- _self.loading=false;
|
|
|
|
|
|
|
+ _self.loading = false;
|
|
|
Common.processException(XMLHttpRequest, textStatus, errorThrown);
|
|
Common.processException(XMLHttpRequest, textStatus, errorThrown);
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
- _self.loading=false;
|
|
|
|
|
|
|
+ _self.loading = false;
|
|
|
Notify.error('提示', '请将界面内容填写完整!');
|
|
Notify.error('提示', '请将界面内容填写完整!');
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -185,7 +200,7 @@ export default {
|
|
|
*/
|
|
*/
|
|
|
deleteById: function () {
|
|
deleteById: function () {
|
|
|
var _self = this;
|
|
var _self = this;
|
|
|
- _self.loading=true;
|
|
|
|
|
|
|
+ _self.loading = true;
|
|
|
$.ajax({
|
|
$.ajax({
|
|
|
url: Common.getApiURL('TraceTimeLineResource/deleteById'),
|
|
url: Common.getApiURL('TraceTimeLineResource/deleteById'),
|
|
|
type: 'get',
|
|
type: 'get',
|
|
@@ -196,11 +211,11 @@ export default {
|
|
|
Common.addTokenToRequest(request);
|
|
Common.addTokenToRequest(request);
|
|
|
},
|
|
},
|
|
|
success: function (data) {
|
|
success: function (data) {
|
|
|
- _self.loading=false;
|
|
|
|
|
|
|
+ _self.loading = false;
|
|
|
_self.returnBack();
|
|
_self.returnBack();
|
|
|
},
|
|
},
|
|
|
error: function (xmlHttpRequest, textStatus, errorThrown) {
|
|
error: function (xmlHttpRequest, textStatus, errorThrown) {
|
|
|
- _self.loading=false;
|
|
|
|
|
|
|
+ _self.loading = false;
|
|
|
Common.processException(xmlHttpRequest, textStatus, errorThrown);
|
|
Common.processException(xmlHttpRequest, textStatus, errorThrown);
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
@@ -218,61 +233,54 @@ export default {
|
|
|
*/
|
|
*/
|
|
|
loadSelectUserName: function () {
|
|
loadSelectUserName: function () {
|
|
|
var _self = this;
|
|
var _self = this;
|
|
|
- $('#userName')
|
|
|
|
|
- .select2({
|
|
|
|
|
- // 请求搜索框数据
|
|
|
|
|
- //data:
|
|
|
|
|
- // placeholder: '用户',
|
|
|
|
|
- minimumInputLength: 0,
|
|
|
|
|
- placeholderOption: 'first',
|
|
|
|
|
- quietMillis: 250,
|
|
|
|
|
- allowClear: true,
|
|
|
|
|
- language: 'zh-CN',
|
|
|
|
|
- width: '100%',
|
|
|
|
|
- placeholder: {
|
|
|
|
|
- id: _self.traceTimeLine.userId,
|
|
|
|
|
- text: _self.traceTimeLine.userName,
|
|
|
|
|
- },
|
|
|
|
|
- // 请求搜索框数据
|
|
|
|
|
- ajax: {
|
|
|
|
|
- url: function (params) {
|
|
|
|
|
- return Common.getApiURL(
|
|
|
|
|
- 'ProjectItemUserResource/listByProjectItemId?projectItemId=' +
|
|
|
|
|
|
|
+ $.ajax({
|
|
|
|
|
+ url: Common.getApiURL(
|
|
|
|
|
+ 'ProjectItemUserResource/listByProjectItemId?projectItemId=' +
|
|
|
_self.projectId,
|
|
_self.projectId,
|
|
|
- ); //通过项目Id查找有权操作的项目的用户
|
|
|
|
|
- },
|
|
|
|
|
- dataType: 'json',
|
|
|
|
|
- type: 'get',
|
|
|
|
|
- delay: 250,
|
|
|
|
|
- minimumInputLength: 1,
|
|
|
|
|
- transport: function (params, success, failure) {
|
|
|
|
|
- params.beforeSend = Common.addTokenToRequest;
|
|
|
|
|
- params.error = Common.processException;
|
|
|
|
|
- var $request = $.ajax(params);
|
|
|
|
|
- $request.then(success);
|
|
|
|
|
- $request.fail(failure);
|
|
|
|
|
- return $request;
|
|
|
|
|
- },
|
|
|
|
|
- data: function (params) {
|
|
|
|
|
- return {};
|
|
|
|
|
- },
|
|
|
|
|
- processResults: function (data, params) {
|
|
|
|
|
- var more = params * 10 <= data.length;
|
|
|
|
|
- for (var i = 0; i < data.length; i++) {
|
|
|
|
|
- data[i].id = data[i].userId;
|
|
|
|
|
- data[i].text = data[i].userName;
|
|
|
|
|
- }
|
|
|
|
|
- return {
|
|
|
|
|
- results: data,
|
|
|
|
|
- more: more,
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
- })
|
|
|
|
|
- .on('change', function () {
|
|
|
|
|
- _self.traceTimeLine.userId = $(this).val();
|
|
|
|
|
- _self.traceTimeLine.userName = $(this).text();
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ ),
|
|
|
|
|
+ type: 'get',
|
|
|
|
|
+ dataType: 'json',
|
|
|
|
|
+ beforeSend: function (request) {
|
|
|
|
|
+ Common.addTokenToRequest(request);
|
|
|
|
|
+ },
|
|
|
|
|
+ success: function (data) {
|
|
|
|
|
+ data.forEach(item => {
|
|
|
|
|
+ item.value = item.userId;
|
|
|
|
|
+ item.label = item.userName;
|
|
|
|
|
+ });
|
|
|
|
|
+ _self.allUsers = data;
|
|
|
|
|
+ },
|
|
|
|
|
+ error: function (errorData) {
|
|
|
|
|
+ Common.processException(errorData);
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ // 日期处理函数
|
|
|
|
|
+ plusZero: function (n) {
|
|
|
|
|
+ return n >= 10 ? n : '0' + n;
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ dateConvert: function (dateStr) {
|
|
|
|
|
+ const date = new Date(dateStr);
|
|
|
|
|
+ const year = date.getFullYear();
|
|
|
|
|
+ const month = date.getMonth() + 1;
|
|
|
|
|
+ const day = date.getDate();
|
|
|
|
|
+ const hour = date.getHours();
|
|
|
|
|
+ const minute = date.getMinutes();
|
|
|
|
|
+ const second = date.getSeconds();
|
|
|
|
|
+ return (
|
|
|
|
|
+ year +
|
|
|
|
|
+ '-' +
|
|
|
|
|
+ this.plusZero(month) +
|
|
|
|
|
+ '-' +
|
|
|
|
|
+ this.plusZero(day) +
|
|
|
|
|
+ ' ' +
|
|
|
|
|
+ this.plusZero(hour) +
|
|
|
|
|
+ ':' +
|
|
|
|
|
+ this.plusZero(minute) +
|
|
|
|
|
+ ':' +
|
|
|
|
|
+ this.plusZero(second)
|
|
|
|
|
+ );
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|