| | |
| | | "dependencies": { |
| | | "@chenfengyuan/vue-qrcode": "^1.0.1", |
| | | "@riophae/vue-treeselect": "0.4.0", |
| | | "@smallwei/avue": "^2.10.18", |
| | | "avue-plugin-ueditor": "^0.1.4", |
| | | "axios": "^0.18.0", |
| | | "babel-polyfill": "^6.26.0", |
| | |
| | | |
| | | <body> |
| | | <script src="https://cdn.staticfile.org/FileSaver.js/2014-11-29/FileSaver.min.js"></script> |
| | | <script src="https://cdn.staticfile.org/xlsx/0.18.2/xlsx.full.min.js"></script> |
| | | <script src="https://cdn.staticfile.org/xlsx/0.18.2/xlsx.full.min.js"></script> |
| | | <noscript> |
| | | <strong |
| | | >很抱歉,如果没有 JavaScript 支持,网站将不能正常工作。请启用浏览器的 |
| | |
| | | import 'quill/dist/quill.bubble.css' |
| | | import diadrag from '@/directive/diadrag' |
| | | import thinclick from '@/directive/thinclick' |
| | | import Avue from '@smallwei/avue'; |
| | | import '@smallwei/avue/lib/index.css'; |
| | | Vue.use(Avue); |
| | | // 插件 json 展示 |
| | | Vue.use(router) |
| | | |
| | |
| | | searchInfoType: 'text' |
| | | }, |
| | | { |
| | | minWidth: '120', |
| | | prop: 'projectName', |
| | | label: '项目名称', |
| | | isTrue: true, |
| | | isSearch: true, |
| | | searchInfoType: 'text' |
| | | }, |
| | | { |
| | | minWidth: '100', |
| | | prop: 'name', |
| | | label: '原材料名称', |
| | |
| | | mounted() { |
| | | |
| | | }, |
| | | // props:['currentRow'], |
| | | methods: { |
| | | getData() { |
| | | if (this.$refs.rawPartTable !== undefined) { |
| | |
| | | } |
| | | }, |
| | | saveSelectRow() { |
| | | // console.log(this.multipleSelection); |
| | | console.log(); |
| | | if (this.multiSelect) { |
| | | this.$emit('handleSelectionChange', this.multipleSelection) |
| | | } else { |
| | |
| | | ) |
| | | } |
| | | this.innerVisible = false |
| | | this.$parent.costPlannedAmountChange(this.currentRow) |
| | | }, |
| | | handleCurrentChange(row) { |
| | | console.log(row); |
| | | this.currentRow = row |
| | | console.log(this.currentRow); |
| | | }, |
| | | handleSelectionChange(val) { |
| | | // 多行选中 |
| | |
| | | arr.push(this.paramArr[i]) |
| | | } |
| | | } |
| | | this.dataListLoading = false |
| | | return this.doCallback(this.ajaxFun, arr, selectedId) |
| | | }, |
| | | doCallback(fn, args, selectedId) { |
| | |
| | | this.clickTable(selectObj) |
| | | } |
| | | } |
| | | this.$emit('change',resultData); |
| | | }) |
| | | .catch((error) => { |
| | | this.dataListLoading = false |
| | |
| | | } |
| | | } |
| | | } |
| | | console.log(this.columnList); |
| | | this.tableKey = Math.random() |
| | | // this.$forceUpdate(); |
| | | const currPathColumnOrder = this.currPath + '_column' |
| | |
| | | <basic-container> |
| | | <ttable |
| | | :table="table" |
| | | :resultData="resultData" |
| | | @change ="costPlannedAmountChange" |
| | | @handleSelectionChange="handleSelectionChange" |
| | | :prelang="prelang" |
| | | :options="options" |
| | |
| | | ></RawMaterialForm> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import ExportMaterial from './ExportMaterial.vue' |
| | | import ttable from '@/views/common/ztt-table.vue' |
| | | import { getRawInspectList,delObj } from '@/api/quality/rawMaterial' |
| | | import RawMaterialForm from './rawMaterial-form' |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | resultData:[], |
| | | addOrUpdateVisible: false, |
| | | type: [1], |
| | | prelang: 'rawMaterial', |
| | |
| | | currentPage: 1, |
| | | pageSize: 20, |
| | | data: [], |
| | | isExport:true, |
| | | // 标题 |
| | | column: [ |
| | | { |
| | |
| | | isSearch: true, |
| | | searchInfoType: 'text', |
| | | render: { fun: this.addOrUpdateHandle } |
| | | }, |
| | | { |
| | | minWidth: '120', |
| | | prop: 'projectName', |
| | | label: '项目名称', |
| | | isTrue: true, |
| | | isSearch: true, |
| | | searchInfoType: 'text' |
| | | }, |
| | | { |
| | | minWidth: '120', |
| | |
| | | label: '合格状态', |
| | | isTrue: true, |
| | | isSearch: true, |
| | | searchInfoType: 'text', |
| | | searchInfoType: 'select', |
| | | formatter: this.formatJudgeState, |
| | | optList: () => { |
| | | return this.StateList |
| | | } |
| | | }, |
| | | ], |
| | | toolbar: [ |
| | |
| | | }, |
| | | { |
| | | text: '导出', |
| | | type: 'primary', |
| | | fun: this.handleExcel |
| | | } |
| | | ], |
| | | operator: [{ |
| | | text: '打印', |
| | | type: 'text', |
| | | size: 'small', |
| | | },{ |
| | | text: '作废', |
| | | type: 'text', |
| | | size: 'small', |
| | |
| | | minWidth: 100 |
| | | }, |
| | | }, |
| | | insStateList: [{label:'全部',value:''},{label:'已检测',value:'1'},{label:'未检测',value:'0'}] |
| | | insStateList: [{label:'全部',value:''},{label:'已检测',value:'1'},{label:'未检测',value:'0'}], |
| | | StateList: [{label:'全部',value:''},{label:'已合格',value:'1'},{label:'不合格',value:'0'}], |
| | | } |
| | | }, |
| | | components: { |
| | | ttable, |
| | | RawMaterialForm, |
| | | ExportMaterial, |
| | | }, |
| | | created() { |
| | | |
| | | }, |
| | | computed: { |
| | | ...mapGetters(['permissions']) |
| | | }, |
| | | methods:{ |
| | | async costPlannedAmountChange(value){ |
| | | this.resultData= value |
| | | }, |
| | | |
| | | handleExcel() { |
| | | console.log(this.resultData); |
| | | console.log(this.table.column); |
| | | // let arr = this.table.column.map(el = el.isTrue == true) |
| | | // console.log(arr); |
| | | let arr = this.table.column.filter(item => item.isTrue == true).map(item => { |
| | | return{ |
| | | prop:item.prop, |
| | | label:item.label |
| | | } |
| | | }) |
| | | let opt = { |
| | | title: '文档标题', |
| | | column: [{ |
| | | label:'', |
| | | prop:'header', |
| | | children:arr |
| | | }], |
| | | data: this.resultData |
| | | } |
| | | this.$Export.excel({ |
| | | title: opt.title, |
| | | columns: opt.column, |
| | | data: opt.data |
| | | }); |
| | | // console.log(this.table); |
| | | |
| | | }, |
| | | // 删除 |
| | | deleteHandle(row) { |
| | | this.$confirm('是否确认删除该数据:' + row.code , '提示', { |
| | |
| | | }, |
| | | getData() { |
| | | this.$refs.rawMaterialTable.getDataList() |
| | | |
| | | }, |
| | | // table自带事件 |
| | | handleSelectionChange(val) { |
| | |
| | | <el-input v-model="dataForm.createUser" disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item prop="projectName" label="项目名称"> |
| | | <el-input v-model="dataForm.projectName" disabled > |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </div> |
| | |
| | | :data="list" border style="width: 100%;" height="400"> |
| | | <el-table-column type="index" label="序号" width="60"> |
| | | </el-table-column> |
| | | |
| | | <el-table-column prop="name" label="项目" width="260"> |
| | | <template slot-scope="scope"> |
| | | <el-select v-if="projectList.length > 0" :disabled="dataForm.id != null" class="inline-input" v-model="scope.row.name" |
| | | filterable allow-create placeholder="请输入或选择项目名称" style="width:100%" @change="changeName(scope.$index,scope.row)"> |
| | | <el-option v-for="(item,index) in projectList" :key="index" :label="item.name" :value="item.name"/> |
| | | </el-select> |
| | | <el-input v-else :disabled="dataForm.id != null" class="inline-input" v-model="scope.row.name" |
| | | <el-input v-else :disabled="dataForm.id != null" class="inline-input" v-model="list.name" |
| | | placeholder="请输入项目名称"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column prop="unit" label="单位" width="260"> |
| | | <template slot-scope="scope"> |
| | | <el-input :disabled="dataForm.id != null" v-model="scope.row.unit" placeholder="请输入单位"></el-input> |
| | |
| | | placeholder="请输入标准值"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column prop="testValue" label="检测值" min-width="260" v-for="(item, index) in empiricalValueAdd" |
| | | :key="index"> |
| | | <template slot-scope="scope"> |
| | | <el-tooltip :disabled="scope.row.equipmentId != null" class="item" effect="dark" content="请先选择设备!" |
| | | placement="top-start"> |
| | | <el-input :disabled="scope.row.equipmentId == null || (dataForm.id!=null&&resultVal!=null)" v-model="scope.row.testValueList[index]" |
| | | @blur="updateTestValue(scope.row,index)" placeholder="请输入检测值"></el-input> |
| | | </el-tooltip> |
| | | |
| | | <!-- <el-input :disabled="scope.row.equipmentId == null || (dataForm.id!=null&&resultVal!=null)" v-model="scope.row.testValueList[index]" |
| | | @blur="updateTestValue(scope.row,index)" placeholder="请输入检测值"></el-input> --> |
| | | |
| | | <el-autocomplete |
| | | :disabled="scope.row.equipmentId == null || (dataForm.id!=null&&resultVal!=null)" |
| | | class="inline-input" |
| | | v-model="scope.row.testValueList[index]" |
| | | :fetch-suggestions="querySearch" |
| | | placeholder="请输入内容" |
| | | @select="handleSelect" |
| | | ></el-autocomplete> |
| | | |
| | | </el-tooltip> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column prop="deviceName" label="试验设备" min-width="260"> |
| | | <template slot-scope="scope"> |
| | | <el-select :disabled="resultVal!=null && dataForm.id!=null" style="width:100%" |
| | |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column fixed="right" v-if="dataForm.id != null" prop="testState" label="结论" min-width="150"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.row.testState == 0" style="color:#F56C6C">不合格</span> |
| | |
| | | <el-button type="primary" @click="submitSave()">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <!-- <rawMaterialPartDialog :currentRow ="currentRow" @costPlannedAmountChange="costPlannedAmountChange"/> --> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | updateRawInspectsById, |
| | | updateDeviceById, } from '@/api/quality/rawMaterial' |
| | | import rawMaterialPartDialog from '@/views/common/rawMaterial-part' |
| | | import { log } from 'util' |
| | | export default { |
| | | // props:['currentRow'], |
| | | computed:{}, |
| | | components:{ |
| | | rawMaterialPartDialog |
| | | }, |
| | | data(){ |
| | | return{ |
| | | currentRow:[], |
| | | userlist:[], |
| | | fiedNum: null, |
| | | unqualifiedNum: null, |
| | | dialogVisible:false, |
| | |
| | | formTime: '', |
| | | message: '', |
| | | name: '', |
| | | code: '88.118.1/A0487643', |
| | | code: '88.118.1/A0498220', |
| | | specs: '', |
| | | unit: '', |
| | | number: '', |
| | |
| | | }], |
| | | dataRule: {}, |
| | | deviceList: [], |
| | | restaurants:[], |
| | | whetherNot:'', |
| | | } |
| | | }, |
| | | beforeUpdate(){ |
| | |
| | | } |
| | | this.init() |
| | | this.getDeviceList() |
| | | this.restaurants = this.loadAll(); |
| | | // this.costPlannedAmountChange() |
| | | }, |
| | | watch:{ |
| | | dialogVisible(newVal){ |
| | |
| | | this.unqualifiedNum = null |
| | | this.fiedNum = null |
| | | } |
| | | } |
| | | }, |
| | | |
| | | }, |
| | | methods:{ |
| | | //项目 |
| | | // xxxx(){ |
| | | // console.log(currentRow); |
| | | // }, |
| | | // 事件处理函数 |
| | | // costPlannedAmountChange(value) { |
| | | // console.log("==>"); |
| | | // console.log(value.rawInsProducts); |
| | | // this.userlist = value.rawInsProducts |
| | | // this.list = this.userlist |
| | | // console.log(this.list); |
| | | // }, |
| | | querySearch(queryString, cb) { |
| | | var restaurants = this.restaurants; |
| | | var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants; |
| | | |
| | | cb(results); |
| | | }, |
| | | createFilter(queryString) { |
| | | return (restaurant) => { |
| | | return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0); |
| | | }; |
| | | }, |
| | | loadAll(){ |
| | | return [ |
| | | {"value":"是"}, |
| | | {"value":"否"} |
| | | ];}, |
| | | handleSelect(item) { |
| | | console.log(item); |
| | | }, |
| | | changeName(index,row){ |
| | | this.projectList.forEach(item=>{ |
| | | if(row.name == item.name){ |
| | |
| | | }, |
| | | // 确认回调 |
| | | selectPart(param, nodePart, index) { |
| | | console.log("成功--",param); |
| | | if (typeof param !== 'undefined') { |
| | | this.dataForm.code = param.code |
| | | this.dataForm.name = param.name |
| | |
| | | this.dataForm.supplier = param.supplier |
| | | this.dataForm.number = param.number |
| | | this.dataForm.message = param.message |
| | | this.dataForm.projectName = param.projectName |
| | | this.projectList = param.rawInsProducts == null ? [] : param.rawInsProducts |
| | | // param.rawInsProducts.forEach(item=>{ |
| | | // this.list.push(item) |
| | | // }) |
| | | } |
| | | }, |
| | | queryCode(){ |
| | | this.paramObj = { |
| | | code: this.dataForm.code |
| | | } |
| | | console.log(this.paramObj); |
| | | this.showPart = true |
| | | }, |
| | | updateDevice(row,index){ |