|
@@ -33,71 +33,99 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
- import { updateCheck } from '@/api/production'
|
|
|
|
- import MaterialComponent from '@/views/modules/common/material-component'
|
|
|
|
- import UploadComponent from '@/views/modules/common/upload-component-v2'
|
|
|
|
|
|
+import {updatePreCheck} from '@/api/production'
|
|
|
|
+import MaterialComponent from '@/views/modules/common/material-component'
|
|
|
|
+import UploadComponent from '@/views/modules/common/upload-component'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
- name: 'scheduling-pre-check',
|
|
|
|
- components: {
|
|
|
|
- UploadComponent,
|
|
|
|
- MaterialComponent
|
|
|
|
- },
|
|
|
|
- data () {
|
|
|
|
- return {
|
|
|
|
- id: 0,
|
|
|
|
- dataForm: {},
|
|
|
|
- attachList: [],
|
|
|
|
- attachListExamine: [],
|
|
|
|
- dataRule: {
|
|
|
|
- }
|
|
|
|
|
|
+ name: 'scheduling-pre-check',
|
|
|
|
+ components: {
|
|
|
|
+ UploadComponent,
|
|
|
|
+ MaterialComponent
|
|
|
|
+ },
|
|
|
|
+ data () {
|
|
|
|
+ return {
|
|
|
|
+ id: 0,
|
|
|
|
+ dataForm: {},
|
|
|
|
+ attachList: [],
|
|
|
|
+ attachListExamine: [],
|
|
|
|
+ dataRule: {
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ onChose () {
|
|
|
|
+ this.$emit('onChose')
|
|
|
|
+ },
|
|
|
|
+ async init (scheduleId) {
|
|
|
|
+ this.dataForm.id = scheduleId || 0
|
|
|
|
+ },
|
|
|
|
+ validateField (type) {
|
|
|
|
+ this.$refs.dataForm.validateField(type)
|
|
},
|
|
},
|
|
- methods: {
|
|
|
|
- onChose () {
|
|
|
|
- this.$emit('onChose')
|
|
|
|
- },
|
|
|
|
- async init (scheduleId, materialId) {
|
|
|
|
- this.dataForm.id = scheduleId || ''
|
|
|
|
- this.dataForm.materialId = materialId || ''
|
|
|
|
- },
|
|
|
|
- validateField (type) {
|
|
|
|
- this.$refs.dataForm.validateField(type)
|
|
|
|
- },
|
|
|
|
// 表单提交
|
|
// 表单提交
|
|
- dataFormSubmit () {
|
|
|
|
- this.$refs['dataForm'].validate((valid) => {
|
|
|
|
- if (valid) {
|
|
|
|
- if (this.dataForm.materialId === '') {
|
|
|
|
- this.$message.error('请选择物品!')
|
|
|
|
- return
|
|
|
|
|
|
+ dataFormSubmit () {
|
|
|
|
+ this.$refs['dataForm'].validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ // 添加附件
|
|
|
|
+ let fList = this.attachList
|
|
|
|
+ if (fList.length > 0) {
|
|
|
|
+ this.dataForm.attachList = []
|
|
|
|
+ for (let i = 0; i < fList.length; i++) {
|
|
|
|
+ this.dataForm.attachList.push({
|
|
|
|
+ fileName: fList[i].name,
|
|
|
|
+ url: fList[i].url
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- updateCheck(this.dataForm).then(({data}) => {
|
|
|
|
- if (data && data.code === '200') {
|
|
|
|
- this.$message({
|
|
|
|
- message: '操作成功',
|
|
|
|
- type: 'success',
|
|
|
|
- duration: 1500,
|
|
|
|
- onClose: () => {
|
|
|
|
- this.onChose()
|
|
|
|
- this.$emit('refreshDataList')
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- this.$message.error(data.msg)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error('请上传试制前准备状态检查报告')
|
|
|
|
+ return
|
|
}
|
|
}
|
|
- })
|
|
|
|
- },
|
|
|
|
- materialSelected (item) {
|
|
|
|
- this.unitName = item.unitName
|
|
|
|
- this.specifications = item.specifications
|
|
|
|
- this.dataForm.cnt = item.cnt
|
|
|
|
- this.dataForm.materialId = item.materialId
|
|
|
|
- }
|
|
|
|
|
|
+ let fList2 = this.attachListExamine
|
|
|
|
+ if (fList2.length > 0) {
|
|
|
|
+ this.dataForm.attachListExamine = []
|
|
|
|
+ for (let i = 0; i < fList2.length; i++) {
|
|
|
|
+ this.dataForm.attachListExamine.push({
|
|
|
|
+ fileName: fList2[i].name,
|
|
|
|
+ url: fList2[i].url
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error('请上传试制前准备状态检查报告')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ updatePreCheck(this.dataForm).then(({data}) => {
|
|
|
|
+ if (data && data.code === '200') {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '操作成功',
|
|
|
|
+ type: 'success',
|
|
|
|
+ duration: 1500,
|
|
|
|
+ onClose: () => {
|
|
|
|
+ this.onChose()
|
|
|
|
+ this.$emit('refreshDataList')
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(data.msg)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ materialSelected (item) {
|
|
|
|
+ this.unitName = item.unitName
|
|
|
|
+ this.specifications = item.specifications
|
|
|
|
+ this.dataForm.cnt = item.cnt
|
|
|
|
+ this.dataForm.materialId = item.materialId
|
|
|
|
+ },
|
|
|
|
+ uploadSuccess1 (fileList) {
|
|
|
|
+ this.attachList = fileList
|
|
|
|
+ },
|
|
|
|
+ uploadSuccess2 (fileList) {
|
|
|
|
+ this.attachListExamine = fileList
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|