|
|
@@ -175,20 +175,32 @@
|
|
|
|
|
|
<!-- 直报系统导入对话框 -->
|
|
|
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
|
|
-
|
|
|
<el-upload class="avatar-uploader" action="#" :show-file-list="false" :http-request="uploadFile"
|
|
|
:before-upload="beforeUpload" :on-change="handleChange" ref="uploadFile">
|
|
|
<el-button type="warning" size="mini">批量导入</el-button>
|
|
|
</el-upload>
|
|
|
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <ele-modal title="选择工厂" :visible.sync="factoriesVisible" :before-close="handleCancel"
|
|
|
+ :close-on-click-modal="false" :close-on-press-escape="false" append-to-body width="20%" :maxable="true">
|
|
|
+ <el-row>
|
|
|
+ <el-select v-model="factoriesId">
|
|
|
+ <el-option v-for="item of factoryList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-row>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="handleSubmit">确 定</el-button>
|
|
|
+ <el-button @click="handleCancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </ele-modal>
|
|
|
</el-card>
|
|
|
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { estimateDeliveryDates, createAll, convertToSalesOrder, importTemplate, exportFile, importFile, listSalesorder, getSalesOrder, delSalesorder, addSalesorder, updateSalesorder, listSalesOrderExpect, occupyRes, listSalesOrderOccupyRes, listSalesorderExpectAll, occupyAllRes } from "@/api/aps/presalesorder";
|
|
|
+import { estimateDeliveryDates, createAll, convertToSalesOrder, importTemplate, exportFile, importFile, listSalesorder, getSalesOrder, delSalesorder, addSalesorder, updateSalesorder, listSalesOrderExpect, occupyRes, listSalesOrderOccupyRes, listSalesorderExpectAll, occupyAllRes, getQueryFactory } from "@/api/aps/presalesorder";
|
|
|
import { API_BASE_URL, TOKEN_HEADER_NAME, LAYOUT_PATH } from '@/config/setting';
|
|
|
import { getToken, setToken } from '@/utils/token-util';
|
|
|
import { download } from '@/utils/request';
|
|
|
@@ -344,6 +356,13 @@ export default {
|
|
|
align: 'center',
|
|
|
width: 140,
|
|
|
},
|
|
|
+ {
|
|
|
+ prop: 'factoriesName',
|
|
|
+ label: '工厂名称',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ align: 'center',
|
|
|
+ width: 120,
|
|
|
+ },
|
|
|
{
|
|
|
prop: 'materialQuantity',
|
|
|
label: '物料数量',
|
|
|
@@ -389,13 +408,22 @@ export default {
|
|
|
],
|
|
|
},
|
|
|
selDataIds: [],
|
|
|
- whereForm: {}
|
|
|
+ whereForm: {},
|
|
|
+ factoriesId: '',
|
|
|
+ factoriesVisible: false,
|
|
|
+ factoryList: []
|
|
|
};
|
|
|
},
|
|
|
async created() {
|
|
|
await this.reload();
|
|
|
+ await this.getFactoryList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ async getFactoryList() {
|
|
|
+ const res = await getQueryFactory();
|
|
|
+ console.log(res, 'data工厂')
|
|
|
+ this.factoryList = res.data;
|
|
|
+ },
|
|
|
datasource({ page, where, limit }) {
|
|
|
const res = listSalesorder({ ...where, page, limit });
|
|
|
return res;
|
|
|
@@ -426,15 +454,15 @@ export default {
|
|
|
},
|
|
|
/** 删除 */
|
|
|
handleDelete(row) {
|
|
|
- let ids=[]
|
|
|
- if(row.id){
|
|
|
+ let ids = []
|
|
|
+ if (row.id) {
|
|
|
ids = [row.id]
|
|
|
- }else{
|
|
|
- ids=this.ids
|
|
|
+ } else {
|
|
|
+ ids = this.ids
|
|
|
}
|
|
|
this.$confirm(`是否确认删除销售订单编号为"${ids}"的数据项?`, '提示')
|
|
|
.then(() => {
|
|
|
- delSalesorder({ids:ids})
|
|
|
+ delSalesorder({ ids: ids })
|
|
|
.then(() => {
|
|
|
this.reload();
|
|
|
this.$message.success("删除成功");
|
|
|
@@ -481,12 +509,21 @@ export default {
|
|
|
this.$message.warning("请选择");
|
|
|
return;
|
|
|
}
|
|
|
- const res = await estimateDeliveryDates({ ids: this.ids })
|
|
|
+ this.factoriesId = '';
|
|
|
+ this.factoriesVisible = true;
|
|
|
+ },
|
|
|
+
|
|
|
+ async handleSubmit() {
|
|
|
+ const res = await estimateDeliveryDates({ ids: this.ids, factoriesId: this.factoriesId })
|
|
|
if (res.code == 0) {
|
|
|
this.$message.success("操作成功");
|
|
|
+ this.factoriesVisible = false;
|
|
|
this.reload();
|
|
|
}
|
|
|
},
|
|
|
+ handleCancel() {
|
|
|
+ this.factoriesVisible = false;
|
|
|
+ },
|
|
|
/*交期预估*/
|
|
|
async handleExpect(row) {
|
|
|
if (this.ids.length === 0) {
|
|
|
@@ -600,7 +637,7 @@ export default {
|
|
|
console.log(this.whereForm, 'this.whereForm')
|
|
|
|
|
|
this.loading = true;
|
|
|
- let params = this.whereForm?this.whereForm:[]
|
|
|
+ let params = this.whereForm ? this.whereForm : []
|
|
|
exportFile(params).then(res => {
|
|
|
this.loading = false;
|
|
|
|