|
@@ -22,6 +22,11 @@
|
|
|
<p class="p">扫码</p>
|
|
|
</button>
|
|
|
</view>
|
|
|
+ <timeSelector showType="date" @btnConfirm="btnConfirm0" @btnCancel="btnCancel0">
|
|
|
+ <view class="body">
|
|
|
+ 更换日期:<input type="text" class="input" name="replateDate" :value="replateDate"/>
|
|
|
+ </view>
|
|
|
+ </timeSelector>
|
|
|
<view class="body">
|
|
|
更换原因:<textarea class="input-two" name="replaceReason" />
|
|
|
</view>
|
|
@@ -35,13 +40,19 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import timeSelector from '@/components/wing-time-selector/wing-time-selector.vue';
|
|
|
+
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ timeSelector
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
machineCoding: '',
|
|
|
coding: '',
|
|
|
oldCoding: '',
|
|
|
- replaceReason: ''
|
|
|
+ replaceReason: '',
|
|
|
+ replateDate: ''
|
|
|
}
|
|
|
},
|
|
|
onLoad: function(option) {
|
|
@@ -78,12 +89,26 @@
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ btnConfirm0(e) {
|
|
|
+ console.log('确定时间为:', new Date(e.key));
|
|
|
+ this.replateDate = e.key;
|
|
|
+ },
|
|
|
+ btnCancel0() {
|
|
|
+ this.replateDate = '';
|
|
|
+ },
|
|
|
update(event) {
|
|
|
var serverUrl = this.serverurl;
|
|
|
const {
|
|
|
value: modules
|
|
|
} = event.detail;
|
|
|
var token = uni.getStorageSync("token");
|
|
|
+ var replateDateObject = new Date(this.replateDate);
|
|
|
+ var replateDateString = replateDateObject.getFullYear() + '-' +
|
|
|
+ (replateDateObject.getMonth() + 1).toString().padStart(2, '0') + '-' +
|
|
|
+ replateDateObject.getDate().toString().padStart(2, '0') + ' ' +
|
|
|
+ replateDateObject.getHours().toString().padStart(2, '0') + ':' +
|
|
|
+ replateDateObject.getMinutes().toString().padStart(2, '0') + ':' +
|
|
|
+ replateDateObject.getSeconds().toString().padStart(2, '0');
|
|
|
uni.request({
|
|
|
url: serverUrl + "/TModules/replace",
|
|
|
method: "POST",
|
|
@@ -91,6 +116,7 @@
|
|
|
"coding":modules.coding,
|
|
|
"machineCoding":modules.machineCoding,
|
|
|
"oldCoding":modules.oldCoding,
|
|
|
+ "replateDate":replateDateString,
|
|
|
"replaceReason":modules.replaceReason,
|
|
|
"replacePersonnel":uni.getStorageSync("name"),
|
|
|
},
|